Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.nwoods.jgo
Class JGoObject

    java.lang.Object
      com.nwoods.jgo.JGoObject

All Implemented Interfaces:
  JGoXMLSaveRestore, java.io.Serializable

Direct Known Subclasses:
  JGoArea, JGoControl, JGoDrawable, JGoImage, JGoText

public abstract class JGoObject
extends java.lang.Object
implements java.io.Serializable, JGoXMLSaveRestore

JGoObject is the superclass of all objects that can be contained in a JGoDocument or a JGoView and that can be displayed in a view.

JGoObjects are fairly efficient; if most AWT components are considered heavyweight, and if most Swing components are considered lightweight, JGoObjects are flyweight.

Each object has a size and a position, in document coordinates. There are many methods for getting and setting the bounding rectangle for the object, or for just the Left, Top, Width, or Height properties. All ultimately go through the basic getBoundingRect() and setBoundingRect() methods.

Although normally one can think of the location of an object being the same as the TopLeft corner, that may not be natural for some objects. Thus each object has its own notion of Location; by default this is the same as the TopLeft.

There are a number of convenience methods for dealing with the standard nine spots of an object (corners, sides, and center), and for repositioning two objects so that their particular user-specified spots coincide. (The old Spot... values have been replaced by and merged with the handle identifiers; for example, SpotTopLeft is now TopLeft.)

Most JGoObjects should either belong directly to a JGoDocument (a top-level document object) or to a JGoArea that belongs to a JGoDocument. In either case getDocument() returns this document; for children of areas, getParent() will return that JGoArea instead of null.

Occasionally some objects will properly belong to a JGoView instead of to a JGoDocument, because they really represent part of the "view" of the document and not of the document itself. Predefined cases include selection handles and the in-place text editor.

As you define your own subclasses, you can define customized default behaviors for responding to various events. JGoObjects do not have their own listeners and events because it is assumed that most of the objects of a certain class in a graph want to behave the same way. This is unlike the situation where one expects to add controls to a dialog without subclassing and yet have radically different behaviors for each one.

The standard "event" handling methods are:

- geometryChange() - the object has changed size and/or position
- geometryChangeChild() - a child object has changed size and/or position
- handleResize() - the user is reshaping this object interactively
- ownerChange() - the object has just been added or removed from a document or view
- paint() - render this object through a Graphics2D
- doMouseClick() - the user just clicked on this object
- doMouseDblClick() - the user just double-clicked on this object
- doUncapturedMouseMove() - the user just passed the mouse over this object without any mouse down
- gainedSelection() - this object just got added to some view's selection
- lostSelection() - this object just got removed from some view's selection
- redirectSelection() - this object is about to be selected; maybe select something else
- getToolTipText() - return a string to display in a tool tip

Each object has a number of boolean properties:

- Visible - can this object be seen in a view
- Selectable - can the user select this object in a view
- Draggable - can the user move this object in a view
- Resizable - can the user reshape this object in a view
- 4ResizeHandles - does this object only have corner selection handles
- AutoRescale - whether resizing the parent will resize this object
- DragsNode - whether this selected object, when moved, should move the top-level parent instead
- BoundingRectInvalid - whether getBoundingRect() should call computeBoundingRect() first
- Initializing - sometimes set during the construction or copying of complex objects
- SuspendUpdates - should we temporarily skip notifying owner listeners
- SkipsUndoManager - should any UndoManager ignore any changes to this object

Whenever any object is added or removed from a document or a view, the appropriate INSERTED or REMOVED event is fired for all listeners. The CHANGED event must also occur with any changes to an object. As you define subclasses with additional properties or other state, you will need to remember to call the update method after the object's state changes. The flags value for CHANGED document or view events depends on the kind of change. For CHANGED events the flags value is actually just an enumeration of different kinds of changes that may have occurred. JGoObject defines several of them, and additional ones are defined by the individual subclasses. A list of the predefined CHANGED sub-hints in the JGo package is provided in the description of the JGoObject.update method.

Furthermore each CHANGED document event should also have a previous value associated with it, representing the original value, before the modification, of the corresponding object's property. For convenience and efficiency, this previous value may be passed in either as an Object or as an integer. By convention, boolean values are also passed in as integers, rather than allocating new Boolean objects.

If there is no efficient way of passing in the previous value, you need to call the foredate method before making any modifications to this object. Then on the call to the update method, you can pass in zero and null as the "previous value" arguments. This circumstance can occur when there are multiple state changes made. A typical case of this is removing some objects from a collection in this object.

A standardized way of creating copies of objects is provided by copy(). Override copyObject() when you add fields to a subclass of JGoObject.

Serialized objects will not be compatible with future JGo releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of JGo.

JGoObject participates in the standard undo/redo mechanism by supporting the copyOldValueForUndo, copyNewValueForRedo, and changeValue methods. The update method has been changed to include an integer and an Object argument specifying the previous or old value.

When defining your own extensions to JGoObject, be sure to define your own unique change hints for any new properties. Mutating methods should first check to be sure a change is really needed--setting a property to its current value should be a no-op. If the new value is indeed different, remember the original value, set the field with the new value, and then call update passing the original value as one or both of the last arguments.

The update method calls the document's fireUpdate method, passing any old value along. If one of the document listeners is responsible for undo and redo, typically an instance of JGoUndoManager, it will remember enough information to be able to perform an undo and later redo, typically using an instance of JGoDocumentChangedEdit. This step is accomplished by calling copyOldValueForUndo and copyNewValueForRedo. These JGoDocument methods call the corresponding JGoObject methods when the event type is JGoDocumentEvent.CHANGED. Finally when the JGoDocumentChangedEdit's undo or redo methods are called, they just call JGoDocument.changeValue. Likewise, that JGoDocument method calls the corresponding JGoObject method when the event type is JGoDocumentEvent.CHANGED.

Note that the built-in undo and redo mechanism only works for document objects, not for unowned objects or for objects in views.

See Also:
  `JGoDocument`, `JGoDocumentEvent`, `JGoDocumentChangedEdit`, `JGoUndoManager`, `JGoSelection`, `JGoView`, Serialized Form

Field Summary
`static int` | `Bottom` a spot location or handle placement, the same as BottomCenter
`static int` | `BottomCenter` a spot location or handle placement
`static int` | `BottomLeft` a spot location or handle placement
`static int` | `BottomMiddle` a spot location or handle placement, the same as BottomCenter
`static int` | `BottomRight` a spot location or handle placement
`static int` | `Center` a spot location or handle placement
`static int` | `CenterLeft` a spot location or handle placement, the same as LeftCenter
`static int` | `CenterRight` a spot location or handle placement, the same as RightCenter
`static int` | `Changed4ResizeHandles` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the 4ResizeHandles property has changed
`static int` | `ChangedAutoRescale` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the AutoRescale property has changed
`static int` | `ChangedBrush` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the JGoBrush has changed
`static int` | `ChangedDraggable` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the draggable property has changed
`static int` | `ChangedDragsNode` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the dragsNode property has changed
`static int` | `ChangedGeometry` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the size and/or position have changed
`static int` | `ChangedGrabChildSelection` Deprecated.
`static int` | `ChangedInitializing`
`static int` | `ChangedPen` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the JGoPen has changed
`static int` | `ChangedResizable` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the resizable property has changed
`static int` | `ChangedSelectable` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the selectable property has changed
`static int` | `ChangedUpdatePartner` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the UpdatePartner property has changed
`static int` | `ChangedVisible` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the visible property has changed
`static int` | `ChangedZOrder` a CHANGED JGoDocumentEvent or JGoViewEvent hint: the object's drawing order has changed relative to other objects in the same document, area, or view.
`static int` | `LastChangedHint` users can define their own CHANGED event hint values greater than this value
`static int` | `Left` a spot location or handle placement, the same as LeftCenter
`static int` | `LeftCenter` a spot location or handle placement
`static int` | `NoHandle` no handle or no particular handle placement
`static int` | `NoSpot` no particular spot location
`static int` | `NumReservedHandles` user-defined handles should have identifiers greater than this value
`static int` | `RepaintAll` a CHANGED JGoDocumentEvent or JGoViewEvent hint: no object state has really changed, but views should be repainted
`static int` | `Right` a spot location or handle placement, the same as RightCenter
`static int` | `RightCenter` a spot location or handle placement
`static int` | `SideLeft` a spot location or handle placement, the same as LeftCenter
`static int` | `SideRight` a spot location or handle placement, the same as RightCenter
`static int` | `Top` a spot location or handle placement, the same as TopCenter
`static int` | `TopCenter` a spot location or handle placement
`static int` | `TopLeft` a spot location or handle placement
`static int` | `TopMiddle` a spot location or handle placement, the same as TopCenter
`static int` | `TopRight` a spot location or handle placement

Constructor Summary
`JGoObject()` Construct a new object with no dimensions
`JGoObject(java.awt.Point location, java.awt.Dimension size)` Construct a JGoObject with a location and a size.
`JGoObject(java.awt.Rectangle rect)` Construct a JGoObject with a bounding rectangle.

