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

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

java.lang.Object
  |
  +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectWrapper
        |
        +--edu.berkeley.guir.lib.satin.objects.StickyGraphicalObjectWrapper
All Implemented Interfaces:
Cloneable, EventListener, GraphicalObject, SatinConstants, Serializable, Shape, StrokeListener, Watchable
Direct Known Subclasses:
StickyXYGraphicalObjectWrapper, StickyZGraphicalObjectWrapper

public abstract class StickyGraphicalObjectWrapper
extends GraphicalObjectWrapper

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v2.1-1.0.0, Aug 24 2000, JH
               Created
 

Since:
JDK 1.3
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
 
Field Summary
static Debug debug
           
 
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
StickyGraphicalObjectWrapper()
          Create an empty proxy.
StickyGraphicalObjectWrapper(GraphicalObject gob)
          Create a proxy pointing to the specified Graphical Object.
 
Method Summary
 void applyTransform(AffineTransform newTx)
          Apply an affine Transform to this Graphical Object.
protected  StickyGraphicalObjectWrapper clone(StickyGraphicalObjectWrapper c)
          Done on proxy, not on proxied object.
protected  StickyGraphicalObjectWrapper deepClone(StickyGraphicalObjectWrapper c)
          Done on proxy, not on proxied object.
 Polygon2D getBoundingPoints2D(int cdsys)
          Get the sticky bounding points.
 Polygon2D getBoundingPoints2D(int cdsys, AffineTransform tx, Polygon2D poly)
          Get the sticky bounding points.
 Rectangle2D getBounds2D(int cdsys)
          Get the sticky bounds.
 Rectangle2D getBounds2D(int cdsys, AffineTransform tx, Rectangle2D rect)
          Get the sticky bounds.
 float getHeight2D(int cdsys)
          Get the sticky height.
 AffineTransform getInverseTransform(int cdsys)
          Concatenates the sticky and the proxied transforms.
 AffineTransform getInverseTransform(int cdsys, AffineTransform outTx)
          Concatenates the sticky and the proxied transforms.
 Point2D getLocation2D(int cdsys)
          Get the sticky location.
 Point2D getLocation2D(int cdsys, AffineTransform tx, Point2D pt)
          Get the sticky location.
protected abstract  AffineTransform getStickyTransform(AffineTransform tx)
          Get the transform that makes us sticky.
 AffineTransform getTransform(int cdsys)
          Concatenates the sticky and the proxied transforms.
 AffineTransform getTransform(int cdsys, AffineTransform outTx)
          Concatenates the sticky and the proxied transforms.
 AffineTransform getTransformRef()
          Does not return a reference, b/c it doesn't make sense in the sticky case.
protected  AffineTransform getUnstickyTransform(int cdsys, AffineTransform tx)
          Get the transform as if this object weren't around.
 float getWidth2D(int cdsys)
          Get the sticky width.
 void moveBy(int cdsys, double dx, double dy)
          Moves by the specified (x,y) offset in the sticky space.
 void moveBy(int cdsys, Point2D pt)
          Moves by the specified (x,y) offset in the sticky space.
 void moveTo(int cdsys, double x, double y)
          Moves to the specified (x,y) location in the sticky space.
 void moveTo(int cdsys, Point2D pt)
          Moves to the specified (x,y) location in the sticky space.
 void render(SatinGraphics g)
          Render the Graphical Object after applying the sticky transform, as determined by getStickyTransform.
 void setBoundingPoints2D(int cdsys, Shape s)
          Sets to the specified shape in the sticky space.
 void setTransform(AffineTransform newTx)
          Set and apply a copy of the specified AffineTransform to this GraphicalObject.
 
