Package sim.portrayal.simple
Class HexagonalPortrayal2D
java.lang.Object
sim.portrayal.SimplePortrayal2D
sim.portrayal.simple.AbstractShapePortrayal2D
sim.portrayal.simple.ShapePortrayal2D
sim.portrayal.simple.HexagonalPortrayal2D
- All Implemented Interfaces:
Serializable
,Portrayal
,Portrayal2D
A simple portrayal for 2D visualization of hexagons. It extends the SimplePortrayal2D and
it manages the drawing and hit-testing for hexagonal shapes. If the DrawInfo2D parameter
received by draw and hitObject functions is an instance of HexaDrawInfo2D, better information
is extracted and used to make everthing look better. Otherwise, hexagons may be created from
information stored in simple DrawInfo2D objects, but overlapping or extra empty spaces may be
observed (especially when increasing the scale).
- See Also:
-
Field Summary
Fields inherited from class sim.portrayal.simple.ShapePortrayal2D
POLY_BOWTIE, POLY_COMPASS, POLY_DIAMOND, POLY_HEXAGON, POLY_HEXAGON_ROTATED, POLY_HOURGLASS, POLY_OCTAGON, POLY_PARALLELOGRAM, POLY_POINTER_DOWN, POLY_POINTER_LEFT, POLY_POINTER_RIGHT, POLY_POINTER_UP, POLY_SQUARE, POLY_STAR, POLY_TRIANGLE_DOWN, POLY_TRIANGLE_LEFT, POLY_TRIANGLE_RIGHT, POLY_TRIANGLE_UP, shape, SHAPE_CHOMP, SHAPE_CIRCLE, SHAPE_DELAY, SHAPE_PILL, SHAPE_REVERSE_DELAY, SHAPE_ROUND_SQUARE, SHAPE_STORAGE, SHAPE_VERY_ROUND_SQUARE, X_POINTS_BOWTIE, X_POINTS_COMPASS, X_POINTS_DIAMOND, X_POINTS_HEXAGON, X_POINTS_HEXAGON_ROTATED, X_POINTS_HOURGLASS, X_POINTS_OCTAGON, X_POINTS_PARALLELOGRAM, X_POINTS_POINTER_DOWN, X_POINTS_POINTER_LEFT, X_POINTS_POINTER_RIGHT, X_POINTS_POINTER_UP, X_POINTS_SQUARE, X_POINTS_STAR, X_POINTS_TRIANGLE_DOWN, X_POINTS_TRIANGLE_LEFT, X_POINTS_TRIANGLE_RIGHT, X_POINTS_TRIANGLE_UP, Y_POINTS_BOWTIE, Y_POINTS_COMPASS, Y_POINTS_DIAMOND, Y_POINTS_HEXAGON, Y_POINTS_HEXAGON_ROTATED, Y_POINTS_HOURGLASS, Y_POINTS_OCTAGON, Y_POINTS_PARALLELOGRAM, Y_POINTS_POINTER_DOWN, Y_POINTS_POINTER_LEFT, Y_POINTS_POINTER_RIGHT, Y_POINTS_POINTER_UP, Y_POINTS_SQUARE, Y_POINTS_STAR, Y_POINTS_TRIANGLE_DOWN, Y_POINTS_TRIANGLE_LEFT, Y_POINTS_TRIANGLE_RIGHT, Y_POINTS_TRIANGLE_UP
Fields inherited from class sim.portrayal.simple.AbstractShapePortrayal2D
defaultStroke, filled, fillPaint, paint, scale, stroke, strokePaint
Fields inherited from class sim.portrayal.SimplePortrayal2D
TYPE_HIT_OBJECT, TYPE_SELECTED_OBJECT
-
Constructor Summary
ConstructorDescriptionHexagonalPortrayal2D
(boolean filled) HexagonalPortrayal2D
(double scale) HexagonalPortrayal2D
(double scale, boolean filled) HexagonalPortrayal2D
(Paint paint) HexagonalPortrayal2D
(Paint paint, boolean filled) HexagonalPortrayal2D
(Paint paint, double scale) HexagonalPortrayal2D
(Paint paint, double scale, boolean filled) HexagonalPortrayal2D
(Paint fillPaint, Paint strokePaint, double strokeWidth, double scale) New-style constructors.HexagonalPortrayal2D
(Paint fillPaint, Paint strokePaint, Stroke stroke, double scale) New-style constructors. -
Method Summary
Methods inherited from class sim.portrayal.simple.ShapePortrayal2D
draw, hitObject, setShape, setShape, setStroke, setStroke
Methods inherited from class sim.portrayal.SimplePortrayal2D
getInspector, getName, getStatus, handleMouseEvent, setSelected
-
Constructor Details
-
HexagonalPortrayal2D
public HexagonalPortrayal2D() -
HexagonalPortrayal2D
-
HexagonalPortrayal2D
public HexagonalPortrayal2D(double scale) -
HexagonalPortrayal2D
public HexagonalPortrayal2D(boolean filled) -
HexagonalPortrayal2D
-
HexagonalPortrayal2D
-
HexagonalPortrayal2D
public HexagonalPortrayal2D(double scale, boolean filled) -
HexagonalPortrayal2D
-
HexagonalPortrayal2D
New-style constructors. Rather than having a "filled" flag which determines whether we stroke versus fill, we can do BOTH. We do this by specifying a fill paint and a stroke paint, either of which can be NULL. We also provide a stroke width and a scale. -
HexagonalPortrayal2D
New-style constructors. Rather than having a "filled" flag which determines whether we stroke versus fill, we can do BOTH. We do this by specifying a fill paint and a stroke paint, either of which can be NULL. We also provide a stroke and a scale.
-