|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Graphical Object collection that implements the Watcher interface, listening for changes to the Graphical Objects contained.
A Graphical Object Collection simply contains a collection of Graphical Objects. It does not modify the Graphical Objects in any way.
If you're familiar with Collections in Java, you're probably wondering why this doesn't implement the collection interface correctly. Well, unfortunately, Java has some naming conflicts with methods, like size(). If the naming conflicts ever get resolved, then we'll straighten out the names here too.
This software is distributed under the Berkeley Software License.
Revisions: - SATIN-v1.0-1.0.0, Oct 09 1998, JH Created class - SATIN-v2.1-1.0.0, Aug 11 2000, JH Touched for SATIN release
Inner classes inherited from class edu.berkeley.guir.lib.satin.SatinConstants |
SatinConstants.ObjectPoolAffineTransform, SatinConstants.ObjectPoolPoint2D, SatinConstants.ObjectPoolPolygon2D, SatinConstants.ObjectPoolRectangle2D, SatinConstants.ObjectPoolStringBuffer, SatinConstants.UniqueAffineTransform, SatinConstants.UniquePoint2D, SatinConstants.UniquePolygon2D, SatinConstants.UniqueRectangle2D |
Method Summary | |
GraphicalObject |
add(GraphicalObject gob)
Same as addToFront. |
GraphicalObject |
add(int index,
GraphicalObject gob)
Add a Graphical Object to the specified location. |
GraphicalObject |
addToBack(GraphicalObject gob)
Add a GraphicalObject to the back of the list. |
GraphicalObject |
addToFront(GraphicalObject gob)
Add a GraphicalObject to the front of the list. |
void |
clear()
Clear out all Graphical Objects in this collection. |
Object |
clone()
Clone shallowly, one level only. |
boolean |
contains(GraphicalObject gob)
See if this Graphical Object Collection contains the specified Graphical Object. |
Object |
deepClone()
Clone deeply, recursing if necessary. |
GraphicalObject |
get(int index)
Get the Graphical Object at the specified index. |
Rectangle2D |
getCollectionBounds2D(int cdsys)
Get the union of the bounds of the GraphicalObjects contained in this collection. |
Rectangle2D |
getCollectionBounds2D(int cdsys,
Rectangle2D rect)
Get the bounds, put them in the specified Rectangle. |
GraphicalObject |
getFirst()
Get the first Graphical Object. |
Iterator |
getForwardIterator()
Get an iterator that goes forward thru the collection. |
GraphicalObject |
getID(int id)
Retrieve the GraphicalObject with the specified unique ID. |
GraphicalObject |
getLast()
Get the last Graphical Object. |
Iterator |
getReverseIterator()
Get an iterator that goes backwards thru the collection. |
int |
indexOf(GraphicalObject gob)
Find the index of the specified Graphical Object. |
boolean |
isEmpty()
Is this collection empty? |
int |
numElements()
Get the number of elements contained in this collection. |
GraphicalObject |
remove(GraphicalObject gob)
Remove a Graphical Object from this collection. |
void |
sort(Comparator c)
Sort the list given the specified comparator. |
Methods inherited from interface edu.berkeley.guir.lib.satin.watch.Watcher |
onDelete, onNotify, onUpdate, onUpdate |
Method Detail |
public GraphicalObject add(GraphicalObject gob)
gob
- is the GraphicalObject to add.public GraphicalObject addToFront(GraphicalObject gob)
gob
- is the Graphical Object to add.public GraphicalObject addToBack(GraphicalObject gob)
gob
- is the Graphical Object to add.public GraphicalObject add(int index, GraphicalObject gob)
index
- is the location to add to (zero-based). It is up to the
programmer to ensure that this is a valid value.gob
- is the Graphical Object to add.public void clear()
public boolean contains(GraphicalObject gob)
GraphicalObject.shapeContains(GraphicalObject)
.public GraphicalObject get(int index)
index
- is the location to look at (zero-based). It is up to the
programmer to ensure that this is a valid value.public GraphicalObject getFirst()
public GraphicalObject getLast()
public GraphicalObject getID(int id)
id
- is the unique ID of the GraphicalObject to retrieve.public Rectangle2D getCollectionBounds2D(int cdsys)
cdsys
- is the coordinate system to use.public Rectangle2D getCollectionBounds2D(int cdsys, Rectangle2D rect)
public int indexOf(GraphicalObject gob)
gob
- is the Graphical Object to look for.public boolean isEmpty()
public int numElements()
I realize that this should have been called size(), but there already exists a deprecated method in Component named size().
public GraphicalObject remove(GraphicalObject gob)
gob
- is the Graphical Object ot remove.public Iterator getForwardIterator()
public Iterator getReverseIterator()
public void sort(Comparator c)
LayerComparator
, which sorts by layers.public Object clone()
clone
in interface Watcher
clone
in class Object
public Object deepClone()
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |