|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--edu.berkeley.guir.lib.satin.Sheet
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:
setEnabled(boolean)
sets whether the Sheet handles any
strokes at all. This can be used to temporarily disable strokes.
You can check the current enabled status by calling
isEnabled()
.
setAcceptLeftButton(boolean)
,
setAcceptMiddleButton(boolean)
, or
setAcceptRightButton(boolean)
.
setDrawLeftButtonStrokes(boolean)
,
setDrawMiddleButtonStrokes(boolean)
, or
setDrawRightButtonStrokes(boolean)
. Of course, this only
works if the strokes are accepted in the first place (see above).
setAddLeftButtonStrokes(boolean)
,
setAddMiddleButtonStrokes(boolean)
, or
setAddRightButtonStrokes(boolean)
.
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
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 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 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.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 |
public static String BACKGROUND_COLOR_PROPERTY
public static String BACKGROUND_COLOR_DEFAULT
public static String CURRENTSTROKE_STYLE_FILE
protected StrokeEventFilter addFilter
Constructor Detail |
public Sheet()
public Sheet(int w, int h)
w
- is the width of the Sheet.h
- is the height of the Sheet.public Sheet(Dimension dim)
dim
- is the width and height dimensions.Method Detail |
protected void undoInternal()
protected void redoInternal()
protected void pasteInternal()
protected void cutInternal()
protected void copyInternal()
protected void deleteInternal()
public void setSheet(Sheet sheet)
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.public void setAutoScroll(boolean flag)
public void setEnabled(boolean flag)
setEnabled
in class JComponent
public boolean isEnabled()
isEnabled
in class Component
public void setAcceptLeftButton(boolean flag)
public void setAcceptMiddleButton(boolean flag)
public void setAcceptRightButton(boolean flag)
public void setDrawLeftButtonStrokes(boolean flag)
public void setDrawMiddleButtonStrokes(boolean flag)
public void setDrawRightButtonStrokes(boolean flag)
public void setAddLeftButtonStrokes(boolean flag)
public void setAddMiddleButtonStrokes(boolean flag)
public void setAddRightButtonStrokes(boolean flag)
public int getUniqueID()
GraphicalObject
getUniqueID
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setUniqueID(int newID)
GraphicalObject
setUniqueID
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Iterator getPropertyNames()
getPropertyNames
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getPropertyNames()
public Object getProperty(String strPropertyName)
getProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getProperty(String)
public void setProperty(String strPropertyName, Object newVal)
setProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.setProperty(String, Object)
public Object removeProperty(String strPropertyName)
removeProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeProperty(String)
public List getIndexedProperty(String strPropertyName)
getIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getIndexedProperty(String)
public Object getIndexedProperty(String strPropertyName, int index)
getIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.getIndexedProperty(String, int)
public void setIndexedProperty(String strPropertyName, int index, Object newVal)
setIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.setIndexedProperty(String, int, Object)
public void addIndexedProperty(String strPropertyName, Object newVal)
addIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.addIndexedProperty(String, Object)
public Object removeIndexedProperty(String strPropertyName, int index)
removeIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeIndexedProperty(String, int)
public List removeIndexedProperty(String strPropertyName)
removeIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.removeIndexedProperty(String)
public void clearIndexedProperty(String strPropertyName)
clearIndexedProperty
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
FlexProperties.clearIndexedProperty(String)
public View getView()
GraphicalObject
getView
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.setView(View)
public void setView(View v)
GraphicalObject
setView
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.getView()
,
View.setBoundingPoints2DRef(Polygon2D)
public Interpreter getGestureInterpreter()
GraphicalObject
getGestureInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Interpreter setGestureInterpreter(Interpreter intrp)
GraphicalObject
setGestureInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
intrp
- is the new Interpreter to use.public Interpreter getInkInterpreter()
GraphicalObject
getInkInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Interpreter setInkInterpreter(Interpreter intrp)
GraphicalObject
setInkInterpreter
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
intrp
- is the new Interpreter to use.public Style setStyle(Style newStyle)
GraphicalObject
Notifies Watchers of an update when called.
setStyle
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
the
- Style to set to. A null value means use default values.public Style getStyle()
GraphicalObject
getStyle
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Style getStyleRef()
GraphicalObject
getStyleRef
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Style setCurrentStyle(Style newStyle)
public Style getCurrentStyle()
public Style setSelectedStyle(Style newStyle)
public Style getSelectedStyle()
public String getRelativeLayer()
GraphicalObject
Main Tree |-- | A Collection | |-- | | Relative: 1 | | Absolute: 1 | | | | |-- | | | Relative: 1 | | | Absolute: 1.1 | | |-- | | | | |-- | | | Relative: 2 | | | Absolute: 1.2 | | |-- | |-- | | Another Collection | |-- | | Relative: 2 | | Absolute: 2 | | | | |-- | | | Relative: 1 | | | Absolute: 2.1 | | |-- | |-- |--
getRelativeLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void setRelativeLayer(int layer)
GraphicalObject
Notifies Watchers of an update when called.
setRelativeLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
layer
- is the non-negative layer value to set to. If it is set
too high, it is just sent to the bottom-most layer.public String getAbsoluteLayer()
GraphicalObject
getAbsoluteLayer
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void bringUpALayer()
GraphicalObject
Notifies Watchers of an update when called.
bringUpALayer
in interface GraphicalObject
public void bringDownALayer()
GraphicalObject
Notifies Watchers of an update when called.
bringDownALayer
in interface GraphicalObject
public void bringToTopLayer()
GraphicalObject
Notifies Watchers of an update when called.
bringToTopLayer
in interface GraphicalObject
public void bringToBottomLayer()
GraphicalObject
Notifies Watchers of an update when called.
bringToBottomLayer
in interface GraphicalObject
public void applyTransform(AffineTransform tr)
GraphicalObject
Notifies Watchers of an update when called.
applyTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
newTx
- is a Transform to apply. No modifications are made to newTx.public void setTransform(AffineTransform tr)
GraphicalObject
Notifies Watchers of an update when called.
setTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
newTx
- is a Transform to apply. Removes the old one completely.
No modifications are made to newTx.public AffineTransform getTransformRef()
GraphicalObject
getTransformRef
in interface GraphicalObject
public AffineTransform getTransform(int cdsys)
GraphicalObject
getTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getTransform(int cdsys, AffineTransform outTx)
GraphicalObject
getTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system.outTx
- is the storage space.outTx
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getInverseTransform(int cdsys)
GraphicalObject
getInverseTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public AffineTransform getInverseTransform(int cdsys, AffineTransform tx)
GraphicalObject
getInverseTransform
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.outTx
- is the output storage. Use null to create a new object.outTx
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void setHasClosedBoundingPoints(boolean flag)
setHasClosedBoundingPoints
in interface GraphicalObject
public boolean hasClosedBoundingPoints()
GraphicalObject
hasClosedBoundingPoints
in interface GraphicalObject
public float minDistance(int cdsys, double x, double y)
GraphicalObject
minDistance
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system.x
- is the x-coordinate.y
- is the y-coordinate.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float minDistance(int cdsys, Point2D pt)
GraphicalObject
GraphicalObject.minDistance(int, double, double)
method.minDistance
in interface GraphicalObject
public Point2D getLocation2D(int cdsys)
GraphicalObject
getLocation2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.GraphicalObject.getLocation2D(int, AffineTransform, Point2D)
,
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Point2D getLocation2D(int cdsys, AffineTransform tx, Point2D pt)
GraphicalObject
getLocation2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.tx
- is the transform to apply after the location is
retrieved. Use null for none.pt
- is where to store the output. Use null to create a
new point. Use for optimization purposes.pt
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Rectangle2D getBounds2D(int cdsys)
GraphicalObject
getBounds2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.GraphicalObject.getBounds2D(int)
,
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Rectangle2D getBounds2D(int cdsys, AffineTransform tx, Rectangle2D rect)
GraphicalObject
getBounds2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.tx
- is the transform to apply after the location is
retrieved. Use null for none.rect
- is the Rectangle to put the results in. Use null to create
a new Rectangle. Use for optimization purposes.rect
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Polygon2D getBoundingPoints2D(int cdsys)
GraphicalObject
getBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public Polygon2D getBoundingPoints2D(int cdsys, AffineTransform tx, Polygon2D poly)
GraphicalObject
getBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.tx
- is the transform to apply after the location is
retrieved. Use null for none.poly
- is the Polygon to put the results in. Use null to
create a new Polygon. Use for optimization purposes.poly
.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float getWidth2D(int cdsys)
GraphicalObject
getWidth2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public float getHeight2D(int cdsys)
GraphicalObject
getHeight2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeContains(GraphicalObject gob)
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
gob
- is the GraphicalObject to check. It doesn't matter what
coordinate space gob is in, it will be moved to the correct
space.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys, Point2D pt)
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system of the point.pt
- is the point.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys, double x, double y)
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system of the point.x
- is the x-coordinate.y
- is the y-coordinate.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeContains(int cdsys, Shape s)
shapeContains
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system of the point.s
- is the shape to check.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeIntersects(GraphicalObject gob)
shapeIntersects
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
gob
- is checked to see if it intersects this GraphicalObject.
It doesn't matter what coordinate space gob is in, it will be
moved to the correct space.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean shapeIntersects(int cdsys, Shape s)
shapeIntersects
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system of the point.s
- is the shape to check.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean isSelectable()
GraphicalObject
isSelectable
in interface GraphicalObject
public void setSelectable(boolean flag)
setSelectable
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
flag
- is true to set this Graphical Object as selectable,
false otherwise.public void moveTo(int cdsys, double x, double y)
GraphicalObject
Notifies Watchers of an update when called.
moveTo
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.x
- is the x-coordinate to move to.y
- is the y-coordinate to move to.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void moveTo(int cdsys, Point2D pt)
GraphicalObject
GraphicalObject.moveTo(int, double, double)
method.moveTo
in interface GraphicalObject
public void moveBy(int cdsys, double dx, double dy)
GraphicalObject
Notifies Watchers of an update when called.
moveBy
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.dx
- is the change in x-coordinate to move.dy
- is the change in y-coordinate to move.SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public void moveBy(int cdsys, Point2D pt)
GraphicalObject
GraphicalObject.moveBy(int, double, double)
method.moveBy
in interface GraphicalObject
public void setBoundingPoints2D(int cdsys, Shape s)
GraphicalObject
Notifies Watchers of an update when called.
setBoundingPoints2D
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
cdsys
- is the coordinate system to use.s
- is the shape that describes our bounds.GraphicalObject.getView()
,
SatinConstants.COORD_LOCAL
,
SatinConstants.COORD_REL
,
SatinConstants.COORD_ABS
public boolean contains(double x, double y)
contains
in interface Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface Shape
public boolean contains(Point2D p)
contains
in interface Shape
public boolean contains(Rectangle2D r)
contains
in interface Shape
public Rectangle2D getBounds2D()
getBounds2D
in interface Shape
public PathIterator getPathIterator(AffineTransform at)
getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface Shape
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public void onNewStroke(NewStrokeEvent evt)
setDrawLeftButtonStrokes(boolean)
), and if the event says
it should render (see SatinEvent.setShouldRender(boolean)
).onNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
evt
- is the event to dispatch. evt should be in this
GraphicalObject's local coordinate space when this method is
called.for information on how to manipulate the event.
public void preProcessNewStroke(NewStrokeEvent evt)
preProcessNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchNewStroke(NewStrokeEvent evt)
redispatchNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessNewStroke(NewStrokeEvent evt)
postProcessNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleNewStroke(NewStrokeEvent evt)
StrokeListener
SatinEvent.setConsumed()
with true to signify that it is
consumed and no one else should handle it. Furthermore, if you don't
want the stroke to be rendered, then call
SatinEvent.setShouldRender(boolean)
with false. By default, the
stroke will be rendered.handleNewStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void onUpdateStroke(UpdateStrokeEvent evt)
onUpdateStroke
in interface GraphicalObject
onNewStroke(NewStrokeEvent)
public void preProcessUpdateStroke(UpdateStrokeEvent evt)
preProcessUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchUpdateStroke(UpdateStrokeEvent evt)
redispatchUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessUpdateStroke(UpdateStrokeEvent evt)
postProcessUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleUpdateStroke(UpdateStrokeEvent evt)
handleUpdateStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void onSingleStroke(SingleStrokeEvent evt)
onSingleStroke
in interface GraphicalObject
onNewStroke(NewStrokeEvent)
public void preProcessSingleStroke(SingleStrokeEvent evt)
preProcessSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void redispatchSingleStroke(SingleStrokeEvent evt)
redispatchSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void postProcessSingleStroke(SingleStrokeEvent evt)
postProcessSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void handleSingleStroke(SingleStrokeEvent evt)
handleSingleStroke
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.onNewStroke(NewStrokeEvent)
public void disableDamage()
GraphicalObject
This method is useful if you are doing multiple operations to the same GraphicalObject all at once, but don't want to damage the GraphicalObject until all the operations are done.
disableDamage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.enableDamage()
,
GraphicalObject.hasDamageEnabled()
public void enableDamage()
GraphicalObject
enableDamage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.disableDamage()
,
GraphicalObject.hasDamageEnabled()
public boolean hasDamageEnabled()
GraphicalObject
hasDamageEnabled
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
GraphicalObject.disableDamage()
,
GraphicalObject.enableDamage()
public void setClipToBounds(boolean flag)
GraphicalObject
setClipToBounds
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
flag
- specifies whether the GraphicalObject should be clipped
to bounds or not.public boolean isClippedToBounds()
GraphicalObject
isClippedToBounds
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void damage(int sync)
GraphicalObject
Watchable.hasNotifyEnabled()
, mark this
GraphicalObject as damaged and repaint.damage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
sync
- is either SatinConstants.DAMAGE_NOW
or
SatinConstants.DAMAGE_LATER
SatinConstants.DAMAGE_NOW
,
SatinConstants.DAMAGE_LATER
public void damage(int sync, Rectangle2D rect)
damage
in interface GraphicalObject
rect
- is the region to repaint.public void damage(int sync, GraphicalObject gob)
damage
in interface GraphicalObject
gob
- is the GraphicalObject to repaint.public void damage(int sync, Rectangle2D oldRect, Rectangle2D newRect)
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.damage
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
sync
- is either SatinConstants.DAMAGE_NOW
or
SatinConstants.DAMAGE_LATER
oldRect
- is the rectangle to damage (absolute coordinates).newRect
- is the rectangle to damage (absolute coordinates).SatinConstants.DAMAGE_NOW
,
SatinConstants.DAMAGE_LATER
public void setParentGroup(GraphicalObjectGroup newparent)
setParentGroup
in interface GraphicalObject
GraphicalObject.setParentGroup(GraphicalObjectGroup)
public GraphicalObjectGroup getParentGroup()
GraphicalObject
getParentGroup
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public Sheet getSheet()
GraphicalObject
getSheet
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
public void delete()
delete
in interface GraphicalObject
public String getRelativeLayer(GraphicalObject gob)
GraphicalObjectGroup
getRelativeLayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the contained Graphical Object to check out.GraphicalObject.getRelativeLayer()
public void setRelativeLayer(GraphicalObject gob, int layer)
GraphicalObjectGroup
setRelativeLayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the contained Graphical Object to move.layer
- is the layer to move to.GraphicalObject.setRelativeLayer(int)
public String getAbsoluteLayer(GraphicalObject gob)
GraphicalObjectGroup
getAbsoluteLayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the contained Graphical Object to check out.GraphicalObject.getAbsoluteLayer()
public void bringUpALayer(GraphicalObject gob)
GraphicalObjectGroup
bringUpALayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.GraphicalObject.bringUpALayer()
public void bringUpNLayers(GraphicalObject gob, int n)
GraphicalObjectGroup
bringUpNLayers
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.n
- is the number of layers to move.GraphicalObject.bringUpNLayers(int)
public void bringUpNLayers(int n)
GraphicalObject
Notifies Watchers of an update when called.
bringUpNLayers
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
n
- is the number of layers to move this GraphicalObject up.public void bringDownALayer(GraphicalObject gob)
GraphicalObjectGroup
bringDownALayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.GraphicalObject.bringDownALayer()
public void bringDownNLayers(GraphicalObject gob, int n)
GraphicalObjectGroup
bringDownNLayers
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.n
- is the number of layers to move.GraphicalObject.bringDownNLayers(int)
public void bringDownNLayers(int n)
GraphicalObject
Notifies Watchers of an update when called.
bringDownNLayers
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
n
- is the number of layers to move this GraphicalObject down.public void bringToTopLayer(GraphicalObject gob)
GraphicalObjectGroup
bringToTopLayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.GraphicalObject.bringToTopLayer()
public void bringToBottomLayer(GraphicalObject gob)
GraphicalObjectGroup
bringToBottomLayer
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the Graphical Object to move.GraphicalObject.bringToBottomLayer()
public GraphicalObject add(GraphicalObject gob)
add
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
gob
- is the GraphicalObject to add.public GraphicalObject addToBack(GraphicalObject gob)
addToBack
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
gob
- is the Graphical Object to add.public GraphicalObject addToFront(GraphicalObject gob)
addToFront
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
gob
- is the Graphical Object to add.public GraphicalObject add(int index, GraphicalObject gob)
GraphicalObjectCollection
add
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
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.public GraphicalObject add(GraphicalObject gob, int pos)
GraphicalObjectGroup
add
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the GraphicalObject to add.pos
- is the GraphicalObject's position, either
GraphicalObjectGroup.KEEP_ABS_POS
or GraphicalObjectGroup.KEEP_REL_POS
.GraphicalObjectGroup.addToFront(GraphicalObject, int)
public GraphicalObject addToBack(GraphicalObject gob, int pos)
addToBack
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the GraphicalObject to add.pos
- is the GraphicalObject's position, either
GraphicalObjectGroup.KEEP_ABS_POS
or GraphicalObjectGroup.KEEP_REL_POS
.public GraphicalObject addToFront(GraphicalObject gob, int pos)
addToFront
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
gob
- is the GraphicalObject to add.pos
- is the GraphicalObject's position, either
GraphicalObjectGroup.KEEP_ABS_POS
or GraphicalObjectGroup.KEEP_REL_POS
.public GraphicalObject add(int index, GraphicalObject gob, int pos)
GraphicalObjectGroup
add
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
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
.public void clear()
clear
in interface GraphicalObjectCollection
public boolean contains(GraphicalObject gob)
GraphicalObjectCollection
GraphicalObject.shapeContains(GraphicalObject)
.contains
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public GraphicalObject get(int index)
GraphicalObjectCollection
get
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
index
- is the location to look at (zero-based). It is up to the
programmer to ensure that this is a valid value.public GraphicalObject getFirst()
GraphicalObjectCollection
getFirst
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public GraphicalObject getLast()
GraphicalObjectCollection
getLast
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public GraphicalObject getID(int id)
GraphicalObjectCollection
getID
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
id
- is the unique ID of the GraphicalObject to retrieve.public Rectangle2D getCollectionBounds2D(int cdsys)
GraphicalObjectCollection
getCollectionBounds2D
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
cdsys
- is the coordinate system to use.public Rectangle2D getCollectionBounds2D(int cdsys, Rectangle2D rect)
GraphicalObjectCollection
getCollectionBounds2D
in interface GraphicalObjectCollection
public int indexOf(GraphicalObject gob)
GraphicalObjectCollection
indexOf
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
gob
- is the Graphical Object to look for.public boolean isEmpty()
GraphicalObjectCollection
isEmpty
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public void sort(Comparator c)
sort
in interface GraphicalObjectCollection
public int numElements()
GraphicalObjectCollection
I realize that this should have been called size(), but there already exists a deprecated method in Component named size().
numElements
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public GraphicalObject remove(GraphicalObject gob)
GraphicalObjectCollection
remove
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
gob
- is the Graphical Object ot remove.public Iterator getForwardIterator()
GraphicalObjectCollection
getForwardIterator
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public Iterator getReverseIterator()
GraphicalObjectCollection
getReverseIterator
in interface GraphicalObjectCollection
edu.berkeley.guir.lib.satin.objects.GraphicalObjectCollection
public void removeAll(GraphicalObjectCollection gobcol)
GraphicalObjectGroup
removeAll
in interface GraphicalObjectGroup
public GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
GraphicalObjectGroup
Really big methods like this one are usually a warning sign, but I really don't see any alternatives.
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
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.public GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)
public GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
getGraphicalObjects
in interface GraphicalObjectGroup
public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype, double thresh, GraphicalObjectCollection out)
GraphicalObjectGroup
Really big methods like this one are usually a warning sign, but I really don't see any alternatives.
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
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.public GraphicalObjectCollection getGraphicalObjects(int cdsys, Point2D pt, int num, int depth, int gettype)
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)
public GraphicalObjectCollection getGraphicalObjects(int cdsys, double x, double y, int num, int depth, int gettype)
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
GraphicalObjectGroup.getGraphicalObjects(int, Point2D, int, int, int, double, GraphicalObjectCollection)
public GraphicalObjectCollection getGraphicalObjects(int cdsys, Shape s, int num, int depth, int gettype)
getGraphicalObjects
in interface GraphicalObjectGroup
public GraphicalObjectCollection getGraphicalObjects(GraphicalObject gob, int num, int depth, int gettype)
getGraphicalObjects
in interface GraphicalObjectGroup
edu.berkeley.guir.lib.satin.objects.GraphicalObjectGroup
GraphicalObjectGroup.getGraphicalObjects(GraphicalObject, int, int, int, double, GraphicalObjectCollection)
public Watcher addWatcher(Watcher w)
Watchable
addWatcher
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
w
- is the Watcher to add.public int countWatchers()
Watchable
countWatchers
in interface Watchable
public Watcher removeWatcher(Watcher w)
Watchable
removeWatcher
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
public void clearWatchers()
Watchable
clearWatchers
in interface Watchable
public void enableNotify()
Watchable
enableNotify
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
Watchable.disableNotify()
public void disableNotify()
Watchable
disableNotify
in interface Watchable
public boolean hasNotifyEnabled()
Watchable
hasNotifyEnabled
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
Watchable.disableNotify()
,
Watchable.enableNotify()
public void notifyWatchers()
Watchable
notifyWatchers
in interface Watchable
public void notifyWatchers(Object arg)
Watchable
notifyWatchers
in interface Watchable
public void notifyWatchersUpdate(Object arg)
Watchable
notifyWatchersUpdate
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
arg
- is the argument to send to all Watchers.public void notifyWatchersUpdate(String strProperty, Object newVal, Object oldVal)
Watchable
notifyWatchersUpdate
in interface Watchable
edu.berkeley.guir.lib.satin.watch.Watchable
strProperty
- is some agreed upon name for the property.oldVal
- is the old value.newVal
- is the new value. It should be a clone, not a
reference to the actual value, unless it is
prohibitively expensive to clone. Whether this is a
copy or a reference should be defined in the
SatinConstants file.SatinConstants
public void notifyWatchersDelete()
Watchable
notifyWatchersDelete
in interface Watchable
public void onNotify(Watchable w, Object arg)
Watcher
onNotify
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object notifying you.arg
- is some agreed upon argument.Watchable.notifyWatchers()
,
Watchable.notifyWatchers(java.lang.Object)
public void onUpdate(Watchable w, Object arg)
Watcher
onUpdate
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object that has been updated.arg
- is some agreed upon argument.Watchable.notifyWatchersUpdate(Object)
public void onUpdate(Watchable w, String strProperty, Object oldVal, Object newVal)
Watcher
onUpdate
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
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.SatinConstants
,
Watchable.notifyWatchersUpdate(String, Object, Object)
public void onDelete(Watchable w)
Watcher
onDelete
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object to be deleted.Watchable.notifyWatchersDelete()
public void setSize(int w, int h)
setSize
in class Component
public void setSize(Dimension dim)
setSize
in class Component
public boolean isFocusTraversable()
isFocusTraversable
in class JComponent
public void setBackground(Color bkgrd)
setBackground
in class JComponent
public void render(SatinGraphics g)
GraphicalObject
When this method is called for you, your Style and Transform has already been set. This has several implications.
First, you can just use the normal drawing methods, like drawLine(), and they will automatically use the thickness and other properties as set in Style. You can still set colors and fonts and such if you want, though.
Secondly, your coordinate system is set such that (0,0) is your top-left corner.
Third, since your transform is already set, you don't have to do anything special to get rotation. Just draw normally.
Fourth, while in render(), do not call any methods that use
SatinConstants.COORD_REL
or SatinConstants.COORD_ABS
,
since the transform has already been applied. Instead, use
SatinConstants.COORD_LOCAL
.
So in other words, all you have to do is just draw the GraphicalObject normally, and everything else will be handled for you. However, do NOT call anything that uses the transformed bounds, since that will apply the transform twice (the transform has already been applied once).
render
in interface GraphicalObject
edu.berkeley.guir.lib.satin.objects.GraphicalObject
g
- is the Graphics context to draw in.public void paintComponent(Graphics g)
paintComponent
in class JComponent
public String toString()
toString
in class Component
public Object clone()
clone
in interface GraphicalObject
clone
in class Object
public Object deepClone()
deepClone
in interface GraphicalObject
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |