Class DefaultStyleOGL2D
- java.lang.Object
-
- repast.simphony.visualizationOGL2D.DefaultStyleOGL2D
-
- All Implemented Interfaces:
StyleOGL2D
public class DefaultStyleOGL2D extends Object implements StyleOGL2D
Default 2D OGL Style.
-
-
Field Summary
Fields Modifier and Type Field Description protected saf.v3d.ShapeFactory2D
shapeFactory
-
Constructor Summary
Constructors Constructor Description DefaultStyleOGL2D()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getBorderColor(Object object)
Gets the border color for the specified object.int
getBorderSize(Object object)
Gets the size of the border for the specified object.Color
getColor(Object agent)
Gets the color for the specified object.String
getLabel(Object object)
Gets a label for the specified object.Color
getLabelColor(Object object)
Gets the label color.Font
getLabelFont(Object object)
Gets the font for this objects label.saf.v3d.scene.Position
getLabelPosition(Object object)
Gets the position of the label relative the VSpatial.float
getLabelXOffset(Object object)
Gets an optional X offset for the label location.float
getLabelYOffset(Object object)
Gets an optional Y offset for the label location.float
getRotation(Object agent)
Gets the rotation, in degrees, of the VSpatial for the specified object.float
getScale(Object object)
Gets the scale for the specified object.saf.v3d.scene.VSpatial
getVSpatial(Object agent, saf.v3d.scene.VSpatial spatial)
Gets the VSpatial visual representation of the object.void
init(saf.v3d.ShapeFactory2D factory)
Initializes this style with the ShapeFactory2D that should be used to create any VSpatials produced by this style.
-
-
-
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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- Parameters:
agent
- the object whose VSpatial representation we wantspatial
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- 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 interfaceStyleOGL2D
- Returns:
- the label color. Can return null if there is no label.
-
-