Method Summary
`boolean` | `canView()` Return whether this object and all of its Parent areas and its Layer are visible.
`void` | `changeValue(JGoDocumentChangedEdit e, boolean undo)` This method is called by the JGoDocumentChangedEdit.undo and redo methods to actually perform the property value change for a JGoObject.
`protected java.awt.Rectangle` | `computeBoundingRect()` Recalculate the correct bounding box for this object.
`java.awt.Point` | `computeMove(int origX, int origY, int newX, int newY, java.awt.Point result)` Calculate a new location for this object.
`protected java.awt.Rectangle` | `computeResize(java.awt.Rectangle origRect, java.awt.Point newPoint, int whichHandle, int minWidth, int minHeight)` Calculate a new bounding rectangle for this object.
`JGoObject` | `copy()` This convenience method just makes a copy of the object itself, using a generic JGoCopyMap, without adding it to a document.
`void` | `copyNewValueForRedo(JGoDocumentChangedEdit e)` This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed.
`JGoObject` | `copyObject(JGoCopyEnvironment env)` Called during the first phase of the copy process to produce a copy of this object within the given copy dictionary.
`void` | `copyObjectDelayed(JGoCopyEnvironment env, JGoObject newobj)` For objects that require a second pass to complete the copying, this method is called after the first pass of copying all of the objects in JGoDocument.copyFromCollection.
`void` | `copyOldValueForUndo(JGoDocumentChangedEdit e)` This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed.
`static java.awt.Rectangle` | `copyRect(java.awt.Rectangle b)` This method implements new Rectangle(Rectangle) for convenient compatibility with SWT.
`boolean` | `doMouseClick(int modifiers, java.awt.Point dc, java.awt.Point vc, JGoView view)` Called when the user clicks on this object.
`boolean` | `doMouseDblClick(int modifiers, java.awt.Point dc, java.awt.Point vc, JGoView view)` Called when the user double clicks on this object.
`boolean` | `doUncapturedMouseMove(int flags, java.awt.Point dc, java.awt.Point vc, JGoView view)` Called when the mouse moves over this object without any mouse button down, not during a drag or resize or similar mouse action.
`void` | `expandRectByPenWidth(java.awt.Rectangle rect)` Modify the given rectangle to account for any likely drawing beyond the bounds of the rectangle caused by wide pens.
`static JGoObject` | `findCommonParent(JGoObject a, JGoObject b)` Find the JGoArea that is closest parent area for this object and another.
`void` | `foredate(int hint)` The foredate method should be called by state changing methods before actually making any changes, when the following update method call is unable to provide the previous property value(s) in a convenient manner.
`protected void` | `gainedSelection(JGoSelection selection)` Called after this object has gained the selection in some view.
`protected void` | `geometryChange(java.awt.Rectangle prevRect)` Called just after the bounding rectangle for this object has been changed.
`protected boolean` | `geometryChangeChild(JGoObject child, java.awt.Rectangle prevRect)` Called if any child of this object has their bounding box changed.
`java.awt.Rectangle` | `getBoundingRect()` Return the bounding box for this object, in document coordinates.
`JGoDocument` | `getDocument()` Gets the document for this object.
`JGoObject` | `getDraggingObject()` This is called by JGoView.moveSelection to decide which object should be moved for a given object in the selection.
`int` | `getFlags()` Return the current state of this object's flags.
`int` | `getHeight()` Return the height of this object's bounding box.
`JGoLayer` | `getLayer()` Return the JGoLayer that owns this object.
`int` | `getLeft()` Return this object's bounding box's X position
`java.awt.Point` | `getLocation()` Return the location of this object.
`java.awt.Point` | `getLocation(java.awt.Point result)` Return the location of this object.
`boolean` | `getNearestIntersectionPoint(int px, int py, int cx, int cy, java.awt.Point result)` Compute the point along the sides of this object's bounding rectangle that is closest to a given point on a straight line from that point to another given point.
`JGoArea` | `getParent()` Gets the parent area for this object.
`JGoNode` | `getParentJGoNode()` Return the first object in the parent chain that is a JGoNode.
`JGoObject` | `getParentNode()` Return the highest-level object in the parent chain that is not a JGoSubGraphBase.
`JGoObject` | `getPartner()` Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class.
`java.awt.Point` | `getRectangleSpotLocation(java.awt.Rectangle r, int spot, java.awt.Point result)`
`java.awt.Dimension` | `getSize()` Return the height and the width of this object's bounding box, in document coordinates.
`java.awt.Dimension` | `getSize(java.awt.Dimension result)` Return the height and the width of this object's bounding box, in document coordinates.
`java.awt.Point` | `getSpotLocation(int nSpot)` Return the location of the given spot.
`java.awt.Point` | `getSpotLocation(int nSpot, java.awt.Point result)` Return the location of the given spot.
`java.lang.String` | `getToolTipText()` Called to produce a string to be used for a tooltip for this object.
`int` | `getTop()` Return this object's bounding box's Y position
`java.awt.Point` | `getTopLeft()` Return the position of the top left corner of the bounding box.
`java.awt.Point` | `getTopLeft(java.awt.Point result)` Return the position of the top left corner of the bounding box.
`JGoObject` | `getTopLevelObject()` If this object has no parent area, return this object itself.
`JGoView` | `getView()` Returns the view that owns this object if it is a view object, or else null if it is not a view object.
`int` | `getWidth()` Return the width of this object's bounding box.
`static void` | `growRect(java.awt.Rectangle b, int w, int h)` This method implements Rectangle.grow(int, int) for convenient compatibility with SWT.
`void` | `handleMove(JGoView view, int modifiers, int event, int spotNumber, int origX, int origY, int newX, int newY)` Called by JGoView.moveSelection when the user moves this object.
`protected java.awt.Rectangle` | `handleResize(java.awt.Graphics2D g, JGoView view, java.awt.Rectangle origRect, java.awt.Point newPoint, int whichHandle, int event, int minWidth, int minHeight)` Called when dragging a resize handle.
`void` | `hideSelectionHandles(JGoSelection selection)` Hide the selection handles.
`boolean` | `is4ResizeHandles()` Return whether this object displays only four resize handles instead of the default eight when selected and resizable.
`boolean` | `isAutoRescale()` Return whether this object automatically rescales its appearance when its size changes.
`protected boolean` | `isBoundingRectInvalid()` Return whether the bounding rectangle is out-of-date and getBoundingRect() needs to compute it.
`boolean` | `isChildOf(JGoObject obj)` Determines if this object is a child, perhaps indirectly, of the given object.
`boolean` | `isDraggable()` Return whether this object is draggable by the user.
`boolean` | `isDragsNode()` Return whether this object, when moved, drags the first parent area whose DragsNode property is false, or the top-level object if no such parent is found.
`boolean` | `isInitializing()` Return whether the Initializing flag is set.
`boolean` | `isPointInObj(java.awt.Point pnt)` Returns true if the given point is inside this object.
`boolean` | `isResizable()` Return whether this object is resizable by the user.
`boolean` | `isSelectable()` Return whether this object is selectable by the user.
`boolean` | `isSkipsUndoManager()` Return whether this object's document's undo manager (if any) should avoid remembering any changes to this object.
`boolean` | `isSuspendChildUpdates()` Deprecated. no longer needed
`boolean` | `isSuspendUpdates()` Return whether this object is not automatically updated when it is changed.
`boolean` | `isTopLevel()` This predicate returns true if this object is not part of an area.
`boolean` | `isUpdatePartner()` Return whether this object will notify a partner or parent object about any updates.
`boolean` | `isVisible()` Return whether this object is visible in the view.
`protected void` | `lostSelection(JGoSelection selection)` Called after this object has lost the selection in some view.
`protected void` | `ownerChange(JGoObjectCollection oldOwner, JGoObjectCollection newOwner, JGoObject mainObject)` Called whenever this object's owner (JGoDocument or JGoView) changes.
`void` | `paint(java.awt.Graphics2D g, JGoView view)` Draws the object on the given graphics context.
`protected void` | `partnerUpdate(JGoObject partner, int hint, int prevInt, java.lang.Object prevVal)` This method is called when a partner or child object is updated, if its isUpdatePartner() is true.
`JGoObject` | `pick(java.awt.Point p, boolean selectableOnly)` Return an object at a point, perhaps only a selectable one.
`JGoObject` | `redirectSelection()` Called before this object is selected in some view.
`void` | `remove()` This convenience method just removes this object from its container, if there is any.
`void` | `set4ResizeHandles(boolean bFlag)` Change whether the object has four standard resize handles instead of eight.
`void` | `setAutoRescale(boolean bFlag)` Change whether this object automatically rescales its appearance when its size changes.
`void` | `setBoundingRect(int left, int top, int width, int height)` Given four integers, set the bounding box for this object.
`void` | `setBoundingRect(java.awt.Point loc, java.awt.Dimension size)` Given a location and a size, set the bounding box for this object.
`void` | `setBoundingRect(java.awt.Rectangle rect)` Given a Rectangle, set the bounding box for this object.
`protected boolean` | `setBoundingRectForce(int left, int top, int width, int height)` Deprecated. don't use this--just call setBoundingRect
`boolean` | `setBoundingRectForce(java.awt.Rectangle rect)` Deprecated. don't use this--just call setBoundingRect
`protected void` | `setBoundingRectInvalid(boolean bFlag)` Set whether or not the bounding rectangle for this object needs to be recomputed before getBoundingRect() returns.
`static void` | `setBoundsRect(java.awt.Rectangle r, java.awt.Rectangle b)` This method implements Rectangle.setBounds(Rectangle) for convenient compatibility with SWT.
`void` | `setDraggable(boolean bFlag)` Change whether the object can be dragged by the user.
`void` | `setDragsNode(boolean bFlag)` Change whether this object, when moved, drags the top-level object instead.
`void` | `setFlags(int f)` Each JGoObject keeps a set of flags that you can use for any purpose; the JGo system itself does not make use of this property.
`void` | `setHeight(int h)` Set this object's bounding box's height.
`void` | `setInitializing(boolean bFlag)` Set or clear a flag indicating that this object is being initialized.
`void` | `setLeft(int l)` Set this object's bounding box's X position.
`void` | `setLocation(int x, int y)` Sets the location of this object to the given point.
`void` | `setLocation(java.awt.Point loc)` Sets the location of this object to the given (x,y) position.
`void` | `setLocationOffset(int x, int y, int dx, int dy)` Sets the location of this object from a point and an offset from that point.
`void` | `setLocationOffset(java.awt.Point location, java.awt.Point offset)` Sets the location of this object from a point and an offset from that point.
`protected void` | `setParent(JGoArea parent)` Called by the area's methods to add and remove objects from the area, to set the parent area back-pointer for this object.
`void` | `setPartner(JGoObject obj)` Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class.
`java.awt.Rectangle` | `setRectangleSpotLocation(java.awt.Rectangle rect, int spot, int x, int y, java.awt.Rectangle result)`
`void` | `setResizable(boolean bFlag)` Change whether the object can be resized by the user.
`void` | `setSelectable(boolean bFlag)` Change whether the object can be selected by the user's clicking or drag-box-selecting the object.
`void` | `setSize(java.awt.Dimension size)` Set the height and the width of this object, given a Dimension.
`void` | `setSize(int width, int height)` Set the height and the width of this object, in document coordinates.
`void` | `setSizeKeepingLocation(int width, int height)` Sets a new size for this object while maintaining the same Location.
`void` | `setSkipsUndoManager(boolean bFlag)` Change whether the JGoUndoManager for this object's JGoDocument (if any) should record any change to this object.
`void` | `setSpotLocation(int nSpot, int x, int y)` Set the location of a particular spot to the given (x,y) location.
`void` | `setSpotLocation(int nSpot, JGoObject obj, int otherSpot)` Set the location of a particular spot to be the same as a given spot on another object.
`void` | `setSpotLocation(int nSpot, java.awt.Point pnt)` Set the location of a particular spot to the given point.
`void` | `setSpotLocationOffset(int nSpot, int x, int y, int dx, int dy)` Set the location of this object by a particular spot to the given point offset by (dx,dy).
`void` | `setSuspendChildUpdates(boolean bFlag)` Deprecated. no longer needed
`void` | `setSuspendUpdates(boolean bFlag)` Change whether the screen is updated and document listeners are notified in response to a change to this object.
`void` | `setTop(int t)` Set this object's bounding box's Y position.
`void` | `setTopLeft(int x, int y)` Change the location of this object so that the top-left corner of the bounding rectangle is at the given point.
`void` | `setTopLeft(java.awt.Point p)` Change the location of this object so that the top-left corner of the bounding rectangle is at the given point.
`void` | `setUpdatePartner(boolean bFlag)` Change whether any partner of this object should be notified of any updates to this object by calling its partnerUpdate method.
`void` | `setVisible(boolean bFlag)` Change whether the object can be seen by the user.
`void` | `setWidth(int w)` Set this object's bounding box's width.
`void` | `showSelectionHandles(JGoSelection selection)` Show the selection handles.
`static int` | `spotOpposite(int nSpot)` For the predefined spots, return the spot corresponding to the one on the opposite side of the object.
`void` | `SVGReadAttributes(DomElement svgElement)` This method will read attributes from standard SVG elements.
`DomNode` | `SVGReadObject(DomDoc svgDoc, JGoDocument jGoDoc, DomElement svgElement, DomElement jGoChildElement)` Read this object in from a DomDoc representing a Scalable Vector Graphics (SVG) XML document.
`void` | `SVGUpdateReference(java.lang.String attr, java.lang.Object referencedObject)` This method will be called to fill in object references.
`void` | `SVGWriteAttributes(DomElement svgElement)` This method will add attributes to standard SVG elements.
`void` | `SVGWriteObject(DomDoc svgDoc, DomElement jGoElementGroup)` Write this object out to a DomDoc representing a Scalable Vector Graphics (SVG) XML document.
`void` | `update()` Cause this object to be repainted sometime in the near future.
`void` | `update(int hint, int prevInt, java.lang.Object prevVal)` Cause this object to be repainted sometime in the near future.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NoSpot

    public static final int NoSpot

  no particular spot location

  See Also:
    Constant Field Values

