Class EditedStyleOGL2D

java.lang.Object
repast.simphony.visualization.editedStyle.EditedStyleOGL2D
All Implemented Interfaces:
StyleOGL2D<Object>

public class EditedStyleOGL2D extends Object implements StyleOGL2D<Object>
Loads style info from a serialized EditedStyleData class.
Author:
Nick Collier
  • Constructor Details

    • EditedStyleOGL2D

      public EditedStyleOGL2D(String styleFile)
  • Method Details

    • init

      public void init(saf.v3d.ShapeFactory2D factory)
      Description copied from interface: StyleOGL2D
      Initializes this style with the ShapeFactory2D that should be used to create any VSpatials produced by this style.
      Specified by:
      init in interface StyleOGL2D<Object>
      Parameters:
      factory - the factory to intialize this style with
    • getVSpatial

      public saf.v3d.scene.VSpatial getVSpatial(Object object, saf.v3d.scene.VSpatial spatial)
      Description copied from interface: StyleOGL2D
      Gets the VSpatial visual representation of the object. If there are no changes to the representation then the VSpatial spatial parameter should be returned.
      Specified by:
      getVSpatial in interface StyleOGL2D<Object>
      Parameters:
      object - the object whose VSpatial representation we want
      spatial - the current VSpatial representation
      Returns:
      a new VSpatial visual representation of the object or the current one if there has been no change.
    • getColor

      public Color getColor(Object object)
      Description copied from interface: StyleOGL2D
      Gets the color for the specified object.
      Specified by:
      getColor in interface StyleOGL2D<Object>
      Returns:
      the color for the specified object.
    • getBorderSize

      public int getBorderSize(Object object)
      Description copied from interface: StyleOGL2D
      Gets the size of the border for the specified object. A size of 0 means no border is drawn.
      Specified by:
      getBorderSize in interface StyleOGL2D<Object>
      Returns:
      the size of the border for the specified object.
    • getBorderColor

      public Color getBorderColor(Object object)
      Description copied from interface: StyleOGL2D
      Gets the border color for the specified object. This will be ignored if the border size is 0.
      Specified by:
      getBorderColor in interface StyleOGL2D<Object>
      Returns:
      the border color for the specified object.
    • getRotation

      public float getRotation(Object object)
      Description copied from interface: StyleOGL2D
      Gets the rotation, in degrees, of the VSpatial for the specified object.
      Specified by:
      getRotation in interface StyleOGL2D<Object>
      Returns:
      the rotation, in degrees, of the VSpatial for the specified object.
    • getScale

      public float getScale(Object object)
      Description copied from interface: StyleOGL2D
      Gets the scale for the specified object.
      Specified by:
      getScale in interface StyleOGL2D<Object>
      Returns:
      the for the specified object.
    • getLabel

      public String getLabel(Object object)
      Description copied from interface: StyleOGL2D
      Gets a label for the specified object. Null and an empty String are permitted values.
      Specified by:
      getLabel in interface StyleOGL2D<Object>
      Parameters:
      object - the object to get the label for
      Returns:
      a label for the specified object. Null and an empty String are permitted values.
    • getLabelFont

      public Font getLabelFont(Object object)
      Description copied from interface: StyleOGL2D
      Gets the font for this objects label. This can be null if there is no label.
      Specified by:
      getLabelFont in interface StyleOGL2D<Object>
      Returns:
      the font for this objects label. This can be null if there is no label.
    • getLabelXOffset

      public float getLabelXOffset(Object object)
      Description copied from interface: StyleOGL2D
      Gets an optional X offset for the label location. This can be used to make small adjustments the label location.
      Specified by:
      getLabelXOffset in interface StyleOGL2D<Object>
      Returns:
      an optional X offset for the label placement.
    • getLabelYOffset

      public float getLabelYOffset(Object object)
      Description copied from interface: StyleOGL2D
      Gets an optional Y offset for the label location. This can be used to make small adjustments the label location.
      Specified by:
      getLabelYOffset in interface StyleOGL2D<Object>
      Returns:
      an optional Y offset for the label placement.
    • getLabelPosition

      public saf.v3d.scene.Position getLabelPosition(Object object)
      Description copied from interface: StyleOGL2D
      Gets the position of the label relative the VSpatial. Valid values are
      • Position.CENTER
      • Position.NORTH
      • Position.SOUTH
      • Position.EAST
      • Position.WEST
      • Position.NORTH_EAST
      • Position.NORTH_WEST
      • Position.SOUTH_EAST
      • Position.SOUTH_WEST
      Specified by:
      getLabelPosition in interface StyleOGL2D<Object>
      Returns:
      the position of the label relative the VSpatial.
    • getLabelColor

      public Color getLabelColor(Object object)
      Description copied from interface: StyleOGL2D
      Gets the label color. Can return null if there is no label.
      Specified by:
      getLabelColor in interface StyleOGL2D<Object>
      Returns:
      the label color. Can return null if there is no label.