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

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

java.lang.Object
  |
  +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectImpl
All Implemented Interfaces:
Cloneable, EventListener, GraphicalObject, SatinConstants, Serializable, Shape, StrokeListener, Watchable
Direct Known Subclasses:
GObImage, GObJComponentWrapper, GObText, GraphicalObjectGroupImpl, TimedStroke

public abstract class GraphicalObjectImpl
extends Object
implements GraphicalObject, Watchable, Shape, StrokeListener

This is a sample implementation class for GraphicalObjects.

Introduction

A GraphicalObject is anything with some state, dynamically redefinable views on that state, and dynamically redefinable behaviors to manipulate that state. See GraphicalObject for background information on Model-View-Controller, Interpreters, and Views.

This implementation of GraphicalObject separates all of the interaction portions into an InteractionHandler, all of the view portions into a ViewHandler, and all of the watch portions into a WatchableImpl. Although there is a lot of indirection, we feel that this significantly improves flexibility and generality.

Getting Started

To start using this base implementation, you must override at least one method, the defaultRender(SatinGraphics) method. This method simply tells the system how to draw the GraphicalObject under normal conditions. Note that you cannot override render(SatinGraphics), as it is a final method in this implementation.

You must also call setBoundingPoints2D(int, Shape) before the GraphicalObject is rendered. This method just sets the bounds of the GraphicalObject, so the system knows where the GraphicalObject is and what is looks like.

Since:
JDK 1.2
Version:
SATIN-v2.1-1.0.0, Aug 11 2000 GraphicalObject going.

The Coordinate Systems

Here is a good point to describe the different coordinate systems. Generally speaking, we support access to three different coordinate systems, termed local, relative, and absolute,

It is important to know what coordinate system you are in at all times. In general, this will likely be the most common bug you encounter. I wish there was a way to simplify this, but there seems to be times when you need easy access to the various coordinate systems. Let us know if you have any better ideas.

There are a host of utilities that convert from one coordinate system to another, in GraphicalObjectLib. Here's a quick overview:

Interaction and Views

You should also look at these three following methods, as these define the behavior of the GraphicalObject when strokes are drawn on it. Currently, these are the only events we support, but we'll see what happens later on.

For a more in-depth description of what happens behind the scenes, check out GraphicalObject.onNewStroke(NewStrokeEvent). This event model is a key aspect to understanding how the system works.

If you've skimmed over the docs, you probably noticed the methods setGestureInterpreter(Interpreter), setInkInterpreter(Interpreter), and setView(View). Basically, these methods let you plug-in new Interpreters and Views. You may want to look over the interface for Interpreter and View before proceeding.

The Gesture Interpreter lets you try to process strokes as gestures, such as cut and copy. The Ink Interpreter lets you preprocess strokes as ink, such as straightening it up. Again, check out GraphicalObject.onNewStroke(NewStrokeEvent) for a diagram showing exactly when these Interpreters are used.

Views let you specify how this GraphicalObject is displayed. If you recall from earlier, there are two different rendering methods, render(SatinGraphics) and defaultRender(SatinGraphics). Note that the defaultRender() method is not part of GraphicalObject, but part of this implementation. The reason for this is that in this implementation, render() simply delegates the rendering to the current View. By default, the current View just calls defaultRender(). Thus the reason for two different rendering methods.

So what if you want to have more than one Interpreter or View? This is where MultiInterpreters and MultiViews come in. MultiInterpreter is a special kind of Interpreter that contains multiple Interpreters. The MultiInterpreter simply decides in what order the Interpreters are called and how to combine their results. A MultiView does the same thing for Views. An example of a MultiView is the SemanticZoomMultiViewImpl, which lets you change how GraphicalObjects appear at different zoom levels.

Notifications

Notifications are another aspect of the system. Notifications differ from events in that events are user-generated, whereas notifications are system-generated. Events can be considered to be input messages from the user, while notifications are messages from one part of the system to another, in order to keep it consistent.

One special kind of notification is the damage notification, used to force the current GraphicalObject to be repainted. There are a host of damage methods, with the primary differences being when the repainting occurs and what area is to be repainted. For example, calling damage(int) with the SatinConstants.DAMAGE_NOW constant forces the GraphicalObject to be repainted immediately, while calling damage(int, Rectangle2D) with the SatinConstants.DAMAGE_LATER constant repaints the specified rectangle at a later time, when it is more convenient for the system. In most cases, the damage call is made for you automatically.

The more general mechanism for notifications is implemented in two methods, notifyWatchersUpdate(Object) and notifyWatchersUpdate(String, Object, Object). Check out SatinConstants for some constants that define the existing types of messages in Satin. Again, in most cases, notifications are automatically sent for you, but there may be cases in your own subclasses that you want to send out additional messages.

The notification and damage mechanisms can be disabled, via the disableNotify() and disableDamage() methods. They can also be re-enabled via the enableNotify() and enableDamage() methods. The methods hasNotifyEnabled() and hasDamageEnabled() can be used to check the current status. The general notification mechanism and damage mechanism are independent of one another. Disabling one has no effect on the other.

Please note that the enable/disable mechanism works like a counting semaphore. Every time you call a disable method, the disabled value is incremented by one. Every time you call a enable method, the disabled value is decremented by one. The mechanism is enabled if and only if the value is 0.

Other Methods Needed for Correctness

There are two methods you should override for correctness, toString(), and clone() and deepClone(). The system will still work (for the most part) if you don't override these, but it won't be 100% correct.

The toString() method is used to get debugging statements. The default implementation of toString() provides a great deal of debugging information about known state, but needs some help to print out debugging information about state internal to your own GraphicalObject. Just override toString(), make the super call to toString() as the first thing you do, and just append the information.

The clone() and deepClone() methods are used for copying GraphicalObjects. If you don't implement these methods correctly, then you can't do copying-and-pasting.

Lastly, there is method that you may have to override for correctness. GraphicalObject defines minDistance(int, double, double) assuming that you want the minimum distance from the specified point to any point on your GraphicalObject, handling open polygons and points inside the Polygon correctly. This will probably be right for nearly every GraphicalObject.

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v1.0-1.0.0, Oct 06 1998, JH
               Created class
             - SATIN-v2.1-1.0.0, Aug 11 2000, JH
               Touched for SATIN release
 
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
GraphicalObjectImpl()
          Default constructor, does nothing fancy.
GraphicalObjectImpl(GraphicalObjectImpl gob)
          Constructor for clone-chaining purposes.
 
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()
          My clone sleeps alone...
protected  GraphicalObjectImpl clone(GraphicalObjectImpl gobClone)
          Clone all of the state in the current GraphicalObject into the passed GraphicalObject.
 boolean contains(double x, double y)
          See if this GraphicalObject contains the specified point.
 boolean contains(double x, double y, double w, double h)
          See if this GraphicalObject contains the specified rectangle.
 boolean contains(Point2D p)
          See if this GraphicalObject contains the specified point.
 boolean contains(Rectangle2D r)
          See if this GraphicalObject contains the specified rectangle.
 int countWatchers()
          Count the number of watchers watching this object.
protected  InteractionHandler createNewInteractionHandler()
          Override this method if you want to use your own InteractionHandler.
protected  ViewHandler createNewViewHandler()
          Override this method if you want to use your own ViewHandler.
 void damage(int sync)
          If this GraphicalObject hasNotifyEnabled(), mark this GraphicalObject as damaged and repaint.
 void damage(int sync, GraphicalObject gob)
          If this GraphicalObject hasNotifyEnabled(), mark the specified GraphicalObject as damaged and repaint.
 void damage(int sync, Rectangle2D rect)
          If this GraphicalObject hasNotifyEnabled(), mark the specified region as damaged and repaint.
 void damage(int sync, Rectangle2D oldBounds, Rectangle2D newBounds)
          If this GraphicalObject hasNotifyEnabled(), mark the specified regions as damaged and repaint.
 Object deepClone()
          If you do not override this method, it calls clone() by default.
protected  GraphicalObjectImpl deepClone(GraphicalObjectImpl gobClone)
           
protected abstract  void defaultRender(SatinGraphics g)
          The default method for rendering.
 void delete()
          Delete this 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.
 boolean equals(Object obj)
          Simply tests if the two IDs are the same or not.
 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.
protected  Polygon2D getBoundingPoints2DRef()
          Get a reference of the relative bounding points instead of a copy.
 Rectangle getBounds()
           
 Rectangle2D getBounds2D()
          Get the relative bounds.
 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.
static boolean getClassDebugProperty()
           
 Object getClassProperty(String strPropertyName)
          Convenience method to get a reference to the specified property.
 Interpreter getClassPropertyGestureInterpreter()
          Convenience method for getting the view class property.
 Interpreter getClassPropertyInkInterpreter()
          Convenience method for getting the view class property.
 Style getClassPropertyStyle()
          Convenience method for getting the view class property.
 View getClassPropertyView()
          Convenience method for getting the view class property.
 Interpreter getGestureInterpreter()
          Get the current Gesture Interpreter, which tries to handle strokes as gestures.
 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.
protected  InteractionHandler getInteractionHandler()
          Get the interaction handler, the object that we delegate most of our interactions to.
 AffineTransform getInverseTransform(int cdsys)
          Get the inverse of the transform.
 AffineTransform getInverseTransform(int cdsys, AffineTransform outTx)
          Get the inverse transform.
protected  Polygon2D getLocalBoundingPoints2DRef()
          Get a reference of the local bounding points instead of a copy.
 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()
          Get the parent of this Graphical object.
 PathIterator getPathIterator(AffineTransform at)
          Get the path iterator, relative coordinates.
 PathIterator getPathIterator(AffineTransform at, double flatness)
           
 String getPresentationName()
           
 Object getProperty(String strPropertyName)
           
 Iterator getPropertyNames()
           
 String getRelativeLayer()
          Get the current layer this Graphical Object is in.
 Sheet getSheet()
          Get the sheet that this Graphical object is in.
 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()
          Get the ID of this GraphicalObject.
 View getView()
          Get the current View for this GraphicalObject, the object that handles how the the GraphicalObject is displayed.
protected  ViewHandler getViewHandler()
          Get the view handler, the object that we delegate most of our views to.
 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)
          Check if the specified rectangle intersects this GraphicalObject (relative coordinates).
 boolean intersects(Rectangle2D r)
          Check if the specified rectangle intersects this GraphicalObject (relative coordinates).
 boolean isClippedToBounds()
          Check whether the GraphicalObject should be clipped to bounds or not.
protected  boolean isDirty()
          Check if this GraphicalObject's bounds are dirty (ie the GraphicalObject has been moved or reshaped, etc) and should be recalculated.
 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.
protected  float minLocalDistance(double x, double y)
          Assumes the specified point is in local coordinates.
 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)
          Don't override this method.
protected  void renderAllCoordBounds(SatinGraphics g, Rectangle2D bounds)
          Render the tiny boxes displaying the numerical coordinates of the bounding box.
protected  void renderBoundingBox(SatinGraphics g, Rectangle2D bounds)
          Render the bounding box around this GraphicalObject.
protected  void renderDebug(SatinGraphics g, Rectangle2D rect)
          Render the graphical debugging information.
protected  void renderDimensions(SatinGraphics g, Rectangle2D bounds)
          Render the height and width of this GraphicalObject.
protected  void renderSelected(SatinGraphics g, Rectangle2D rect)
          Render how this Graphical Object is displayed when selected.
protected  void renderSelectionHandle(SatinGraphics g, int x, int y)
          Paint a selection handle centered at the specified coordinate.
 void setBoundingPoints2D(int cdsys, Shape s)
          Set the bounding points for our default view.