### NoHandle

    public static final int NoHandle

  no handle or no particular handle placement

  See Also:
    Constant Field Values

### Center

    public static final int Center

  a spot location or handle placement

  See Also:
    Constant Field Values

### TopLeft

    public static final int TopLeft

  a spot location or handle placement

  See Also:
    Constant Field Values

### TopCenter

    public static final int TopCenter

  a spot location or handle placement

  See Also:
    Constant Field Values

### TopMiddle

    public static final int TopMiddle

  a spot location or handle placement, the same as TopCenter

  See Also:
    Constant Field Values

### Top

    public static final int Top

  a spot location or handle placement, the same as TopCenter

  See Also:
    Constant Field Values

### TopRight

    public static final int TopRight

  a spot location or handle placement

  See Also:
    Constant Field Values

### RightCenter

    public static final int RightCenter

  a spot location or handle placement

  See Also:
    Constant Field Values

### CenterRight

    public static final int CenterRight

  a spot location or handle placement, the same as RightCenter

  See Also:
    Constant Field Values

### SideRight

    public static final int SideRight

  a spot location or handle placement, the same as RightCenter

  See Also:
    Constant Field Values

### Right

    public static final int Right

  a spot location or handle placement, the same as RightCenter

  See Also:
    Constant Field Values

### BottomRight

    public static final int BottomRight

  a spot location or handle placement

  See Also:
    Constant Field Values

### BottomCenter

    public static final int BottomCenter

  a spot location or handle placement

  See Also:
    Constant Field Values

### BottomMiddle

    public static final int BottomMiddle

  a spot location or handle placement, the same as BottomCenter

  See Also:
    Constant Field Values

### Bottom

    public static final int Bottom

  a spot location or handle placement, the same as BottomCenter

  See Also:
    Constant Field Values

### BottomLeft

    public static final int BottomLeft

  a spot location or handle placement

  See Also:
    Constant Field Values

### LeftCenter

    public static final int LeftCenter

  a spot location or handle placement

  See Also:
    Constant Field Values

### CenterLeft

    public static final int CenterLeft

  a spot location or handle placement, the same as LeftCenter

  See Also:
    Constant Field Values

### SideLeft

    public static final int SideLeft

  a spot location or handle placement, the same as LeftCenter

  See Also:
    Constant Field Values

### Left

    public static final int Left

  a spot location or handle placement, the same as LeftCenter

  See Also:
    Constant Field Values

### NumReservedHandles

    public static final int NumReservedHandles

  user-defined handles should have identifiers greater than this value

  See Also:
    Constant Field Values

### RepaintAll

    public static final int RepaintAll

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: no object state has really changed, but views should be repainted

  See Also:
    Constant Field Values

### ChangedGeometry

    public static final int ChangedGeometry

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the size and/or position have changed

  See Also:
    Constant Field Values

### ChangedVisible

    public static final int ChangedVisible

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the visible property has changed

  See Also:
    Constant Field Values

### ChangedSelectable

    public static final int ChangedSelectable

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the selectable property has changed

  See Also:
    Constant Field Values

### ChangedDraggable

    public static final int ChangedDraggable

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the draggable property has changed

  See Also:
    Constant Field Values

### ChangedResizable

    public static final int ChangedResizable

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the resizable property has changed

  See Also:
    Constant Field Values

### Changed4ResizeHandles

    public static final int Changed4ResizeHandles

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the 4ResizeHandles property has changed

  See Also:
    Constant Field Values

### ChangedGrabChildSelection

    public static final int ChangedGrabChildSelection

  Deprecated.

  See Also:
    Constant Field Values

### ChangedZOrder

    public static final int ChangedZOrder

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the object's drawing order has changed relative to other objects in the same document, area, or view. The previous value is the object that used to follow the object before it was moved. If the object had been at the end of the list (i.e., completely in front), the previous value object will be container collection.

  See Also:
    Constant Field Values

### ChangedPen

    public static final int ChangedPen

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the JGoPen has changed

  See Also:
    Constant Field Values

### ChangedBrush

    public static final int ChangedBrush

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the JGoBrush has changed

  See Also:
    Constant Field Values

### ChangedDragsNode

    public static final int ChangedDragsNode

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the dragsNode property has changed

  See Also:
    Constant Field Values

### ChangedUpdatePartner

    public static final int ChangedUpdatePartner

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the UpdatePartner property has changed

  See Also:
    Constant Field Values

### ChangedAutoRescale

    public static final int ChangedAutoRescale

  a CHANGED JGoDocumentEvent or JGoViewEvent hint: the AutoRescale property has changed

  See Also:
    Constant Field Values

### ChangedInitializing

    public static final int ChangedInitializing

See Also:
  Constant Field Values

### LastChangedHint

    public static final int LastChangedHint

  users can define their own CHANGED event hint values greater than this value

  See Also:
    Constant Field Values

Constructor Detail

### JGoObject

    public JGoObject()

  Construct a new object with no dimensions

### JGoObject

    public JGoObject(java.awt.Rectangle rect)

  Construct a JGoObject with a bounding rectangle.

  By default an object is Visible, Selectable, Draggable and Resizable (with 8 resize handles).

Parameters:
  `rect` - the bounding rectangle

### JGoObject

    public JGoObject(java.awt.Point location,
                     java.awt.Dimension size)

  Construct a JGoObject with a location and a size.

  By default an object is Visible, Selectable, Draggable and Resizable (with 8 resize handles).

Parameters:
  `location` - the location of the object
  `size` - the size of the object

Method Detail

### copyObject

    public JGoObject copyObject(JGoCopyEnvironment env)

  Called during the first phase of the copy process to produce a copy of this object within the given copy dictionary. If you just need to make a copy of a JGoObject, call JGoObject.copy(), or JGoDocument.addCopy, or JGoDocument.copyFromCollection if you have more than one object to copy.

  You should override this method in your derived classes when it has some fields that have reference objects that need to be copied. Your override method should first call super.copyObject(env) to get the newly copied object. The standard implementation of this method for JGoObject is to do a shallow copy, by Object.getClass().newInstance(). This depends on the existence of a zero-argument constructor. The result should be the object you return, after performing any other deeper copying of referenced objects that you deem necessary, and after removing references that should not be shared (such as to cached data structures). If super.copyObject(env) returns null, it's either already copied, or mapped to an existing object in this document, or shouldn't be copied at all.

  The copied object does not belong to any layer or any group, nor does it have any observers; the ultimate caller (i.e. JGoDocument.copyFromCollection) is responsible for adding it to the appropriate collection and copyObjectDelayed is responsible for adding the appropriate observers.

  You probably should not be calling this method for any reason but the initial super.copyObject(env) call in an override of this method; normally only JGoCopyEnvironment.copy is the caller. Within an override of this method, if you need to make a copy of another object, call JGoCopyEnvironment.copy instead.

  Parameters:
    `env` - the environment for the copy operation - keeps track of copied objects.
  Returns:
    a newly allocated copy of this object, or null

### copyObjectDelayed

    public void copyObjectDelayed(JGoCopyEnvironment env,
                                  JGoObject newobj)

  For objects that require a second pass to complete the copying, this method is called after the first pass of copying all of the objects in JGoDocument.copyFromCollection.

  This method need only be overridden by objects that refer to other independent objects. The problem usually is that during the call to copyObject, some of the objects that this object refers to might not yet have been copied. So it's best to add this object to the JGoCopyEnvironment's Delayeds collection in the call to copyObject, and then fix things up during the second pass in the call to this method, copyObjectDelayed.

  For most objects, this method does nothing. For JGoLinks, however, it also makes sure both ports refer to the copied ports, and if the ports were not copied, it removes the link.

  Parameters:
    `env` - a JGoCopyEnvironment that remembers the mapping of original objects to copied ones
    `newobj` - the newly copied instance of this object

### copy

    public JGoObject copy()

  This convenience method just makes a copy of the object itself, using a generic JGoCopyMap, without adding it to a document.

  The easiest way to add a copy of an object to a document is to call JGoDocument.addCopy.

  You should not override this method, which is implemented as:

         JGoCopyMap env = new JGoCopyMap();
         return env.copyComplete(this);

  JGoCopyMap.copyComplete calls JGoObject.copyObject to allow the object to decide how to copy itself. Although the use of a copy environment isn't really needed for the simplest objects, more complex objects (such as JGoAreas) may contain references that need to be resolved with a second pass.

  If you want to copy many objects together, it will be more efficient to allocate your own JGoCopyMap, call JGoCopyMap.copy (not copyComplete!) on each object, and then finally call JGoCopyMap.finishDelayedCopies. But if you are just going to be adding those copied objects into a JGoDocument, just call JGoDocument.copyFromCollection, which performs both copy passes using a single JGoCopyMap.

  If you want to make many copies of one object without adding them immediately to any JGoDocument, it will be more efficient to allocate your own JGoCopyMap, and then for each copy you want to make, call JGoCopyMap.copyComplete on the object followed by a call to clear() the map. Clearing the copy environment will make sure each JGoCopyMap.copyComplete call does not share any references with any other copy.

### getBoundingRect

    public java.awt.Rectangle getBoundingRect()

  Return the bounding box for this object, in document coordinates.

  The bounding rectangle represents the maximum drawing extent of the object. The object need not appear rectangular, of course, but the updating routines of JGoDocument and JGoView depend on a bounding rectangle that is large enough to cover the object and that is not significantly larger than needed, for efficiency.

  To simplify this notion, the expandRectByPenWidth() method is also used by the updating routines so that most object manipulations need not worry about pen widths greater than 1.

  A subclass that finds that the bounding rectangle is expensive to compute may wish to use the BoundingRectInvalid property to only carry out such computations upon demand. Such a class must override computeBoundingRect() to return the correct bounding bounding rectangle.

  Returns:
    the bounding rectangle of this object--this rectangle must not be modified

