view
Class ShapeDraw

java.lang.Object
  extended by view.AbstractFilledShape
      extended by view.ShapeDraw
All Implemented Interfaces:
Centerable, FilledShape

public class ShapeDraw
extends AbstractFilledShape
implements Centerable

Drawing shapes that are either filled or outlined, but otherwise are plain shapes.


Field Summary
private  boolean fill
          True if this shape should be filled on drawing.
private  Shape zero
          The 0,0-centered shape to draw.
 
Constructor Summary
ShapeDraw(Object key, Shape generic, boolean where)
          Constructs a new PointDraw object by providing a generic shape and a normalized location for it.
ShapeDraw(Shape generic)
          Constructs a new PointDraw object by providing a generic shape and a normalized location for it.
ShapeDraw(Shape generic, boolean where)
          Constructs a new PointDraw object by providing a generic shape and a normalized location for it.
 
Method Summary
 boolean equals(Object that)
          To point draws are equal if they draw at the same point and the same shape.
 Point2D getCenter()
          Returns the normalized position where to draw the shape.
 Shape getShape(Graphics2D g2d)
          Returns the zero-centered shape.
 int hashCode()
          Hash code is the has code of the location.
 boolean isFilled()
          Returns the normalized position where to draw the shape.
 String toString()
          String version.
 
Methods inherited from class view.AbstractFilledShape
getUnique
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

zero

private Shape zero
The 0,0-centered shape to draw.


fill

private boolean fill
True if this shape should be filled on drawing.

Constructor Detail

ShapeDraw

public ShapeDraw(Shape generic)
Constructs a new PointDraw object by providing a generic shape and a normalized location for it.


ShapeDraw

public ShapeDraw(Shape generic,
                 boolean where)
Constructs a new PointDraw object by providing a generic shape and a normalized location for it.


ShapeDraw

public ShapeDraw(Object key,
                 Shape generic,
                 boolean where)
Constructs a new PointDraw object by providing a generic shape and a normalized location for it.

Method Detail

isFilled

public boolean isFilled()
Returns the normalized position where to draw the shape.

Specified by:
isFilled in interface FilledShape

getShape

public Shape getShape(Graphics2D g2d)
Returns the zero-centered shape.

Specified by:
getShape in interface FilledShape

getCenter

public Point2D getCenter()
Returns the normalized position where to draw the shape. Note that the affine transform my not be the tranform to draw a shape on a component.

Specified by:
getCenter in interface Centerable

toString

public String toString()
String version.

Overrides:
toString in class Object

equals

public boolean equals(Object that)
To point draws are equal if they draw at the same point and the same shape.

Overrides:
equals in class AbstractFilledShape

hashCode

public int hashCode()
Hash code is the has code of the location.

Overrides:
hashCode in class AbstractFilledShape