Class DefaultStyleOGL2D

  • All Implemented Interfaces:
    StyleOGL2D

    public class DefaultStyleOGL2D
    extends Object
    implements StyleOGL2D
    Default 2D OGL Style.
    • Field Detail

      • shapeFactory

        protected saf.v3d.ShapeFactory2D shapeFactory
    • Constructor Detail

      • DefaultStyleOGL2D

        public DefaultStyleOGL2D()
    • Method Detail

      • 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
        Parameters:
        factory - the factory to intialize this style with
      • getVSpatial

        public saf.v3d.scene.VSpatial getVSpatial​(Object agent,
                                                  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
        Parameters:
        agent - the object whose VSpatial representation we want
        spatial - the current VSpatial representation
        Returns:
        a circle of radius 4.
      • getColor

        public Color getColor​(Object agent)
        Description copied from interface: StyleOGL2D
        Gets the color for the specified object.
        Specified by:
        getColor in interface StyleOGL2D
        Returns:
        Color.BLUE.
      • getRotation

        public float getRotation​(Object agent)
        Description copied from interface: StyleOGL2D
        Gets the rotation, in degrees, of the VSpatial for the specified object.
        Specified by:
        getRotation in interface StyleOGL2D
        Returns:
        the rotation, in degrees, of the VSpatial 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
        Returns:
        the border 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
        Returns:
        the size of the border 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
        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
        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
        Returns:
        the font for this objects label. This can be null if there is no label.
      • 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
        Returns:
        the position of the label relative the VSpatial.
      • 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
        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
        Returns:
        an optional Y offset for the label placement.
      • 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
        Returns:
        the label color. Can return null if there is no label.