static void setClassDebugProperty(boolean flag)
          Set graphical debugging mode.
 void setClassProperty(String strPropertyName, Object obj)
          Convenience method to set a property.
 void setClassPropertyGestureInterpreter(Interpreter intrp)
          Convenience method for setting the view class property.
 void setClassPropertyInkInterpreter(Interpreter intrp)
          Convenience method for setting the view class property.
 void setClassPropertyStyle(Style s)
          Convenience method for setting the view class property.
 void setClassPropertyView(View v)
          Convenience method for setting the view class property.
 void setClipToBounds(boolean flag)
          Set whether the GraphicalObject should be clipped to bounds or not.
protected  void setDirty()
          Call this method if this GraphicalObject's bounds have been changed.
 Interpreter setGestureInterpreter(Interpreter intrp)
          Set the current Gesture Interpreter, which tries to handle strokes as gestures.
 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.
protected  InteractionHandler setInteractionHandler(InteractionHandler newHandler)
          Set the interaction handler.
protected  void setLocalBoundingPoints2DRef(Polygon2D poly)
          Set the reference to the bounding points.
 void setParentGroup(GraphicalObjectGroup newParent)
          This method should not normally be used.
 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.
protected  void setTransformInternal(AffineTransform newTx)
          An internal version of setTransform() that does not try to update the normalizing transform.
 void setUniqueID(int newID)
          Set the ID of this GraphicalObject.
 void setView(View v)
          Set the View for this GraphicalObject.
protected  ViewHandler setViewHandler(ViewHandler newHandler)
          Set the view handler.
 void setVisible(boolean flag)
          Set whether this GraphicalObject should be displayed or not.
 boolean shapeContains(GraphicalObject gob)
          In most cases should not override this method.
 boolean shapeContains(int cdsys, double x, double y)
          In most cases should not override this method.
 boolean shapeContains(int cdsys, Point2D pt)
          In most cases should not override this method.
 boolean shapeContains(int cdsys, Shape s)
          In most cases should not override this method.
protected  boolean shapeContainsInternal(Point2D pt)
          Internal method.
protected  boolean shapeContainsInternal(Shape s)
          Internal method.
 boolean shapeIntersects(GraphicalObject gob)
          In most cases should not override this method.
 boolean shapeIntersects(int cdsys, Shape s)
          In most cases should not override this method.
protected  boolean shapeIntersectsInternal(Shape s)
          Internal method.
 String toDebugString()
          Some debugging info.
 String toString()
           
protected  void updateBoundingPoints()
          Update cached copies of our bounds.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphicalObjectImpl

public GraphicalObjectImpl()
Default constructor, does nothing fancy.

GraphicalObjectImpl

public GraphicalObjectImpl(GraphicalObjectImpl gob)
Constructor for clone-chaining purposes.

Cloning in Java is broken, since there is no clone chaining (like there is constructor chaining). This means that the bottom-most subclass has to do all of the work, unless you have constructors like these to help out.

Method Detail

setClassDebugProperty

public static void setClassDebugProperty(boolean flag)
Set graphical debugging mode.

getClassDebugProperty

public static boolean getClassDebugProperty()

setClassProperty

public final void setClassProperty(String strPropertyName,
                                   Object obj)
Convenience method to set a property.

getClassProperty

public final Object getClassProperty(String strPropertyName)
Convenience method to get a reference to the specified property.

setClassPropertyView

public final void setClassPropertyView(View v)
Convenience method for setting the view class property.

getClassPropertyView

public final View getClassPropertyView()
Convenience method for getting the view class property.

setClassPropertyStyle

public final void setClassPropertyStyle(Style s)
Convenience method for setting the view class property.

getClassPropertyStyle

public final Style getClassPropertyStyle()
Convenience method for getting the view class property.

setClassPropertyGestureInterpreter

public final void setClassPropertyGestureInterpreter(Interpreter intrp)
Convenience method for setting the view class property.

getClassPropertyGestureInterpreter

public final Interpreter getClassPropertyGestureInterpreter()
Convenience method for getting the view class property.

setClassPropertyInkInterpreter

public final void setClassPropertyInkInterpreter(Interpreter intrp)
Convenience method for setting the view class property.

getClassPropertyInkInterpreter

public final Interpreter getClassPropertyInkInterpreter()
Convenience method for getting the view class property.

createNewInteractionHandler

