view
Class PointDraw

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

public class PointDraw
extends AbstractFilledShape
implements Centerable

Drawing shapes that should have a constant size during zooming is not possible by adding them as normal shapes in JNormalizedCanvas. Use this class instead.


Field Summary
private  Point2D center
          The normalized position of this object.
private  ShapeDraw zero
          The 0,0-centered shape to draw.
 
Constructor Summary
PointDraw(Point2D where, Shape generic, boolean fill)
          Constructs a new PointDraw object by providing a generic shape and a normalized location for it.
PointDraw(Point2D where, ShapeDraw generic)
          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()
          Returns the center plus the shape as a string.
 
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 ShapeDraw zero
The 0,0-centered shape to draw.


center

private Point2D center
The normalized position of this object.

Constructor Detail

PointDraw

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


PointDraw

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

Method Detail

getCenter

public Point2D getCenter()
Returns the normalized position where to draw the shape.

Specified by:
getCenter in interface Centerable

getShape

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

Specified by:
getShape in interface FilledShape

isFilled

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

Specified by:
isFilled in interface FilledShape

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

toString

public String toString()
Returns the center plus the shape as a string.

Overrides:
toString in class Object