Class AbstractDisplayLayerOGL2D<S>

java.lang.Object
repast.simphony.visualizationOGL2D.AbstractDisplayLayerOGL2D<S>
Record Components:
S - the Style type
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 Details

    • MODEL_OBJECT_KEY

      public static final String MODEL_OBJECT_KEY
      See Also:
    • LABEL_KEY

      public static final String LABEL_KEY
      See Also:
    • style

      protected S style
    • layer

      protected saf.v3d.scene.VLayer layer
    • toBeAdded

      protected Set<Object> toBeAdded
    • toBeRemoved

      protected Set<Object> toBeRemoved
    • objMap

      protected Map<Object,saf.v3d.scene.VSpatial> objMap
    • labelLayers

      protected Map<Font,saf.v3d.scene.VLabelLayer> labelLayers
  • Constructor Details

    • AbstractDisplayLayerOGL2D

      public AbstractDisplayLayerOGL2D(S style, saf.v3d.scene.VLayer layer)
  • Method Details

    • 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 interface IDisplayLayer<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 interface IDisplayLayer<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 interface IDisplayLayer<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 interface IDisplayLayer<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 interface IDisplayLayer<S>
      Parameters:
      updater - used to update the layout and position information