UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.satin.objects
Class GraphicalObjectGroupImpl

java.lang.Object
  |
  +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectImpl
        |
        +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroupImpl
All Implemented Interfaces:
Cloneable, EventListener, GraphicalObject, GraphicalObjectCollection, GraphicalObjectGroup, SatinConstants, Serializable, Shape, StrokeListener, Watchable, Watcher
Direct Known Subclasses:
Label, PatchImpl, Sheet.SheetGraphicalObjectGroup

public class GraphicalObjectGroupImpl
extends GraphicalObjectImpl
implements GraphicalObjectGroup, GraphicalObjectCollection, GraphicalObject, Watchable, Watcher, Shape, StrokeListener

A Group of Graphical objects. Unlike GraphicalObjectCollections, GraphicalObjectGroups can be rendered on screen.

If you subclass this class, be sure to implement deep-clone chaining by overriding deepClone(). This is necessary for copy / cut / paste to work in Satin. Deep-clone chaining is essentially the same as clone chaining.

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v1.0-1.0.0, Oct 06 1998, JH
               Created class
             - SATIN-v2.1-1.0.0, Aug 11 2000, JH
               Touched for SATIN release
 

Since:
JDK 1.2
Version:
SATIN-v2.1-1.0.0, Aug 11 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )
See Also:
Serialized Form

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
 
Fields inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
DEFAULT_POS_POLICY, KEEP_ABS_POS, KEEP_REL_POS
 
Fields inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObject
GESTUREINTRP_CLPROPERTY, INKINTRP_CLPROPERTY, STYLE_CLPROPERTY, VIEW_CLPROPERTY
 
Fields inherited from interface edu.berkeley.guir.lib.satin.SatinConstants
ABOVE, ALL, BAR, BELOW, clipboard, clprops, cmdqueue, cmdsubsys, CONTAINEDBY, CONTAINS, COORD_ABS, COORD_LOCAL, COORD_REL, DAMAGE_LATER, DAMAGE_NOW, DEBUG_GRAPHICS_OFFSET, DEBUG_STYLE_FILE, DEBUG_STYLE_GPROPERTY, DEEP, DEFAULT_POINT2D_POOL_SIZE, DEFAULT_POLYGON2D_POOL_SIZE, DEFAULT_RECTANGLE_POOL_SIZE, DEFAULT_REPAINT_THRESHOLD, DEFAULT_SELECT_THRESHOLD, DEFAULT_STRINGBUFFER_POOL_SIZE, DEFAULT_TRANSFORM_POOL_SIZE, DIR_CENTER, DIR_DOWN, DIR_DOWN_LEFT, DIR_DOWN_RIGHT, DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_UP_LEFT, DIR_UP_RIGHT, FILTER_THRESHOLD, FIRST, FLOATING_PT_TOLERANCE, glprops, INTERSECTS, KEY_STYLE_DASHARRAY, KEY_STYLE_DASHPHASE, KEY_STYLE_DRAWCOLOR, KEY_STYLE_DRAWFONT, KEY_STYLE_DRAWTRANSPARENCY, KEY_STYLE_ENDCAP, KEY_STYLE_FILLCOLOR, KEY_STYLE_FILLTRANSPARENCY, KEY_STYLE_LINEJOIN, KEY_STYLE_LINEWIDTH, KEY_STYLE_MITERLIMIT, NEAR, NOTIFY_BOUNDS, NOTIFY_LAYER, NOTIFY_LOCATION, NOTIFY_STYLE, NOTIFY_TRANSFORM, poolPoints, poolPolys, poolRects, poolStrbuf, poolTx, rand, SATIN_DATA_DIRECTORY_DEFAULT, SATIN_DATA_DIRECTORY_GPROPERTY, SATIN_PROPERTIES_FILENAME, SHALLOW
 