protected InteractionHandler createNewInteractionHandler()
Override this method if you want to use your own InteractionHandler. This method is called automatically in the constructor.

getInteractionHandler

protected InteractionHandler getInteractionHandler()
Get the interaction handler, the object that we delegate most of our interactions to.

setInteractionHandler

protected InteractionHandler setInteractionHandler(InteractionHandler newHandler)
Set the interaction handler.

createNewViewHandler

protected ViewHandler createNewViewHandler()
Override this method if you want to use your own ViewHandler. This method is called automatically in the constructor.

getViewHandler

protected ViewHandler getViewHandler()
Get the view handler, the object that we delegate most of our views to.

setViewHandler

protected ViewHandler setViewHandler(ViewHandler newHandler)
Set the view handler.

getUniqueID

public int getUniqueID()
Description copied from interface: GraphicalObject
Get the ID of this GraphicalObject. This value should be set by the constructor.
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)
Description copied from interface: GraphicalObject
Set the ID of this GraphicalObject. It is designed for network access, and should not normally be called.
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)

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.

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.

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.

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.

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

setDirty

protected void setDirty()
Call this method if this GraphicalObject's bounds have been changed. Normally, you will not use this method.
See Also:
isDirty()

isDirty

protected boolean isDirty()
Check if this GraphicalObject's bounds are dirty (ie the GraphicalObject has been moved or reshaped, etc) and should be recalculated. Normally, you will not have to use this method.
See Also:
setDirty()

updateBoundingPoints

protected void updateBoundingPoints()
Update cached copies of our bounds.

setTransformInternal

protected void setTransformInternal(AffineTransform newTx)
An internal version of setTransform() that does not try to update the normalizing transform. Used by the ViewHandler when mucking around with the normalizing transform, in order to prevent mutually recursive calls.

setLocalBoundingPoints2DRef

protected void setLocalBoundingPoints2DRef(Polygon2D poly)
Set the reference to the bounding points.

getLocalBoundingPoints2DRef

protected Polygon2D getLocalBoundingPoints2DRef()
Get a reference of the local bounding points instead of a copy. Internal method.

You can override this behavior to grab the bounding points from somewhere else instead of from the views if you want.

Because this method can be overridden, ViewHandler's method ViewHandler.getViewBoundingPoints2DRef() should not be called. Instead, this method should be used.


getBoundingPoints2DRef

protected Polygon2D getBoundingPoints2DRef()
Get a reference of the relative bounding points instead of a copy. Internal method.

You can override this behavior to grab the bounding points from somewhere else instead of from the views if you want.


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.

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

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

setParentGroup

public void setParentGroup(GraphicalObjectGroup newParent)
This method should not normally be used. Add a Graphical Object into a Graphical Object Group instead.
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.

getParentGroup

public GraphicalObjectGroup getParentGroup()
Description copied from interface: GraphicalObject
Get the parent of this Graphical 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.

getSheet

public Sheet getSheet()
Description copied from interface: GraphicalObject
Get the sheet that this Graphical object is in.
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()
Description copied from interface: GraphicalObject
Delete this object. Useful only if this object has a parent. Essentially, this means that you cannot delete the root of the interactor tree.

Also notifies Watchers of a delete when called.

Specified by:
delete in interface GraphicalObject

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

minLocalDistance

protected float minLocalDistance(double x,
                                 double y)
Assumes the specified point is in local coordinates. Override this method if needed.

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.

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)

shapeContainsInternal

protected boolean shapeContainsInternal(Point2D pt)
Internal method. Assumes pt is already in local coordinates. Override for specific Graphical Object behavior.

shapeContainsInternal

protected boolean shapeContainsInternal(Shape s)
Internal method. Assumes s is already in local coordinates. Override for specific Graphical Object behavior.

shapeIntersectsInternal

protected boolean shapeIntersectsInternal(Shape s)
Internal method. Assumes s is already in local coordinates. Override for specific Graphical Object behavior.

shapeContains

public boolean shapeContains(GraphicalObject gob)
In most cases should not override this method.
Specified by:
shapeContains in interface GraphicalObject
See Also:
for overriding.

