sim.portrayal.simple
Class ShapePortrayal2D
java.lang.Object
sim.portrayal.SimplePortrayal2D
sim.portrayal.simple.ShapePortrayal2D
- All Implemented Interfaces:
- java.io.Serializable, Portrayal, Portrayal2D
public class ShapePortrayal2D
- extends SimplePortrayal2D
A simple portrayal for 2D visualization of java.awt.Shapes. It extends the SimplePortrayal2D and
it manages the drawing and hit-testing for shapes.
- See Also:
- Serialized Form
Method Summary |
void |
draw(java.lang.Object object,
java.awt.Graphics2D graphics,
DrawInfo2D info)
Draw a portrayed object centered at the origin in info, and
with the given scaling factors. |
boolean |
hitObject(java.lang.Object object,
DrawInfo2D range)
If drawing area intersects selected area, return true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
paint
public java.awt.Paint paint
scale
public double scale
shape
public java.awt.Shape shape
ShapePortrayal2D
public ShapePortrayal2D(java.awt.Shape shape)
ShapePortrayal2D
public ShapePortrayal2D(java.awt.Shape shape,
java.awt.Paint paint)
ShapePortrayal2D
public ShapePortrayal2D(java.awt.Shape shape,
double scale)
ShapePortrayal2D
public ShapePortrayal2D(java.awt.Shape shape,
java.awt.Paint paint,
double scale)
draw
public void draw(java.lang.Object object,
java.awt.Graphics2D graphics,
DrawInfo2D info)
- Description copied from interface:
Portrayal2D
- Draw a portrayed object centered at the origin in info, and
with the given scaling factors. It is possible that object
is null.
- Specified by:
draw
in interface Portrayal2D
- Overrides:
draw
in class SimplePortrayal2D
hitObject
public boolean hitObject(java.lang.Object object,
DrawInfo2D range)
- Description copied from class:
SimplePortrayal2D
- If drawing area intersects selected area, return true. The default computes
the intersection with the (-0.5,-0.5) to (0.5,0.5) rectangle.
- Overrides:
hitObject
in class SimplePortrayal2D