Constructor Summary
GraphicalObjectGroupImpl()
           
 
Method Summary
 GraphicalObject add(GraphicalObject gob)
          This adds a GraphicalObject to the top of the group, keeping its relative coordinates the same.
 GraphicalObject add(GraphicalObject gob, int pos)
          Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
 GraphicalObject add(int index, GraphicalObject gob)
          This adds a GraphicalObject to the group at the specified layer, keeping its relative coordinates the same.
 GraphicalObject add(int index, GraphicalObject gob, int pos)
          Add a GraphicalObject to the specified layer of this group, specifying the GraphicalObject's position at the same time.
 GraphicalObject addToBack(GraphicalObject gob)
          This adds a GraphicalObject to the bottom of the group, keeping its relative coordinates the same.
 GraphicalObject addToBack(GraphicalObject gob, int pos)
          Add a GraphicalObject to the bottom of this group, specifying the GraphicalObject's position at the same time.
 GraphicalObject addToFront(GraphicalObject gob)
          This adds a GraphicalObject to the top of the group, keeping its relative coordinates the same.
 GraphicalObject addToFront(GraphicalObject gob, int pos)
          Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
 void bringDownALayer(GraphicalObject gob)
          Move the specified GraphicalObject down one layer in this Graphical Object Group.
 void bringDownNLayers(GraphicalObject gob, int n)
          Move the specified GraphicalObject down N layers in this Group.
 void bringToBottomLayer(GraphicalObject gob)
          Move the specified Graphical Object to the bottom layer of this Graphical Object Group.
 void bringToTopLayer(GraphicalObject gob)
          Move the specified Graphical Object to the top layer of this Graphical Object Group.
 void bringUpALayer(GraphicalObject gob)
          Move the specified GraphicalObject up one layer in this Graphical Object Group.
 void bringUpNLayers(GraphicalObject gob, int n)
          Move the specified GraphicalObject up N layers in this Group.
 void clear()
          Clear out all Graphical Objects in this collection.
 Object clone()
          So that my clone will not sleep alone.
protected  GraphicalObjectGroupImpl clone(GraphicalObjectGroupImpl gobgrpClone)
          For clone chaining purposes.
 boolean contains(GraphicalObject gob)
          See if this Graphical Object Collection contains the specified Graphical Object.
protected  InteractionHandler createNewInteractionHandler()
          Create an InteractionHandler for Graphical Object Groups.
 Object deepClone()
          Make a deep clone of the GraphicalObjectGroup.
protected  GraphicalObjectGroupImpl deepClone(GraphicalObjectGroupImpl newGobGrp)
          For deep-clone chaining.
protected  void defaultRender(SatinGraphics g)
          The default method for rendering.
 GraphicalObject get(int index)
          Get the Graphical Object at the specified index.
 String getAbsoluteLayer(GraphicalObject gob)
          Given a GraphicalObject, return its absolute layer position.
 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.
protected  GraphicalObject getDispatchee(TimedStroke stk)
          Given a stroke, figure out which of our children it will be dispatched to.
 GraphicalObject getFirst()
          Get the first Graphical Object.
 Iterator getForwardIterator()
          Get an iterator that goes forward thru the collection.
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
          Get all Graphical Objects subject to the specified parameters.
 GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
          Get all Graphical Objects subject to the specified parameters.
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
           
 GraphicalObject getID(int id)
          Retrieve the GraphicalObject with the specified unique ID.
 GraphicalObject getLast()
          Get the last Graphical Object.
 String getRelativeLayer(GraphicalObject gob)
          Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
 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?
 void notifyWatchersDelete()
          Notify the watchers that this object has been deleted.
 int numElements()
          Get the number of elements contained in this collection.
 void onDelete(Watchable w)
          Callback method for notifications of deletions, that is this Graphical Object has been deleted and you should remove it.
 void onNotify(Watchable w, Object arg)
          Callback method for generic notifications.
 void onUpdate(Watchable w, Object arg)
          Recalculate the bounding points.
 void onUpdate(Watchable w, String strProperty, Object oldVal, Object newVal)
          Recalculate the bounding points.
 GraphicalObject remove(GraphicalObject gob)
          Remove a Graphical Object from this collection.
 void removeAll(GraphicalObjectCollection gobcol)
          Remove from this Group all of the GraphicalObjects in the collection.
 void setRelativeLayer(GraphicalObject gob, int layer)
          Given a GraphicalObject, set what layer it is in relative to this Graphical Object Group.
protected  boolean shapeContainsInternal(Point2D pt)
          Internal method.
protected  boolean shapeContainsInternal(Shape s)
          Internal method.