### setBoundingRect

    public void setBoundingRect(int left,
                                int top,
                                int width,
                                int height)

  Given four integers, set the bounding box for this object. The coordinates are all document coordinates.

  This method also calls the geometryChange() method and fires a CHANGED event with a ChangedGeometry flag/hint. If the object is part of a JGoArea, it also calls the area's geometryChangeChild() method, so that the area is notified of the change in the child.

  You may want to override this method in order to enforce certain constraints, such as a minimum width or height. Just call super.setBoundingRect() with the desired values. You will need to override the constructors to make sure a newly created instance of your subclass doesn't start out with invalid geometry.

  Parameters:
    `left` - the left side of the new bounding box
    `top` - the top side of the new bounding box
    `width` - the width of the new bounding box
    `height` - the height of the new bounding box

### setBoundingRect

    public final void setBoundingRect(java.awt.Point loc,
                                      java.awt.Dimension size)

  Given a location and a size, set the bounding box for this object.

  This method is final so that you will not accidentally override it instead of setBoundingRect(int, int, int, int).

  Parameters:
    `loc` - the new location
    `size` - the new dimensions

### setBoundingRect

    public final void setBoundingRect(java.awt.Rectangle rect)

  Given a Rectangle, set the bounding box for this object.

  This method is final so that you will not accidentally override it instead of setBoundingRect(int, int, int, int).

  Parameters:
    `rect` - the new bounding rectangle

### setBoundingRectForce

    protected final boolean setBoundingRectForce(int left,
                                                 int top,
                                                 int width,
                                                 int height)

  Deprecated. don't use this--just call setBoundingRect

### setBoundingRectForce

    public final boolean setBoundingRectForce(java.awt.Rectangle rect)

  Deprecated. don't use this--just call setBoundingRect

### computeBoundingRect

    protected java.awt.Rectangle computeBoundingRect()

  Recalculate the correct bounding box for this object. By default this just returns the current BoundingRect. return a Rectangle that must not be modified

### getSize

    public final java.awt.Dimension getSize()

  Return the height and the width of this object's bounding box, in document coordinates.

  This returns a newly allocated Dimension; you may find it more efficient to call getSize(Dimension).

  Returns:
    the size of the bounding rectangle

### getSize

    public final java.awt.Dimension getSize(java.awt.Dimension result)

  Return the height and the width of this object's bounding box, in document coordinates.

  Parameters:
    `result` - a Dimension that will be modified to have the width/height sizes; if result is null a Dimension will be allocated
  Returns:
    the size of the bounding rectangle, in document coordinates; this is the modified argument result or else a newly allocated Dimension

### setSize

    public final void setSize(java.awt.Dimension size)

  Set the height and the width of this object, given a Dimension.

  Parameters:
    `size` - the new dimensions for this object's bounding rectangle

### setSize

    public final void setSize(int width,
                              int height)

  Set the height and the width of this object, in document coordinates.

  Parameters:
    `width` - the new width for this object's bounding rectangle
    `height` - the new height for this object's bounding rectangle

### getWidth

    public final int getWidth()

  Return the width of this object's bounding box.

  Returns:
    the width, in document coordinates

### setWidth

    public final void setWidth(int w)

  Set this object's bounding box's width.

  Parameters:
    `w` - the new width, in document coordinates

### getHeight

    public final int getHeight()

  Return the height of this object's bounding box.

  Returns:
    the height, in document coordinates

### setHeight

    public final void setHeight(int h)

  Set this object's bounding box's height.

  Parameters:
    `h` - the new height, in document coordinates

### getLeft

    public final int getLeft()

  Return this object's bounding box's X position

  Returns:
    the left position, in document coordinates

### setLeft

    public final void setLeft(int l)

  Set this object's bounding box's X position.

  Parameters:
    `l` - the new left position, in document coordinates

### getTop

    public final int getTop()

  Return this object's bounding box's Y position

  Returns:
    the top position, in document coordinates

### setTop

    public final void setTop(int t)

  Set this object's bounding box's Y position.

  Parameters:
    `t` - the new top position, in document coordinates

### getTopLeft

    public final java.awt.Point getTopLeft()

  Return the position of the top left corner of the bounding box.

  This method similar to getLocation(), except that the Location for some kinds of JGoObjects might not be the top-left corner of the bounding rectangle.

  This returns a newly allocated Point; you may find it more efficient to call getTopLeft(Point).

  Returns:
    the top-left corner, in document coordinates

### getTopLeft

    public final java.awt.Point getTopLeft(java.awt.Point result)

  Return the position of the top left corner of the bounding box.

  This method similar to getLocation(), except that the Location for some kinds of JGoObjects might not be the top-left corner of the bounding rectangle.

  Parameters:
    `result` - a Point that will be modified to have the top-left coordinates; if result is null a Point will be allocated
  Returns:
    the top-left corner, in document coordinates; this is the modified argument result or else a newly allocated Point

### setTopLeft

    public final void setTopLeft(java.awt.Point p)

  Change the location of this object so that the top-left corner of the bounding rectangle is at the given point.

  This method similar to setLocation(), except that the Location for some kinds of JGoObjects might not be the top-left corner of the bounding rectangle.

  Parameters:
    `p` - the new location, in document coordinates

### setTopLeft

    public final void setTopLeft(int x,
                                 int y)

  Change the location of this object so that the top-left corner of the bounding rectangle is at the given point.

  This method similar to setLocation(), except that the Location for some kinds of JGoObjects might not be the top-left corner of the bounding rectangle.

  Parameters:
    `x` - the new left position, in document coordinates
    `y` - the new top position, in document coordinates

### getLocation

    public java.awt.Point getLocation(java.awt.Point result)

  Return the location of this object.

  Defaults to the value of getTopLeft(), but may be overridden by various objects that have a different natural notion of what their location is, with respect to the top-left corner. If you override this method, you should also override setLocation().

  Parameters:
    `result` - a Point that will be modified to have the object's natural location in document coordinates; if result is null a Point will be allocated
  Returns:
    the location of the object, in document coordinates; this is the modified argument result or else a newly allocated Point

### getLocation

    public final java.awt.Point getLocation()

  Return the location of this object.

  This returns a newly allocated Point; you may find it more efficient to call getLocation(Point).

  Returns:
    the location of the object, in document coordinates

### setLocation

    public void setLocation(int x,
                            int y)

  Sets the location of this object to the given point.

  By default the location is the top-left corner. Override this method to change the default behavior, to match any override of getLocation().

  Parameters:
    `x` - the new X position for the object's location
    `y` - the new Y position for the object's location

### setLocation

    public final void setLocation(java.awt.Point loc)

  Sets the location of this object to the given (x,y) position.

  Parameters:
    `loc` - the location to set to, in document coordinates

### setSizeKeepingLocation

    public void setSizeKeepingLocation(int width,
                                       int height)

  Sets a new size for this object while maintaining the same Location. This is more efficient than remembering getLocation(), calling setSize(), and then calling setLocation() again.

  By default this is just the same as setSize(int, int).

  Parameters:
    `width` - the new width for this object's bounding rectangle
    `height` - the new height for this object's bounding rectangle

### setLocationOffset

    public final void setLocationOffset(int x,
                                        int y,
                                        int dx,
                                        int dy)

  Sets the location of this object from a point and an offset from that point. Offsets may be negative. Both are in document coordinates.

  Parameters:
    `x` - the x-coordinate
    `y` - the y-coordinate
    `dx` - the x-offset
    `dy` - the y-offset

### setLocationOffset

    public final void setLocationOffset(java.awt.Point location,
                                        java.awt.Point offset)

  Sets the location of this object from a point and an offset from that point. Offsets may be negative. Both are in document coordinates.

  Parameters:
    `location` - the basic Point to which this object should be moved
    `offset` - a relative-to-the-location position

### spotOpposite

    public static int spotOpposite(int nSpot)

  For the predefined spots, return the spot corresponding to the one on the opposite side of the object.

  This returns Center for the opposite of Center.

  Returns:
    a spot, not a Point or a coordinate position

### getRectangleSpotLocation

    public java.awt.Point getRectangleSpotLocation(java.awt.Rectangle r,
                                                   int spot,
                                                   java.awt.Point result)

### setRectangleSpotLocation

    public java.awt.Rectangle setRectangleSpotLocation(java.awt.Rectangle rect,
                                                       int spot,
                                                       int x,
                                                       int y,
                                                       java.awt.Rectangle result)

### getSpotLocation

    public java.awt.Point getSpotLocation(int nSpot,
                                          java.awt.Point result)

  Return the location of the given spot. This version of the method modifies a given point to have the specified location and then returns the point.

  If you override this method, perhaps because you want to support additional spots that make sense for your particular class, don't forget to override setSpotLocation too.

  Parameters:
    `nSpot` - the spot to return the location of
    `result` - a Point that will be modified to have the object's natural location in document coordinates; if result is null a Point will be allocated
  Returns:
    the location of the object's spot, in document coordinates; this is the modified argument result or else a newly allocated Point

### getSpotLocation

    public final java.awt.Point getSpotLocation(int nSpot)

  Return the location of the given spot.

  This returns a newly allocated Point; you may find it more efficient to call getSpotLocation(int, Point).

  Parameters:
    `nSpot` - the spot to return the location of
  Returns:
    the location of the given spot

### setSpotLocation

    public void setSpotLocation(int nSpot,
                                int x,
                                int y)

  Set the location of a particular spot to the given (x,y) location.

  If you override this method, override the function getSpotLocation() too.

  Parameters:
    `nSpot` - the number of the spot
    `x` - the x-coordinate of the new point
    `y` - the y-coordinate of the new point

### setSpotLocation

    public final void setSpotLocation(int nSpot,
                                      java.awt.Point pnt)

  Set the location of a particular spot to the given point.

  Parameters:
    `nSpot` - the number of the spot to move
    `pnt` - the new point

### setSpotLocation

    public final void setSpotLocation(int nSpot,
                                      JGoObject obj,
                                      int otherSpot)

  Set the location of a particular spot to be the same as a given spot on another object.

  Parameters:
    `nSpot` - the number of the spot to move
    `obj` - another object
    `otherSpot` - the spot on the other object

### setSpotLocationOffset

    public final void setSpotLocationOffset(int nSpot,
                                            int x,
                                            int y,
                                            int dx,
                                            int dy)

  Set the location of this object by a particular spot to the given point offset by (dx,dy).

  Parameters:
    `nSpot` - the number of the spot
    `x` - the x-coordinate
    `y` - the y-coordinate
    `dx` - the x-offset
    `dy` - the y-offset

### update

    public final void update()

  Cause this object to be repainted sometime in the near future.

  Listeners will receive a JGoDocumentEvent.CHANGED or a JGoViewEvent.CHANGED, depending on whether the object is a document object or a view object. The flag/sub-hint value will be RepaintAll, to indicate that views should repaint this object, but that no specific object state has been changed

  This method observes the SuspendUpdates properties of both this object and its document.

