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

edu.berkeley.guir.lib.satin
Class Sheet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--edu.berkeley.guir.lib.satin.Sheet
All Implemented Interfaces:
Accessible, Cloneable, EventListener, GraphicalObject, GraphicalObjectCollection, GraphicalObjectGroup, ImageObserver, MenuContainer, SatinConstants, Serializable, Shape, StrokeListener, Watchable, Watcher
Direct Known Subclasses:
Brainstorm, BrainstormSheet, Posterboard, SketchySpice

public class Sheet
extends JPanel
implements GraphicalObjectGroup, SatinConstants, GraphicalObjectCollection, GraphicalObject, Watchable, Watcher, Shape, StrokeListener

Essentially a SATIN Panel. The Panel contains patches and screen objects.

There are a number of ways of configuring how the Sheet handles strokes by default. They include:

To change the background color, use setBackground(Color) just like a normal JComponent.

Be very careful about calling repaint, as that may cause strange painting errors, especially during animation. It's safer to use the damage(int) methods included in this class.

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v1.0-1.0.0, May 19 1998, JH
               Created 
             - SATIN-v2.1-1.0.0, Aug 11 2000, JH
               Touched for SATIN release
 

Since:
JDK 1.3RC1
Version:
SATIN-v2.1-1.0.0, Aug 11 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )
See Also:
Serialized Form

Inner Class Summary
 class Sheet.SheetGraphicalObjectGroup
          This class handles the Graphical Objects in the sheet.
 
Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
Inner classes inherited from class edu.berkeley.guir.lib.satin.SatinConstants
SatinConstants.ObjectPoolAffineTransform, SatinConstants.ObjectPoolPoint2D, SatinConstants.ObjectPoolPolygon2D, SatinConstants.ObjectPoolRectangle2D, SatinConstants.ObjectPoolStringBuffer, SatinConstants.UniqueAffineTransform, SatinConstants.UniquePoint2D, SatinConstants.UniquePolygon2D, SatinConstants.UniqueRectangle2D
 
Field Summary
protected  StrokeEventFilter addFilter
           
static String BACKGROUND_COLOR_DEFAULT
           
static String BACKGROUND_COLOR_PROPERTY
           
static String CURRENTSTROKE_STYLE_FILE
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
DEFAULT_POS_POLICY, KEEP_ABS_POS, KEEP_REL_POS
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Sheet()
          Default constructor.
Sheet(Dimension dim)
          Create a Sheet with the specified width and height dimensions.
Sheet(int w, int h)
          Create a Sheet with the specified width and height.
 
Method Summary
 GraphicalObject add(GraphicalObject gob)
          Add a GraphicalObject to the top layer.
 GraphicalObject add(GraphicalObject gob, int pos)
          Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
 GraphicalObject add(int index, GraphicalObject gob)
          Add a Graphical Object to the specified location.
 GraphicalObject add(int index, GraphicalObject gob, int pos)
          Add a GraphicalObject to the specified layer of this group, specifying the GraphicalObject's position at the same time.
 void addIndexedProperty(String strPropertyName, Object newVal)
           
 GraphicalObject addToBack(GraphicalObject gob)
          Add a GraphicalObject to the bottom layer.
 GraphicalObject addToBack(GraphicalObject gob, int pos)
          Add a GraphicalObject to the bottom layer.
 GraphicalObject addToFront(GraphicalObject gob)
          Add a GraphicalObject to the top layer.
 GraphicalObject addToFront(GraphicalObject gob, int pos)
          Add a GraphicalObject to the top layer.
 Watcher addWatcher(Watcher w)
          Add a watcher to this object.
 void applyTransform(AffineTransform tr)
          Apply an affine Transform to this Graphical Object.
 void bringDownALayer()
          Bring this Graphical Object down one layer in its current group.
 void bringDownALayer(GraphicalObject gob)
          Move the specified GraphicalObject down one layer in this Graphical Object Group.
 void bringDownNLayers(GraphicalObject gob, int n)
          Move the specified GraphicalObject down N layers in this 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 bringToBottomLayer(GraphicalObject gob)
          Move the specified Graphical Object to the bottom layer of this Graphical Object Group.
 void bringToTopLayer()
          Bring this Graphical Object to the top of its current group.
 void bringToTopLayer(GraphicalObject gob)
          Move the specified Graphical Object to the top layer of this Graphical Object Group.
 void bringUpALayer()
          Bring this Graphical Object up one layer in its current group.
 void bringUpALayer(GraphicalObject gob)
          Move the specified GraphicalObject up one layer in this Graphical Object Group.
 void bringUpNLayers(GraphicalObject gob, int n)
          Move the specified GraphicalObject up N layers in this Group.
 void bringUpNLayers(int n)
          Bring this Graphical Object up N layers in its current group.
 void clear()
          Clear out everything on the Sheet.
 void clearIndexedProperty(String strPropertyName)
           
 void clearWatchers()
          Delete all watchers on this object.
 Object clone()
          My clone sleeps alone as a shallow clone.
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(GraphicalObject gob)
          See if this Graphical Object Collection contains the specified Graphical Object.
 boolean contains(Point2D p)
           
 boolean contains(Rectangle2D r)
           
protected  void copyInternal()
          Called when the user copies by keyboard.
 int countWatchers()
          Count the number of watchers watching this object.
protected  void cutInternal()
          Called when the user cuts by keyboard.
 void damage(int sync)
          If this GraphicalObject hasNotifyEnabled(), mark this GraphicalObject as damaged and repaint.
 void damage(int sync, GraphicalObject gob)
          Damage an area for repainting.
 void damage(int sync, Rectangle2D rect)
          Damage an area for immediate repainting.
 void damage(int sync, Rectangle2D oldRect, Rectangle2D newRect)
          If this GraphicalObject hasNotifyEnabled(), mark the specified regions as damaged and repaint.
 Object deepClone()
          My clone sleeps alone as a deep clone.
 void delete()
          Ignore.
protected  void deleteInternal()
          Called when the user deletes by keyboard.
 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.
 GraphicalObject get(int index)
          Get the Graphical Object at the specified index.
 String getAbsoluteLayer()
          Get the absolute layer this group is in.
 String getAbsoluteLayer(GraphicalObject gob)
          Given a GraphicalObject, return its absolute layer position.
 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.
 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.
 Rectangle2D getCollectionBounds2D(int cdsys)
          Get the union of the bounds of the GraphicalObjects contained in this collection.
 Rectangle2D getCollectionBounds2D(int cdsys, Rectangle2D rect)
          Get the bounds, put them in the specified Rectangle.
 Style getCurrentStyle()
          Get the style for how the current stroke is drawn.
 GraphicalObject getFirst()
          Get the first Graphical Object.
 Iterator getForwardIterator()
          Get an iterator that goes forward thru the collection.
 Interpreter getGestureInterpreter()
          Get the current Gesture Interpreter, which tries to handle strokes as gestures.
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
          Get all Graphical Objects subject to the specified parameters.
 GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
          Get all Graphical Objects subject to the specified parameters.
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype)
           
 GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
           
 float getHeight2D(int cdsys)
          Get the height of all of the visible views of this GraphicalObject.
 GraphicalObject getID(int id)
          Retrieve the GraphicalObject with the specified unique ID.
 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 tx)
          Get the inverse transform.
 GraphicalObject getLast()
          Get the last Graphical Object.
 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)
           
 PathIterator getPathIterator(AffineTransform at, double flatness)
           
 Object getProperty(String strPropertyName)
           
 Iterator getPropertyNames()
           
 String getRelativeLayer()
          Get the current layer this Graphical Object is in.
 String getRelativeLayer(GraphicalObject gob)
          Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
 Iterator getReverseIterator()
          Get an iterator that goes backwards thru the collection.
 Style getSelectedStyle()
          Get the style for how the selected objects are drawn.
 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.
 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.
 int indexOf(GraphicalObject gob)
          Find the index of the specified Graphical Object.
 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 isEmpty()
          Is this collection empty?
 boolean isEnabled()
          Check whether ink is enabled for this Sheet or not.
 boolean isFocusTraversable()
           
 boolean isSelectable()
          Check whether or not this Graphical Object can be selected.
 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 newVal, Object oldVal)
          Notify the watchers that some value has been changed.
 int numElements()
          Get the number of elements contained in this collection.
 void onDelete(Watchable w)
          Callback method for notifications of deletions, that is this Graphical Object has been deleted and you should remove it.
 void onNewStroke(NewStrokeEvent evt)
          Start dispatching a new stroke.
 void onNotify(Watchable w, Object arg)
          Callback method for generic notifications.
 void onSingleStroke(SingleStrokeEvent evt)
           
 void onUpdate(Watchable w, Object arg)
          Callback method for notifications.
 void onUpdate(Watchable w, String strProperty, Object oldVal, Object newVal)
          Callback method for notifications.
 void onUpdateStroke(UpdateStrokeEvent evt)
           
 void paintComponent(Graphics g)
           
protected  void pasteInternal()
          Called when the user pastes by keyboard.
 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)
           
protected  void redoInternal()
          Called when the user redoes an action by keyboard.
 GraphicalObject remove(GraphicalObject gob)
          Remove a Graphical Object from this collection.
 void removeAll(GraphicalObjectCollection gobcol)
          Remove from this Group all of the GraphicalObjects in the collection.
 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 setAcceptLeftButton(boolean flag)
          Set whether any left-button strokes will be dispatched at all.
 void setAcceptMiddleButton(boolean flag)
          Set whether any middle-button strokes will be dispatched at all.
 void setAcceptRightButton(boolean flag)
          Set whether any right-button strokes will be dispatched at all.
 void setAddLeftButtonStrokes(boolean flag)
          Set whether left-button strokes will be added.
 void setAddMiddleButtonStrokes(boolean flag)
          Set whether middle-button strokes will be added.
 void setAddRightButtonStrokes(boolean flag)
          Set whether right-button strokes will be added.
 void setAutoScroll(boolean flag)
           
 void setBackground(Color bkgrd)
           
 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.
 Style setCurrentStyle(Style newStyle)
          Set the style for how the current stroke is drawn.
 void setDrawLeftButtonStrokes(boolean flag)
          Set whether left-button strokes will be drawn.
 void setDrawMiddleButtonStrokes(boolean flag)
          Set whether middle-button strokes will be drawn.
 void setDrawRightButtonStrokes(boolean flag)
          Set whether right-button strokes will be drawn.
 void setEnabled(boolean flag)
          Set whether ink is enabled for this Sheet or not.
 Interpreter setGestureInterpreter(Interpreter intrp)
          Set the current Gesture Interpreter, which tries to handle strokes as gestures.
 void setHasClosedBoundingPoints(boolean flag)
          Ignored, since we always have closed bounding points.
 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)
          This method should not normally be used.
 void setProperty(String strPropertyName, Object newVal)
           
 void setRelativeLayer(GraphicalObject gob, int layer)
          Given a GraphicalObject, set what layer it is in relative to this Graphical Object Group.
 void setRelativeLayer(int layer)
          A convenience method to set what layer this object is in.
 void setSelectable(boolean flag)
          Ignored.
 Style setSelectedStyle(Style newStyle)
          Set the style for how the selected objects are drawn.
 void setSheet(Sheet sheet)
          Set this sheet to be the same as the specified sheet.
 void setSize(Dimension dim)
           
 void setSize(int w, int h)
           
 Style setStyle(Style newStyle)
          Set the current Style for this Graphical Object.
 void setTransform(AffineTransform tr)
          Set and apply a copy of the specified AffineTransform to this GraphicalObject.
 void setUniqueID(int newID)
          Set the ID of this GraphicalObject.
 void setView(View v)
          Set the View for this GraphicalObject.
 boolean shapeContains(GraphicalObject gob)
          Yes, we contain everything.
 boolean shapeContains(int cdsys, double x, double y)
          Yes, we contain everything.
 boolean shapeContains(int cdsys, Point2D pt)
          Yes, we contain everything.
 boolean shapeContains(int cdsys, Shape s)
          Yes, we contain everything.
 boolean shapeIntersects(GraphicalObject gob)
          Yes, we intersect everything.
 boolean shapeIntersects(int cdsys, Shape s)
          Yes, we intersect everything.
 void sort(Comparator c)
          Actually does nothing, since ordering is imposed by layers.
 String toString()
          Return debugging information for the entire system.
protected  void undoInternal()
          Called when the user undoes an action by keyboard.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObject
isVisible, setVisible
 
Methods inherited from interface java.awt.Shape
getBounds
 

Field Detail

BACKGROUND_COLOR_PROPERTY

public static String BACKGROUND_COLOR_PROPERTY

BACKGROUND_COLOR_DEFAULT

public static String BACKGROUND_COLOR_DEFAULT

CURRENTSTROKE_STYLE_FILE

