sim.portrayal.simple
Class OvalPortrayal2D

java.lang.Object
  extended by sim.portrayal.SimplePortrayal2D
      extended by sim.portrayal.simple.OvalPortrayal2D
All Implemented Interfaces:
java.io.Serializable, Portrayal, Portrayal2D

public class OvalPortrayal2D
extends SimplePortrayal2D

A simple portrayal for 2D visualization of ovals. It extends the SimplePortrayal2D and it manages the drawing and hit-testing for oval shapes.

See Also:
Serialized Form

Field Summary
 java.awt.Paint paint
           
 double scale
           
 
Constructor Summary
OvalPortrayal2D()
           
OvalPortrayal2D(double scale)
           
OvalPortrayal2D(java.awt.Paint paint)
           
OvalPortrayal2D(java.awt.Paint paint, double scale)
           
 
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, add last portrayed object to the bag
 
Methods inherited from class sim.portrayal.SimplePortrayal2D
getInspector, getName, getStatus, move, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paint

public java.awt.Paint paint

scale

public double scale
Constructor Detail

OvalPortrayal2D

public OvalPortrayal2D()

OvalPortrayal2D

public OvalPortrayal2D(java.awt.Paint paint)

OvalPortrayal2D

public OvalPortrayal2D(double scale)

OvalPortrayal2D

public OvalPortrayal2D(java.awt.Paint paint,
                       double scale)
Method Detail

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)
If drawing area intersects selected area, add last portrayed object to the bag

Overrides:
hitObject in class SimplePortrayal2D