### update

    public void update(int hint,
                       int prevInt,
                       java.lang.Object prevVal)

  Cause this object to be repainted sometime in the near future.

  Listeners will receive a JGoDocumentEvent.CHANGED or a JGoViewEvent.CHANGED, depending on whether the object is a document object or a view object.

  A number of subhint values are predefined for the different kinds of changes that can happen:

  - JGoObject.RepaintAll = 0
  - JGoObject.ChangedGeometry = 1
  - JGoObject.ChangedVisible = 2
  - JGoObject.ChangedSelectable = 3
  - JGoObject.ChangedDraggable = 4
  - JGoObject.ChangedResizable = 5
  - JGoObject.Changed4ResizeHandles = 6
  - JGoObject.ChangedZOrder = 10
  - JGoObject.ChangedPen = 11
  - JGoObject.ChangedBrush = 12
  - JGoObject.ChangedDragsNode = 13
  - JGoObject.ChangedUpdatePartner = 14
  - JGoObject.ChangedAutoRescale = 15
  - JGoObject.ChangedInitializing = 40
  - JGoStroke.ChangedAddPoint = 101
  - JGoStroke.ChangedRemovePoint = 102
  - JGoStroke.ChangedModifiedPoint = 103
  - JGoStroke.ChangedArrowHeads = 104
  - JGoStroke.ChangedArrowLength = 105
  - JGoStroke.ChangedArrowShaftLength = 106
  - JGoStroke.ChangedArrowAngle = 107
  - JGoStroke.ChangedHighlight = 108
  - JGoStroke.ChangedCubic = 109
  - JGoStroke.ChangedAllPoints = 110
  - JGoStroke.ChangedArrowWidth = 111
  - JGoLink.ChangedFromPort = 201
  - JGoLink.ChangedToPort = 202
  - JGoLink.ChangedOrthogonal = 203
  - JGoLink.ChangedRelinkable = 204
  - JGoLink.ChangedJumpsOver = 205
  - JGoLink.ChangedAvoidsNodes = 206
  - JGoLink.ChangedCurviness = 207
  - JGoLink.ChangedAdjustingStyle = 208
  - JGoLink.ChangedUserObject = 209
  - JGoLink.ChangedPartID = 210
  - JGoLink.ChangedRoundedCorners = 211
  - JGoLabeledLink.ChangedFromLabel = 251
  - JGoLabeledLink.ChangedMidLabel = 252
  - JGoLabeledLink.ChangedToLabel = 253
  - JGoLabeledLink.ChangedGrabChildSelection = 254
  - JGoPort.ChangedStyle = 301
  - JGoPort.ChangedObject = 302
  - JGoPort.ChangedValidSource = 303
  - JGoPort.ChangedValidDestination = 304
  - JGoPort.ChangedFromSpot = 305
  - JGoPort.ChangedToSpot = 306
  - JGoPort.ChangedAddedLink = 307
  - JGoPort.ChangedRemovedLink = 308
  - JGoPort.ChangedEndSegmentLength = 309
  - JGoPort.ChangedValidSelfNode = 310
  - JGoPort.ChangedValidDuplicateLinks = 311
  - JGoPort.ChangedPartID = 312
  - JGo3DNoteRect.ChangedShadowSize = 401
  - JGo3DNoteRect.ChangedFlapSize = 402
  - JGo3DRect.ChangedState = 403
  - JGoRoundRect.ChangedArcDimension = 404
  - JGoText.ChangedText = 501
  - JGoText.ChangedAlignment = 502
  - JGoText.ChangedFontSize = 503
  - JGoText.ChangedFaceName = 504
  - JGoText.ChangedTextColor = 505
  - JGoText.ChangedBkColor = 506
  - JGoText.ChangedTransparent = 507
  - JGoText.ChangedBold = 508
  - JGoText.ChangedUnderline = 509
  - JGoText.ChangedItalic = 510
  - JGoText.ChangedMultiline = 511
  - JGoText.ChangedEditable = 512
  - JGoText.ChangedEditOnSingleClick = 513
  - JGoText.Changed2DScale = 514
  - JGoText.ChangedSelectBackground = 515
  - JGoText.ChangedClipping = 516
  - JGoText.ChangedStrikeThrough = 517
  - JGoText.ChangedAutoResize = 518
  - JGoText.ChangedWrapping = 519
  - JGoText.ChangedWrappingWidth = 520
  - JGoText.ChangedBetterPainting = 521
  - JGoImage.ChangedImage = 901
  - JGoImage.ChangedTransparentColor = 903
  - JGoImage.ChangedURL = 904
  - JGoImage.ChangedFilename = 905
  - JGoButton.ChangedLabel = 1001
  - JGoScrollBar.ChangedScrollBar = 1002
  - JGoScrollBar.ChangedScrollBarValue = 1003
  - JGoScrollBar.ChangedScrollBarVertical = 1004
  - JGoArea.ChangedPickableBackground = 1900
  - JGoNode.ChangedPartID = 2001
  - JGoNode.ChangedUserObject = 2002
  - JGoNode.ChangedToolTipText = 2003
  - JGoBasicNode.ChangedLabelSpot = 2101
  - JGoBasicNode.ChangedDrawable = 2102
  - JGoBasicNode.ChangedLabel = 2103
  - JGoBasicNode.ChangedPort = 2104
  - JGoBasicNode.ChangedInsets = 2105
  - JGoBasicNode.ChangedAutoResize = 2106
  - JGoIconicNode.ChangedLabel = 2201
  - JGoIconicNode.ChangedIcon = 2202
  - JGoIconicNode.ChangedPort = 2203
  - JGoIconicNode.ChangedLabelOffset = 2204
  - JGoIconicNode.ChangedDraggableLabel = 2205
  - JGoTextNode.ChangedLabel = 2301
  - JGoTextNode.ChangedBackground = 2302
  - JGoTextNode.ChangedTopPort = 2303
  - JGoTextNode.ChangedRightPort = 2304
  - JGoTextNode.ChangedBottomPort = 2305
  - JGoTextNode.ChangedLeftPort = 2306
  - JGoTextNode.ChangedInsets = 2307
  - JGoTextNode.ChangedAutoResize = 2308
  - JGoSubGraph.ChangedBackgroundColor = 2401
  - JGoSubGraph.ChangedBorderPen = 2402
  - JGoSubGraph.ChangedLabelSpot = 2403
  - JGoSubGraph.ChangedCollapsible = 2405
  - JGoSubGraph.ChangedInsets = 2406
  - JGoSubGraph.ChangedOpacity = 2407
  - JGoSubGraph.ChangedCollapsedLabelSpot = 2408
  - JGoSubGraph.ChangedCollapsedInsets = 2409
  - JGoSubGraph.ChangedCollapsedObject = 2410
  - JGoSubGraph.ChangedLabel = 2411
  - JGoSubGraph.ChangedPort = 2412
  - JGoSubGraph.ChangedState = 2413
  - JGoSubGraph.ChangedSavedBounds = 2414
  - JGoSubGraph.ChangedSavedPaths = 2415
  - JGoSubGraph.ChangedWasExpanded = 2416
  - JGoSubGraph.ChangedExpandedResizable = 2417
  - JGoObject.LastChangedHint = 0xFFFF
  Please note that this table may not be complete--indeed you are encouraged to add update sub-hint constants larger than LastChangedHint for your own properties and other changes. This sub-hint value is used as a sub-hint in the event object, implemented as the flags property of the event when the hint value is JGoDocumentEvent.CHANGED.

  This method observes the SuspendUpdates properties of this object. The object's document's fireUpdate() method observes the SuspendUpdates property of that document.

  When isUpdatePartner() is true, this method also calls the partner's partnerUpdate method. If getPartner() returns null, this method will call partnerUpdate on the parent area, if getParent() returns an object.

  When you add state to objects in your subclasses, be sure to remember to override copyOldValueForUndo, copyNewValueForRedo, and changeValue so that the JGoDocumentChangedEdit remembers and restores the before and after states of the object for each new object CHANGED hint.

  Parameters:
    `hint` - the flags to be passed through the event to the listener as the flags to help distinguish the kind of change.
    `prevInt` - a previous value for a changed property
    `prevVal` - a previous value for a changed property

### foredate

    public void foredate(int hint)

  The foredate method should be called by state changing methods before actually making any changes, when the following update method call is unable to provide the previous property value(s) in a convenient manner. Use this method to notify Undo/Redo-like listeners that they may want to pay attention to the state of this object before it gets modified.

  When an object's mutating method uses foredate/update instead of just update with a previous value, it is moving the responsibility of keeping track of the object's original state to any Undo/Redo document listeners.

  Note that this method is effective only for document objects. If this object is part of a view or not part of a document, this method is a no-op.

  Be sure that the copyOldValueForUndo method does copy the appropriate state.

  Parameters:
    `hint` - the flags to be passed through the event to the listener to help distinguish the kind of change.

### paint

    public void paint(java.awt.Graphics2D g,
                      JGoView view)

  Draws the object on the given graphics context. The default implementation is to draw a rectangle with an X in it. Derived classes should override this function to specify how they will appear on the screen.

  This method is commonly overridden. It is not called if the object is not Visible.

  The view argument can be used to customize the drawing behavior.

  Parameters:
    `g` - the graphics context on which to draw
    `view` - the view we're drawing in

### isPointInObj

    public boolean isPointInObj(java.awt.Point pnt)

  Returns true if the given point is inside this object.

  By default, this just checks to see if the point is in the bounding rectangle. Some classes will override this when the representation is not rectangular.

  Parameters:
    `pnt` - the point to check
  Returns:
    true if pnt is in this object

### expandRectByPenWidth

    public void expandRectByPenWidth(java.awt.Rectangle rect)

  Modify the given rectangle to account for any likely drawing beyond the bounds of the rectangle caused by wide pens.

  JGoDrawable has a JGoPen, so it overrides this.

  Parameters:
    `rect` - a rectangle to be modified

### getNearestIntersectionPoint

    public boolean getNearestIntersectionPoint(int px,
                                               int py,
                                               int cx,
                                               int cy,
                                               java.awt.Point result)

  Compute the point along the sides of this object's bounding rectangle that is closest to a given point on a straight line from that point to another given point.

  We modify the given result Point to hold the point that is closest to (px,py).

  Parameters:
    `px` - the X coordinate of a point that starts a line
    `py` - the Y coordinate of a point that starts a line
    `cx` - the X coordinate of a point that specifies the other end of the line
    `cy` - the Y coordinate of a point that specifies the other end of the line
    `result` - a Point that is modified (must not be null)
  Returns:
    whether the line from (px,py) to (cx,cy) intersects the bounding rectangle

### pick

    public JGoObject pick(java.awt.Point p,
                          boolean selectableOnly)

  Return an object at a point, perhaps only a selectable one.

  This will return null if this object is not visible or if the point is not in this object (isPointInObj). If the selectableOnly argument is false, it will return this object; if selectableOnly is true, it will return this object only if isSelectable() is true. Finally, if isSelectable() is false, and this object is part of a JGoArea, it proceeds up the chain of parent objects until it finds one that isSelectable(), and returns that. Failing all of those tests, this method will return null.

  This method is called by JGoLayer.pickObject, JGoLayer.pickObjects, JGoView.pickObject, and JGoArea.pickObject.

  Parameters:
    `p` - a Point in document coordinates
    `selectableOnly` - whether the return value must be selectable by the user
  Returns:
    An object under the point. If selectableOnly is true, the object returned may be a Parent of this object, and will have isSelectable() be true. This method returns null if not suitable object is found.