public static String CURRENTSTROKE_STYLE_FILE

addFilter

protected StrokeEventFilter addFilter
Constructor Detail

Sheet

public Sheet()
Default constructor.

Sheet

public Sheet(int w,
             int h)
Create a Sheet with the specified width and height.
Parameters:
w - is the width of the Sheet.
h - is the height of the Sheet.

Sheet

public Sheet(Dimension dim)
Create a Sheet with the specified width and height dimensions.
Parameters:
dim - is the width and height dimensions.
Method Detail

undoInternal

protected void undoInternal()
Called when the user undoes an action by keyboard.

redoInternal

protected void redoInternal()
Called when the user redoes an action by keyboard.

pasteInternal

protected void pasteInternal()
Called when the user pastes by keyboard.

cutInternal

protected void cutInternal()
Called when the user cuts by keyboard.

copyInternal

protected void copyInternal()
Called when the user copies by keyboard.

deleteInternal

protected void deleteInternal()
Called when the user deletes by keyboard.

setSheet

public void setSheet(Sheet sheet)
Set this sheet to be the same as the specified sheet. Handy for deserialization. Don't use the passed-in variable after calling this method, as it will be stripped bare.
Parameters:
sheet - is the Sheet that contains the objects that we want. Don't use variable sheet after calling this method, since many of the variables will be shared, and since we move all of the GraphicalObjects from the passed-in sheet to this sheet.

setAutoScroll

public void setAutoScroll(boolean flag)

setEnabled

public void setEnabled(boolean flag)
Set whether ink is enabled for this Sheet or not.
Overrides:
setEnabled in class JComponent

isEnabled

public boolean isEnabled()
Check whether ink is enabled for this Sheet or not.
Overrides:
isEnabled in class Component

setAcceptLeftButton

public void setAcceptLeftButton(boolean flag)
Set whether any left-button strokes will be dispatched at all.

setAcceptMiddleButton

public void setAcceptMiddleButton(boolean flag)
Set whether any middle-button strokes will be dispatched at all.

setAcceptRightButton

public void setAcceptRightButton(boolean flag)
Set whether any right-button strokes will be dispatched at all.

setDrawLeftButtonStrokes

public void setDrawLeftButtonStrokes(boolean flag)
Set whether left-button strokes will be drawn.

setDrawMiddleButtonStrokes

public void setDrawMiddleButtonStrokes(boolean flag)
Set whether middle-button strokes will be drawn.

setDrawRightButtonStrokes

public void setDrawRightButtonStrokes(boolean flag)
Set whether right-button strokes will be drawn.

setAddLeftButtonStrokes

public void setAddLeftButtonStrokes(boolean flag)
Set whether left-button strokes will be added.

setAddMiddleButtonStrokes

public void setAddMiddleButtonStrokes(boolean flag)
Set whether middle-button strokes will be added.

setAddRightButtonStrokes

public void setAddRightButtonStrokes(boolean flag)
Set whether right-button strokes will be added.

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)

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)

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)

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.

setCurrentStyle

public Style setCurrentStyle(Style newStyle)
Set the style for how the current stroke is drawn.

getCurrentStyle

public Style getCurrentStyle()
Get the style for how the current stroke is drawn.

setSelectedStyle

public Style setSelectedStyle(Style newStyle)
Set the style for how the selected objects are drawn.

getSelectedStyle

public Style getSelectedStyle()
Get the style for how the selected objects are drawn.

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

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

bringToTopLayer

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

Notifies Watchers of an update when called.

Specified by:
bringToTopLayer in interface GraphicalObject

bringToBottomLayer

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

Notifies Watchers of an update when called.

Specified by:
bringToBottomLayer in interface GraphicalObject

applyTransform

public void applyTransform(AffineTransform tr)
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 tr)
Description copied from interface: GraphicalObject
Set and apply a copy of the specified AffineTransform to this GraphicalObject.

Notifies Watchers of an update when called.

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

getTransformRef

public AffineTransform getTransformRef()
Description copied from interface: GraphicalObject
Get a reference to the current transform. For optimization purposes.
Specified by:
getTransformRef in interface GraphicalObject

getTransform

public AffineTransform getTransform(int cdsys)
Description copied from interface: GraphicalObject
Get a copy of the current transform for this GraphicalObject.
Specified by:
getTransform in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system.
Returns:
a copy of the current Transform.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getTransform

