Class NFEProgressIndicatorLayer

  • All Implemented Interfaces:
    Layer, PropertySupport

    public class NFEProgressIndicatorLayer
    extends ProgressIndicatorLayer
    This layer displays a (indeterminate) progress indicator in the center of the map. Typical usage is to call the taskStarted() method when a long running task just started. When the task is either completed or aborted make sure to call the taskCompleted() method. You can call taskStarted() as many times as the number of concurrent long-running tasks. The Progress indicator layer maintains an internal count of running tasks. The spinning clock will disappear only when all long running tasks have completed (or aborted).
    • Constructor Detail

      • NFEProgressIndicatorLayer

        public NFEProgressIndicatorLayer​(MapCanvas canvas)
    • Method Detail

      • taskStarted

        public void taskStarted()
        Call this method to display a progress indicator on the map. This is typically called when a long run task has just been started. You must call the corresponding taskCompleted() when the task is either completed or aborted. Failure to do so may result in the indicator being displayed indefinitely on the map.
        Overrides:
        taskStarted in class ProgressIndicatorLayer
      • update

        public void update​(long elapsedTime)
        Description copied from interface: Layer
        updates the contents data model or structure.
        Specified by:
        update in interface Layer
        Overrides:
        update in class ProgressIndicatorLayer
        Parameters:
        elapsedTime - The elapsed time since last update.
      • mapRegionChanged

        public void mapRegionChanged​(MapRegionEvent e)
        Description copied from interface: Layer
        When the associated canvas's map region is changed, this method is called to notify the layer of the change. Note that either a device window change (as a result of resizing the application window) or a data window change can cause this method to be invoked. Query the canvas' MapRegion object to get the changed values. Inside a mapRegionChanged() implementation, the layer typically needs to update its data contents accordingly.
        Specified by:
        mapRegionChanged in interface Layer
        Overrides:
        mapRegionChanged in class ProgressIndicatorLayer
      • render

        public long render​(java.awt.Graphics2D g)
        Description copied from interface: Layer
        Renders the layer contents to the given Graphics.
        Specified by:
        render in interface Layer
        Overrides:
        render in class ProgressIndicatorLayer
        Parameters:
        g - the graphics object
        Returns:
        the rendering time in milliseconds.
      • reset

        public void reset()
        Resets the internal task count to zero. This also makes the indicator disappear (until a new call to the taskStarted method).
        Overrides:
        reset in class ProgressIndicatorLayer
      • handleEvent

        public boolean handleEvent​(java.util.EventObject evt)
        Description copied from interface: Layer
        The main method that performs event handling for this tool. Returns whether the event should be propagated to other layers down stream (further down the layer stack) after the event has been handled.
        Specified by:
        handleEvent in interface Layer
        Overrides:
        handleEvent in class ProgressIndicatorLayer