### doMouseClick

    public boolean doMouseClick(int modifiers,
                                java.awt.Point dc,
                                java.awt.Point vc,
                                JGoView view)

  Called when the user clicks on this object. The view will have selected an object first.

  The default implementation is to do nothing. Derived classes can override to provide various behaviors such as bringing up a properties editing dialog appropriate for this class, or by performing some action on this object. JGoText overrides this to start user-editing of the text string, if that behavior was enabled on that instance of the JGoText.

  If this method returns false, the view will try this object's parent, and so on up the chain of parents, until either a call returns true, or until there are no more parents. In the latter case the view will have some default behavior.

  Another way to get notified of an object being clicked on is to add a JGoViewListener and watch for CLICKED events.

  Parameters:
    `modifiers` - which modifier keys and buttons are depressed (see MouseEvent documentation)
    `dc` - the point of the click in document coordinates
    `vc` - the point of the click in view coordinates
    `view` - the view in which this event occured
  Returns:
    true if handled here and the view doesn't need to try this object's parent to see if it's interested
  See Also:
    `JGoView.doMouseDblClick(int, java.awt.Point, java.awt.Point)`

### doMouseDblClick

    public boolean doMouseDblClick(int modifiers,
                                   java.awt.Point dc,
                                   java.awt.Point vc,
                                   JGoView view)

  Called when the user double clicks on this object.

  The default implementation is to do nothing. Derived classes can override to provide various behaviors such as bringing up a properties editing dialog appropriate for this class, or by bringing up another window.

  If this method returns false, the view will try this object's parent, and so on up the chain of parents, until either a call returns true, or until there are no more parents. In the latter case the view will have some default behavior.

  Another way to get notified of an object being clicked on is to add a JGoViewListener and watch for DOUBLE_CLICKED events.

  Parameters:
    `modifiers` - which modifier keys and buttons are depressed (see MouseEvent documentation)
    `dc` - the point of the click in document coordinates
    `vc` - the point of the click in view coordinates
    `view` - the view in which this event occured
  Returns:
    true if handled here and the view doesn't need to try this object's parent to see if it's interested
  See Also:
    `JGoView.doMouseDblClick(int, java.awt.Point, java.awt.Point)`

### doUncapturedMouseMove

    public boolean doUncapturedMouseMove(int flags,
                                         java.awt.Point dc,
                                         java.awt.Point vc,
                                         JGoView view)

  Called when the mouse moves over this object without any mouse button down, not during a drag or resize or similar mouse action.

  The default behavior is to do nothing. Derived classes can override to handle this method in various manners, such as changing the cursor or updating a status window. JGoHandle overrides this method to change the cursor.

  If this method returns false (the default), the view will call this object's parent with the same arguments, and so on up the parent chain, until a call returns true, or until there are no more parents. In the latter case the view will have some default behavior.

  A special case of this kind of behavior is embodied by the getToolTipText() method.

  Parameters:
    `flags` - event specific flags
    `dc` - the point of the click in document coordinates
    `vc` - the point of the click in view coordinates
    `view` - the view in which this event occured
  Returns:
    true if handled here and the view doesn't need to try this object's parent to see if it's interested
  See Also:
    `JGoView.doUncapturedMouseMove(int, java.awt.Point, java.awt.Point)`

### getToolTipText

    public java.lang.String getToolTipText()

  Called to produce a string to be used for a tooltip for this object.

  Return null if there should be no tooltip for this object.

  The default behavior is to return null, so no object will have any tooltips unless one overrides this method.

  Returns:
    the tooltip string for this object

### ownerChange

    protected void ownerChange(JGoObjectCollection oldOwner,
                               JGoObjectCollection newOwner,
                               JGoObject mainObject)

  Called whenever this object's owner (JGoDocument or JGoView) changes.

  This is often useful when the newOwner is null, meaning this object is no longer part of its document (or view for view objects).

  Parameters:
    `oldOwner` - the previous owner object
    `newOwner` - the new owner object
    `mainObject` - the object being inserted or removed from the document or view

### gainedSelection

    protected void gainedSelection(JGoSelection selection)

  Called after this object has gained the selection in some view.

  The default behavior is to create the appropriate selection handle(s) for this object. The kind and number of selection handles depends on whether the object is resizable and whether the 4ResizeHandles property is true. The appearance of the standard selection handles is determined by JGoSelection.

  If you want to display selection in completely different manner, not using the standard (or slightly altered) selection handles, override this function. One common technique is to change the appearance of the selected object itself, particularly for compound objects ("nodes"). You can change the border, background color, icon, or text's font or color or background.

  Another way to get notified of an object becoming selected is to add a JGoViewListener and watch for SELECTION_GAINED events.

  Parameters:
    `selection` - the selection into which this object was added

### lostSelection

    protected void lostSelection(JGoSelection selection)

  Called after this object has lost the selection in some view.

  Another way to get notified of an object becoming unselected is to add a JGoViewListener and watch for SELECTION_LOST events.

  Parameters:
    `selection` - the selection from which this object was removed

### redirectSelection

    public JGoObject redirectSelection()

  Called before this object is selected in some view. The object that this method returns is the one that will be selected -- so you can "redirect" the selection to another object. If you return null, no object will be selected.

  Returns:
    by default, returns this object

### getDraggingObject

    public JGoObject getDraggingObject()

  This is called by JGoView.moveSelection to decide which object should be moved for a given object in the selection.

  Normally this is just this object's top-level object. However, if isDragsNode() is false, this just returns itself. Furthermore, in the default case where isDragsNode() is true, this method searches up the chain of parents to find the first one whose DragsNode property is false. If it finds one, it returns that JGoArea; otherwise it returns the top-level object.

### handleMove

    public void handleMove(JGoView view,
                           int modifiers,
                           int event,
                           int spotNumber,
                           int origX,
                           int origY,
                           int newX,
                           int newY)

  Called by JGoView.moveSelection when the user moves this object.

  Basically this just calls setSpotLocation with the given spotNumber and the result of calling computeMove. However, you can override this method to constrain the places that this object can be moved to by the user. You will still be able to move this object programmatically by setting the bounding rectangle or by calling setLocation or setTopLeft.

  Parameters:
    `view` - the JGoView in which the user is moving the selection
    `modifiers` - which modifier keys and buttons are depressed (see MouseEvent documentation)
    `event` - one of: JGoView.EventMouseUp, JGoView.EventMouseMove, JGoView.EventMouseDown
    `spotNumber` - a spot of this object, such as JGoObject.TopLeft or JGoObject.Center
    `origX` - the original location's X coordinate
    `origY` - the original location's Y coordinate
    `newX` - the proposed new location's X coordinate
    `newY` - the proposed new location's Y coordinate

### computeMove

    public java.awt.Point computeMove(int origX,
                                      int origY,
                                      int newX,
                                      int newY,
                                      java.awt.Point result)

  Calculate a new location for this object.

  This is normally called by JGoDocument.copyFromCollection and JGoObject.handleMove

  Parameters:
    `origX` - the original X coordinate of this object's location
    `origY` - the original Y coordinate of this object's location
    `newX` - the proposed new X coordinate for this object's location
    `newY` - the proposed new Y coordinate for this object's location
    `result` - a Point that is modified to hold the new X,Y location; if this argument is null, a new Point is allocated, modified, and returned
  Returns:
    the new location for this object, which by default is just the result Point: (newX,newY)

### handleResize

    protected java.awt.Rectangle handleResize(java.awt.Graphics2D g,
                                              JGoView view,
                                              java.awt.Rectangle origRect,
                                              java.awt.Point newPoint,
                                              int whichHandle,
                                              int event,
                                              int minWidth,
                                              int minHeight)

  Called when dragging a resize handle.

  By default, the dragging a resize handle causes the object to be resized. Depending on which handle is being dragged, a corner or a side of the object is moved, thereby resizing and/or repositioning the object.

  The bounding rectangle for this object is only changed on an EventMouseUp. This means that the object is not really resized interactively--the user only resizes a rectangular outline. If you want to really cause the object to be resized interactively, override this method and after the super method, call setBoundingRect() when the event is EventMouseMove.

  Return null if you handle updating in realtime and don't want to have the view draw the XOR'd rectangle.

  To enforce a minimum width or height while resizing, override this method and just call this super method passing in the desired minimums.

  JGoStroke and JGoLink override this method to provide completely different behavior.

  Parameters:
    `g` - the graphics context to draw on
    `view` - the view we're being resizing in
    `origRect` - the object's original bounding rectangle
    `newPoint` - the location of the new point
    `whichHandle` - the handle number of the point being moved
    `event` - one of: JGoView.EventMouseUp, JGoView.EventMouseMove, JGoView.EventMouseDown
    `minWidth` - the minimum width of the object (defaults to zero)
    `minHeight` - the minimum height of the object (defaults to zero)

### computeResize

    protected java.awt.Rectangle computeResize(java.awt.Rectangle origRect,
                                               java.awt.Point newPoint,
                                               int whichHandle,
                                               int minWidth,
                                               int minHeight)

  Calculate a new bounding rectangle for this object.

  This is normally called by handleResize.

  Parameters:
    `origRect` - the object's original bounding rectangle
    `newPoint` - the location of the new point
    `whichHandle` - the handle number of the point being moved
    `minWidth` - the minimum width of the object (defaults to zero)
    `minHeight` - the minimum height of the object (defaults to zero)
  Returns:
    a newly allocated Rectangle holding the new bounding rectangle

### geometryChange

    protected void geometryChange(java.awt.Rectangle prevRect)

  Called just after the bounding rectangle for this object has been changed. This is a hook for subclasses to get notification and perform processing when their dimensions change. For JGoAreas, this method is typically used to call a method to resize and reposition some or all of the children, depending on the class's specific needs.

  The default implementation does nothing.

  Another way to get notified of an object changing location or size is to add a JGoDocumentListener and watch for CHANGED events.

  When this method (or the listener) gets called, the bounding rectangle for this object has already been changed, so it is already too late to prevent the change. Changing the bounding rectangle from this method (or the listener) should be avoided, or at least done extremely carefully to avoid situations such as ever-expanding objects or infinite adjustment loops.

### geometryChangeChild

    protected boolean geometryChangeChild(JGoObject child,
                                          java.awt.Rectangle prevRect)

  Called if any child of this object has their bounding box changed.

  Override this method with care to avoid situations where changing the geometry of other children (or especially of the given child) might cause infinite loops or indeterminate-appearing behavior. The latter can easily happen when layout algorithms implicitly depend on the order that objects have their geometry changed.

  Parameters:
    `child` - the child that has changed
    `prevRect` - the child's previous bounding rectangle
  Returns:
    true if the bounding rect was changed by this method