public AffineTransform getTransform(int cdsys,
                                    AffineTransform outTx)
Description copied from interface: GraphicalObject
Get a copy of the current transform, putting the results in outTx.
Specified by:
getTransform in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system.
outTx - is the storage space.
Returns:
a reference to outTx.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getInverseTransform

public AffineTransform getInverseTransform(int cdsys)
Description copied from interface: GraphicalObject
Get the inverse of the transform.
Specified by:
getInverseTransform in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
the inverse transform in the specified coordinate system.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getInverseTransform

public AffineTransform getInverseTransform(int cdsys,
                                           AffineTransform tx)
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

setHasClosedBoundingPoints

public void setHasClosedBoundingPoints(boolean flag)
Ignored, since we always have closed bounding points.
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
Returns:
true always.

minDistance

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

minDistance

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

getLocation2D

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

getLocation2D

public Point2D getLocation2D(int cdsys,
                             AffineTransform tx,
                             Point2D pt)
Description copied from interface: GraphicalObject
Get the location of the top-left corner of the bounding box for all of the visible views of this GraphicalObject.
Specified by:
getLocation2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
tx - is the transform to apply after the location is retrieved. Use null for none.
pt - is where to store the output. Use null to create a new point. Use for optimization purposes.
Returns:
a reference to pt.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBounds2D

public Rectangle2D getBounds2D(int cdsys)
Description copied from interface: GraphicalObject
Get the bounds of all of the visible views of this GraphicalObject.
Specified by:
getBounds2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
a reference to rect.
See Also:
GraphicalObject.getBounds2D(int), SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBounds2D

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

getBoundingPoints2D

public Polygon2D getBoundingPoints2D(int cdsys)
Description copied from interface: GraphicalObject
Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
Specified by:
getBoundingPoints2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
Returns:
a Polygon representing this GraphicalObject's bounding points.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getBoundingPoints2D

public Polygon2D getBoundingPoints2D(int cdsys,
                                     AffineTransform tx,
                                     Polygon2D poly)
Description copied from interface: GraphicalObject
Get a Polygon describing the outer boundary of all of the visible views of this GraphicalObject.
Specified by:
getBoundingPoints2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
tx - is the transform to apply after the location is retrieved. Use null for none.
poly - is the Polygon to put the results in. Use null to create a new Polygon. Use for optimization purposes.
Returns:
a reference to poly.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getWidth2D

public float getWidth2D(int cdsys)
Description copied from interface: GraphicalObject
Get the width of all of the visible views of this GraphicalObject.
Specified by:
getWidth2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

getHeight2D

public float getHeight2D(int cdsys)
Description copied from interface: GraphicalObject
Get the height of all of the visible views of this GraphicalObject.
Specified by:
getHeight2D in interface GraphicalObject
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObject
Parameters:
cdsys - is the coordinate system to use.
See Also:
SatinConstants.COORD_LOCAL, SatinConstants.COORD_REL, SatinConstants.COORD_ABS

shapeContains

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

shapeContains

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

shapeContains

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

shapeContains

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

shapeIntersects

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

shapeIntersects

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

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
Returns:
false always.

setSelectable

public void setSelectable(boolean flag)
Ignored.
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

contains

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

contains

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

contains

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

contains

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

getBounds2D

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

getPathIterator

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

getPathIterator

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

intersects

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

intersects

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

onNewStroke

public void onNewStroke(NewStrokeEvent evt)
Start dispatching a new stroke. Renders the stroke if and only if the draw filter accepts this event (see setDrawLeftButtonStrokes(boolean)), and if the event says it should render (see SatinEvent.setShouldRender(boolean)).
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
See Also:
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
See Also:
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)

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,
                   Rectangle2D rect)
Damage an area for immediate repainting.
Specified by:
damage in interface GraphicalObject
Parameters:
rect - is the region to repaint.

damage

public void damage(int sync,
                   GraphicalObject gob)
Damage an area for repainting.
Specified by:
damage in interface GraphicalObject
Parameters:
gob - is the GraphicalObject to repaint.

damage

public void damage(int sync,
                   Rectangle2D oldRect,
                   Rectangle2D newRect)
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

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
See Also:
GraphicalObject.setParentGroup(GraphicalObjectGroup)

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()
Ignore. Doesn't make sense to delete the Sheet.
Specified by:
delete in interface GraphicalObject