protected  boolean shapeIntersectsInternal(Shape s)
          Internal method.
 void sort(Comparator c)
          Actually does nothing, since the ordering is imposed by the Group.
 String toDebugString()
          List what Graphical Objects are contained.
protected  void updateGroupBounds()
          Recalculate all of the bounds for this group.
protected  void updateGroupBounds(GraphicalObject gob)
          Specifies how bounds are updated when a Graphical Object is added.
 
Methods inherited from class edu.berkeley.guir.lib.satin.objects.GraphicalObjectImpl
addIndexedProperty, addWatcher, applyTransform, bringDownALayer, bringDownNLayers, bringToBottomLayer, bringToTopLayer, bringUpALayer, bringUpNLayers, clearIndexedProperty, clearWatchers, clone, contains, contains, contains, contains, countWatchers, createNewViewHandler, damage, damage, damage, damage, deepClone, delete, disableDamage, disableNotify, enableDamage, enableNotify, equals, getAbsoluteLayer, getBoundingPoints2D, getBoundingPoints2D, getBoundingPoints2DRef, getBounds, getBounds2D, getBounds2D, getBounds2D, getClassDebugProperty, getClassProperty, getClassPropertyGestureInterpreter, getClassPropertyInkInterpreter, getClassPropertyStyle, getClassPropertyView, getGestureInterpreter, getHeight2D, getIndexedProperty, getIndexedProperty, getInkInterpreter, getInteractionHandler, getInverseTransform, getInverseTransform, getLocalBoundingPoints2DRef, getLocation2D, getLocation2D, getParentGroup, getPathIterator, getPathIterator, getPresentationName, getProperty, getPropertyNames, getRelativeLayer, getSheet, getStyle, getStyleRef, getTransform, getTransform, getTransformRef, getUniqueID, getView, getViewHandler, getWidth2D, handleNewStroke, handleSingleStroke, handleUpdateStroke, hasClosedBoundingPoints, hasDamageEnabled, hasNotifyEnabled, intersects, intersects, isClippedToBounds, isDirty, isSelectable, isVisible, minDistance, minDistance, minLocalDistance, moveBy, moveBy, moveTo, moveTo, notifyWatchers, notifyWatchers, notifyWatchersUpdate, notifyWatchersUpdate, onNewStroke, onSingleStroke, onUpdateStroke, postProcessNewStroke, postProcessSingleStroke, postProcessUpdateStroke, preProcessNewStroke, preProcessSingleStroke, preProcessUpdateStroke, redispatchNewStroke, redispatchSingleStroke, redispatchUpdateStroke, removeIndexedProperty, removeIndexedProperty, removeProperty, removeWatcher, render, renderAllCoordBounds, renderBoundingBox, renderDebug, renderDimensions, renderSelected, renderSelectionHandle, setBoundingPoints2D, setClassDebugProperty, setClassProperty, setClassPropertyGestureInterpreter, setClassPropertyInkInterpreter, setClassPropertyStyle, setClassPropertyView, setClipToBounds, setDirty, setGestureInterpreter, setHasClosedBoundingPoints, setIndexedProperty, setInkInterpreter, setInteractionHandler, setLocalBoundingPoints2DRef, setParentGroup, setProperty, setRelativeLayer, setSelectable, setStyle, setTransform, setTransformInternal, setUniqueID, setView, setViewHandler, setVisible, shapeContains, shapeContains, shapeContains, shapeContains, shapeIntersects, shapeIntersects, toString, updateBoundingPoints
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObject
addIndexedProperty, applyTransform, bringDownALayer, bringDownNLayers, bringToBottomLayer, bringToTopLayer, bringUpALayer, bringUpNLayers, clearIndexedProperty, damage, damage, damage, damage, delete, disableDamage, enableDamage, getAbsoluteLayer, getBoundingPoints2D, getBoundingPoints2D, getBounds2D, getBounds2D, getGestureInterpreter, getHeight2D, getIndexedProperty, getIndexedProperty, getInkInterpreter, getInverseTransform, getInverseTransform, getLocation2D, getLocation2D, getParentGroup, getProperty, getPropertyNames, getRelativeLayer, getSheet, getStyle, getStyleRef, getTransform, getTransform, getTransformRef, getUniqueID, getView, getWidth2D, handleNewStroke, handleSingleStroke, handleUpdateStroke, hasClosedBoundingPoints, hasDamageEnabled, isClippedToBounds, isSelectable, isVisible, minDistance, minDistance, moveBy, moveBy, moveTo, moveTo, onNewStroke, onSingleStroke, onUpdateStroke, postProcessNewStroke, postProcessSingleStroke, postProcessUpdateStroke, preProcessNewStroke, preProcessSingleStroke, preProcessUpdateStroke, redispatchNewStroke, redispatchSingleStroke, redispatchUpdateStroke, removeIndexedProperty, removeIndexedProperty, removeProperty, render, setBoundingPoints2D, setClipToBounds, setGestureInterpreter, setHasClosedBoundingPoints, setIndexedProperty, setInkInterpreter, setParentGroup, setProperty, setRelativeLayer, setSelectable, setStyle, setTransform, setUniqueID, setView, setVisible, shapeContains, shapeContains, shapeContains, shapeContains, shapeIntersects, shapeIntersects
 