shapeContains

public boolean shapeContains(int cdsys,
                             Point2D pt)
In most cases should not override this method.
Specified by:
shapeContains in interface GraphicalObject
See Also:
for overriding.

shapeContains

public boolean shapeContains(int cdsys,
                             double x,
                             double y)
In most cases should not override this method.
Specified by:
shapeContains in interface GraphicalObject
See Also:
for overriding.

shapeContains

public boolean shapeContains(int cdsys,
                             Shape s)
In most cases should not override this method.
Specified by:
shapeContains in interface GraphicalObject
See Also:
for overriding.

shapeIntersects

public boolean shapeIntersects(GraphicalObject gob)
In most cases should not override this method.
Specified by:
shapeIntersects in interface GraphicalObject
See Also:
for overriding.

shapeIntersects

public boolean shapeIntersects(int cdsys,
                               Shape s)
In most cases should not override this method.
Specified by:
shapeIntersects in interface GraphicalObject
See Also:
for overriding.

contains

public boolean contains(double x,
                        double y)
See if this GraphicalObject contains the specified point.

Use GraphicalObjectLib.toLocalCoordinates(GraphicalObject, Point2D, GraphicalObject) or GraphicalObjectLib.toLocalCoordinates(GraphicalObject, Point2D, GraphicalObject, Point2D) to convert the point. Since you want the coordinates in relative coordinates (ie our parent's coordinates), you would do something like: dst.contains( GraphicalObjectLib.toLocalCoordinates(src, pt, dst.getParentGroup()) ); In most cases should not override this method.

Specified by:
contains in interface Shape
Parameters:
x - is the x-coordinate of the point (relative coords).
y - is the y-coordinate of the point (relative coords).
See Also:
for overriding.

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
See if this GraphicalObject contains the specified rectangle.

In most cases should not override this method.

Specified by:
contains in interface Shape
Parameters:
x - is the top-left of the rectangle (in this GraphicalObject's coordinate space, ie relative).
y - is the top-left of the rectangle (in this GraphicalObject's coordinate space, ie relative).
w - is the width of the rectangle.
h - is the height of the rectangle.
See Also:
for overriding., for an example of converting coordinate systems correctly.

contains

public boolean contains(Point2D p)
See if this GraphicalObject contains the specified point.

In most cases should not override this method.

Specified by:
contains in interface Shape
Parameters:
p - is the point to check (in this GraphicalObject's coordinate space, ie relative).
See Also:
for overriding., for an example of converting coordinate systems correctly.

contains

public boolean contains(Rectangle2D r)
See if this GraphicalObject contains the specified rectangle.

In most cases should not override this method.

Specified by:
contains in interface Shape
Parameters:
r - is the rectangle to check (in this GraphicalObject's coordinate space, ie relative).
See Also:
for overriding.

getBounds

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

getBounds2D

public Rectangle2D getBounds2D()
Get the relative bounds.
Specified by:
getBounds2D in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Get the path iterator, relative coordinates. Supppose that if you wanted to get the absolute bounds path iterator, you could call getPathIterator(getAbsoluteTransform()).

In most cases should not override this method.

Specified by:
getPathIterator in interface Shape
See Also:
for overriding.

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)
Check if the specified rectangle intersects this GraphicalObject (relative coordinates).

In most cases should not override this method.

Specified by:
intersects in interface Shape
See Also:
for overriding., for an example of converting coordinate systems correctly.

intersects

public boolean intersects(Rectangle2D r)
Check if the specified rectangle intersects this GraphicalObject (relative coordinates).

In most cases should not override this method.

Specified by:
intersects in interface Shape
See Also:
for overriding.

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

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)
Description copied from interface: GraphicalObject
If this GraphicalObject Watchable.hasNotifyEnabled(), mark this GraphicalObject as damaged and repaint.
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)
Description copied from interface: GraphicalObject
If this GraphicalObject Watchable.hasNotifyEnabled(), mark the specified GraphicalObject as damaged and repaint.
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)
Description copied from interface: GraphicalObject
If this GraphicalObject Watchable.hasNotifyEnabled(), mark the specified region as damaged and repaint.
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 oldBounds,
                   Rectangle2D newBounds)
