Class TLspPaintProgress

java.lang.Object
com.luciad.view.lightspeed.TLspPaintProgress

public final class TLspPaintProgress extends Object
Class describing the progress of paint operations in an ILspView. Methods which perform painting, such as ILspPaintableLayer#paint or ILspPainter#paintObjects can return a paint progress object to indicate to the caller whether or not they were able to bring the view completely up to date for the data they were supposed to paint. They can also provide an indication of how much work has been done and how much is still remaining. This may be useful for displaying progress information to the end user, e.g. when data has to be retrieved from a slow storage medium or network.

This class represents progress using two values: amount of work already done and total amount of work to be done. These values are in unspecified units, but for convenience getProgress() converts them into a fraction between 0 and 1. A value of zero, by convention, indicates that progress is indeterminate.

Since:
2012.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TLspPaintProgress
    Convenience constant indicating completed progress.
    static final TLspPaintProgress
    Convenience constant indicating indeterminate progress.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TLspPaintProgress(int aAmountDone, int aTotalWork, boolean aComplete)
    Creates a new painting progress object with the given parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Returns the amount of work done.
    final double
    Returns a normalized progress value (between 0 and 1).
    final int
    Returns the total amount of work to be done.
    final boolean
    Returns true if this paint progress indicates that progress has been completed.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • INDETERMINATE

      public static final TLspPaintProgress INDETERMINATE
      Convenience constant indicating indeterminate progress.
    • COMPLETE

      public static final TLspPaintProgress COMPLETE
      Convenience constant indicating completed progress.
  • Constructor Details

    • TLspPaintProgress

      public TLspPaintProgress(int aAmountDone, int aTotalWork, boolean aComplete)
      Creates a new painting progress object with the given parameters.
      Parameters:
      aAmountDone - the amount of work already done
      aTotalWork - the total work to be done
      aComplete - whether or not the progress is completed
  • Method Details

    • getAmountDone

      public final int getAmountDone()
      Returns the amount of work done. The units of this value and of getTotalWork() are unspecified and left up to the user. For instance, the values could represent the number of domain objects being processed or the number of requests being sent to a remote server. The getProgress() method returns a normalized progress value based on the total work and the amount done.
      Returns:
      the amount of work done
    • getTotalWork

      public final int getTotalWork()
      Returns the total amount of work to be done. The units of this value are unspecified but must be the same as those of getAmountDone().
      Returns:
      the total amount of work to be done
    • isComplete

      public final boolean isComplete()
      Returns true if this paint progress indicates that progress has been completed.
      Returns:
      whether paint progress has been completed
    • getProgress

      public final double getProgress()
      Returns a normalized progress value (between 0 and 1). This value is defined as the ratio of getAmountDone() over getTotalWork().
      Returns:
      the normalized progress value
    • toString

      public String toString()
      Overrides:
      toString in class Object