public class DirectionPortrayal extends SimplePortrayal2D
Double2D
objects within an ObjectGrid2D
.
If the scale is too small to draw all directions, every nth direction is skipped, while n decreases when scale increases.
Modifier and Type | Field and Description |
---|---|
static double |
MINIMUM_FULL_DRAW_SCALE
If draw scale is below minimum, fewer directions are drawn to comply with
the lack of space.
|
TYPE_HIT_OBJECT, TYPE_SELECTED_OBJECT
Constructor and Description |
---|
DirectionPortrayal()
Constructs a new
DirectionPortrayal with default settings. |
DirectionPortrayal(Paint directionPaint)
Constructs a new
DirectionPortrayal with the given paint for the
directions. |
Modifier and Type | Method and Description |
---|---|
void |
draw(Object object,
Graphics2D graphics,
DrawInfo2D info) |
boolean |
hitObject(Object object,
DrawInfo2D range)
Just check the whole square for hit detection.
|
getInspector, getName, getStatus, handleMouseEvent, setSelected
public static final double MINIMUM_FULL_DRAW_SCALE
public DirectionPortrayal()
DirectionPortrayal
with default settings.public DirectionPortrayal(Paint directionPaint)
DirectionPortrayal
with the given paint for the
directions.directionPaint
- public void draw(Object object, Graphics2D graphics, DrawInfo2D info)
draw
in interface Portrayal2D
draw
in class SimplePortrayal2D
public boolean hitObject(Object object, DrawInfo2D range)
hitObject
in class SimplePortrayal2D
RectanglePortrayal2D.hitObject(Object, DrawInfo2D)