public class ArrowActionGlyph extends java.lang.Object implements ActionGlyphPainter
ActionGlyphPainter
that will render arrows to the graphics context.Modifier and Type | Field and Description |
---|---|
protected int |
direction
The direction of the arrow.0: north; 1: south; 2: east; 3:west
|
protected java.awt.Color |
fillColor
The color of the arrow
|
Constructor and Description |
---|
ArrowActionGlyph(int direction)
creates an arrow action glyph painter in the specified direction
|
Modifier and Type | Method and Description |
---|---|
static PolicyGlyphPainter2D |
getNSEWPolicyGlyphPainter(java.lang.String classWithPositionAtts,
java.lang.String xAtt,
java.lang.String yAtt,
java.lang.String northActionName,
java.lang.String southActionName,
java.lang.String eastActionName,
java.lang.String westActionName)
Creates and returns a
PolicyGlyphPainter2D
where the x and y position attributes are name xAtt and yAtt, respectively, belong to the class
classWithPositionAtts, and the north, south east, west actions have the corresponding names and
will be rendered using ArrowActionGlyph
objects. |
void |
paintGlyph(java.awt.Graphics2D g2,
float x,
float y,
float width,
float height)
Called to paint a glyph in the rectangle defined by the top left origin (x,y) with the given width and height.
|
protected int direction
protected java.awt.Color fillColor
public ArrowActionGlyph(int direction)
direction
- 0: north; 1: south; 2: east; 3:westpublic static PolicyGlyphPainter2D getNSEWPolicyGlyphPainter(java.lang.String classWithPositionAtts, java.lang.String xAtt, java.lang.String yAtt, java.lang.String northActionName, java.lang.String southActionName, java.lang.String eastActionName, java.lang.String westActionName)
PolicyGlyphPainter2D
where the x and y position attributes are name xAtt and yAtt, respectively, belong to the class
classWithPositionAtts, and the north, south east, west actions have the corresponding names and
will be rendered using ArrowActionGlyph
objects.classWithPositionAtts
- the class which contains the x-y position information of the state.xAtt
- the name of the x attributeyAtt
- the name of the y attributenorthActionName
- the name of the north actionsouthActionName
- the name of the south actioneastActionName
- the name of the east actionwestActionName
- the name of the west actionPolicyGlyphPainter2D
instance.public void paintGlyph(java.awt.Graphics2D g2, float x, float y, float width, float height)
ActionGlyphPainter
paintGlyph
in interface ActionGlyphPainter
g2
- the graphics context to paint tox
- the left of the rectangle originy
- the top of the rectangle originwidth
- the width of the rectangleheight
- the height of the rectangle.