### SVGWriteObject

    public void SVGWriteObject(DomDoc svgDoc,
                               DomElement jGoElementGroup)

  Description copied from interface: `JGoXMLSaveRestore`
  Write this object out to a DomDoc representing a Scalable Vector Graphics (SVG) XML document.

  This method will be called by com.nwoods.jgo.svg.DefaultDocument.SVGWriteDoc() for every JGoObject contained within a JGoDocument. The following example uses a JGoRectangle to illustrate the format of a generated SVG JGoObject:

  <g>
  <JGoClass class="com.nwoods.jgo.JGoRectangle"\>
  <rect height="75" style="stroke:black;stroke-width:1;fill:rgb(255,0,0);" width="75" x="65" y="71"/>
  <JGoClass class="com.nwoods.jgo.JGoDrawable" drawablebrush="jgoid1" drawablepen="jgoid2" embeddedpenbrush="false"/>
  <JGoClass class="com.nwoods.jgo.JGoObject" obj_flags="1054"/>
  </g>

  Note that the entire JGoObject is enclosed in a group (<g>). Each subclass of the JGoObject is described by a <JGoClass> element, starting with the most specific class and moving to the more general. Each <JGoClass> element has a "class" attribute which defines the class name. Each <JGoClass> element may also have several other attributes which uniquely describe that state of that class. Following the <JGoClass> element, each class may also genereate any other elements that are required, including representations of contained objects and standard SVG elements such as the <rect> element shown in the above example. The generation of SVG elements in the output makes it possible for the output to be read by SVG viewers and other SVG aware applications. The information contained in the <JGoClass> elements allows us to accurately save and restore all the information in a particular JGoObject subclass.

  If this class contains a reference to another object, call DomDoc.registerReferencingNode() to register that reference. This will cause the element representing the referenced object to be identified with a unique id attribute, and cause the element representing the referring object to have a user defined attribute containing a reference to that id. See DomDoc.registerReferencingNode() for more information.

  Typically, an implementation of this method will generate a <JGoClass> element using the DomDoc.createJGoClassElement() method, adding whatever attributes are necessary to describe the class. It will then call its superclass so that the superclass can add its own <JGoClass> element and other information to jGoElementGroup within the DomDoc.

  Refer to com.nwoods.jgo.examples.flower.ActivityNode.SVGWriteObject() and com.nwoods.jgo.examples.SimpleNode.SVGWriteObject() for examples using this method.

  Refer to the file com.nwoods.jgo.svg\xsvg.dtd for a formal description of JGo extensions to the SVG document type.

  Specified by:
    `SVGWriteObject` in interface `JGoXMLSaveRestore`
  Parameters:
    `svgDoc` - the DomDoc in which to construct the SVG representation of this object
    `jGoElementGroup` - the DomElement to which to attach this object
  See Also:
    `SVGReadObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.JGoDocument, com.nwoods.jgo.DomElement, com.nwoods.jgo.DomElement)`, `SVGWriteAttributes(com.nwoods.jgo.DomElement)`, `SVGReadAttributes(com.nwoods.jgo.DomElement)`, `SVGUpdateReference(java.lang.String, java.lang.Object)`, `DomDoc`, `DomNode`, `DomElement`, `DomText`

### SVGReadObject

    public DomNode SVGReadObject(DomDoc svgDoc,
                                 JGoDocument jGoDoc,
                                 DomElement svgElement,
                                 DomElement jGoChildElement)

  Description copied from interface: `JGoXMLSaveRestore`
  Read this object in from a DomDoc representing a Scalable Vector Graphics (SVG) XML document.

  This method will be called by com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc() for every <JGoClass> element encountered in a DomDoc. First, an object of the type specified by the class attribute will be created and then the SVGReadObject() method will be called on that newly created object. Refer to SVGWriteObject() for a description of the expected format of the SVG document.

  This method may also be called by com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc() when reading any SVG document, including those not generated by JGo and therefore not containing any <JGoClass> elements. In such cases, the DefaultDocument.SVGReadElement() method may be subclassed to examine the SVG element and cause the appropriate JGoObject to be created to represent that element and call SVGReadObject() on that newly created object. By default, standard JGoObjects such as JGoRectangles, JGoStrokes, etc will be created to represent these objects.

  If this class contains a reference to another object, call DomDoc.registerReferencingObject() to register that reference. This will cause the JGoObject.SVGUpdateReference() to be called on the referencing object after all the objects have been created, passing in the object befing referenced. See DomDoc.registerReferencingObject() for more information.

  Typically, an implementation of this method starts by verifying that the element being read is a <JGoClass> element (which will be true if jGoChildElement is not null). This will always be true unless you have subclassed the DefaultDocument.SVGReadElement() method as described above. It will then read the expected attributes of the <JGoClass> element (as written by SVGReadObject()), call SVGReadObject() on its superclass, and finally return the next element by calling svgElement.getNextSibling().

  Refer to com.nwoods.jgo.examples.flower.ActivityNode.SVGReadObject() and com.nwoods.jgo.examples.SimpleNode.SVGReadObject() for examples using this method.

  Specified by:
    `SVGReadObject` in interface `JGoXMLSaveRestore`
  Parameters:
    `svgDoc` - the DomDoc containing the SVG representation of this object
    `jGoDoc` - the JGoDocument in which this object was created
    `svgElement` - the element being read (typically the <g> element containing the JGoObject definition)
    `jGoChildElement` - the current <JGoClass> element being read withing the <g>
  See Also:
    `SVGWriteObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.DomElement)`, `SVGWriteAttributes(com.nwoods.jgo.DomElement)`, `SVGReadAttributes(com.nwoods.jgo.DomElement)`, `SVGUpdateReference(java.lang.String, java.lang.Object)`, `DomDoc`, `DomNode`, `DomElement`, `DomText`

### SVGWriteAttributes

    public void SVGWriteAttributes(DomElement svgElement)

  This method will add attributes to standard SVG elements.

  Call this method from SVGWriteObject() if standard SVG elements are generated by this class or if this class may be subclassed and it should contribute arguments to SVG elements. For example, the JGoDrawable class implements this method to add standard SVG attributes for stroke, fill, and width. The JGoRectangle class calls this method to add all appropriate attributes to the <rect> element it generates. It is not necessary to implement this method if this class does not contribute any attributes to standard SVG elements. It is not necessary to call this method from SVGWriteObject() if this class does not generate any standard SVG elements.

  Typically, an implementation of this method will first call the superclass and then call DomElement.setAttribute() to add attributes for this class.

  Parameters:
    `svgElement` - the DomElement to which to add attributes
  See Also:
    `SVGWriteObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.DomElement)`, `SVGReadObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.JGoDocument, com.nwoods.jgo.DomElement, com.nwoods.jgo.DomElement)`, `SVGWriteAttributes(com.nwoods.jgo.DomElement)`, `SVGReadAttributes(com.nwoods.jgo.DomElement)`, `SVGUpdateReference(java.lang.String, java.lang.Object)`, `DomDoc`, `DomNode`, `DomElement`, `DomText`

### SVGReadAttributes

    public void SVGReadAttributes(DomElement svgElement)

  This method will read attributes from standard SVG elements.

  Call this method from SVGReadObject() if standard SVG elements are being read by this class or if this class may be subclassed and it should read arguments from SVG elements. For example, the JGoDrawable class implements this method to read standard SVG attributes for stroke, fill, and width. The JGoRectangle class calls this method to read all appropriate attributes from the <rect> element it is reading. It is not necessary to implement this method if this class does not read any attributes from standard SVG elements. It is not necessary to call this method from SVGReadObject() if this class does not read any standard SVG elements.

  Typically, an implementation of this method will first call the superclass and then call DomElement.getAttribute() to read the attributes for this class.

  Parameters:
    `svgElement` - the DomElement from which to read attributes
  See Also:
    `SVGWriteObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.DomElement)`, `SVGReadObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.JGoDocument, com.nwoods.jgo.DomElement, com.nwoods.jgo.DomElement)`, `SVGWriteAttributes(com.nwoods.jgo.DomElement)`, `SVGReadAttributes(com.nwoods.jgo.DomElement)`, `SVGUpdateReference(java.lang.String, java.lang.Object)`, `DomDoc`, `DomNode`, `DomElement`, `DomText`

### SVGUpdateReference

    public void SVGUpdateReference(java.lang.String attr,
                                   java.lang.Object referencedObject)

  This method will be called to fill in object references.

  This is called by com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc() after all the objects have been created and if DomDoc.registerReferencingObject() has been previously called by SVGReadObject().

  Typically, an implementation of this method will first call the superclass and then fill in the appropriate object reference based on the attr argument.

  Refer to com.nwoods.jgo.examples.SimpleNode.SVGWriteObject() for an example using this method.

  Parameters:
    `attr` - the attribute name specified by SVGReadDoc() in DomDoc.registerReferencingObject()
    `referencedObject` - the object being referenced
  See Also:
    `SVGWriteObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.DomElement)`, `SVGReadObject(com.nwoods.jgo.DomDoc, com.nwoods.jgo.JGoDocument, com.nwoods.jgo.DomElement, com.nwoods.jgo.DomElement)`, `SVGWriteAttributes(com.nwoods.jgo.DomElement)`, `SVGReadAttributes(com.nwoods.jgo.DomElement)`, `SVGUpdateReference(java.lang.String, java.lang.Object)`, `DomDoc`, `DomNode`, `DomElement`, `DomText`

### getParent

    public JGoArea getParent()

  Gets the parent area for this object.

### setParent

    protected void setParent(JGoArea parent)

  Called by the area's methods to add and remove objects from the area, to set the parent area back-pointer for this object.

  In order to add an object to an area, don't call this method, but instead call one of the area's methods to add an object.

  Parameters:
    `parent` - the area that this object will be a part of

### isTopLevel

    public final boolean isTopLevel()

  This predicate returns true if this object is not part of an area.

### getTopLevelObject

    public JGoObject getTopLevelObject()

  If this object has no parent area, return this object itself. Otherwise return the most enclosing area for this object, i.e. the area containing this object that has no parent area.

### getParentNode

    public JGoObject getParentNode()

  Return the highest-level object in the parent chain that is not a JGoSubGraphBase. If this object has no parent area, return this object itself.

### getParentJGoNode

    public JGoNode getParentJGoNode()

  Return the first object in the parent chain that is a JGoNode. If no parent JGoNode is found, return null.

### isChildOf

    public boolean isChildOf(JGoObject obj)

  Determines if this object is a child, perhaps indirectly, of the given object.

  Parameters:
    `obj` - any JGoObject
  Returns:
    this predicate will be false if OBJ is this object itself or if it is not a JGoArea

### findCommonParent

    public static JGoObject findCommonParent(JGoObject a,
                                             JGoObject b)

  Find the JGoArea that is closest parent area for this object and another.

  This will return null if either argument is null or if there is no parent JGoArea that contains both objects. If A is the same object as B, it will return it. If A is a parent of B, it will return A. If B is a parent of A, it will return B.

  Parameters:
    `a` - any JGoObject
    `b` - any JGoObject

### remove

    public void remove()

  This convenience method just removes this object from its container, if there is any.

  If this object is a child of a JGoArea, it is removed from that area. If this object is a top-level object in a JGoLayer, it is removed from that layer. If this object is an object owned by a JGoView, it is removed from that view.

