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

edu.berkeley.guir.lib.satin.objects
Interface GraphicalObjectGroup

All Superinterfaces:
Cloneable, EventListener, GraphicalObject, GraphicalObjectCollection, SatinConstants, Serializable, Shape, StrokeListener, Watchable, Watcher
All Known Subinterfaces:
Patch
All Known Implementing Classes:
GraphicalObjectGroupImpl, Sheet

public interface GraphicalObjectGroup
extends GraphicalObject, GraphicalObjectCollection

A collection of Graphical Objects that is part of the interactor tree.

Unlike a GraphicalObjectCollection, Graphical Objects will be modified when added, making this Group the parent of the added Graphical Object, as well as modifying the coordinates of the Graphical Object to be relative to the Group boundaries.

When a GraphicalObject is added to a group, it retains its relative coordinates if the KEEP_REL_POS constant is specified when calling add(GraphicalObject,int). If the KEEP_ABS_POS constant is specified when calling the same method, then the added GraphicalObject will retain its current absolute position.

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
 

Since:
JDK 1.3RC1
Version:
SATIN-v2.1-1.0.0, Aug 11 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

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
 
Field Summary
static int DEFAULT_POS_POLICY
          Which of the two policies above we use by default, if unspecified.
static int KEEP_ABS_POS
          When adding a GraphicalObject into this GraphicalObjectGroup, keep the same absolute position the GraphicalObject currently has.
static int KEEP_REL_POS
          When adding a GraphicalObject into this GraphicalObjectGroup, keep the same relative position the GraphicalObject currently has.
 
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
 
Method Summary
 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, 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, int pos)
          Add a GraphicalObject to the bottom of this group, specifying the GraphicalObject's position at the same time.
 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.
 String getAbsoluteLayer(GraphicalObject gob)
          Given a GraphicalObject, return its absolute layer position.
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype, double thresh, GraphicalObjectCollection gobcol)
          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 gobcol)
           
 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 gobcol)
          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 gobcol)
           
 String getRelativeLayer(GraphicalObject gob)
          Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
 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.
 
Methods inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObject
addIndexedProperty, applyTransform, bringDownALayer, bringDownNLayers, bringToBottomLayer, bringToTopLayer, bringUpALayer, bringUpNLayers, clearIndexedProperty, clone, damage, damage, damage, damage, deepClone, 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, notifyWatchersDelete, notifyWatchersUpdate, notifyWatchersUpdate, removeWatcher
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 
Methods inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
add, add, addToBack, addToFront, clear, clone, contains, deepClone, get, getCollectionBounds2D, getCollectionBounds2D, getFirst, getForwardIterator, getID, getLast, getReverseIterator, indexOf, isEmpty, numElements, remove, sort
 
Methods inherited from interface edu.berkeley.guir.lib.satin.watch.Watcher
onDelete, onNotify, onUpdate, onUpdate
 

Field Detail

KEEP_ABS_POS

public static final int KEEP_ABS_POS
When adding a GraphicalObject into this GraphicalObjectGroup, keep the same absolute position the GraphicalObject currently has. That is, once you add a GraphicalObject, it will still appear to be in the same place it currently has on the screen. Another way to think about it is that the GraphicalObejct's absolute position will remain the same before and after adding.

See GraphicalObjectImpl for an explanation of the different coordinate systems.


KEEP_REL_POS

public static final int KEEP_REL_POS
When adding a GraphicalObject into this GraphicalObjectGroup, keep the same relative position the GraphicalObject currently has. That is, the GraphicalObject's relative position will remain the same before and after adding.

See GraphicalObjectImpl for an explanation of the different coordinate systems.


DEFAULT_POS_POLICY

public static final int DEFAULT_POS_POLICY
Which of the two policies above we use by default, if unspecified.
Method Detail

add

public GraphicalObject add(GraphicalObject gob,
                           int pos)
Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either KEEP_ABS_POS or KEEP_REL_POS.
See Also:
addToFront(GraphicalObject, int)

addToBack

public GraphicalObject addToBack(GraphicalObject gob,
                                 int pos)
Add a GraphicalObject to the bottom of this group, specifying the GraphicalObject's position at the same time.
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either KEEP_ABS_POS or KEEP_REL_POS.

addToFront

public GraphicalObject addToFront(GraphicalObject gob,
                                  int pos)
Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either KEEP_ABS_POS or KEEP_REL_POS.

add

public 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.
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 KEEP_ABS_POS or KEEP_REL_POS.

getRelativeLayer

public String getRelativeLayer(GraphicalObject gob)
Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
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)
Given a GraphicalObject, set what layer it is in relative to this Graphical Object Group.
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)
Given a GraphicalObject, return its absolute layer position.
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)
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.
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringUpALayer()

bringUpNLayers

public void bringUpNLayers(GraphicalObject gob,
                           int n)
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.
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)
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.
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringDownALayer()

bringDownNLayers

public void bringDownNLayers(GraphicalObject gob,
                             int n)
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.
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)
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.
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToTopLayer()

bringToBottomLayer

public void bringToBottomLayer(GraphicalObject gob)
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.
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToBottomLayer()

removeAll

public void removeAll(GraphicalObjectCollection gobcol)
Remove from this Group all of the GraphicalObjects in the collection.

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Point2D pt,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection gobcol)
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.

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 gobcol)
See Also:
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 gobcol)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection gobcol)
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.

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)
See Also:
getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     double x,
                                                     double y,
                                                     int num,
                                                     int depth,
                                                     int gettype)
See Also:
getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Shape s,
                                                     int num,
                                                     int depth,
                                                     int gettype)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype)
See Also:
getGraphicalObjects(GraphicalObject, int, int, int, double, GraphicalObjectCollection)

Copyright Information