Methods inherited from interface edu.berkeley.guir.lib.satin.watch.Watchable
addWatcher, clearWatchers, countWatchers, disableNotify, enableNotify, hasNotifyEnabled, notifyWatchers, notifyWatchers, notifyWatchersUpdate, notifyWatchersUpdate, removeWatcher
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

GraphicalObjectGroupImpl

public GraphicalObjectGroupImpl()
Method Detail

createNewInteractionHandler

protected InteractionHandler createNewInteractionHandler()
Create an InteractionHandler for Graphical Object Groups.
Overrides:
createNewInteractionHandler in class GraphicalObjectImpl

add

public GraphicalObject add(GraphicalObject gob)
This adds a GraphicalObject to the top of the group, keeping its relative coordinates the same.
Specified by:
add in interface GraphicalObjectCollection
Parameters:
gob - is a GraphicalObject whose coordinates have already been transformed to this group's coordinate system.
See Also:
GraphicalObjectGroup.KEEP_REL_POS

addToBack

public GraphicalObject addToBack(GraphicalObject gob)
This adds a GraphicalObject to the bottom of the group, keeping its relative coordinates the same.
Specified by:
addToBack in interface GraphicalObjectCollection
Parameters:
gob - is a GraphicalObject whose coordinates have already been transformed to this group's coordinate system.
See Also:
GraphicalObjectGroup.KEEP_REL_POS

addToFront

public GraphicalObject addToFront(GraphicalObject gob)
This adds a GraphicalObject to the top of the group, keeping its relative coordinates the same.
Specified by:
addToFront in interface GraphicalObjectCollection
Parameters:
gob - is a GraphicalObject whose coordinates have already been transformed to this group's coordinate system.
See Also:
GraphicalObjectGroup.KEEP_REL_POS

add

public GraphicalObject add(int index,
                           GraphicalObject gob)
This adds a GraphicalObject to the group at the specified layer, keeping its relative coordinates the same.
Specified by:
add in interface GraphicalObjectCollection
Parameters:
index - is the layer to add the GraphicalObject to. Lower numbers indicate the front (higher layers), while higher numbers indicate the back (lower layers).
gob - is a GraphicalObject whose coordinates have already been transformed to this group's local coordinate system.
See Also:
GraphicalObjectGroup.KEEP_REL_POS

add

