Class DisplayGIS3D
- java.lang.Object
-
- repast.simphony.visualization.AbstractDisplay
-
- repast.simphony.visualization.gis3D.DisplayGIS3D
-
- All Implemented Interfaces:
Renderer
,ProjectionListener
,IDisplay
public class DisplayGIS3D extends AbstractDisplay
Display for GIS 3D- Author:
- Eric Tatara TODO GIS add separator layers that are always hidden with predefined String key IDs that can be used to separate layer types such as agent layers, network layers, coverage layers, wms layers, etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DisplayGIS3D.GlobePositionListener
-
Nested classes/interfaces inherited from interface repast.simphony.visualization.IDisplay
IDisplay.LayoutFrequency
-
-
Field Summary
Fields Modifier and Type Field Description static String
BACKGROUND_LAYER_NAME
protected Color
backgroundColor
protected gov.nasa.worldwind.geom.Sector
boundingSector
protected Map<Class<?>,AbstractRenderableLayer<?,?>>
classStyleMap
protected Map<String,CoverageLayer>
coverageLayerMap
protected Map<org.geotools.coverage.grid.GridCoverage2D,gov.nasa.worldwind.render.SurfaceImage>
coverageToRenderableMap
protected String
displayMode
protected boolean
doRender
protected gov.nasa.worldwind.globes.FlatGlobe
flatGlobe
protected Geography
geog
protected List<gov.nasa.worldwind.layers.Layer>
globeLayers
protected GISDisplayData<?>
initData
static String
LAYER_ID_KEY
protected LayerPanel
layerPanel
protected Layout
layout
protected LayoutUpdater
layoutUpdater
protected static double
MIN_DEFAULT_ZOOM_ALTITUDE
protected gov.nasa.worldwind.Model
model
protected Map<Network<?>,NetworkLayerGIS>
networkLayerMap
protected JPanel
panel
protected DisplayGIS3D.GlobePositionListener
positionListener
protected gov.nasa.worldwind.globes.Globe
roundGlobe
protected RepastStatusBar
statusBar
protected boolean
trackAgents
protected Lock
updateLock
protected Runnable
updater
protected RepastViewControlsSelectListener
viewControlsSelectListener
protected boolean
visible
protected gov.nasa.worldwind.awt.WorldWindowGLJPanel
worldWindow
-
Fields inherited from class repast.simphony.visualization.AbstractDisplay
dlSupport, FRAME_UPDATE_INTERVAL, INFO_CURSOR, lastRenderTS, probeSupport
-
-
Constructor Summary
Constructors Constructor Description DisplayGIS3D(GISDisplayData<?> data, Layout layout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addObject(Object o)
void
closed()
Notifies this IDisplay that its associated gui widget has been closed.protected void
createBackgroundLayer()
Create a simple background layer that is a single colored rectangle that covers the entire globe.DisplayEditorLifecycle
createEditor(JPanel panel)
Creates an DisplayEditor appropriate for editing this display.void
createPanel()
protected gov.nasa.worldwind.layers.RenderableLayer
createStaticRasterLayer(String filename, boolean forceLongitudeFirstAxis)
Adds a static raster layer from the provided file.void
deIconified()
Notifies this IDisplay that its associated gui widget has been deIconified.void
destroy()
!!! Destroy needs to properly dispose and shutdown of WorldWind objects to prevent memory leaks !!!!void
enableRoundGlobe(boolean round)
Map<Class<?>,AbstractRenderableLayer<?,?>>
getClassStyleMap()
LayerPanel
getLayerPanel()
Layout
getLayout()
Gets the layout the display usesJPanel
getPanel()
Gets a panel that contains the actual gui for visualization.List<Class>
getRegisteredClasses()
gov.nasa.worldwind.WorldWindow
getWwglCanvas()
void
iconified()
Notifies this IDisplay that its associated gui widget has been iconified.void
init()
Initializes the display.protected void
initGlobes(GISDisplayDescriptor.VIEW_TYPE viewType)
Initialize the WWJ globe (flat/globe)boolean
isFlatGlobe()
protected boolean
isVisible()
protected void
moveObject(Object o)
void
probe(gov.nasa.worldwind.event.SelectEvent event)
void
registerCoverageStyle(String coverageName, CoverageStyle<?> style)
Register the dynamic coverage and style informationvoid
registerNetworkStyle(Network<?> network, NetworkStyleGIS style)
Register the network and style informationvoid
registerStyle(Class<?> clazz, StyleGIS<?> style)
Register the agent class and style informationvoid
registerToolBar(JToolBar bar)
Registers the specified toolbar with this IDisplay.protected void
removeObject(Object o)
void
render()
Render the display.void
resetHomeView()
Resets the home (initial) view of the displayvoid
setBackgroundColor(Color backgroundColor)
void
setLayout(Layout layout)
Sets the Layout for the display to use.void
setLayoutFrequency(IDisplay.LayoutFrequency frequency, int interval)
Sets the frequency of the layout.void
setPause(boolean pause)
Pause the rendering.void
setRenderQuality(RepastStereoOptionSceneController.RenderQuality quality)
void
setTrackAgents(boolean trackAgents)
void
toggleAnaglyphStereo()
void
toggleInfoProbe()
void
update()
Updates the state of the display to reflect whatever it is that it is displaying.-
Methods inherited from class repast.simphony.visualization.AbstractDisplay
addDisplayListener, addProbeListener, createInfoCursor, getProbeSupport, projectionEventOccurred, setProbeSupport
-
-
-
-
Field Detail
-
MIN_DEFAULT_ZOOM_ALTITUDE
protected static final double MIN_DEFAULT_ZOOM_ALTITUDE
- See Also:
- Constant Field Values
-
BACKGROUND_LAYER_NAME
public static final String BACKGROUND_LAYER_NAME
- See Also:
- Constant Field Values
-
LAYER_ID_KEY
public static final String LAYER_ID_KEY
- See Also:
- Constant Field Values
-
updateLock
protected Lock updateLock
-
panel
protected JPanel panel
-
layout
protected Layout layout
-
layoutUpdater
protected LayoutUpdater layoutUpdater
-
initData
protected GISDisplayData<?> initData
-
geog
protected Geography geog
-
model
protected gov.nasa.worldwind.Model model
-
classStyleMap
protected Map<Class<?>,AbstractRenderableLayer<?,?>> classStyleMap
-
networkLayerMap
protected Map<Network<?>,NetworkLayerGIS> networkLayerMap
-
coverageLayerMap
protected Map<String,CoverageLayer> coverageLayerMap
-
globeLayers
protected List<gov.nasa.worldwind.layers.Layer> globeLayers
-
coverageToRenderableMap
protected Map<org.geotools.coverage.grid.GridCoverage2D,gov.nasa.worldwind.render.SurfaceImage> coverageToRenderableMap
-
worldWindow
protected gov.nasa.worldwind.awt.WorldWindowGLJPanel worldWindow
-
displayMode
protected String displayMode
-
layerPanel
protected LayerPanel layerPanel
-
doRender
protected boolean doRender
-
visible
protected boolean visible
-
backgroundColor
protected Color backgroundColor
-
viewControlsSelectListener
protected RepastViewControlsSelectListener viewControlsSelectListener
-
statusBar
protected RepastStatusBar statusBar
-
roundGlobe
protected gov.nasa.worldwind.globes.Globe roundGlobe
-
flatGlobe
protected gov.nasa.worldwind.globes.FlatGlobe flatGlobe
-
trackAgents
protected boolean trackAgents
-
boundingSector
protected gov.nasa.worldwind.geom.Sector boundingSector
-
positionListener
protected DisplayGIS3D.GlobePositionListener positionListener
-
updater
protected Runnable updater
-
-
Constructor Detail
-
DisplayGIS3D
public DisplayGIS3D(GISDisplayData<?> data, Layout layout)
-
-
Method Detail
-
registerStyle
public void registerStyle(Class<?> clazz, StyleGIS<?> style)
Register the agent class and style information- Parameters:
clazz
- the agent class to style in the displaystyle
- the agent styleorder
- the agent layer order in the display
-
registerNetworkStyle
public void registerNetworkStyle(Network<?> network, NetworkStyleGIS style)
Register the network and style information- Parameters:
network
- the networkstyle
- the network style
-
registerCoverageStyle
public void registerCoverageStyle(String coverageName, CoverageStyle<?> style)
Register the dynamic coverage and style information- Parameters:
coverageName
- the coverage name to style in the displaystyle
- the coverage styleorder
- the coverage layer order in the display
-
createPanel
public void createPanel()
-
getPanel
public JPanel getPanel()
Description copied from interface:IDisplay
Gets a panel that contains the actual gui for visualization.- Returns:
- a panel that contains the actual gui for visualization.
-
isVisible
protected boolean isVisible()
-
probe
public void probe(gov.nasa.worldwind.event.SelectEvent event)
-
init
public void init()
Description copied from interface:IDisplay
Initializes the display. Called once before the display is made visible.
-
createBackgroundLayer
protected void createBackgroundLayer()
Create a simple background layer that is a single colored rectangle that covers the entire globe.
-
createStaticRasterLayer
protected gov.nasa.worldwind.layers.RenderableLayer createStaticRasterLayer(String filename, boolean forceLongitudeFirstAxis)
Adds a static raster layer from the provided file. The raster BufferedImage is created and added to the WWJ Globe so that it persists as long as the display exists, but is not updated with display updates.- Parameters:
filename
- the GIS raster filename to displayforceLongitudeFirstAxis
- true if lon should be forced first axis in coverage loader
-
destroy
public void destroy()
!!! Destroy needs to properly dispose and shutdown of WorldWind objects to prevent memory leaks !!!!- Specified by:
destroy
in interfaceIDisplay
- Overrides:
destroy
in classAbstractDisplay
-
addObject
protected void addObject(Object o)
- Specified by:
addObject
in classAbstractDisplay
-
moveObject
protected void moveObject(Object o)
- Specified by:
moveObject
in classAbstractDisplay
-
removeObject
protected void removeObject(Object o)
- Specified by:
removeObject
in classAbstractDisplay
-
setLayout
public void setLayout(Layout layout)
Description copied from interface:IDisplay
Sets the Layout for the display to use.- Parameters:
layout
- the layout to use
-
setLayoutFrequency
public void setLayoutFrequency(IDisplay.LayoutFrequency frequency, int interval)
Description copied from interface:IDisplay
Sets the frequency of the layout.- Parameters:
frequency
- the frequency of the layoutinterval
- the interval if the frequency is AT_INTERVAL. The interval is in terms of number of calls to update()
-
update
public void update()
Description copied from interface:IDisplay
Updates the state of the display to reflect whatever it is that it is displaying.
-
render
public void render()
Description copied from interface:Renderer
Render the display. This rendering should take place asynchronously on the AWT thread.
-
setPause
public void setPause(boolean pause)
Description copied from interface:Renderer
Pause the rendering. The Renderer should update and render if pause is true, if possible. The rendering should take place asynchronously on the AWT thread.
-
getLayout
public Layout getLayout()
Description copied from interface:IDisplay
Gets the layout the display uses- Returns:
- a layout object
-
createEditor
public DisplayEditorLifecycle createEditor(JPanel panel)
Description copied from interface:IDisplay
Creates an DisplayEditor appropriate for editing this display.- Parameters:
panel
- a JPanel with a BorderLayout to which editor components can be added- Returns:
- an DisplayEditor appropriate for editing this display or null if this display cannot be edited.
-
resetHomeView
public void resetHomeView()
Description copied from interface:IDisplay
Resets the home (initial) view of the display
-
toggleAnaglyphStereo
public void toggleAnaglyphStereo()
-
registerToolBar
public void registerToolBar(JToolBar bar)
Description copied from class:AbstractDisplay
Registers the specified toolbar with this IDisplay. This IDisplay can then put buttons etc. are on this toolbar. This is a default no-op implementation.- Specified by:
registerToolBar
in interfaceIDisplay
- Overrides:
registerToolBar
in classAbstractDisplay
- Parameters:
bar
- the bar to register
-
initGlobes
protected void initGlobes(GISDisplayDescriptor.VIEW_TYPE viewType)
Initialize the WWJ globe (flat/globe)- Parameters:
viewType
- the view type (flat/globe)
-
isFlatGlobe
public boolean isFlatGlobe()
-
setTrackAgents
public void setTrackAgents(boolean trackAgents)
-
setRenderQuality
public void setRenderQuality(RepastStereoOptionSceneController.RenderQuality quality)
-
enableRoundGlobe
public void enableRoundGlobe(boolean round)
-
toggleInfoProbe
public void toggleInfoProbe()
-
getClassStyleMap
public Map<Class<?>,AbstractRenderableLayer<?,?>> getClassStyleMap()
-
getWwglCanvas
public gov.nasa.worldwind.WorldWindow getWwglCanvas()
-
getLayerPanel
public LayerPanel getLayerPanel()
-
deIconified
public void deIconified()
Description copied from interface:IDisplay
Notifies this IDisplay that its associated gui widget has been deIconified.
-
iconified
public void iconified()
Description copied from interface:IDisplay
Notifies this IDisplay that its associated gui widget has been iconified.
-
closed
public void closed()
Description copied from interface:IDisplay
Notifies this IDisplay that its associated gui widget has been closed.
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
-
-