Class NFEProgressIndicatorLayer
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
-
- oracle.spatial.network.nfe.vis.maps.layer.ui.ProgressIndicatorLayer
-
- oracle.spatial.network.nfe.vis.mapcanvas.render.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).
-
-
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 NFEProgressIndicatorLayer(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()Call this method when the task is 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
-
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:
taskStartedin classProgressIndicatorLayer
-
taskCompleted
public void taskCompleted()
Call this method when the task is completed or aborted.- Overrides:
taskCompletedin classProgressIndicatorLayer
-
update
public void update(long elapsedTime)
Description copied from interface:Layerupdates the contents data model or structure.- Specified by:
updatein interfaceLayer- Overrides:
updatein classProgressIndicatorLayer- Parameters:
elapsedTime- The elapsed time since last update.
-
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 classProgressIndicatorLayer
-
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 classProgressIndicatorLayer- 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:
resetin classProgressIndicatorLayer
-
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 classProgressIndicatorLayer
-
-