Description copied from interface: GraphicalObject
If this GraphicalObject Watchable.hasNotifyEnabled(), mark the specified regions as damaged and repaint. This method is typically used when transforms are applied, when the GraphicalObject was in one place and is now in another.
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 final void render(SatinGraphics g)
Don't override this method. Instead, add a View to the ViewHandler.
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.

defaultRender

protected abstract void defaultRender(SatinGraphics g)
The default method for rendering. This method is used by the DefaultView to render. Override this method in subclasses.

renderDebug

protected void renderDebug(SatinGraphics g,
                           Rectangle2D rect)
Render the graphical debugging information.

This method is called only if this Graphical Object's view is visible (see and View#isVisible()), and if it is not the current stroke.

Default behavior is to render the absolute bounding box and absolute coordinates of the bounding box.

Override this method in a subclass to change how the debugging information is rendered on screen. When this method is called, SatinGraphics.ignoreTransforms() has already been called for you. After this method is done, SatinGraphics.dontIgnoreTransforms() will be called for you. In other words, you are in absolute coordinates for rendering.

Parameters:
g - is the SatinGraphics context.
rect - is the bounding box (absolute coordinates).

renderSelected

protected void renderSelected(SatinGraphics g,
                              Rectangle2D rect)
Render how this Graphical Object is displayed when selected.

This method is called only if this Graphical Object's view is visible (see and View#isVisible()).

Default behavior is to render selection handles around the bounding box.

Override this method in a subclass to change how the debugging information is rendered on screen. When this method is called, SatinGraphics.ignoreTransforms() has already been called for you. After this method is done, SatinGraphics.dontIgnoreTransforms() will be called for you. In other words, you are in absolute coordinates for rendering.

Parameters:
g - is the SatinGraphics context.
rect - is the bounding box (absolute coordinates).

renderSelectionHandle

protected void renderSelectionHandle(SatinGraphics g,
                                     int x,
                                     int y)
Paint a selection handle centered at the specified coordinate.
Parameters:
x - is the x-coordinate to paint at.
y - is the y-coordinate to paint at.

renderAllCoordBounds

protected void renderAllCoordBounds(SatinGraphics g,
                                    Rectangle2D bounds)
Render the tiny boxes displaying the numerical coordinates of the bounding box.

renderBoundingBox

protected void renderBoundingBox(SatinGraphics g,
                                 Rectangle2D bounds)
Render the bounding box around this GraphicalObject.

renderDimensions

protected void renderDimensions(SatinGraphics g,
                                Rectangle2D bounds)
Render the height and width of this GraphicalObject.

equals

public boolean equals(Object obj)
Simply tests if the two IDs are the same or not.
Overrides:
equals in class Object
Returns:
true if the GraphicalObjects are the same, false otherwise.

clone

public Object clone()
My clone sleeps alone...
Specified by:
clone in interface GraphicalObject
Overrides:
clone in class Object

clone

protected GraphicalObjectImpl clone(GraphicalObjectImpl gobClone)
Clone all of the state in the current GraphicalObject into the passed GraphicalObject. This is necessary for clone chaining. Does not set the parent, though, as that doesn't quite make sense.
Parameters:
gobClone - is a GraphicalObject that will get the same GraphicalObject state as the current Graphical Object.
Returns:
a reference to gobClone.

deepClone

public Object deepClone()
If you do not override this method, it calls clone() by default.
Specified by:
deepClone in interface GraphicalObject

deepClone

protected GraphicalObjectImpl deepClone(GraphicalObjectImpl gobClone)

getPresentationName

public String getPresentationName()

toString

public final String toString()
Overrides:
toString in class Object

toDebugString

public String toDebugString()
Some debugging info. The general rule used for all toStrings() in SATIN is to use "\n" for newlines, and not to have a terminating newline. Override this method in subclasses.

Do not call method toString() in any implementation of toDebugString(). Method toString() calls toDebugString().


Copyright Information