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

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

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

public class GraphicalObjectWrapper
extends Object
implements GraphicalObject

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
 
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
GraphicalObjectWrapper()
          Create an empty proxy.
GraphicalObjectWrapper(GraphicalObject gob)
          Create a proxy pointing to the specified Graphical Object.
 
Method Summary
 void addIndexedProperty(String strPropertyName, Object newVal)
           
 Watcher addWatcher(Watcher w)
          Add a watcher to this object.
 void applyTransform(AffineTransform newTx)
          Apply an affine Transform to this Graphical Object.
 void bringDownALayer()
          Bring this Graphical Object down one layer in its current group.
 void bringDownNLayers(int n)
          Bring this Graphical Object down N layers in its current group.
 void bringToBottomLayer()
          Bring this Graphical Object to the bottom of its current group.
 void bringToTopLayer()
          Bring this Graphical Object to the top of its current group.
 void bringUpALayer()
          Bring this Graphical Object up one layer in its current group.
 void bringUpNLayers(int n)
          Bring this Graphical Object up N layers in its current group.
 void clearIndexedProperty(String strPropertyName)
           
 void clearWatchers()
          Delete all watchers on this object.
 Object clone()
          Done on proxy, not on proxied object.
protected  GraphicalObjectWrapper clone(GraphicalObjectWrapper gobw)
          Clone our current state into the passed-in object.
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(Point2D p)
           
 boolean contains(Rectangle2D r)
           
 int countWatchers()
          Count the number of watchers watching this object.
 void damage(int sync)
          Done on proxy, not on proxied object.
 void damage(int sync, GraphicalObject gob)
          Done on proxy, not on proxied object.
 void damage(int sync, Rectangle2D rect)
          Done on proxy, not on proxied object.
 void damage(int sync, Rectangle2D oldRect, Rectangle2D newRect)
          Done on proxy, not on proxied object.
 Object deepClone()
          Done on proxy, not on proxied object.
protected  GraphicalObjectWrapper deepClone(GraphicalObjectWrapper gobw)
          Deep clone our current state into the passed-in object.
 void delete()
          Done on proxy, not on proxied object.
 void disableDamage()
          Turn off damage mechanism temporarily.
 void disableNotify()
          Turn off ability to notify others.
 void enableDamage()
          Re-enable damage mechanism.
 void enableNotify()
          Turn on ability to notify others.
 String getAbsoluteLayer()
          Get the absolute layer this group is in.
 Polygon2D getBoundingPoints2D(int cdsys)
          Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
 Polygon2D getBoundingPoints2D(int cdsys, AffineTransform tx, Polygon2D poly)
          Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
 Rectangle getBounds()
           
 Rectangle2D getBounds2D()
           
 Rectangle2D getBounds2D(int cdsys)
          Get the bounds of all of the visible views of this GraphicalObject.
 Rectangle2D getBounds2D(int cdsys, AffineTransform tx, Rectangle2D rect)
          Get the bounds of all of the visible views of this GraphicalObject.
 Interpreter getGestureInterpreter()
          Get the current Gesture Interpreter, which tries to handle strokes as gestures.
 GraphicalObject getGraphicalObject()
           
 float getHeight2D(int cdsys)
          Get the height of all of the visible views of this GraphicalObject.
 List getIndexedProperty(String strPropertyName)
           
 Object getIndexedProperty(String strPropertyName, int index)
           
 Interpreter getInkInterpreter()
          Get the current Ink Interpreter, which tries to handle strokes as Ink.
 AffineTransform getInverseTransform(int cdsys)
          Get the inverse of the transform.
 AffineTransform getInverseTransform(int cdsys, AffineTransform outTx)
          Get the inverse transform.
 Point2D getLocation2D(int cdsys)
          Get the location of the top-left corner of the bounding box for all of the visible views of this GraphicalObject.
 Point2D getLocation2D(int cdsys, AffineTransform tx, Point2D pt)
          Get the location of the top-left corner of the bounding box for all of the visible views of this GraphicalObject.
 GraphicalObjectGroup getParentGroup()
          Done on proxy, not on proxied object.
 PathIterator getPathIterator(AffineTransform at)
           
 PathIterator getPathIterator(AffineTransform at, double flatness)
           
 Object getProperty(String strPropertyName)
           
 Iterator getPropertyNames()
           
 String getRelativeLayer()
          Get the current layer this Graphical Object is in.
 Sheet getSheet()
          Done on proxy, not on proxied object.
 Style getStyle()
          Get a copy of the current Style for this Graphical Object.
 Style getStyleRef()
          Get a reference of the current Style for this Graphical Object.
 AffineTransform getTransform(int cdsys)
          Get a copy of the current transform for this GraphicalObject.
 AffineTransform getTransform(int cdsys, AffineTransform outTx)
          Get a copy of the current transform, putting the results in outTx.
 AffineTransform getTransformRef()
          Get a reference to the current transform.
 int getUniqueID()
          Done on proxy, not on proxied object.
 View getView()
          Get the current View for this GraphicalObject, the object that handles how the the GraphicalObject is displayed.
 float getWidth2D(int cdsys)
          Get the width of all of the visible views of this GraphicalObject.
 void handleNewStroke(NewStrokeEvent evt)
          This callback is called when the stroke should be handled by this object.
 void handleSingleStroke(SingleStrokeEvent evt)
           
 void handleUpdateStroke(UpdateStrokeEvent evt)
           
 boolean hasClosedBoundingPoints()
          Check if the bounding points describing this GraphicalObject is a closed Polygon (e.g.
 boolean hasDamageEnabled()
          See if damage is enabled or not.
 boolean hasNotifyEnabled()
          Check current ability to notify others.
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(Rectangle2D r)
           
 boolean isClippedToBounds()
          Check whether the GraphicalObject should be clipped to bounds or not.
 boolean isSelectable()
          Check whether or not this Graphical Object can be selected.
 boolean isVisible()
          Check whether this GraphicalObject is visible or not.
 float minDistance(int cdsys, double x, double y)
          Calculate the closest distance from the specified point to self.
 float minDistance(int cdsys, Point2D pt)
          Calls the other minDistance(int, double, double) method.
 void moveBy(int cdsys, double dx, double dy)
          Move relative to where we currently are.
 void moveBy(int cdsys, Point2D pt)
          Calls the other moveBy(int, double, double) method.
 void moveTo(int cdsys, double x, double y)
          Move directly to the specified position.
 void moveTo(int cdsys, Point2D pt)
          Calls the other moveTo(int, double, double) method.
 void notifyWatchers()
          Notify the watchers.
 void notifyWatchers(Object arg)
          Notify the watchers.
 void notifyWatchersDelete()
          Notify the watchers that this object has been deleted.
 void notifyWatchersUpdate(Object arg)
          Notify the watchers that the object has been changed and the change needs to be handled by the watchers.
 void notifyWatchersUpdate(String strProperty, Object oldVal, Object newVal)
          Notify the watchers that some value has been changed.
 void onNewStroke(NewStrokeEvent evt)
          Here is an overview of how dispatching works in Satin.
 void onSingleStroke(SingleStrokeEvent evt)
           
 void onUpdateStroke(UpdateStrokeEvent evt)
           
 void postProcessNewStroke(NewStrokeEvent evt)
           
 void postProcessSingleStroke(SingleStrokeEvent evt)
           
 void postProcessUpdateStroke(UpdateStrokeEvent evt)
           
 void preProcessNewStroke(NewStrokeEvent evt)
           
 void preProcessSingleStroke(SingleStrokeEvent evt)
           
 void preProcessUpdateStroke(UpdateStrokeEvent evt)
           
 void redispatchNewStroke(NewStrokeEvent evt)
           
 void redispatchSingleStroke(SingleStrokeEvent evt)
           
 void redispatchUpdateStroke(UpdateStrokeEvent evt)
           
 List removeIndexedProperty(String strPropertyName)
           
 Object removeIndexedProperty(String strPropertyName, int index)
           
 Object removeProperty(String strPropertyName)
           
 Watcher removeWatcher(Watcher w)
          Delete a watcher on this object.
 void render(SatinGraphics g)
          Render this graphical object in the specified Graphics context.
 void setBoundingPoints2D(int cdsys, Shape s)
          Set the bounding points for our default view.
 void setClipToBounds(boolean flag)
          Set whether the GraphicalObject should be clipped to bounds or not.
 Interpreter setGestureInterpreter(Interpreter intrp)
          Set the current Gesture Interpreter, which tries to handle strokes as gestures.
 void setGraphicalObject(GraphicalObject newGob)
           
 void setHasClosedBoundingPoints(boolean flag)
          Set whether or not this GraphicalObject is a closed shape or not.
 void setIndexedProperty(String strPropertyName, int index, Object newVal)
           
 Interpreter setInkInterpreter(Interpreter intrp)
          Set the current Ink Interpreter, which tries to handle strokes as Ink.
 void setParentGroup(GraphicalObjectGroup newParent)
          Done on proxy, not on proxied object.
 void setProperty(String strPropertyName, Object newVal)
           
 void setRelativeLayer(int layer)
          A convenience method to set what layer this object is in.
 void setSelectable(boolean flag)
          Set whether or not this Graphical Object can be selected.
 Style setStyle(Style newStyle)
          Set the current Style for this Graphical Object.
 void setTransform(AffineTransform newTx)
          Set and apply a copy of the specified AffineTransform to this GraphicalObject.
 void setUniqueID(int newID)
          Done on proxy, not on proxied object.
 void setView(View v)
          Set the View for this GraphicalObject.
 void setVisible(boolean flag)
          Set whether this GraphicalObject should be displayed or not.
 boolean shapeContains(GraphicalObject gob)
          See if the specified GraphicalObject fits entirely within our bounds.
 boolean shapeContains(int cdsys, double x, double y)
          See if we contain the specified point.
 boolean shapeContains(int cdsys, Point2D pt)
          See if we contain the specified point.
 boolean shapeContains(int cdsys, Shape s)
          See if we contain the specified rectangle.
 boolean shapeIntersects(GraphicalObject gob)
          See if the specified GraphicalObject intersects the this GraphicalObject.
 boolean shapeIntersects(int cdsys, Shape s)
          See if we intersect the specified shape.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicalObjectWrapper

public GraphicalObjectWrapper()
Create an empty proxy.

GraphicalObjectWrapper

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

setGraphicalObject

public void setGraphicalObject(GraphicalObject newGob)

getGraphicalObject

public GraphicalObject getGraphicalObject()

getUniqueID

public int getUniqueID()
Done on proxy, not on proxied object.
Specified by:
getUniqueID in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
an integer containing the ID value.

setUniqueID

public void setUniqueID(int newID)
Done on proxy, not on proxied object.
Specified by:
setUniqueID in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the ID value set.

getPropertyNames

public Iterator getPropertyNames()
Specified by:
getPropertyNames in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.getPropertyNames()

getProperty

public Object getProperty(String strPropertyName)
Specified by:
getProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.getProperty(String)

setProperty

public void setProperty(String strPropertyName,
                        Object newVal)
Specified by:
setProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.setProperty(String, Object)

removeProperty

public Object removeProperty(String strPropertyName)
Specified by:
removeProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.removeProperty(String)

getIndexedProperty

public List getIndexedProperty(String strPropertyName)
Specified by:
getIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.getIndexedProperty(String)

getIndexedProperty

public Object getIndexedProperty(String strPropertyName,
                                 int index)
Specified by:
getIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.getIndexedProperty(String, int)

setIndexedProperty

public void setIndexedProperty(String strPropertyName,
                               int index,
                               Object newVal)
Specified by:
setIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.setIndexedProperty(String, int, Object)

addIndexedProperty

public void addIndexedProperty(String strPropertyName,
                               Object newVal)
Specified by:
addIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.addIndexedProperty(String, Object)

removeIndexedProperty

public Object removeIndexedProperty(String strPropertyName,
                                    int index)
Specified by:
removeIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.removeIndexedProperty(String, int)

removeIndexedProperty

public List removeIndexedProperty(String strPropertyName)
Specified by:
removeIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.removeIndexedProperty(String)

clearIndexedProperty

public void clearIndexedProperty(String strPropertyName)
Specified by:
clearIndexedProperty in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
FlexProperties.clearIndexedProperty(String)

setView

public void setView(View v)
Description copied from interface: GraphicalObject
Set the View for this GraphicalObject. This sets the bounding points for the View to be the same as this GraphicalObject by default.
Specified by:
setView in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.getView(), View.setBoundingPoints2DRef(Polygon2D)

getView

public View getView()
Description copied from interface: GraphicalObject
Get the current View for this GraphicalObject, the object that handles how the the GraphicalObject is displayed.
Specified by:
getView in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.setView(View)

setGestureInterpreter

public Interpreter setGestureInterpreter(Interpreter intrp)
Description copied from interface: GraphicalObject
Set the current Gesture Interpreter, which tries to handle strokes as gestures.
Specified by:
setGestureInterpreter in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
intrp - is the new Interpreter to use.
Returns:
the current Interpreter.

getGestureInterpreter

public Interpreter getGestureInterpreter()
Description copied from interface: GraphicalObject
Get the current Gesture Interpreter, which tries to handle strokes as gestures.
Specified by:
getGestureInterpreter in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the current Interpreter.

setInkInterpreter

public Interpreter setInkInterpreter(Interpreter intrp)
Description copied from interface: GraphicalObject
Set the current Ink Interpreter, which tries to handle strokes as Ink.
Specified by:
setInkInterpreter in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
intrp - is the new Interpreter to use.
Returns:
the current Interpreter.

getInkInterpreter

public Interpreter getInkInterpreter()
Description copied from interface: GraphicalObject
Get the current Ink Interpreter, which tries to handle strokes as Ink.
Specified by:
getInkInterpreter in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the current Interpreter.

setStyle

public Style setStyle(Style newStyle)
Description copied from interface: GraphicalObject
Set the current Style for this Graphical Object.

Notifies Watchers of an update when called.

Specified by:
setStyle in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
the - Style to set to. A null value means use default values.

getStyle

public Style getStyle()
Description copied from interface: GraphicalObject
Get a copy of the current Style for this Graphical Object.
Specified by:
getStyle in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the current Style.

getStyleRef

public Style getStyleRef()
Description copied from interface: GraphicalObject
Get a reference of the current Style for this Graphical Object.
Specified by:
getStyleRef in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the current Style.

getRelativeLayer

public String getRelativeLayer()
Description copied from interface: GraphicalObject
Get the current layer this Graphical Object is in. Layers are a property of all Graphical Objects, and only specify a relative Z-ordering (not an absolute one). That is, we only know if a Graphical Object is above or below another, but not by how much (b/c didn't think it would be that useful, and would increase complexity). Layers may also be nested (through Graphical Object Groups).

 Main Tree
 |--  
 |    A Collection
 |    |--
 |    |   Relative: 1
 |    |   Absolute: 1
 |    |
 |    |    |--
 |    |    |   Relative: 1
 |    |    |   Absolute: 1.1
 |    |    |--
 |    |
 |    |    |--
 |    |    |   Relative: 2
 |    |    |   Absolute: 1.2
 |    |    |--
 |    |--
 |
 |    Another Collection
 |    |--
 |    |   Relative: 2
 |    |   Absolute: 2
 |    |
 |    |    |--
 |    |    |   Relative: 1
 |    |    |   Absolute: 2.1
 |    |    |--
 |    |--
 |--
 
Specified by:
getRelativeLayer in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
a non-negative value representing the current layer we are in.

setRelativeLayer

public void setRelativeLayer(int layer)
Description copied from interface: GraphicalObject
A convenience method to set what layer this object is in. Usually, this should not be used.

Notifies Watchers of an update when called.

Specified by:
setRelativeLayer in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
layer - is the non-negative layer value to set to. If it is set too high, it is just sent to the bottom-most layer.

getAbsoluteLayer

public String getAbsoluteLayer()
Description copied from interface: GraphicalObject
Get the absolute layer this group is in.
Specified by:
getAbsoluteLayer in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
a String like "1.3.2" or "2.1.1"

bringUpALayer

public void bringUpALayer()
Description copied from interface: GraphicalObject
Bring this Graphical Object up one layer in its current group. Does nothing if the operation is not possible.

Notifies Watchers of an update when called.

Specified by:
bringUpALayer in interface GraphicalObject

bringUpNLayers

public void bringUpNLayers(int n)
Description copied from interface: GraphicalObject
Bring this Graphical Object up N layers in its current group. Brings up as many layers as possible.

Notifies Watchers of an update when called.

Specified by:
bringUpNLayers in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
n - is the number of layers to move this GraphicalObject up.

bringDownALayer

public void bringDownALayer()
Description copied from interface: GraphicalObject
Bring this Graphical Object down one layer in its current group. Does nothing if the operation is not possible.

Notifies Watchers of an update when called.

Specified by:
bringDownALayer in interface GraphicalObject

bringDownNLayers

public void bringDownNLayers(int n)
Description copied from interface: GraphicalObject
Bring this Graphical Object down N layers in its current group. Brings up as many layers as possible.

Notifies Watchers of an update when called.

Specified by:
bringDownNLayers in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
n - is the number of layers to move this GraphicalObject down.

bringToTopLayer

public void bringToTopLayer()
Description copied from interface: GraphicalObject
Bring this Graphical Object to the top of its current group. Does nothing if the operation is not possible.

Notifies Watchers of an update when called.

Specified by:
bringToTopLayer in interface GraphicalObject

bringToBottomLayer

public void bringToBottomLayer()
Description copied from interface: GraphicalObject
Bring this Graphical Object to the bottom of its current group. Does nothing if the operation is not possible.

Notifies Watchers of an update when called.

Specified by:
bringToBottomLayer in interface GraphicalObject

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.

Specified by:
applyTransform in interface GraphicalObject
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.

Specified by:
setTransform in interface GraphicalObject
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()
Description copied from interface: GraphicalObject
Get a reference to the current transform. For optimization purposes.
Specified by:
getTransformRef in interface GraphicalObject

getTransform

public AffineTransform getTransform(int cdsys)
Description copied from interface: GraphicalObject
Get a copy of the current transform for this GraphicalObject.
Specified by:
getTransform in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get a copy of the current transform, putting the results in outTx.
Specified by:
getTransform in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the inverse of the transform.
Specified by:
getInverseTransform in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the inverse transform.
Specified by:
getInverseTransform in interface GraphicalObject
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

minDistance

public float minDistance(int cdsys,
                         double x,
                         double y)
Description copied from interface: GraphicalObject
Calculate the closest distance from the specified point to self. This method assumes that the GraphicalObject can be described as a Polygon. The distance is defined as 0 if the point is within this GraphicalObject and the GraphicalObject is closed. Otherwise, it is the minimum distance from the specified point to the nearest point in the GraphicalObject.
Specified by:
minDistance in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system.
x - is the x-coordinate.
y - is the y-coordinate.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

minDistance

public float minDistance(int cdsys,
                         Point2D pt)
Description copied from interface: GraphicalObject
Calls the other GraphicalObject.minDistance(int, double, double) method.
Specified by:
minDistance in interface GraphicalObject

getLocation2D

public Point2D getLocation2D(int cdsys)
Description copied from interface: GraphicalObject
Get the location of the top-left corner of the bounding box for all of the visible views of this GraphicalObject.
Specified by:
getLocation2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the location of the top-left corner of the bounding box for all of the visible views of this GraphicalObject.
Specified by:
getLocation2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the bounds of all of the visible views of this GraphicalObject.
Specified by:
getBounds2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the bounds of all of the visible views of this GraphicalObject.
Specified by:
getBounds2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
Specified by:
getBoundingPoints2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
Specified by:
getBoundingPoints2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the width of all of the visible views of this GraphicalObject.
Specified by:
getWidth2D in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Get the height of all of the visible views of this GraphicalObject.
Specified by:
getHeight2D in interface GraphicalObject
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

setHasClosedBoundingPoints

public void setHasClosedBoundingPoints(boolean flag)
Description copied from interface: GraphicalObject
Set whether or not this GraphicalObject is a closed shape or not. By default is true.
Specified by:
setHasClosedBoundingPoints in interface GraphicalObject

hasClosedBoundingPoints

public boolean hasClosedBoundingPoints()
Description copied from interface: GraphicalObject
Check if the bounding points describing this GraphicalObject is a closed Polygon (e.g. a box) or an open Polygon (e.g. most ink strokes).
Specified by:
hasClosedBoundingPoints in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
true if the GraphicalObject is closed, false otherwise.

shapeContains

public boolean shapeContains(GraphicalObject gob)
Description copied from interface: GraphicalObject
See if the specified GraphicalObject fits entirely within our bounds.

Don't confuse this method with GraphicalObjectCollection.contains(GraphicalObject).

Specified by:
shapeContains in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
gob - is the GraphicalObject to check. It doesn't matter what coordinate space gob is in, it will be moved to the correct space.
Returns:
true if gob is contained, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeContains

public boolean shapeContains(int cdsys,
                             Point2D pt)
Description copied from interface: GraphicalObject
See if we contain the specified point.
Specified by:
shapeContains in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system of the point.
pt - is the point.
Returns:
true if we contain the point, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeContains

public boolean shapeContains(int cdsys,
                             double x,
                             double y)
Description copied from interface: GraphicalObject
See if we contain the specified point.
Specified by:
shapeContains in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system of the point.
x - is the x-coordinate.
y - is the y-coordinate.
Returns:
true if we contain the point, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeContains

public boolean shapeContains(int cdsys,
                             Shape s)
Description copied from interface: GraphicalObject
See if we contain the specified rectangle.
Specified by:
shapeContains in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system of the point.
s - is the shape to check.
Returns:
true if we contain the point, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeIntersects

public boolean shapeIntersects(GraphicalObject gob)
Description copied from interface: GraphicalObject
See if the specified GraphicalObject intersects the this GraphicalObject. Two GraphicalObjects intersect if they share any two points in common.
Specified by:
shapeIntersects in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
gob - is checked to see if it intersects this GraphicalObject. It doesn't matter what coordinate space gob is in, it will be moved to the correct space.
Returns:
true if gob intersects this GraphicalObject, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeIntersects

public boolean shapeIntersects(int cdsys,
                               Shape s)
Description copied from interface: GraphicalObject
See if we intersect the specified shape.
Specified by:
shapeIntersects in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system of the point.
s - is the shape to check.
Returns:
true if we contain the point, false otherwise.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface Shape

contains

public boolean contains(Point2D p)
Specified by:
contains in interface Shape

contains

public boolean contains(Rectangle2D r)
Specified by:
contains in interface Shape

getBounds

public Rectangle getBounds()
Specified by:
getBounds in interface Shape

getBounds2D

public Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Specified by:
getPathIterator in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Specified by:
getPathIterator in interface Shape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface Shape

intersects

public boolean intersects(Rectangle2D r)
Specified by:
intersects in interface Shape

addWatcher

public Watcher addWatcher(Watcher w)
Description copied from interface: Watchable
Add a watcher to this object.
Specified by:
addWatcher in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
Parameters:
w - is the Watcher to add.
Returns:
a reference to the added Watcher.

countWatchers

public int countWatchers()
Description copied from interface: Watchable
Count the number of watchers watching this object.
Specified by:
countWatchers in interface Watchable

removeWatcher

public Watcher removeWatcher(Watcher w)
Description copied from interface: Watchable
Delete a watcher on this object.
Specified by:
removeWatcher in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
Returns:
a reference to the removed Watcher.

clearWatchers

public void clearWatchers()
Description copied from interface: Watchable
Delete all watchers on this object.
Specified by:
clearWatchers in interface Watchable

enableNotify

public void enableNotify()
Description copied from interface: Watchable
Turn on ability to notify others.
Specified by:
enableNotify in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
See Also:
Watchable.disableNotify()

disableNotify

public void disableNotify()
Description copied from interface: Watchable
Turn off ability to notify others. This works like a counting semaphore. Every time you call this method, the enabled value is incremented by 1. The watch is enabled if and only if the value is 0.
Specified by:
disableNotify in interface Watchable

hasNotifyEnabled

public boolean hasNotifyEnabled()
Description copied from interface: Watchable
Check current ability to notify others.
Specified by:
hasNotifyEnabled in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
See Also:
Watchable.disableNotify(), Watchable.enableNotify()

notifyWatchers

public void notifyWatchers()
Description copied from interface: Watchable
Notify the watchers. This is just a generic method, should not be generally used.
Specified by:
notifyWatchers in interface Watchable

notifyWatchers

public void notifyWatchers(Object arg)
Description copied from interface: Watchable
Notify the watchers. This is just a generic method, should not be generally used.
Specified by:
notifyWatchers in interface Watchable

notifyWatchersUpdate

public void notifyWatchersUpdate(Object arg)
Description copied from interface: Watchable
Notify the watchers that the object has been changed and the change needs to be handled by the watchers.
Specified by:
notifyWatchersUpdate in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
Parameters:
arg - is the argument to send to all Watchers.

notifyWatchersUpdate

public void notifyWatchersUpdate(String strProperty,
                                 Object oldVal,
                                 Object newVal)
Description copied from interface: Watchable
Notify the watchers that some value has been changed. Modifying the parameters should have no effect on this Watchable object. See SatinConstants for a list of predefined property names.
Specified by:
notifyWatchersUpdate in interface Watchable
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watchable
Parameters:
strProperty - is some agreed upon name for the property.
oldVal - is the old value.
newVal - is the new value. It should be a clone, not a reference to the actual value, unless it is prohibitively expensive to clone. Whether this is a copy or a reference should be defined in the SatinConstants file.
See Also:
SatinConstants

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

isSelectable

public boolean isSelectable()
Description copied from interface: GraphicalObject
Check whether or not this Graphical Object can be selected.
Specified by:
isSelectable in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
true if it can be selected, false otherwise.

setSelectable

public void setSelectable(boolean flag)
Description copied from interface: GraphicalObject
Set whether or not this Graphical Object can be selected.
Specified by:
setSelectable in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
flag - is true to set this Graphical Object as selectable, false otherwise.

moveTo

public void moveTo(int cdsys,
                   double x,
                   double y)
Description copied from interface: GraphicalObject
Move directly to the specified position.

Notifies Watchers of an update when called.

Specified by:
moveTo in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Calls the other GraphicalObject.moveTo(int, double, double) method.
Specified by:
moveTo in interface GraphicalObject

moveBy

public void moveBy(int cdsys,
                   double dx,
                   double dy)
Description copied from interface: GraphicalObject
Move relative to where we currently are.

Notifies Watchers of an update when called.

Specified by:
moveBy in interface GraphicalObject
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)
Description copied from interface: GraphicalObject
Calls the other GraphicalObject.moveBy(int, double, double) method.
Specified by:
moveBy in interface GraphicalObject

setBoundingPoints2D

public void setBoundingPoints2D(int cdsys,
                                Shape s)
Description copied from interface: GraphicalObject
Set the bounding points for our default view.

Notifies Watchers of an update when called.

Specified by:
setBoundingPoints2D in interface GraphicalObject
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

onNewStroke

public void onNewStroke(NewStrokeEvent evt)
Description copied from interface: GraphicalObject
Here is an overview of how dispatching works in Satin. The ASCII diagram below shows the lifecycle of a TimedStroke as it is dispatched. When a TimedStroke is created, a message is dispatched to the Sheet signifying that a Stroke is being created, via onNewStroke(). As the TimedStroke is updated, onUpdateStroke() is called on the Sheet. After it is completed, onSingleStroke() is called on the Sheet.
     ---------------    ------------------    ------------------
 --->|onNewStroke()|--->|onUpdateStroke()|--->|onSingleStroke()|
     ---------------    ------------------    ------------------
                                   |    ^
                                   |    |
                                   |____|

 

Here's what happens in Sheet when onNewStroke() is called, in order.

The same happens when onUpdateStroke() and onSingleStroke() are called.

Here's a full example of what happens. Suppose you are drawing a stroke on top of a GraphicalObject (which in turn is contained by the Sheet). In the notation below, the sheet is designated with s and the GraphicalObject is designated with g. The indentation represents different levels of the call stack. Here are the methods that are called:

 s.onNewStroke()                      // this occurs once per TimedStroke
    s.preProcessNewStroke()
    s.redispatchNewStroke()
       g.onNewStroke()
          g.preProcessNewStroke()
             g.getGestureInterpreter().handleNewStroke()
          g.redispatchNewStroke()
          g.postProcessNewStroke()
             g.getInkInterpreter().handleNewStroke()
          g.handleNewStroke()
    s.postProcessNewStroke()
    s.handleNewStroke()

 s.onUpdateStroke()                   // this occurs multiple times
    s.preProcessUpdateStroke()
    s.redispatchUpdateStroke()
       g.onUpdateStroke()
          g.preProcessUpdateStroke()
             g.getGestureInterpreter().handleUpdateStroke()
          g.redispatchUpdateStroke()
          g.postProcessUpdateStroke()
             g.getInkInterpreter().handleUpdateStroke()
          g.handleUpdateStroke()
    s.postProcessUpdateStroke()
    s.handleUpdateStroke()

 s.onSingleStroke()                   // this occurs once per TimedStroke
    s.preProcessSingleStroke()
    s.redispatchSingleStroke()
       g.onSingleStroke()
          g.preProcessSingleStroke()
             g.getGestureInterpreter().handleSingleStroke()
          g.redispatchSingleStroke()
          g.postProcessSingleStroke()
             g.getInkInterpreter().handleSingleStroke()
          g.handleSingleStroke()
    s.postProcessSingleStroke()
    s.handleSingleStroke()
 
Specified by:
onNewStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
evt - is the event to dispatch. evt should be in this GraphicalObject's local coordinate space when this method is called.
See Also:
for information on how to manipulate the event.

preProcessNewStroke

public void preProcessNewStroke(NewStrokeEvent evt)
Specified by:
preProcessNewStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

redispatchNewStroke

public void redispatchNewStroke(NewStrokeEvent evt)
Specified by:
redispatchNewStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

postProcessNewStroke

public void postProcessNewStroke(NewStrokeEvent evt)
Specified by:
postProcessNewStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

handleNewStroke

public void handleNewStroke(NewStrokeEvent evt)
Description copied from interface: StrokeListener
This callback is called when the stroke should be handled by this object. If you, the listener, have consumed the Stroke, then call SatinEvent.setConsumed() with true to signify that it is consumed and no one else should handle it. Furthermore, if you don't want the stroke to be rendered, then call SatinEvent.setShouldRender(boolean) with false. By default, the stroke will be rendered.
Specified by:
handleNewStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

onUpdateStroke

public void onUpdateStroke(UpdateStrokeEvent evt)
Specified by:
onUpdateStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

preProcessUpdateStroke

public void preProcessUpdateStroke(UpdateStrokeEvent evt)
Specified by:
preProcessUpdateStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

redispatchUpdateStroke

public void redispatchUpdateStroke(UpdateStrokeEvent evt)
Specified by:
redispatchUpdateStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

postProcessUpdateStroke

public void postProcessUpdateStroke(UpdateStrokeEvent evt)
Specified by:
postProcessUpdateStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

handleUpdateStroke

public void handleUpdateStroke(UpdateStrokeEvent evt)
Specified by:
handleUpdateStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

onSingleStroke

public void onSingleStroke(SingleStrokeEvent evt)
Specified by:
onSingleStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

preProcessSingleStroke

public void preProcessSingleStroke(SingleStrokeEvent evt)
Specified by:
preProcessSingleStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

redispatchSingleStroke

public void redispatchSingleStroke(SingleStrokeEvent evt)
Specified by:
redispatchSingleStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

postProcessSingleStroke

public void postProcessSingleStroke(SingleStrokeEvent evt)
Specified by:
postProcessSingleStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

handleSingleStroke

public void handleSingleStroke(SingleStrokeEvent evt)
Specified by:
handleSingleStroke in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.onNewStroke(NewStrokeEvent)

setVisible

public void setVisible(boolean flag)
Description copied from interface: GraphicalObject
Set whether this GraphicalObject should be displayed or not.
Specified by:
setVisible in interface GraphicalObject

isVisible

public boolean isVisible()
Description copied from interface: GraphicalObject
Check whether this GraphicalObject is visible or not.
Specified by:
isVisible in interface GraphicalObject

disableDamage

public void disableDamage()
Description copied from interface: GraphicalObject
Turn off damage mechanism temporarily. This works like a counting semaphore. Every time this method is called, the disable value is incremented. The damage mechanism is enabled if and only if the disable value is 0.

This method is useful if you are doing multiple operations to the same GraphicalObject all at once, but don't want to damage the GraphicalObject until all the operations are done.

Specified by:
disableDamage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.enableDamage(), GraphicalObject.hasDamageEnabled()

enableDamage

public void enableDamage()
Description copied from interface: GraphicalObject
Re-enable damage mechanism.
Specified by:
enableDamage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.disableDamage(), GraphicalObject.hasDamageEnabled()

hasDamageEnabled

public boolean hasDamageEnabled()
Description copied from interface: GraphicalObject
See if damage is enabled or not.
Specified by:
hasDamageEnabled in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
See Also:
GraphicalObject.disableDamage(), GraphicalObject.enableDamage()

setClipToBounds

public void setClipToBounds(boolean flag)
Description copied from interface: GraphicalObject
Set whether the GraphicalObject should be clipped to bounds or not. Slows down performance if true. Default is false.
Specified by:
setClipToBounds in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
flag - specifies whether the GraphicalObject should be clipped to bounds or not.

isClippedToBounds

public boolean isClippedToBounds()
Description copied from interface: GraphicalObject
Check whether the GraphicalObject should be clipped to bounds or not.
Specified by:
isClippedToBounds in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
true if the GraphicalObject should be clipped to bounds, false otherwise.

damage

public void damage(int sync)
Done on proxy, not on proxied object.
Specified by:
damage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
sync - is either SatinConstants.DAMAGE_NOW or SatinConstants.DAMAGE_LATER
See Also:
SatinConstants.DAMAGE_NOW, SatinConstants.DAMAGE_LATER

damage

public void damage(int sync,
                   GraphicalObject gob)
Done on proxy, not on proxied object.
Specified by:
damage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
sync - is either SatinConstants.DAMAGE_NOW or SatinConstants.DAMAGE_LATER
gob - is the GraphicalObject to repaint.
See Also:
SatinConstants.DAMAGE_NOW, SatinConstants.DAMAGE_LATER

damage

public void damage(int sync,
                   Rectangle2D rect)
Done on proxy, not on proxied object.
Specified by:
damage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
sync - is either SatinConstants.DAMAGE_NOW or SatinConstants.DAMAGE_LATER
rect - is the rectangle to damage (absolute coordinates).
See Also:
SatinConstants.DAMAGE_NOW, SatinConstants.DAMAGE_LATER

damage

public void damage(int sync,
                   Rectangle2D oldRect,
                   Rectangle2D newRect)
Done on proxy, not on proxied object.
Specified by:
damage in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
sync - is either SatinConstants.DAMAGE_NOW or SatinConstants.DAMAGE_LATER
oldRect - is the rectangle to damage (absolute coordinates).
newRect - is the rectangle to damage (absolute coordinates).
See Also:
SatinConstants.DAMAGE_NOW, SatinConstants.DAMAGE_LATER

render

public void render(SatinGraphics g)
Description copied from interface: GraphicalObject
Render this graphical object in the specified Graphics context.

When this method is called for you, your Style and Transform has already been set. This has several implications.

First, you can just use the normal drawing methods, like drawLine(), and they will automatically use the thickness and other properties as set in Style. You can still set colors and fonts and such if you want, though.

Secondly, your coordinate system is set such that (0,0) is your top-left corner.

Third, since your transform is already set, you don't have to do anything special to get rotation. Just draw normally.

Fourth, while in render(), do not call any methods that use SatinConstants.COORD_REL or SatinConstants.COORD_ABS, since the transform has already been applied. Instead, use SatinConstants.COORD_LOCAL.

So in other words, all you have to do is just draw the GraphicalObject normally, and everything else will be handled for you. However, do NOT call anything that uses the transformed bounds, since that will apply the transform twice (the transform has already been applied once).

Specified by:
render in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
g - is the Graphics context to draw in.

getParentGroup

public GraphicalObjectGroup getParentGroup()
Done on proxy, not on proxied object.
Specified by:
getParentGroup in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the Parent of this Graphical Object, or null if it does not have a parent.

setParentGroup

public void setParentGroup(GraphicalObjectGroup newParent)
Done on proxy, not on proxied object.
Specified by:
setParentGroup in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
newParent - is the parent to set to. Use null if this object does not have a parent.

getSheet

public Sheet getSheet()
Done on proxy, not on proxied object.
Specified by:
getSheet in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Returns:
the Sheet that this Graphical Object is in, or null if it is not in a Sheet.

delete

public void delete()
Done on proxy, not on proxied object.
Specified by:
delete in interface GraphicalObject

clone

public Object clone()
Done on proxy, not on proxied object.
Specified by:
clone in interface GraphicalObject
Overrides:
clone in class Object

clone

protected GraphicalObjectWrapper clone(GraphicalObjectWrapper gobw)
Clone our current state into the passed-in object. Used for clone chaining.

deepClone

public Object deepClone()
Done on proxy, not on proxied object.
Specified by:
deepClone in interface GraphicalObject

deepClone

protected GraphicalObjectWrapper deepClone(GraphicalObjectWrapper gobw)
Deep clone our current state into the passed-in object. Used for clone chaining.

Copyright Information