Methods inherited from class edu.berkeley.guir.lib.satin.objects.GraphicalObjectWrapper
addIndexedProperty, addWatcher, bringDownALayer, bringDownNLayers, bringToBottomLayer, bringToTopLayer, bringUpALayer, bringUpNLayers, clearIndexedProperty, clearWatchers, clone, clone, contains, contains, contains, contains, countWatchers, damage, damage, damage, damage, deepClone, deepClone, delete, disableDamage, disableNotify, enableDamage, enableNotify, getAbsoluteLayer, getBounds, getBounds2D, getGestureInterpreter, getGraphicalObject, getIndexedProperty, getIndexedProperty, getInkInterpreter, getParentGroup, getPathIterator, getPathIterator, getProperty, getPropertyNames, getRelativeLayer, getSheet, getStyle, getStyleRef, getUniqueID, getView, handleNewStroke, handleSingleStroke, handleUpdateStroke, hasClosedBoundingPoints, hasDamageEnabled, hasNotifyEnabled, intersects, intersects, isClippedToBounds, isSelectable, isVisible, minDistance, minDistance, notifyWatchers, notifyWatchers, notifyWatchersDelete, notifyWatchersUpdate, notifyWatchersUpdate, onNewStroke, onSingleStroke, onUpdateStroke, postProcessNewStroke, postProcessSingleStroke, postProcessUpdateStroke, preProcessNewStroke, preProcessSingleStroke, preProcessUpdateStroke, redispatchNewStroke, redispatchSingleStroke, redispatchUpdateStroke, removeIndexedProperty, removeIndexedProperty, removeProperty, removeWatcher, setClipToBounds, setGestureInterpreter, setGraphicalObject, setHasClosedBoundingPoints, setIndexedProperty, setInkInterpreter, setParentGroup, setProperty, setRelativeLayer, setSelectable, setStyle, setUniqueID, setView, setVisible, shapeContains, shapeContains, shapeContains, shapeContains, shapeIntersects, shapeIntersects
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final Debug debug
Constructor Detail

StickyGraphicalObjectWrapper

public StickyGraphicalObjectWrapper()
Create an empty proxy.

StickyGraphicalObjectWrapper

public StickyGraphicalObjectWrapper(GraphicalObject gob)
Create a proxy pointing to the specified Graphical Object.
Method Detail

applyTransform

public void applyTransform(AffineTransform newTx)
Description copied from interface: GraphicalObject
Apply an affine Transform to this Graphical Object.

Notifies Watchers of an update when called.

Overrides:
applyTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
newTx - is a Transform to apply. No modifications are made to newTx.

setTransform

public void setTransform(AffineTransform newTx)
Description copied from interface: GraphicalObject
Set and apply a copy of the specified AffineTransform to this GraphicalObject.

Notifies Watchers of an update when called.

Overrides:
setTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
newTx - is a Transform to apply. Removes the old one completely. No modifications are made to newTx.

getTransformRef

public AffineTransform getTransformRef()
Does not return a reference, b/c it doesn't make sense in the sticky case.
Overrides:
getTransformRef in class GraphicalObjectWrapper

getTransform

public AffineTransform getTransform(int cdsys)
Concatenates the sticky and the proxied transforms.
Overrides:
getTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system.
Returns:
a copy of the current Transform.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getTransform

public AffineTransform getTransform(int cdsys,
                                    AffineTransform outTx)
Concatenates the sticky and the proxied transforms.
Overrides:
getTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system.
outTx - is the storage space.
Returns:
a reference to outTx.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getInverseTransform

public AffineTransform getInverseTransform(int cdsys)
Concatenates the sticky and the proxied transforms.
Overrides:
getInverseTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
the inverse transform in the specified coordinate system.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getInverseTransform

public AffineTransform getInverseTransform(int cdsys,
                                           AffineTransform outTx)
Concatenates the sticky and the proxied transforms.
Overrides:
getInverseTransform in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
outTx - is the output storage. Use null to create a new object.
Returns:
a reference to outTx
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getLocation2D

public Point2D getLocation2D(int cdsys)
Get the sticky location.
Overrides:
getLocation2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
a Point2D containing the Location of the top-left corner of this object's bounding box.
See Also:
GraphicalObject.getLocation2D(int, AffineTransform, Point2D), SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getLocation2D

public Point2D getLocation2D(int cdsys,
                             AffineTransform tx,
                             Point2D pt)
Get the sticky location.
Overrides:
getLocation2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
tx - is the transform to apply after the location is retrieved. Use null for none.
pt - is where to store the output. Use null to create a new point. Use for optimization purposes.
Returns:
a reference to pt.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBounds2D

public Rectangle2D getBounds2D(int cdsys)
Get the sticky bounds.
Overrides:
getBounds2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
a reference to rect.
See Also:
GraphicalObject.getBounds2D(int), SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBounds2D

public Rectangle2D getBounds2D(int cdsys,
                               AffineTransform tx,
                               Rectangle2D rect)
Get the sticky bounds.
Overrides:
getBounds2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
tx - is the transform to apply after the location is retrieved. Use null for none.
rect - is the Rectangle to put the results in. Use null to create a new Rectangle. Use for optimization purposes.
Returns:
a reference to rect.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBoundingPoints2D

public Polygon2D getBoundingPoints2D(int cdsys)
Get the sticky bounding points.
Overrides:
getBoundingPoints2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
a Polygon representing this GraphicalObject's bounding points.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBoundingPoints2D

public Polygon2D getBoundingPoints2D(int cdsys,
                                     AffineTransform tx,
                                     Polygon2D poly)
Get the sticky bounding points.
Overrides:
getBoundingPoints2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
tx - is the transform to apply after the location is retrieved. Use null for none.
poly - is the Polygon to put the results in. Use null to create a new Polygon. Use for optimization purposes.
Returns:
a reference to poly.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getWidth2D

public float getWidth2D(int cdsys)
Get the sticky width.
Overrides:
getWidth2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getHeight2D

public float getHeight2D(int cdsys)
Get the sticky height.
Overrides:
getHeight2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

moveTo

public void moveTo(int cdsys,
                   double x,
                   double y)
Moves to the specified (x,y) location in the sticky space.
Overrides:
moveTo in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
x - is the x-coordinate to move to.
y - is the y-coordinate to move to.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

moveTo

public void moveTo(int cdsys,
                   Point2D pt)
Moves to the specified (x,y) location in the sticky space.
Overrides:
moveTo in class GraphicalObjectWrapper

moveBy

public void moveBy(int cdsys,
                   double dx,
                   double dy)
Moves by the specified (x,y) offset in the sticky space.
Overrides:
moveBy in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
dx - is the change in x-coordinate to move.
dy - is the change in y-coordinate to move.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

moveBy

public void moveBy(int cdsys,
                   Point2D pt)
Moves by the specified (x,y) offset in the sticky space.
Overrides:
moveBy in class GraphicalObjectWrapper

setBoundingPoints2D

public void setBoundingPoints2D(int cdsys,
                                Shape s)
Sets to the specified shape in the sticky space.
Overrides:
setBoundingPoints2D in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
s - is the shape that describes our bounds.
See Also:
GraphicalObject.getView(), SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

render

public void render(SatinGraphics g)
Render the Graphical Object after applying the sticky transform, as determined by getStickyTransform.
Overrides:
render in class GraphicalObjectWrapper
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
g - is the Graphics context to draw in.

getStickyTransform

protected abstract AffineTransform getStickyTransform(AffineTransform tx)
Get the transform that makes us sticky.
Parameters:
tx - is the storage space.

getUnstickyTransform

protected AffineTransform getUnstickyTransform(int cdsys,
                                               AffineTransform tx)
Get the transform as if this object weren't around.

clone

protected StickyGraphicalObjectWrapper clone(StickyGraphicalObjectWrapper c)
Done on proxy, not on proxied object.

deepClone

protected StickyGraphicalObjectWrapper deepClone(StickyGraphicalObjectWrapper c)
Done on proxy, not on proxied object.

Copyright Information