org.vizzini.ui.graphics
Class ShapeGroup

java.lang.Object
  extended by org.vizzini.ui.graphics.ShapeGroup

public final class ShapeGroup
extends Object

Holds a collection of shapes and draws them.

Since:
v0.2
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
ShapeGroup()
           
 
Method Summary
 void add(IShape shape)
          Add the given shape.
 void clear()
          Clear all shapes.
 void computeScreenPoints(Quaternion q, Vector v, double magnify, int offsetX, int offsetY, double d)
          Compute the screen points of all the shapes.
 void drawOn(Graphics g, double magnify)
          Draw the shapes on the given graphics with the given magnification.
 Rectangle getBounds()
          Return the bounding box of the screen coordinates.
 boolean isEmpty()
          Return true if this is empty.
 Iterator iterator()
          Return an iterator over the shapes.
 void remove(IShape shape)
          Remove the given shape.
 void setSorted(boolean flag)
          Set the sorted flag.
 int size()
          Return the size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeGroup

public ShapeGroup()
Method Detail

add

public void add(IShape shape)
Add the given shape.

Since:
v0.2

clear

public void clear()
Clear all shapes.

Since:
v0.2

computeScreenPoints

public void computeScreenPoints(Quaternion q,
                                Vector v,
                                double magnify,
                                int offsetX,
                                int offsetY,
                                double d)
Compute the screen points of all the shapes.

Parameters:
q - The parent quaternion.
magnify - The magnification.
offsetX - The offset X coordinate.
offsetY - The offset Y coordinate.
d - Perspective constant.
Since:
v0.2

drawOn

public void drawOn(Graphics g,
                   double magnify)
Draw the shapes on the given graphics with the given magnification.

Parameters:
g - The graphics.
magnify - The magnification.
Since:
v0.2

getBounds

public Rectangle getBounds()
Return the bounding box of the screen coordinates.

Since:
v0.2

isEmpty

public boolean isEmpty()
Return true if this is empty.

Since:
v0.2

iterator

public Iterator iterator()
Return an iterator over the shapes.

Since:
v0.2

remove

public void remove(IShape shape)
Remove the given shape.

Parameters:
shape - The shape to remove.
Since:
v0.2

setSorted

public void setSorted(boolean flag)
Set the sorted flag.

Since:
v0.2

size

public int size()
Return the size.

Since:
v0.2


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02