### getDocument

    public JGoDocument getDocument()

  Gets the document for this object. This will return null for view objects and for objects that have not yet been added to a document.

### getLayer

    public JGoLayer getLayer()

  Return the JGoLayer that owns this object. If this object is not part of a document, this will return null.

### getView

    public JGoView getView()

  Returns the view that owns this object if it is a view object, or else null if it is not a view object.

  Returns:
    the parent view

### showSelectionHandles

    public void showSelectionHandles(JGoSelection selection)

  Show the selection handles.

### hideSelectionHandles

    public void hideSelectionHandles(JGoSelection selection)

  Hide the selection handles.

### getPartner

    public JGoObject getPartner()

  Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class. Although JGoObject does not provide any storage for this "property", subclasses may decide to do so.

  By default this returns null.

### setPartner

    public void setPartner(JGoObject obj)

  Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class. Although JGoObject does not provide any storage for this "property", subclasses may decide to do so.

  By default this is a no-op.

### setUpdatePartner

    public void setUpdatePartner(boolean bFlag)

  Change whether any partner of this object should be notified of any updates to this object by calling its partnerUpdate method.

  Even if this object is not selectable, it can still be part of a view's selection, by adding it programmatically.

  Parameters:
    `bFlag` - true if selectable, false if not

### isUpdatePartner

    public boolean isUpdatePartner()

  Return whether this object will notify a partner or parent object about any updates.

  If this property is true, the update method will call the partnerUpdate method on the object returned by getPartner(). If getPartner() returns null, the update method will instead call partnerUpdate on the parent area, assuming getParent() returns a non-null JGoObject.

### partnerUpdate

    protected void partnerUpdate(JGoObject partner,
                                 int hint,
                                 int prevInt,
                                 java.lang.Object prevVal)

  This method is called when a partner or child object is updated, if its isUpdatePartner() is true.

  By default this does nothing.

  Parameters:
    `partner` - the partner or child object that was changed
    `hint` - the flags to be passed through the event to the listener as the flags to help distinguish the kind of change.
    `prevInt` - a previous value for a changed property
    `prevVal` - a previous value for a changed property

### copyOldValueForUndo

    public void copyOldValueForUndo(JGoDocumentChangedEdit e)

  This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed. The previous value Object provided by the JGoObject.update method might be altered by future changes. But losing that state would make it hard for the JGoDocumentChangedEdit to perform an undo correctly. In these cases it is important for the JGoDocumentChangedEdit to make a copy of the Object value, by calling setOldValue with a copy of the getOldValue Object.

  The exact nature of the Object depends on the particular event hint or sub-hint, of course, but is typically a Rectangle or Point or some similar structure that is actually owned by the object. The responsibility for copying rests with the document event listener rather than the code calling JGoObject.update for efficiency when there is no undo/redo manager.

  Parameters:
    `e` - the UndoableEdit that also remembers the kind of change and any appropriate previous state that should be copied in-place

### copyNewValueForRedo

    public void copyNewValueForRedo(JGoDocumentChangedEdit e)

  This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed. In order for the JGoDocumentChangedEdit to be able to perform a redo, it needs to remember the new property value or state. However, the JGoObject.update method does not provide such a new value. The value must be taken from this object and copied into the JGoDocumentChangedEdit by calling setNewValue and/or setNewValueInt.

  Just as the previous/old value/state information is stored as one or both of an integer and an Object, the new value/state information may be stored as either or both of an integer or an Object.

  The responsibility for copying rests with the document event listener rather than the code calling JGoObject.update for efficiency when there is no undo/redo manager.

  Parameters:
    `e` - the UndoableEdit that also remembers the kind of change and any appropriate new state that should be copied in

### changeValue

    public void changeValue(JGoDocumentChangedEdit e,
                            boolean undo)

  This method is called by the JGoDocumentChangedEdit.undo and redo methods to actually perform the property value change for a JGoObject.

  You will want to override this method to handle changing the additional state of your object subclasses.

  Parameters:
    `e` - the UndoableEdit that also remembers the kind of change and any appropriate old and new state for performing an undo or redo
    `undo` - if true, this method should restore the old state/value, otherwise this method should restore the new state/value

### setFlags

    public final void setFlags(int f)

  Each JGoObject keeps a set of flags that you can use for any purpose; the JGo system itself does not make use of this property. However, the flags are copied by copyObject and are not transient.

  Setting the flags does not call update, because the need for update must be determined by the application and the flags being changed.

  Parameters:
    `f` - a new set of flag bits

### getFlags

    public final int getFlags()

  Return the current state of this object's flags.

### setVisible

    public void setVisible(boolean bFlag)

  Change whether the object can be seen by the user.

  Invisible objects, besides being hidden, tend not to be selectable or respond to mouse events.

  Parameters:
    `bFlag` - true if visible, false if not

### isVisible

    public boolean isVisible()

  Return whether this object is visible in the view.

  Note that even if isVisible() is true, the object might not be seen by the user, perhaps because other objects are occluding this one, or because this object has been scrolled off beyond the view's canvas.

### canView

    public boolean canView()

  Return whether this object and all of its Parent areas and its Layer are visible.

### setSelectable

    public void setSelectable(boolean bFlag)

  Change whether the object can be selected by the user's clicking or drag-box-selecting the object.

  Even if this object is not selectable, it can still be part of a view's selection, by adding it programmatically.

  A selectable JGoArea will get selected when trying to select an unselectable child of the area. Call JGoArea.setPickableBackground(true) to make a click within an area but not in a child select the area.

  Parameters:
    `bFlag` - true if selectable, false if not

### isSelectable

    public boolean isSelectable()

  Return whether this object is selectable by the user.

### setDraggable

    public void setDraggable(boolean bFlag)

  Change whether the object can be dragged by the user.

  You can change the location programmatically by calling setBoundingRect() or setLocation() or related methods.

  Parameters:
    `bFlag` - true if draggable, false if not

### isDraggable

    public boolean isDraggable()

  Return whether this object is draggable by the user.

### setResizable

    public void setResizable(boolean bFlag)

  Change whether the object can be resized by the user.

  You can change the dimensions programmatically by calling setBoundingRect() or setSize() or related methods.

  By default a resizable object will have four or eight resize handles at the corners and middles of the sides, depending on the 4ResizeHandles property.

  Parameters:
    `bFlag` - true if resizable, false if not

### isResizable

    public boolean isResizable()

  Return whether this object is resizable by the user.

### set4ResizeHandles

    public void set4ResizeHandles(boolean bFlag)

  Change whether the object has four standard resize handles instead of eight. If there are only four, the four corner handles are the ones that are shown.

  Parameters:
    `bFlag` - true if only four, false if eight

### is4ResizeHandles

    public boolean is4ResizeHandles()

  Return whether this object displays only four resize handles instead of the default eight when selected and resizable.

### setAutoRescale

    public void setAutoRescale(boolean bFlag)

  Change whether this object automatically rescales its appearance when its size changes.

  For most objects, particularly shapes, it is natural that when the size changes, the object adjusts its appearance appropriately smaller or larger, and accomodating any change in aspect ratio. Most classes ignore this property. However, there are certain circumstances where users do not expect this behavior, for example for JGoText instances that are part of a resizable area. Typically you will set this property false for text objects added to areas. JGoArea.rescaleChildren heeds this property.

### isAutoRescale

    public boolean isAutoRescale()

  Return whether this object automatically rescales its appearance when its size changes.

  This defaults to true for most objects. However JGoText defaults this to false, since most resizings of areas don't expect the text size to change.

### setDragsNode

    public void setDragsNode(boolean bFlag)

  Change whether this object, when moved, drags the top-level object instead.

  This is used by getDraggingObject, which in turn is called by JGoView.moveSelection.

  Parameters:
    `bFlag` - true if drags top-level node, false if not

### isDragsNode

    public boolean isDragsNode()

  Return whether this object, when moved, drags the first parent area whose DragsNode property is false, or the top-level object if no such parent is found.

  By default this property is true.

### setSuspendUpdates

    public void setSuspendUpdates(boolean bFlag)

  Change whether the screen is updated and document listeners are notified in response to a change to this object. This method should be used with caution--you should be sure to call setSuspendUpdates(false) soon after making a group of changes to this object.

  You can temporarily turn off updates for all objects in a document by using JGoDocument.setSuspendUpdates().

  Parameters:
    `bFlag` - true if stop notifications, false if resume notifications

### isSuspendUpdates

    public boolean isSuspendUpdates()

  Return whether this object is not automatically updated when it is changed.

### setSkipsUndoManager

    public void setSkipsUndoManager(boolean bFlag)

  Change whether the JGoUndoManager for this object's JGoDocument (if any) should record any change to this object. Setting this property does not notify any listeners.

  Parameters:
    `bFlag` - true if to stop recording JGoDocumentChangedEdits, false if to record normally

### isSkipsUndoManager

    public boolean isSkipsUndoManager()

  Return whether this object's document's undo manager (if any) should avoid remembering any changes to this object. By default this value is false. This predicate is used by JGoUndoManager.skipEvent.

### setSuspendChildUpdates

    public void setSuspendChildUpdates(boolean bFlag)

  Deprecated. no longer needed

### isSuspendChildUpdates

    public boolean isSuspendChildUpdates()

  Deprecated. no longer needed

### setBoundingRectInvalid

    protected void setBoundingRectInvalid(boolean bFlag)

  Set whether or not the bounding rectangle for this object needs to be recomputed before getBoundingRect() returns.

  Typically you will call this method with a true value at the end of your geometryChange or geometryChangeChild method where the children of an area have been resized and rearranged and you need to make sure the bounding rectangle is up-to-date.

  Setting this flag does not call update.

  Parameters:
    `bFlag` - if true, getBoundingRect() should recompute this object's true bounds

### isBoundingRectInvalid

    protected boolean isBoundingRectInvalid()

  Return whether the bounding rectangle is out-of-date and getBoundingRect() needs to compute it.

  Returns:
    true if the stored bounding Rectangle is invalid and needs to be recomputed and reset

### setInitializing

    public void setInitializing(boolean bFlag)

  Set or clear a flag indicating that this object is being initialized.

  This is normally only used by JGoAreas when areas are constructed or initialized, to avoid repeated expensive calculations such as JGoNode.layoutChildren().

  Setting this flag does not call update.

### isInitializing

    public boolean isInitializing()

  Return whether the Initializing flag is set.

### setBoundsRect

    public static void setBoundsRect(java.awt.Rectangle r,
                                     java.awt.Rectangle b)

  This method implements Rectangle.setBounds(Rectangle) for convenient compatibility with SWT.

### copyRect

    public static java.awt.Rectangle copyRect(java.awt.Rectangle b)

  This method implements new Rectangle(Rectangle) for convenient compatibility with SWT.

### growRect

    public static void growRect(java.awt.Rectangle b,
                                int w,
                                int h)

  This method implements Rectangle.grow(int, int) for convenient compatibility with SWT.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD