Trait

net.sf.ij_plugins.ui.progress

ProgressReporter

Related Doc: package progress

Permalink

trait ProgressReporter extends AnyRef

Reports progress of an operation to its listeners. Progress starts at 0.0 and finishes at 1.0, so 0.3 means 30% progress.

Example usage:

class CounterWithProgress(marker: Char) extends ProgressReporter {
  def count(max: Int) {
    val progressIncrement = Math.max(max / 10, 1)

    println("Counting " + max + " '" + marker + "'.")

    for (i <- 1 to max) {
      print(marker)
      if (i % progressIncrement == 0) notifyProgressListeners(i, max)
    }

    println("\nCounting done.")
  }
}

object ProgressReporterExample extends App {
  // Create counter
  val counter = new CounterWithProgress('+')

  // Add progress listener
  counter.addProgressListener(e => println(f"\nProgress notification: ${e.progressPercent}%3.0f%%"))

  // Count
  counter.count(100)
}
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProgressReporter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addProgressListener[R](op: (ProgressEvent) ⇒ R): Unit

    Permalink

    Add progress listener.

  5. def addProgressListener(l: ProgressListener): Unit

    Permalink

    Add progress listener.

    Add progress listener.

    l

    listener to add.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def currentProgress: Double

    Permalink

    Report what fraction of the processing task was already completed.

    Report what fraction of the processing task was already completed. Progress value is between 0 and 1 (meaning 100% completed). For instance, 0.25 means that 25% con the processing was completed.

    returns

    current progress.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def notifyProgressListeners(count: Long, max: Long, message: String = ""): Unit

    Permalink

    Set new progress value and notify listeners.

    Set new progress value and notify listeners. Progress is calculated from count and max values:

    progress = count.toDouble / max.toDouble
    message

    message that will be send to listeners within ProgressEvent

    Attributes
    protected
  19. def notifyProgressListeners(progress: Double): Unit

    Permalink
    Attributes
    protected
  20. def notifyProgressListeners(progress: Double, message: String): Unit

    Permalink

    Set new progress value and notify listeners.

    Set new progress value and notify listeners.

    progress

    new value of currentProgress. The value must be not less than 0 and not more than 1.

    message

    message that will be send to listeners within ProgressEvent

    Attributes
    protected
  21. def notifyProgressListeners(): Unit

    Permalink

    Notify listeners of current value of progress.

    Notify listeners of current value of progress. Progress message is an empty string.

    Attributes
    protected
    See also

    #notifyProgressListeners(double)

  22. def removeAllProgressListener(): Unit

    Permalink

    Remove all progress listener.

  23. def removeProgressListener(l: ProgressListener): Unit

    Permalink

    Remove specific progress listener.

    Remove specific progress listener.

    l

    listener to remove.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped