Class DisplayOGL2D
java.lang.Object
repast.simphony.visualization.AbstractDisplay
repast.simphony.visualizationOGL2D.DisplayOGL2D
- All Implemented Interfaces:
EventListener,ChangeListener,Renderer,ProjectionListener,IDisplay,saf.v3d.CanvasListener,saf.v3d.picking.PickListener
public class DisplayOGL2D
extends AbstractDisplay
implements saf.v3d.CanvasListener, saf.v3d.picking.PickListener, ChangeListener
2D display that uses jogl for rendering.
- Author:
- Nick Collier
-
Nested Class Summary
Nested classes/interfaces inherited from interface repast.simphony.visualization.IDisplay
IDisplay.LayoutFrequency -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected saf.v3d.Canvas2Dprotected Map<Class<?>,StyledDisplayLayerOGL2D> protected saf.v3d.scene.VLayerprotected Map<String,ProjectionDecorator2D<?>> protected DisplayData<?>protected booleanprotected booleanprotected booleanprotected Layout<?,?> protected LayoutUpdaterprotected Map<Network<?>,NetworkLayerOGL2D> protected JPanelprotected Componentprotected JTabbedPaneprotected Runnableprotected Map<ValueLayer,ValueLayerDisplayLayer> Fields inherited from class repast.simphony.visualization.AbstractDisplay
dlSupport, FRAME_UPDATE_INTERVAL, INFO_CURSOR, lastRenderTS, probeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclosed()Notifies this IDisplay that its associated gui widget has been closed.createEditor(JPanel panel) Creates an DisplayEditor appropriate for editing this display.voidvoidNotifies this IDisplay that its associated gui widget has been deIconified.voiddestroy()Destroys the display, allowing it to free any resources it may have acquired.voiddispose(com.jogamp.opengl.GLAutoDrawable drawable) protected StyledDisplayLayerOGL2DFinds the layer associated with this object.Gets the background color of this display.saf.v3d.Canvas2DLayout<?,?> Gets the layout the display usesgetPanel()Gets a panel that contains the actual gui for visualization.voidNotifies this IDisplay that its associated gui widget has been iconified.voidinit()Initializes the display.voidinit(com.jogamp.opengl.GLAutoDrawable drawable, saf.v3d.scene.VRoot root) protected voidmoveObject(Object o) voidpickPerformed(saf.v3d.picking.PickEvent evt) voidregisterDecorator(ProjectionDecorator2D<?> decorator) voidregisterNetworkStyle(Network<?> network, EdgeStyleOGL2D style) Registers the specified style for the specified network.voidregisterStyle(Class<?> clazz, StyleOGL2D<?> style) Register the specified style for the specified class.voidregisterValueLayerStyle(ValueLayer layer, ValueLayerStyleOGL style) Registers the specified style and layer for display.protected voidvoidrender()Render the display.voidResets the home (initial) view of the displayvoidreshape(com.jogamp.opengl.GLAutoDrawable drawable, float width, float height, saf.v3d.scene.VRoot root) voidsetBackgroundColor(Color color) Sets the background color of this display.voidSets the Layout for the display to use.voidsetLayoutFrequency(IDisplay.LayoutFrequency frequency, int interval) Sets the frequency of the layout.voidsetPause(boolean pause) Pause the rendering.voidstateChanged(ChangeEvent evt) voidupdate()Updates the state of the display to reflect whatever it is that it is displaying.voidvSpatialMoved(saf.v3d.scene.VSpatial spatial, org.jogamp.vecmath.Point3f localTrans) Methods inherited from class repast.simphony.visualization.AbstractDisplay
addDisplayListener, addProbeListener, createInfoCursor, getProbeSupport, projectionEventOccurred, registerToolBar, setProbeSupport
-
Field Details
-
updater
-
panel
-
layout
-
canvas
protected saf.v3d.Canvas2D canvas -
displayData
-
classStyleMap
-
networkStyleMap
-
valueLayerStyleMap
-
decoratorMap
-
layoutUpdater
-
doRender
protected boolean doRender -
glInitialized
protected boolean glInitialized -
iconified
protected boolean iconified -
tabParent
-
tabChild
-
decoratorLayer
protected saf.v3d.scene.VLayer decoratorLayer
-
-
Constructor Details
-
DisplayOGL2D
-
-
Method Details
-
init
public void init()Description copied from interface:IDisplayInitializes the display. Called once before the display is made visible. -
setBackgroundColor
Sets the background color of this display.- Parameters:
color- the new background color
-
getBackgroundColor
Gets the background color of this display.- Returns:
- the background color.
-
moveObject
- Specified by:
moveObjectin classAbstractDisplay
-
addObject
- Specified by:
addObjectin classAbstractDisplay
-
removeObject
- Specified by:
removeObjectin classAbstractDisplay
-
closed
public void closed()Description copied from interface:IDisplayNotifies this IDisplay that its associated gui widget has been closed. -
createEditor
Description copied from interface:IDisplayCreates an DisplayEditor appropriate for editing this display.- Specified by:
createEditorin interfaceIDisplay- 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.
-
deIconified
public void deIconified()Description copied from interface:IDisplayNotifies this IDisplay that its associated gui widget has been deIconified.- Specified by:
deIconifiedin interfaceIDisplay
-
iconified
public void iconified()Description copied from interface:IDisplayNotifies this IDisplay that its associated gui widget has been iconified. -
resetHomeView
public void resetHomeView()Description copied from interface:IDisplayResets the home (initial) view of the display- Specified by:
resetHomeViewin interfaceIDisplay
-
getLayout
Description copied from interface:IDisplayGets the layout the display uses -
getPanel
Description copied from interface:IDisplayGets a panel that contains the actual gui for visualization. -
createPanel
public void createPanel() -
stateChanged
- Specified by:
stateChangedin interfaceChangeListener
-
setLayout
Description copied from interface:IDisplaySets the Layout for the display to use. -
setLayoutFrequency
Description copied from interface:IDisplaySets the frequency of the layout.- Specified by:
setLayoutFrequencyin interfaceIDisplay- 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()
-
setPause
public void setPause(boolean pause) Description copied from interface:RendererPause the rendering. The Renderer should update and render if pause is true, if possible. The rendering should take place asynchronously on the AWT thread. -
update
public void update()Description copied from interface:IDisplayUpdates the state of the display to reflect whatever it is that it is displaying. -
render
public void render()Description copied from interface:RendererRender the display. This rendering should take place asynchronously on the AWT thread. -
registerDecorator
-
findLayer
Finds the layer associated with this object. This will return the layer explicitly associated with the object. If that is not found then this will return the first layer associated with the objects parent classes or interface.- Parameters:
obj- the object to find the layer for- Returns:
- the layer that best matches the object
-
registerStyle
Register the specified style for the specified class. All objects of that class will be styled using that style.- Parameters:
clazz- the class to register the style forstyle- the style to register
-
registerNetworkStyle
Registers the specified style for the specified network.- Parameters:
network- the networkstyle-
-
registerValueLayerStyle
Registers the specified style and layer for display.- Parameters:
style- the styling info for displaying the layerlayer- the layer to display
-
destroy
public void destroy()Description copied from class:AbstractDisplayDestroys the display, allowing it to free any resources it may have acquired.- Specified by:
destroyin interfaceIDisplay- Overrides:
destroyin classAbstractDisplay
-
pickPerformed
public void pickPerformed(saf.v3d.picking.PickEvent evt) - Specified by:
pickPerformedin interfacesaf.v3d.picking.PickListener
-
init
public void init(com.jogamp.opengl.GLAutoDrawable drawable, saf.v3d.scene.VRoot root) - Specified by:
initin interfacesaf.v3d.CanvasListener
-
reshape
public void reshape(com.jogamp.opengl.GLAutoDrawable drawable, float width, float height, saf.v3d.scene.VRoot root) - Specified by:
reshapein interfacesaf.v3d.CanvasListener
-
vSpatialMoved
public void vSpatialMoved(saf.v3d.scene.VSpatial spatial, org.jogamp.vecmath.Point3f localTrans) - Specified by:
vSpatialMovedin interfacesaf.v3d.CanvasListener
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable drawable) - Specified by:
disposein interfacesaf.v3d.CanvasListener
-
getCanvas
public saf.v3d.Canvas2D getCanvas()
-