org.vizzini.ui.graphics
Class ShapeSortList

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

public final class ShapeSortList
extends Object

Provides a sortable list to hold shapes.

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

Constructor Summary
ShapeSortList()
           
 
Method Summary
 void add(IShape shape)
          Add the given shape.
protected  void checkSort()
          Make sure the data is sorted.
 void clear()
          Clear all shapes.
 void computeScreenPoints(Quaternion q, Vector v, double magnify, int offsetX, int offsetY, double d)
          Compute the screen points for all shapes.
 IShape get(int index)
          Return the shape at the given index.
 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.
 Iterator sortedIterator()
          Return an iterator over the shapes in sorted order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeSortList

public ShapeSortList()
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 for all 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

get

public IShape get(int index)
Return the shape at the given index.

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. The shapes may not be sorted; for the sorted shapes, use sortedIterator.

Since:
v0.2
See Also:
sortedIterator()

remove

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

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

sortedIterator

public Iterator sortedIterator()
Return an iterator over the shapes in sorted order.

Since:
v0.2

checkSort

protected void checkSort()
Make sure the data is sorted.

Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02