public GraphicalObject add(GraphicalObject gob,
                           int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
Specified by:
add in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.
See Also:
GraphicalObjectGroup.addToFront(GraphicalObject, int)

addToBack

public GraphicalObject addToBack(GraphicalObject gob,
                                 int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the bottom of this group, specifying the GraphicalObject's position at the same time.
Specified by:
addToBack in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

addToFront

public GraphicalObject addToFront(GraphicalObject gob,
                                  int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
Specified by:
addToFront in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

add

public GraphicalObject add(int index,
                           GraphicalObject gob,
                           int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the specified layer of this group, specifying the GraphicalObject's position at the same time.
Specified by:
add in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
index - is the layer to add to. Lower numbers indicate the front (higher layers).
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

clear

public void clear()
Description copied from interface: GraphicalObjectCollection
Clear out all Graphical Objects in this collection.
Specified by:
clear in interface GraphicalObjectCollection

contains

public boolean contains(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
See if this Graphical Object Collection contains the specified Graphical Object. Please note that this is NOT the same as calling GraphicalObject.shapeContains(GraphicalObject).
Specified by:
contains in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
true if it contains the specified Graphical Object, false otherwise.

get

public GraphicalObject get(int index)
Description copied from interface: GraphicalObjectCollection
Get the Graphical Object at the specified index.
Specified by:
get in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
index - is the location to look at (zero-based). It is up to the programmer to ensure that this is a valid value.
Returns:
the Graphical Object at the specified index.

getFirst

public GraphicalObject getFirst()
Description copied from interface: GraphicalObjectCollection
Get the first Graphical Object.
Specified by:
getFirst in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
null if nothing is there.

getLast

public GraphicalObject getLast()
Description copied from interface: GraphicalObjectCollection
Get the last Graphical Object.
Specified by:
getLast in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
null if nothing is there.

getID

public GraphicalObject getID(int id)
Description copied from interface: GraphicalObjectCollection
Retrieve the GraphicalObject with the specified unique ID.
Specified by:
getID in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
id - is the unique ID of the GraphicalObject to retrieve.
Returns:
the GraphicalObject with that ID, or null if it isn't here.

getCollectionBounds2D

public Rectangle2D getCollectionBounds2D(int cdsys)
Description copied from interface: GraphicalObjectCollection
Get the union of the bounds of the GraphicalObjects contained in this collection. Asking for local bounds is useless.
Asking for relative bounds is useful only if all of the GraphicalObjects have the same parent.
Asking for absolute bounds will always work.
Specified by:
getCollectionBounds2D in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
cdsys - is the coordinate system to use.
Returns:
Rectangle representing the union of bounds.

getCollectionBounds2D

public Rectangle2D getCollectionBounds2D(int cdsys,
                                         Rectangle2D rect)
Description copied from interface: GraphicalObjectCollection
Get the bounds, put them in the specified Rectangle.
Specified by:
getCollectionBounds2D in interface GraphicalObjectCollection

indexOf

public int indexOf(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
Find the index of the specified Graphical Object.
Specified by:
indexOf in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object to look for.
Returns:
the index of the Graphical Object in this collection (zero-based) or -1 if it is not here.

isEmpty

public boolean isEmpty()
Description copied from interface: GraphicalObjectCollection
Is this collection empty?
Specified by:
isEmpty in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
true if empty, false otherwise.

sort

public void sort(Comparator c)
Actually does nothing, since the ordering is imposed by the Group. I suppose you could want to sort on things like color and size and so on.
Specified by:
sort in interface GraphicalObjectCollection

numElements

public int numElements()
Description copied from interface: GraphicalObjectCollection
Get the number of elements contained in this collection.

I realize that this should have been called size(), but there already exists a deprecated method in Component named size().

Specified by:
numElements in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
the number of elements contained.

remove

public GraphicalObject remove(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
Remove a Graphical Object from this collection.
Specified by:
remove in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object ot remove.

getForwardIterator

public Iterator getForwardIterator()
Description copied from interface: GraphicalObjectCollection
Get an iterator that goes forward thru the collection.
Specified by:
getForwardIterator in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
an Iterator.

getReverseIterator

public Iterator getReverseIterator()
Description copied from interface: GraphicalObjectCollection
Get an iterator that goes backwards thru the collection.
Specified by:
getReverseIterator in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
an Iterator.

updateGroupBounds

protected void updateGroupBounds(GraphicalObject gob)
Specifies how bounds are updated when a Graphical Object is added.

updateGroupBounds

protected void updateGroupBounds()
Recalculate all of the bounds for this group.

getRelativeLayer

public String getRelativeLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
Specified by:
getRelativeLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to check out.
Returns:
the relative layer, or empty string if the specified Graphical Object is not contained by this group.
See Also:
GraphicalObject.getRelativeLayer()

setRelativeLayer

public void setRelativeLayer(GraphicalObject gob,
                             int layer)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, set what layer it is in relative to this Graphical Object Group.
Specified by:
setRelativeLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to move.
layer - is the layer to move to.
See Also:
GraphicalObject.setRelativeLayer(int)

getAbsoluteLayer

public String getAbsoluteLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, return its absolute layer position.
Specified by:
getAbsoluteLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to check out.
Returns:
the absolute layer, or empty string if the specified Graphical Object is not contained by this group.
See Also:
GraphicalObject.getAbsoluteLayer()

bringUpALayer

public void bringUpALayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject up one layer in this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringUpALayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringUpALayer()

bringUpNLayers

public void bringUpNLayers(GraphicalObject gob,
                           int n)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject up N layers in this Group. Tries to move the GraphicalObject as many layers as possible. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringUpNLayers in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
n - is the number of layers to move.
See Also:
GraphicalObject.bringUpNLayers(int)

bringDownALayer

public void bringDownALayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject down one layer in this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringDownALayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringDownALayer()

bringDownNLayers

public void bringDownNLayers(GraphicalObject gob,
                             int n)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject down N layers in this Group. Tries to move the GraphicalObject as many layers as possible. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringDownNLayers in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
n - is the number of layers to move.
See Also:
GraphicalObject.bringDownNLayers(int)

bringToTopLayer

public void bringToTopLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified Graphical Object to the top layer of this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringToTopLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToTopLayer()

bringToBottomLayer

public void bringToBottomLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified Graphical Object to the bottom layer of this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringToBottomLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToBottomLayer()

removeAll

public void removeAll(GraphicalObjectCollection gobcol)
Description copied from interface: GraphicalObjectGroup
Remove from this Group all of the GraphicalObjects in the collection.
Specified by:
removeAll in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Point2D pt,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Description copied from interface: GraphicalObjectGroup
Get all Graphical Objects subject to the specified parameters. This version is for optimization or fine-tuning purposes.

Really big methods like this one are usually a warning sign, but I really don't see any alternatives.

Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
cdsys - is the coordinate system.
pt - is the point to get the Graphical Objects from.
num - is either SatinConstants.ALL or SatinConstants.FIRST.
depth - is either SatinConstants.SHALLOW or SatinConstants.DEEP
gettype - is the algorithm to use to retrieve, either SatinConstants.INTERSECTS, SatinConstants.CONTAINEDBY, SatinConstants.CONTAINS, SatinConstants.NEAR, SatinConstants.ABOVE, SatinConstants.BELOW,
thresh - is the threshold or halo to retrieve.
gobcol - is the storage for output. Use null to create new space.

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     double x,
                                                     double y,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Shape s,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Description copied from interface: GraphicalObjectGroup
Get all Graphical Objects subject to the specified parameters. This version is for optimization or fine-tuning purposes.

Really big methods like this one are usually a warning sign, but I really don't see any alternatives.

Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object whose bounding points to use.
num - is either SatinConstants.ALL or SatinConstants.FIRST.
depth - is either SatinConstants.SHALLOW or SatinConstants.DEEP
gettype - is the algorithm to use to retrieve, either SatinConstants.INTERSECTS, SatinConstants.CONTAINEDBY, SatinConstants.CONTAINS, SatinConstants.NEAR, SatinConstants.ABOVE, SatinConstants.BELOW,
thresh - is the threshold or halo to retrieve.
gobcol - is the storage for output. Use null to create new space.

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Point2D pt,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     double x,
                                                     double y,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Shape s,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(GraphicalObject, int, int, int, double, GraphicalObjectCollection)

onNotify

public void onNotify(Watchable w,
                     Object arg)
Description copied from interface: Watcher
Callback method for generic notifications. This typically won't be used.
Specified by:
onNotify in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object notifying you.
arg - is some agreed upon argument.
See Also:
Watchable.notifyWatchers(), Watchable.notifyWatchers(java.lang.Object)

onUpdate

public void onUpdate(Watchable w,
                     Object arg)
Recalculate the bounding points.
Specified by:
onUpdate in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object that has been updated.
arg - is some agreed upon argument.
See Also:
Watchable.notifyWatchersUpdate(Object)

onUpdate

public void onUpdate(Watchable w,
                     String strProperty,
                     Object oldVal,
                     Object newVal)
Recalculate the bounding points.
Specified by:
onUpdate in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object that has been updated.
strProperty - is the name of the property to update.
oldVal - is the old value of the property. This should usually be a clone of the old value, so that modifying this value should have no effect. Whether this is a copy or a reference should be defined in the SatinConstants file.
newVal - is the new value of the property. This should usually be a clone of the old value, so that modifying this value should have no effect. However, don't clone if it is prohibitively expensive to do so. Whether this is a copy or a reference should be defined in the SatinConstants file.
See Also:
SatinConstants, Watchable.notifyWatchersUpdate(String, Object, Object)

onDelete

public void onDelete(Watchable w)
Description copied from interface: Watcher
Callback method for notifications of deletions, that is this Graphical Object has been deleted and you should remove it.
Specified by:
onDelete in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object to be deleted.
See Also:
Watchable.notifyWatchersDelete()

notifyWatchersDelete

public void notifyWatchersDelete()
Description copied from interface: Watchable
Notify the watchers that this object has been deleted. Notifications are error-prone, as you may accidentally modify the iterator. Be sure to clone first.
Specified by:
notifyWatchersDelete in interface Watchable
Overrides:
notifyWatchersDelete in class GraphicalObjectImpl

getDispatchee

protected GraphicalObject getDispatchee(TimedStroke stk)
Given a stroke, figure out which of our children it will be dispatched to. Only figures this out for the current level, ie direct children, not children of children.

Override this method for more interesting behavior on how strokes should be dispatched.

Returns:
the GraphicalObject to dispatch to, or null if there isn't one.

shapeContainsInternal

protected boolean shapeContainsInternal(Point2D pt)
Description copied from class: GraphicalObjectImpl
Internal method. Assumes pt is already in local coordinates. Override for specific Graphical Object behavior.
Overrides:
shapeContainsInternal in class GraphicalObjectImpl

shapeContainsInternal

protected boolean shapeContainsInternal(Shape s)
Description copied from class: GraphicalObjectImpl
Internal method. Assumes s is already in local coordinates. Override for specific Graphical Object behavior.
Overrides:
shapeContainsInternal in class GraphicalObjectImpl

shapeIntersectsInternal

protected boolean shapeIntersectsInternal(Shape s)
Description copied from class: GraphicalObjectImpl
Internal method. Assumes s is already in local coordinates. Override for specific Graphical Object behavior.
Overrides:
shapeIntersectsInternal in class GraphicalObjectImpl

defaultRender

protected void defaultRender(SatinGraphics g)
Description copied from class: GraphicalObjectImpl
The default method for rendering. This method is used by the DefaultView to render. Override this method in subclasses.
Overrides:
defaultRender in class GraphicalObjectImpl

toDebugString

public String toDebugString()
List what Graphical Objects are contained.
Overrides:
toDebugString in class GraphicalObjectImpl

clone

public Object clone()
So that my clone will not sleep alone.
Specified by:
clone in interface GraphicalObject
Overrides:
clone in class GraphicalObjectImpl
Returns:
a shallow clone of this object.
See Also:
deepClone()

clone

protected GraphicalObjectGroupImpl clone(GraphicalObjectGroupImpl gobgrpClone)
For clone chaining purposes.
Parameters:
gobgrpClone - is the object to clone into (ie gobgrpClone is the clone that will be returned).
Returns:
a reference to gobgrpClone.
See Also:
GraphicalObjectImpl.clone(GraphicalObjectImpl)

deepClone

public Object deepClone()
Make a deep clone of the GraphicalObjectGroup.
Specified by:
deepClone in interface GraphicalObject
Overrides:
deepClone in class GraphicalObjectImpl
See Also:
clone()

deepClone

protected GraphicalObjectGroupImpl deepClone(GraphicalObjectGroupImpl newGobGrp)
For deep-clone chaining. If you override this method in a subclass, be sure to call this method, just as you would have to for normal clone chaining.
Parameters:
newGobGrp - is the object that will be a clone of the current object. That is, we copy our parameters into newGobGrp.
See Also:
clone(), deepClone(), GraphicalObjectImpl.clone(GraphicalObjectImpl)

Copyright Information