|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectWrapper
This software is distributed under the Berkeley Software License.
Revisions: - SATIN-v2.1-1.0.0, Aug 24 2000, JH
Created
| 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 |
| 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 |
public GraphicalObjectWrapper()
public GraphicalObjectWrapper(GraphicalObject gob)
| Method Detail |
public void setGraphicalObject(GraphicalObject newGob)
public GraphicalObject getGraphicalObject()
public int getUniqueID()
getUniqueID in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void setUniqueID(int newID)
setUniqueID in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic Iterator getPropertyNames()
getPropertyNames in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.getPropertyNames()public Object getProperty(String strPropertyName)
getProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.getProperty(String)
public void setProperty(String strPropertyName,
Object newVal)
setProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.setProperty(String, Object)public Object removeProperty(String strPropertyName)
removeProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.removeProperty(String)public List getIndexedProperty(String strPropertyName)
getIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.getIndexedProperty(String)
public Object getIndexedProperty(String strPropertyName,
int index)
getIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.getIndexedProperty(String, int)
public void setIndexedProperty(String strPropertyName,
int index,
Object newVal)
setIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.setIndexedProperty(String, int, Object)
public void addIndexedProperty(String strPropertyName,
Object newVal)
addIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.addIndexedProperty(String, Object)
public Object removeIndexedProperty(String strPropertyName,
int index)
removeIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.removeIndexedProperty(String, int)public List removeIndexedProperty(String strPropertyName)
removeIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.removeIndexedProperty(String)public void clearIndexedProperty(String strPropertyName)
clearIndexedProperty in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectFlexProperties.clearIndexedProperty(String)public void setView(View v)
GraphicalObjectsetView in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.getView(),
View.setBoundingPoints2DRef(Polygon2D)public View getView()
GraphicalObjectgetView in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.setView(View)public Interpreter setGestureInterpreter(Interpreter intrp)
GraphicalObjectsetGestureInterpreter in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectintrp - is the new Interpreter to use.public Interpreter getGestureInterpreter()
GraphicalObjectgetGestureInterpreter in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic Interpreter setInkInterpreter(Interpreter intrp)
GraphicalObjectsetInkInterpreter in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectintrp - is the new Interpreter to use.public Interpreter getInkInterpreter()
GraphicalObjectgetInkInterpreter in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic Style setStyle(Style newStyle)
GraphicalObjectNotifies Watchers of an update when called.
setStyle in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectthe - Style to set to. A null value means use default values.public Style getStyle()
GraphicalObjectgetStyle in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic Style getStyleRef()
GraphicalObjectgetStyleRef in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic String getRelativeLayer()
GraphicalObjectMain 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 | | |-- | |-- |--
getRelativeLayer in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void setRelativeLayer(int layer)
GraphicalObjectNotifies Watchers of an update when called.
setRelativeLayer in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectlayer - is the non-negative layer value to set to. If it is set
too high, it is just sent to the bottom-most layer.public String getAbsoluteLayer()
GraphicalObjectgetAbsoluteLayer in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void bringUpALayer()
GraphicalObjectNotifies Watchers of an update when called.
bringUpALayer in interface GraphicalObjectpublic void bringUpNLayers(int n)
GraphicalObjectNotifies Watchers of an update when called.
bringUpNLayers in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectn - is the number of layers to move this GraphicalObject up.public void bringDownALayer()
GraphicalObjectNotifies Watchers of an update when called.
bringDownALayer in interface GraphicalObjectpublic void bringDownNLayers(int n)
GraphicalObjectNotifies Watchers of an update when called.
bringDownNLayers in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectn - is the number of layers to move this GraphicalObject down.public void bringToTopLayer()
GraphicalObjectNotifies Watchers of an update when called.
bringToTopLayer in interface GraphicalObjectpublic void bringToBottomLayer()
GraphicalObjectNotifies Watchers of an update when called.
bringToBottomLayer in interface GraphicalObjectpublic void applyTransform(AffineTransform newTx)
GraphicalObjectNotifies Watchers of an update when called.
applyTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectnewTx - is a Transform to apply. No modifications are made to newTx.public void setTransform(AffineTransform newTx)
GraphicalObjectNotifies Watchers of an update when called.
setTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectnewTx - is a Transform to apply. Removes the old one completely.
No modifications are made to newTx.public AffineTransform getTransformRef()
GraphicalObjectgetTransformRef in interface GraphicalObjectpublic AffineTransform getTransform(int cdsys)
GraphicalObjectgetTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public AffineTransform getTransform(int cdsys,
AffineTransform outTx)
GraphicalObjectgetTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system.outTx - is the storage space.outTx.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic AffineTransform getInverseTransform(int cdsys)
GraphicalObjectgetInverseTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public AffineTransform getInverseTransform(int cdsys,
AffineTransform outTx)
GraphicalObjectgetInverseTransform in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.outTx - is the output storage. Use null to create a new object.outTxSatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public float minDistance(int cdsys,
double x,
double y)
GraphicalObjectminDistance in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system.x - is the x-coordinate.y - is the y-coordinate.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public float minDistance(int cdsys,
Point2D pt)
GraphicalObjectGraphicalObject.minDistance(int, double, double) method.minDistance in interface GraphicalObjectpublic Point2D getLocation2D(int cdsys)
GraphicalObjectgetLocation2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.GraphicalObject.getLocation2D(int, AffineTransform, Point2D),
SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public Point2D getLocation2D(int cdsys,
AffineTransform tx,
Point2D pt)
GraphicalObjectgetLocation2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - 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.pt.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic Rectangle2D getBounds2D(int cdsys)
GraphicalObjectgetBounds2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.GraphicalObject.getBounds2D(int),
SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public Rectangle2D getBounds2D(int cdsys,
AffineTransform tx,
Rectangle2D rect)
GraphicalObjectgetBounds2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - 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.rect.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic Polygon2D getBoundingPoints2D(int cdsys)
GraphicalObjectgetBoundingPoints2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public Polygon2D getBoundingPoints2D(int cdsys,
AffineTransform tx,
Polygon2D poly)
GraphicalObjectgetBoundingPoints2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - 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.poly.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic float getWidth2D(int cdsys)
GraphicalObjectgetWidth2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic float getHeight2D(int cdsys)
GraphicalObjectgetHeight2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic void setHasClosedBoundingPoints(boolean flag)
GraphicalObjectsetHasClosedBoundingPoints in interface GraphicalObjectpublic boolean hasClosedBoundingPoints()
GraphicalObjecthasClosedBoundingPoints in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic boolean shapeContains(GraphicalObject gob)
GraphicalObject
Don't confuse this method with
GraphicalObjectCollection.contains(GraphicalObject).
shapeContains in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectgob - is the GraphicalObject to check. It doesn't matter what
coordinate space gob is in, it will be moved to the correct
space.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys,
Point2D pt)
GraphicalObjectshapeContains in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system of the point.pt - is the point.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys,
double x,
double y)
GraphicalObjectshapeContains in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system of the point.x - is the x-coordinate.y - is the y-coordinate.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys,
Shape s)
GraphicalObjectshapeContains in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system of the point.s - is the shape to check.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic boolean shapeIntersects(GraphicalObject gob)
GraphicalObjectshapeIntersects in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectgob - 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.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public boolean shapeIntersects(int cdsys,
Shape s)
GraphicalObjectshapeIntersects in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system of the point.s - is the shape to check.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public boolean contains(double x,
double y)
contains in interface Shape
public boolean contains(double x,
double y,
double w,
double h)
contains in interface Shapepublic boolean contains(Point2D p)
contains in interface Shapepublic boolean contains(Rectangle2D r)
contains in interface Shapepublic Rectangle getBounds()
getBounds in interface Shapepublic Rectangle2D getBounds2D()
getBounds2D in interface Shapepublic PathIterator getPathIterator(AffineTransform at)
getPathIterator in interface Shape
public PathIterator getPathIterator(AffineTransform at,
double flatness)
getPathIterator in interface Shape
public boolean intersects(double x,
double y,
double w,
double h)
intersects in interface Shapepublic boolean intersects(Rectangle2D r)
intersects in interface Shapepublic Watcher addWatcher(Watcher w)
WatchableaddWatcher in interface Watchableedu.berkeley.guir.lib.satin.watch.Watchablew - is the Watcher to add.public int countWatchers()
WatchablecountWatchers in interface Watchablepublic Watcher removeWatcher(Watcher w)
WatchableremoveWatcher in interface Watchableedu.berkeley.guir.lib.satin.watch.Watchablepublic void clearWatchers()
WatchableclearWatchers in interface Watchablepublic void enableNotify()
WatchableenableNotify in interface Watchableedu.berkeley.guir.lib.satin.watch.WatchableWatchable.disableNotify()public void disableNotify()
WatchabledisableNotify in interface Watchablepublic boolean hasNotifyEnabled()
WatchablehasNotifyEnabled in interface Watchableedu.berkeley.guir.lib.satin.watch.WatchableWatchable.disableNotify(),
Watchable.enableNotify()public void notifyWatchers()
WatchablenotifyWatchers in interface Watchablepublic void notifyWatchers(Object arg)
WatchablenotifyWatchers in interface Watchablepublic void notifyWatchersUpdate(Object arg)
WatchablenotifyWatchersUpdate in interface Watchableedu.berkeley.guir.lib.satin.watch.Watchablearg - is the argument to send to all Watchers.
public void notifyWatchersUpdate(String strProperty,
Object oldVal,
Object newVal)
WatchablenotifyWatchersUpdate in interface Watchableedu.berkeley.guir.lib.satin.watch.WatchablestrProperty - 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.SatinConstantspublic void notifyWatchersDelete()
WatchablenotifyWatchersDelete in interface Watchablepublic boolean isSelectable()
GraphicalObjectisSelectable in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void setSelectable(boolean flag)
GraphicalObjectsetSelectable in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectflag - is true to set this Graphical Object as selectable,
false otherwise.
public void moveTo(int cdsys,
double x,
double y)
GraphicalObjectNotifies Watchers of an update when called.
moveTo in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.x - is the x-coordinate to move to.y - is the y-coordinate to move to.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public void moveTo(int cdsys,
Point2D pt)
GraphicalObjectGraphicalObject.moveTo(int, double, double) method.moveTo in interface GraphicalObject
public void moveBy(int cdsys,
double dx,
double dy)
GraphicalObjectNotifies Watchers of an update when called.
moveBy in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.dx - is the change in x-coordinate to move.dy - is the change in y-coordinate to move.SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABS
public void moveBy(int cdsys,
Point2D pt)
GraphicalObjectGraphicalObject.moveBy(int, double, double) method.moveBy in interface GraphicalObject
public void setBoundingPoints2D(int cdsys,
Shape s)
GraphicalObjectNotifies Watchers of an update when called.
setBoundingPoints2D in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectcdsys - is the coordinate system to use.s - is the shape that describes our bounds.GraphicalObject.getView(),
SatinConstants.COORD_LOCAL,
SatinConstants.COORD_REL,
SatinConstants.COORD_ABSpublic void onNewStroke(NewStrokeEvent evt)
GraphicalObjectTimedStroke 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.
onNewStroke() - message that a new stroke is
being created
preProcessNewStroke() - use interpreter to process
stroke as gesture
redispatchNewStroke() - redispatch the stroke
to others
postProcessNewStroke() - use interpreter to
process stroke as ink
handleNewStroke() - handle the stroke, ie add,
ignore, etc.
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()
onNewStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectevt - is the event to dispatch. evt should be in this
GraphicalObject's local coordinate space when this method is
called.for information on how to manipulate the event.public void preProcessNewStroke(NewStrokeEvent evt)
preProcessNewStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void redispatchNewStroke(NewStrokeEvent evt)
redispatchNewStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void postProcessNewStroke(NewStrokeEvent evt)
postProcessNewStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void handleNewStroke(NewStrokeEvent evt)
StrokeListenerSatinEvent.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.handleNewStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void onUpdateStroke(UpdateStrokeEvent evt)
onUpdateStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void preProcessUpdateStroke(UpdateStrokeEvent evt)
preProcessUpdateStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void redispatchUpdateStroke(UpdateStrokeEvent evt)
redispatchUpdateStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void postProcessUpdateStroke(UpdateStrokeEvent evt)
postProcessUpdateStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void handleUpdateStroke(UpdateStrokeEvent evt)
handleUpdateStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void onSingleStroke(SingleStrokeEvent evt)
onSingleStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void preProcessSingleStroke(SingleStrokeEvent evt)
preProcessSingleStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void redispatchSingleStroke(SingleStrokeEvent evt)
redispatchSingleStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void postProcessSingleStroke(SingleStrokeEvent evt)
postProcessSingleStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void handleSingleStroke(SingleStrokeEvent evt)
handleSingleStroke in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.onNewStroke(NewStrokeEvent)public void setVisible(boolean flag)
GraphicalObjectsetVisible in interface GraphicalObjectpublic boolean isVisible()
GraphicalObjectisVisible in interface GraphicalObjectpublic void disableDamage()
GraphicalObjectThis 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.
disableDamage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.enableDamage(),
GraphicalObject.hasDamageEnabled()public void enableDamage()
GraphicalObjectenableDamage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.disableDamage(),
GraphicalObject.hasDamageEnabled()public boolean hasDamageEnabled()
GraphicalObjecthasDamageEnabled in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectGraphicalObject.disableDamage(),
GraphicalObject.enableDamage()public void setClipToBounds(boolean flag)
GraphicalObjectsetClipToBounds in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectflag - specifies whether the GraphicalObject should be clipped
to bounds or not.public boolean isClippedToBounds()
GraphicalObjectisClippedToBounds in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void damage(int sync)
damage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectsync - is either SatinConstants.DAMAGE_NOW or
SatinConstants.DAMAGE_LATERSatinConstants.DAMAGE_NOW,
SatinConstants.DAMAGE_LATER
public void damage(int sync,
GraphicalObject gob)
damage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectsync - is either SatinConstants.DAMAGE_NOW or
SatinConstants.DAMAGE_LATERgob - is the GraphicalObject to repaint.SatinConstants.DAMAGE_NOW,
SatinConstants.DAMAGE_LATER
public void damage(int sync,
Rectangle2D rect)
damage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectsync - is either SatinConstants.DAMAGE_NOW or
SatinConstants.DAMAGE_LATERrect - is the rectangle to damage (absolute coordinates).SatinConstants.DAMAGE_NOW,
SatinConstants.DAMAGE_LATER
public void damage(int sync,
Rectangle2D oldRect,
Rectangle2D newRect)
damage in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectsync - is either SatinConstants.DAMAGE_NOW or
SatinConstants.DAMAGE_LATERoldRect - is the rectangle to damage (absolute coordinates).newRect - is the rectangle to damage (absolute coordinates).SatinConstants.DAMAGE_NOW,
SatinConstants.DAMAGE_LATERpublic void render(SatinGraphics g)
GraphicalObjectWhen 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).
render in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectg - is the Graphics context to draw in.public GraphicalObjectGroup getParentGroup()
getParentGroup in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void setParentGroup(GraphicalObjectGroup newParent)
setParentGroup in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectnewParent - is the parent to set to. Use null if this object does
not have a parent.public Sheet getSheet()
getSheet in interface GraphicalObjectedu.berkeley.guir.lib.satin.objects.GraphicalObjectpublic void delete()
delete in interface GraphicalObjectpublic Object clone()
clone in interface GraphicalObjectclone in class Objectprotected GraphicalObjectWrapper clone(GraphicalObjectWrapper gobw)
public Object deepClone()
deepClone in interface GraphicalObjectprotected GraphicalObjectWrapper deepClone(GraphicalObjectWrapper gobw)
|
Copyright Information | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||