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.Object xVar,
java.lang.Object yVar,
VariableDomain xRange,
VariableDomain yRange,
double xWidth,
double yWidth,
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.Object xVar, java.lang.Object yVar, VariableDomain xRange, VariableDomain yRange, double xWidth, double yWidth, 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.xVar
- the x variable keyyVar
- the y variable keyxRange
- the range of the x variableyRange
- the range of the y variablexWidth
- the width of each rendered state within the x domainyWidth
- the width of the each rendered state within the y domainnorthActionName
- 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.