Class ProgressIndicatorLayer
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
-
- oracle.spatial.network.nfe.vis.maps.layer.ui.ProgressIndicatorLayer
-
- All Implemented Interfaces:
Layer,PropertySupport
- Direct Known Subclasses:
NFEProgressIndicatorLayer
public class ProgressIndicatorLayer extends BasicLayer
This layer displays a (indeterminate) progress indicator in the center of the map. The default indicator is a clock with spinning hour and minute hands. 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).
-
-
Field Summary
-
Fields inherited from class oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
canvas, properties
-
Fields inherited from interface oracle.spatial.network.nfe.vis.maps.core.Layer
PROPERTY_NAME, PROPERTY_PROVIDERID, PROPERTY_SRID, PROPERTY_VISIBLE
-
-
Constructor Summary
Constructors Constructor Description ProgressIndicatorLayer(MapCanvas canvas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandleEvent(java.util.EventObject evt)The main method that performs event handling for this tool.voidmapRegionChanged(MapRegionEvent e)When the associated canvas's map region is changed, this method is called to notify the layer of the change.longrender(java.awt.Graphics2D g)Renders the layer contents to the given Graphics.voidreset()Resets the internal task count to zero.voidtaskCompleted()This method should be called when a task has either completed or aborted.voidtaskStarted()Call this method to display a progress indicator on the map.voidupdate(long elapsedTime)updates the contents data model or structure.-
Methods inherited from class oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
added, addPropertyChangeListener, addPropertyChangeListener, clear, fromXMLElement, getCanvas, getDataMBR, getFullExtent, getIcon, getName, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getProviderID, getSRID, handleTheEvent, hitTest, hitTest, isMyEvent, isVisible, propagateEvent, removed, removePropertyChangeListener, removePropertyChangeListener, repaint, setCanvas, setMyCursor, setName, setProperty, setProviderID, setSRID, setVisible, toXMLElement
-
-
-
-
Constructor Detail
-
ProgressIndicatorLayer
public ProgressIndicatorLayer(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.
-
taskCompleted
public void taskCompleted()
This method should be called when a task has either completed or aborted.
-
update
public void update(long elapsedTime)
Description copied from interface:Layerupdates the contents data model or structure.- Specified by:
updatein interfaceLayer- Overrides:
updatein classBasicLayer- Parameters:
elapsedTime- The elapsed time since last update.
-
handleEvent
public boolean handleEvent(java.util.EventObject evt)
Description copied from interface:LayerThe 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:
handleEventin interfaceLayer- Overrides:
handleEventin classBasicLayer
-
mapRegionChanged
public void mapRegionChanged(MapRegionEvent e)
Description copied from interface:LayerWhen 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:
mapRegionChangedin interfaceLayer- Overrides:
mapRegionChangedin classBasicLayer
-
render
public long render(java.awt.Graphics2D g)
Description copied from interface:LayerRenders the layer contents to the given Graphics.- Specified by:
renderin interfaceLayer- Overrides:
renderin classBasicLayer- 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).
-
-