Class AbstractDisplayLayerOGL2D<S>
- java.lang.Object
-
- repast.simphony.visualizationOGL2D.AbstractDisplayLayerOGL2D<S>
-
- All Implemented Interfaces:
IDisplayLayer<saf.v3d.scene.VSpatial>
- Direct Known Subclasses:
NetworkLayerOGL2D
,StyledDisplayLayerOGL2D
public abstract class AbstractDisplayLayerOGL2D<S> extends Object implements IDisplayLayer<saf.v3d.scene.VSpatial>
Abstract base class for OGL2D display layers.- Author:
- Nick Collier
-
-
Field Summary
Fields Modifier and Type Field Description static String
LABEL_KEY
protected Map<Font,saf.v3d.scene.VLabelLayer>
labelLayers
protected saf.v3d.scene.VLayer
layer
static String
MODEL_OBJECT_KEY
protected Map<Object,saf.v3d.scene.VSpatial>
objMap
protected S
style
protected Set<Object>
toBeAdded
protected Set<Object>
toBeRemoved
-
Constructor Summary
Constructors Constructor Description AbstractDisplayLayerOGL2D(S style, saf.v3d.scene.VLayer layer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addObject(Object obj)
Adds the specified object to the layer.void
applyUpdates()
No-op for ogl based code as the displaying the GLAutoDrawable will reflect the updates.S
getStyle()
Gets the style used by this display layer.saf.v3d.scene.VSpatial
getVisualItem(Object obj)
Gets the visual item that represents the specified object in the display.void
removeObject(Object obj)
Removes this specified object from this layer.void
setStyle(S style)
Sets the style used by this display layer.abstract void
update(LayoutUpdater updater)
Updates the displayed nodes by applying styles etc.
-
-
-
Field Detail
-
MODEL_OBJECT_KEY
public static final String MODEL_OBJECT_KEY
- See Also:
- Constant Field Values
-
LABEL_KEY
public static final String LABEL_KEY
- See Also:
- Constant Field Values
-
style
protected S style
-
layer
protected saf.v3d.scene.VLayer layer
-
-
Constructor Detail
-
AbstractDisplayLayerOGL2D
public AbstractDisplayLayerOGL2D(S style, saf.v3d.scene.VLayer layer)
-
-
Method Detail
-
getStyle
public S getStyle()
Gets the style used by this display layer.- Returns:
- the style used by this display layer.
-
setStyle
public void setStyle(S style)
Sets the style used by this display layer.- Parameters:
style
- the new style
-
addObject
public void addObject(Object obj)
Description copied from interface:IDisplayLayer
Adds the specified object to the layer.- Specified by:
addObject
in interfaceIDisplayLayer<S>
- Parameters:
obj
- the object to add
-
applyUpdates
public void applyUpdates()
No-op for ogl based code as the displaying the GLAutoDrawable will reflect the updates. Nothing needs to be done here.- Specified by:
applyUpdates
in interfaceIDisplayLayer<S>
-
getVisualItem
public saf.v3d.scene.VSpatial getVisualItem(Object obj)
Gets the visual item that represents the specified object in the display.- Specified by:
getVisualItem
in interfaceIDisplayLayer<S>
- Parameters:
obj
- the object whose visual representation we want to get- Returns:
- the visual item that represents the specified object in the display.
-
removeObject
public void removeObject(Object obj)
Removes this specified object from this layer.- Specified by:
removeObject
in interfaceIDisplayLayer<S>
- Parameters:
obj
- the object to remove
-
update
public abstract void update(LayoutUpdater updater)
Updates the displayed nodes by applying styles etc. The display is not updated to reflect these changes.- Specified by:
update
in interfaceIDisplayLayer<S>
- Parameters:
updater
- used to update the layout and position information
-
-