getRelativeLayer

public String getRelativeLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, return what layer it is in relative to this Graphical Object Group.
Specified by:
getRelativeLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to check out.
Returns:
the relative layer, or empty string if the specified Graphical Object is not contained by this group.
See Also:
GraphicalObject.getRelativeLayer()

setRelativeLayer

public void setRelativeLayer(GraphicalObject gob,
                             int layer)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, set what layer it is in relative to this Graphical Object Group.
Specified by:
setRelativeLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to move.
layer - is the layer to move to.
See Also:
GraphicalObject.setRelativeLayer(int)

getAbsoluteLayer

public String getAbsoluteLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Given a GraphicalObject, return its absolute layer position.
Specified by:
getAbsoluteLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the contained Graphical Object to check out.
Returns:
the absolute layer, or empty string if the specified Graphical Object is not contained by this group.
See Also:
GraphicalObject.getAbsoluteLayer()

bringUpALayer

public void bringUpALayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject up one layer in this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringUpALayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringUpALayer()

bringUpNLayers

public void bringUpNLayers(GraphicalObject gob,
                           int n)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject up N layers in this Group. Tries to move the GraphicalObject as many layers as possible. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringUpNLayers in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
n - is the number of layers to move.
See Also:
GraphicalObject.bringUpNLayers(int)

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(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject down one layer in this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringDownALayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringDownALayer()

bringDownNLayers

public void bringDownNLayers(GraphicalObject gob,
                             int n)
Description copied from interface: GraphicalObjectGroup
Move the specified GraphicalObject down N layers in this Group. Tries to move the GraphicalObject as many layers as possible. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringDownNLayers in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
n - is the number of layers to move.
See Also:
GraphicalObject.bringDownNLayers(int)

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(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified Graphical Object to the top layer of this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringToTopLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToTopLayer()

bringToBottomLayer

public void bringToBottomLayer(GraphicalObject gob)
Description copied from interface: GraphicalObjectGroup
Move the specified Graphical Object to the bottom layer of this Graphical Object Group. Does nothing if the specified Graphical Object is not contained by this Graphical Object Group.
Specified by:
bringToBottomLayer in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object to move.
See Also:
GraphicalObject.bringToBottomLayer()

add

public GraphicalObject add(GraphicalObject gob)
Add a GraphicalObject to the top layer.
Specified by:
add in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the GraphicalObject to add.
Returns:
a reference to the GraphicalObject added.

addToBack

public GraphicalObject addToBack(GraphicalObject gob)
Add a GraphicalObject to the bottom layer.
Specified by:
addToBack in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object to add.
Returns:
a reference to the GraphicalObject added.

addToFront

public GraphicalObject addToFront(GraphicalObject gob)
Add a GraphicalObject to the top layer.
Specified by:
addToFront in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object to add.
Returns:
a reference to the GraphicalObject added.

add

public GraphicalObject add(int index,
                           GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
Add a Graphical Object to the specified location.
Specified by:
add in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
index - is the location to add to (zero-based). It is up to the programmer to ensure that this is a valid value.
gob - is the Graphical Object to add.

add

public GraphicalObject add(GraphicalObject gob,
                           int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the top of this group, specifying the GraphicalObject's position at the same time.
Specified by:
add in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.
See Also:
GraphicalObjectGroup.addToFront(GraphicalObject, int)

addToBack

public GraphicalObject addToBack(GraphicalObject gob,
                                 int pos)
Add a GraphicalObject to the bottom layer.
Specified by:
addToBack in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

addToFront

public GraphicalObject addToFront(GraphicalObject gob,
                                  int pos)
Add a GraphicalObject to the top layer.
Specified by:
addToFront in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

add

public GraphicalObject add(int index,
                           GraphicalObject gob,
                           int pos)
Description copied from interface: GraphicalObjectGroup
Add a GraphicalObject to the specified layer of this group, specifying the GraphicalObject's position at the same time.
Specified by:
add in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
index - is the layer to add to. Lower numbers indicate the front (higher layers).
gob - is the GraphicalObject to add.
pos - is the GraphicalObject's position, either GraphicalObjectGroup.KEEP_ABS_POS or GraphicalObjectGroup.KEEP_REL_POS.

clear

public void clear()
Clear out everything on the Sheet. Also, clear out the selected objects.
Specified by:
clear in interface GraphicalObjectCollection

contains

public boolean contains(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
See if this Graphical Object Collection contains the specified Graphical Object. Please note that this is NOT the same as calling GraphicalObject.shapeContains(GraphicalObject).
Specified by:
contains in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
true if it contains the specified Graphical Object, false otherwise.

get

public GraphicalObject get(int index)
Description copied from interface: GraphicalObjectCollection
Get the Graphical Object at the specified index.
Specified by:
get in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
index - is the location to look at (zero-based). It is up to the programmer to ensure that this is a valid value.
Returns:
the Graphical Object at the specified index.

getFirst

public GraphicalObject getFirst()
Description copied from interface: GraphicalObjectCollection
Get the first Graphical Object.
Specified by:
getFirst in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
null if nothing is there.

getLast

public GraphicalObject getLast()
Description copied from interface: GraphicalObjectCollection
Get the last Graphical Object.
Specified by:
getLast in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
null if nothing is there.

getID

public GraphicalObject getID(int id)
Description copied from interface: GraphicalObjectCollection
Retrieve the GraphicalObject with the specified unique ID.
Specified by:
getID in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
id - is the unique ID of the GraphicalObject to retrieve.
Returns:
the GraphicalObject with that ID, or null if it isn't here.

getCollectionBounds2D

public Rectangle2D getCollectionBounds2D(int cdsys)
Description copied from interface: GraphicalObjectCollection
Get the union of the bounds of the GraphicalObjects contained in this collection. Asking for local bounds is useless.
Asking for relative bounds is useful only if all of the GraphicalObjects have the same parent.
Asking for absolute bounds will always work.
Specified by:
getCollectionBounds2D in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
cdsys - is the coordinate system to use.
Returns:
Rectangle representing the union of bounds.

getCollectionBounds2D

public Rectangle2D getCollectionBounds2D(int cdsys,
                                         Rectangle2D rect)
Description copied from interface: GraphicalObjectCollection
Get the bounds, put them in the specified Rectangle.
Specified by:
getCollectionBounds2D in interface GraphicalObjectCollection

indexOf

public int indexOf(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
Find the index of the specified Graphical Object.
Specified by:
indexOf in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object to look for.
Returns:
the index of the Graphical Object in this collection (zero-based) or -1 if it is not here.

isEmpty

public boolean isEmpty()
Description copied from interface: GraphicalObjectCollection
Is this collection empty?
Specified by:
isEmpty in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
true if empty, false otherwise.

sort

public void sort(Comparator c)
Actually does nothing, since ordering is imposed by layers.
Specified by:
sort in interface GraphicalObjectCollection

numElements

public int numElements()
Description copied from interface: GraphicalObjectCollection
Get the number of elements contained in this collection.

I realize that this should have been called size(), but there already exists a deprecated method in Component named size().

Specified by:
numElements in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
the number of elements contained.

remove

public GraphicalObject remove(GraphicalObject gob)
Description copied from interface: GraphicalObjectCollection
Remove a Graphical Object from this collection.
Specified by:
remove in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Parameters:
gob - is the Graphical Object ot remove.

getForwardIterator

public Iterator getForwardIterator()
Description copied from interface: GraphicalObjectCollection
Get an iterator that goes forward thru the collection.
Specified by:
getForwardIterator in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
an Iterator.

getReverseIterator

public Iterator getReverseIterator()
Description copied from interface: GraphicalObjectCollection
Get an iterator that goes backwards thru the collection.
Specified by:
getReverseIterator in interface GraphicalObjectCollection
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
Returns:
an Iterator.

removeAll

public void removeAll(GraphicalObjectCollection gobcol)
Description copied from interface: GraphicalObjectGroup
Remove from this Group all of the GraphicalObjects in the collection.
Specified by:
removeAll in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Point2D pt,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Description copied from interface: GraphicalObjectGroup
Get all Graphical Objects subject to the specified parameters. This version is for optimization or fine-tuning purposes.

Really big methods like this one are usually a warning sign, but I really don't see any alternatives.

Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
cdsys - is the coordinate system.
pt - is the point to get the Graphical Objects from.
num - is either SatinConstants.ALL or SatinConstants.FIRST.
depth - is either SatinConstants.SHALLOW or SatinConstants.DEEP
gettype - is the algorithm to use to retrieve, either SatinConstants.INTERSECTS, SatinConstants.CONTAINEDBY, SatinConstants.CONTAINS, SatinConstants.NEAR, SatinConstants.ABOVE, SatinConstants.BELOW,
thresh - is the threshold or halo to retrieve.
gobcol - is the storage for output. Use null to create new space.

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     double x,
                                                     double y,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Shape s,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype,
                                                     double thresh,
                                                     GraphicalObjectCollection out)
Description copied from interface: GraphicalObjectGroup
Get all Graphical Objects subject to the specified parameters. This version is for optimization or fine-tuning purposes.

Really big methods like this one are usually a warning sign, but I really don't see any alternatives.

Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
Parameters:
gob - is the Graphical Object whose bounding points to use.
num - is either SatinConstants.ALL or SatinConstants.FIRST.
depth - is either SatinConstants.SHALLOW or SatinConstants.DEEP
gettype - is the algorithm to use to retrieve, either SatinConstants.INTERSECTS, SatinConstants.CONTAINEDBY, SatinConstants.CONTAINS, SatinConstants.NEAR, SatinConstants.ABOVE, SatinConstants.BELOW,
thresh - is the threshold or halo to retrieve.
gobcol - is the storage for output. Use null to create new space.

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Point2D pt,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     double x,
                                                     double y,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(int cdsys,
                                                     Shape s,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup

getGraphicalObjects

public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob,
                                                     int num,
                                                     int depth,
                                                     int gettype)
Specified by:
getGraphicalObjects in interface GraphicalObjectGroup
Following copied from interface: edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
See Also:
GraphicalObjectGroup.getGraphicalObjects(GraphicalObject, int, int, int, double, GraphicalObjectCollection)

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 newVal,
                                 Object oldVal)
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

onNotify

public void onNotify(Watchable w,
                     Object arg)
Description copied from interface: Watcher
Callback method for generic notifications. This typically won't be used.
Specified by:
onNotify in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object notifying you.
arg - is some agreed upon argument.
See Also:
Watchable.notifyWatchers(), Watchable.notifyWatchers(java.lang.Object)

onUpdate

public void onUpdate(Watchable w,
                     Object arg)
Description copied from interface: Watcher
Callback method for notifications.
Specified by:
onUpdate in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object that has been updated.
arg - is some agreed upon argument.
See Also:
Watchable.notifyWatchersUpdate(Object)

onUpdate

public void onUpdate(Watchable w,
                     String strProperty,
                     Object oldVal,
                     Object newVal)
Description copied from interface: Watcher
Callback method for notifications.
Specified by:
onUpdate in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object that has been updated.
strProperty - is the name of the property to update.
oldVal - is the old value of the property. This should usually be a clone of the old value, so that modifying this value should have no effect. Whether this is a copy or a reference should be defined in the SatinConstants file.
newVal - is the new value of the property. This should usually be a clone of the old value, so that modifying this value should have no effect. However, don't clone if it is prohibitively expensive to do so. Whether this is a copy or a reference should be defined in the SatinConstants file.
See Also:
SatinConstants, Watchable.notifyWatchersUpdate(String, Object, Object)

onDelete

public void onDelete(Watchable w)
Description copied from interface: Watcher
Callback method for notifications of deletions, that is this Graphical Object has been deleted and you should remove it.
Specified by:
onDelete in interface Watcher
Following copied from interface: edu.berkeley.guir.lib.satin.watch.Watcher
Parameters:
w - is the Watchable object to be deleted.
See Also:
Watchable.notifyWatchersDelete()

setSize

public void setSize(int w,
                    int h)
Overrides:
setSize in class Component

setSize

public void setSize(Dimension dim)
Overrides:
setSize in class Component

isFocusTraversable

public boolean isFocusTraversable()
Overrides:
isFocusTraversable in class JComponent

setBackground

public void setBackground(Color bkgrd)
Overrides:
setBackground in class JComponent

render

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

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

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

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

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

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

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

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

paintComponent

public void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

toString

public String toString()
Return debugging information for the entire system. Warning: this can be quite large!
Overrides:
toString in class Component

clone

public Object clone()
My clone sleeps alone as a shallow clone. Not implemented.
Specified by:
clone in interface GraphicalObject
Overrides:
clone in class Object

deepClone

public Object deepClone()
My clone sleeps alone as a deep clone. Not implemented.
Specified by:
deepClone in interface GraphicalObject

Copyright Information