|
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 GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setUniqueID(int newID)
setUniqueID
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Iterator getPropertyNames()
getPropertyNames
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getPropertyNames()
public Object getProperty(String strPropertyName)
getProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getProperty(String)
public void setProperty(String strPropertyName, Object newVal)
setProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.setProperty(String, Object)
public Object removeProperty(String strPropertyName)
removeProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeProperty(String)
public List getIndexedProperty(String strPropertyName)
getIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getIndexedProperty(String)
public Object getIndexedProperty(String strPropertyName, int index)
getIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getIndexedProperty(String, int)
public void setIndexedProperty(String strPropertyName, int index, Object newVal)
setIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.setIndexedProperty(String, int, Object)
public void addIndexedProperty(String strPropertyName, Object newVal)
addIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.addIndexedProperty(String, Object)
public Object removeIndexedProperty(String strPropertyName, int index)
removeIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeIndexedProperty(String, int)
public List removeIndexedProperty(String strPropertyName)
removeIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeIndexedProperty(String)
public void clearIndexedProperty(String strPropertyName)
clearIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.clearIndexedProperty(String)
public void setView(View v)
GraphicalObject
setView
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.getView()
,
View.setBoundingPoints2DRef(Polygon2D)
public View getView()
GraphicalObject
getView
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.setView(View)
public Interpreter setGestureInterpreter(Interpreter intrp)
GraphicalObject
setGestureInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
intrp
- is the new Interpreter to use.public Interpreter getGestureInterpreter()
GraphicalObject
getGestureInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Interpreter setInkInterpreter(Interpreter intrp)
GraphicalObject
setInkInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
intrp
- is the new Interpreter to use.public Interpreter getInkInterpreter()
GraphicalObject
getInkInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Style setStyle(Style newStyle)
GraphicalObject
Notifies Watchers of an update when called.
setStyle
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
the
- Style to set to. A null value means use default values.public Style getStyle()
GraphicalObject
getStyle
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Style getStyleRef()
GraphicalObject
getStyleRef
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public String getRelativeLayer()
GraphicalObject
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 | | |-- | |-- |--
getRelativeLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setRelativeLayer(int layer)
GraphicalObject
Notifies Watchers of an update when called.
setRelativeLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.public String getAbsoluteLayer()
GraphicalObject
getAbsoluteLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void bringUpALayer()
GraphicalObject
Notifies Watchers of an update when called.
bringUpALayer
in interface GraphicalObject
public void bringUpNLayers(int n)
GraphicalObject
Notifies Watchers of an update when called.
bringUpNLayers
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
n
- is the number of layers to move this GraphicalObject up.public void bringDownALayer()
GraphicalObject
Notifies Watchers of an update when called.
bringDownALayer
in interface GraphicalObject
public void bringDownNLayers(int n)
GraphicalObject
Notifies Watchers of an update when called.
bringDownNLayers
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
n
- is the number of layers to move this GraphicalObject down.public void bringToTopLayer()
GraphicalObject
Notifies Watchers of an update when called.
bringToTopLayer
in interface GraphicalObject
public void bringToBottomLayer()
GraphicalObject
Notifies Watchers of an update when called.
bringToBottomLayer
in interface GraphicalObject
public void applyTransform(AffineTransform newTx)
GraphicalObject
Notifies Watchers of an update when called.
applyTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
newTx
- is a Transform to apply. No modifications are made to newTx.public void setTransform(AffineTransform newTx)
GraphicalObject
Notifies Watchers of an update when called.
setTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
newTx
- is a Transform to apply. Removes the old one completely.
No modifications are made to newTx.public AffineTransform getTransformRef()
GraphicalObject
getTransformRef
in interface GraphicalObject
public AffineTransform getTransform(int cdsys)
GraphicalObject
getTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getTransform(int cdsys, AffineTransform outTx)
GraphicalObject
getTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system.outTx
- is the storage space.outTx
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getInverseTransform(int cdsys)
GraphicalObject
getInverseTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getInverseTransform(int cdsys, AffineTransform outTx)
GraphicalObject
getInverseTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.outTx
- is the output storage. Use null to create a new object.outTx
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float minDistance(int cdsys, double x, double y)
GraphicalObject
minDistance
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
GraphicalObject.minDistance(int, double, double)
method.minDistance
in interface GraphicalObject
public Point2D getLocation2D(int cdsys)
GraphicalObject
getLocation2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
getLocation2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.pt
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Rectangle2D getBounds2D(int cdsys)
GraphicalObject
getBounds2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
getBounds2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.rect
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Polygon2D getBoundingPoints2D(int cdsys)
GraphicalObject
getBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Polygon2D getBoundingPoints2D(int cdsys, AffineTransform tx, Polygon2D poly)
GraphicalObject
getBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.poly
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float getWidth2D(int cdsys)
GraphicalObject
getWidth2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float getHeight2D(int cdsys)
GraphicalObject
getHeight2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void setHasClosedBoundingPoints(boolean flag)
GraphicalObject
setHasClosedBoundingPoints
in interface GraphicalObject
public boolean hasClosedBoundingPoints()
GraphicalObject
hasClosedBoundingPoints
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public boolean shapeContains(GraphicalObject gob)
GraphicalObject
Don't confuse this method with
GraphicalObjectCollection.contains(GraphicalObject)
.
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
gob
- 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)
GraphicalObject
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system of the point.s
- is the shape to check.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeIntersects(GraphicalObject gob)
GraphicalObject
shapeIntersects
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeIntersects(int cdsys, Shape s)
GraphicalObject
shapeIntersects
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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 Shape
public boolean contains(Point2D p)
contains
in interface Shape
public boolean contains(Rectangle2D r)
contains
in interface Shape
public Rectangle getBounds()
getBounds
in interface Shape
public Rectangle2D getBounds2D()
getBounds2D
in interface Shape
public 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 Shape
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public Watcher addWatcher(Watcher w)
Watchable
addWatcher
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
w
- is the Watcher to add.public int countWatchers()
Watchable
countWatchers
in interface Watchable
public Watcher removeWatcher(Watcher w)
Watchable
removeWatcher
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
public void clearWatchers()
Watchable
clearWatchers
in interface Watchable
public void enableNotify()
Watchable
enableNotify
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
Watchable.disableNotify()
public void disableNotify()
Watchable
disableNotify
in interface Watchable
public boolean hasNotifyEnabled()
Watchable
hasNotifyEnabled
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
Watchable.disableNotify()
,
Watchable.enableNotify()
public void notifyWatchers()
Watchable
notifyWatchers
in interface Watchable
public void notifyWatchers(Object arg)
Watchable
notifyWatchers
in interface Watchable
public void notifyWatchersUpdate(Object arg)
Watchable
notifyWatchersUpdate
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
arg
- is the argument to send to all Watchers.public void notifyWatchersUpdate(String strProperty, Object oldVal, Object newVal)
Watchable
notifyWatchersUpdate
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
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.SatinConstants
public void notifyWatchersDelete()
Watchable
notifyWatchersDelete
in interface Watchable
public boolean isSelectable()
GraphicalObject
isSelectable
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setSelectable(boolean flag)
GraphicalObject
setSelectable
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
flag
- is true to set this Graphical Object as selectable,
false otherwise.public void moveTo(int cdsys, double x, double y)
GraphicalObject
Notifies Watchers of an update when called.
moveTo
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- 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)
GraphicalObject
GraphicalObject.moveTo(int, double, double)
method.moveTo
in interface GraphicalObject
public void moveBy(int cdsys, double dx, double dy)
GraphicalObject
Notifies Watchers of an update when called.
moveBy
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void moveBy(int cdsys, Point2D pt)
GraphicalObject
GraphicalObject.moveBy(int, double, double)
method.moveBy
in interface GraphicalObject
public void setBoundingPoints2D(int cdsys, Shape s)
GraphicalObject
Notifies Watchers of an update when called.
setBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.s
- is the shape that describes our bounds.GraphicalObject.getView()
,
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void onNewStroke(NewStrokeEvent evt)
GraphicalObject
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.
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 GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
evt
- 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 GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchNewStroke(NewStrokeEvent evt)
redispatchNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessNewStroke(NewStrokeEvent evt)
postProcessNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleNewStroke(NewStrokeEvent evt)
StrokeListener
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.handleNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void onUpdateStroke(UpdateStrokeEvent evt)
onUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void preProcessUpdateStroke(UpdateStrokeEvent evt)
preProcessUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchUpdateStroke(UpdateStrokeEvent evt)
redispatchUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessUpdateStroke(UpdateStrokeEvent evt)
postProcessUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleUpdateStroke(UpdateStrokeEvent evt)
handleUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void onSingleStroke(SingleStrokeEvent evt)
onSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void preProcessSingleStroke(SingleStrokeEvent evt)
preProcessSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchSingleStroke(SingleStrokeEvent evt)
redispatchSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessSingleStroke(SingleStrokeEvent evt)
postProcessSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleSingleStroke(SingleStrokeEvent evt)
handleSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void setVisible(boolean flag)
GraphicalObject
setVisible
in interface GraphicalObject
public boolean isVisible()
GraphicalObject
isVisible
in interface GraphicalObject
public void disableDamage()
GraphicalObject
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.
disableDamage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.enableDamage()
,
GraphicalObject.hasDamageEnabled()
public void enableDamage()
GraphicalObject
enableDamage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.disableDamage()
,
GraphicalObject.hasDamageEnabled()
public boolean hasDamageEnabled()
GraphicalObject
hasDamageEnabled
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.disableDamage()
,
GraphicalObject.enableDamage()
public void setClipToBounds(boolean flag)
GraphicalObject
setClipToBounds
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
flag
- specifies whether the GraphicalObject should be clipped
to bounds or not.public boolean isClippedToBounds()
GraphicalObject
isClippedToBounds
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void damage(int sync)
damage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
sync
- is either SatinConstants.DAMAGE_NOW
or
SatinConstants.DAMAGE_LATER
SatinConstants.DAMAGE_NOW
,
SatinConstants.DAMAGE_LATER
public void damage(int sync, GraphicalObject gob)
damage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
sync
- is either SatinConstants.DAMAGE_NOW
or
SatinConstants.DAMAGE_LATER
gob
- is the GraphicalObject to repaint.SatinConstants.DAMAGE_NOW
,
SatinConstants.DAMAGE_LATER
public void damage(int sync, Rectangle2D rect)
damage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
sync
- is either SatinConstants.DAMAGE_NOW
or
SatinConstants.DAMAGE_LATER
rect
- 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 GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
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).SatinConstants.DAMAGE_NOW
,
SatinConstants.DAMAGE_LATER
public void render(SatinGraphics g)
GraphicalObject
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).
render
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
g
- is the Graphics context to draw in.public GraphicalObjectGroup getParentGroup()
getParentGroup
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setParentGroup(GraphicalObjectGroup newParent)
setParentGroup
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
newParent
- is the parent to set to. Use null if this object does
not have a parent.public Sheet getSheet()
getSheet
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void delete()
delete
in interface GraphicalObject
public Object clone()
clone
in interface GraphicalObject
clone
in class Object
protected GraphicalObjectWrapper clone(GraphicalObjectWrapper gobw)
public Object deepClone()
deepClone
in interface GraphicalObject
protected GraphicalObjectWrapper deepClone(GraphicalObjectWrapper gobw)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |