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 JGoView

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  com.nwoods.jgo.JGoView

All Implemented Interfaces:
  java.awt.dnd.Autoscroll, java.awt.datatransfer.ClipboardOwner, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, java.util.EventListener, java.awt.image.ImageObserver, JGoDocumentListener, JGoObjectCollection, JGoObjectSimpleCollection, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable

Direct Known Subclasses:
  JGoGridView, JGoJPEGView, JGoOverview, JGoPalette

public class JGoView
extends javax.swing.JComponent
implements JGoObjectCollection, java.awt.print.Printable, java.awt.datatransfer.ClipboardOwner, java.awt.dnd.Autoscroll, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, JGoDocumentListener, java.awt.event.KeyListener

JGoView is a lightweight Swing JComponent that supports the display and editing of graphical objects such as nodes and links.

JGoView supports the model-view-controller paradigm. JGoDocument is the model for JGoView.

JGoView supports many basic features:

- displaying a JGoDocument and its JGoObjects
- displaying its own view-specific objects
- scrolling and scroll bars
- autoscrolling
- scaling (zooming)
- printing
- clipboard transfer
- drag-and-drop
- default keyboard commands
- view events and listeners
- selection
- creating links between ports, or reconnecting existing links
- resizing objects
- handling single clicks, double clicks
- handling mouse move and tool tips
- in-place text editing
- default cursor
- painting background, including a grid

Display

The primary purpose of JGoView is to display a JGoDocument and its JGoObjects. You can use the default JGoDocument that is created for the default JGoView constructor, or you can supply your own, either at construction or later.

A JGoView is just a regular Swing JComponent. The part of a JGoView that shows the document is called the canvas. A view can also have scroll bars. A view can have a border, but the canvas does not support one.

JGoView also supports the display of its own view-specific objects. Thus each view on the same document can have its own set of JGoObjects. These view objects will appear in front of all document objects. The most common example of view object is a selection handle (JGoHandle).

Painting

As a Swing JComponent, JGoView's canvas overrides paintComponent() in order to render the view. This just calls JGoView.onPaintComponent(), which is responsible for scaling and translating the Graphics2D and getting a document-coordinates clipping rectangle. It then calls paintView(), which calls methods to fill in the paper color, to draw any additional background, to draw all of the document objects, and then to draw any view objects. You can override paintView() or any of the four methods called by paintView() in order to get different effects; overriding paintPaperColor() and paintBackgroundDecoration() are the most common. The paintBackgroundDecoration method is responsible for drawing the BackgroundImage, if any.

The JGoDocument's PaperColor property determines the background for all views unless the paper color is null, which it is by default. Thus the view's Background property specifies the background color for typical documents.

Printing

JGoView also provides support for printing. The print() method brings up the print dialog and then starts a PrinterJob. You can easily override getPrintDocumentSize(), getPrintPageRect(), and getPrintScale() to customize how much is printed, on how much of the page, and at what scale. Override printDecoration() to add headers and/or footers or any other decoration on each page. Override printView(), like paintView(), to change what things get printed--by default the paper color and the view objects are not printed.

Version 5.1 also introduces a printPreview method.

Scrolling

JGoView has support for scrolling and scroll bars built in. The use of JScrollPane and JViewport is not necessary. By default there will be both a horizontal and a vertical scroll bar, but you can remove one or both of them by setting the respective properties to null. There is also a separate corner component, where the two scroll bars meet, that is visible when both scroll bars are visible.

Of course users can scroll the view by manipulating the scroll bars. When drag-and-drop is enabled, users can also cause automatic scrolling when they are dragging near the edge of the canvas. This autoscroll region is specified by the AutoscrollInsets property.

Because a view does not show the whole document, the ViewPosition property indicates where the view's top-left corner is in the document. The ExtentSize property indicates the size of the view's canvas in the document.

Scaling and Coordinate Systems

JGoView also supports zooming, to change the scale at which the objects are drawn. The Scale property is normally 1; smaller values make objects appear smaller on the screen; larger values correspond to zooming into the diagram.

The ability to scroll and zoom the view means that the coordinate system used in a view is different from that used in the document. The convertDocToView() and convertViewToDoc() methods perform the basic transformations of Points, Dimensions, and Rectangles. The docToViewCoords() and viewToDocCoords() methods do the same, but can be less efficient to use because they allocate new objects for the return values.

Selection

Each JGoView has a JGoSelection that holds the currently selected document objects for that view. The default selection object is an instance of JGoSelection, but you can override createDefaultSelection(). The selection object is also responsible managing selection handles in the view. Many methods in JGoView deal with the current selection, either by changing it, or by operating on its collection of objects. Important examples include: cut(), copy(), deleteSelection(), moveSelection() and selectAll().

Events

JGoView is a JGoDocumentListener, which is how it can keep its display up-to-date with changes to the document and its objects. JGoView also has view-specific state that other objects may care about tracking. Thus a JGoView will notify its JGoViewListeners about any JGoViewEvents. Such events include:

- inserting, changing, and removing view objects (but not document objects)
- changing the view's position and scale
- adding and removing objects from the view's selection
- single and double clicking on objects

High Level Mouse Events

One of the more important functions of JGoView is to handle mouse clicks. Depending on the state of the view, where the click happens, and any event modifiers, the selection may change or the click will get passed on to any object on top underneath that point. This will cause JGoViewEvents to be fired off to any interested listeners, and will call doMouseClick() or doMouseDblClick(). This method then calls the method of the same name on the object and on its parents up to the top-level object until a call returns true, indicating that it completely handled the single-click or double-click.

Similarly, when the mouse moves without any mouse button being held down, doUncapturedMouseMove() is called, which in turn calls doUncapturedMouseMove() on the object underneath that point, and on up the parent chain until a call returns true. Getting a tool tip text is also similar, in that the view passes the request down to a particular object at that point, and to its parents, until it gets a non-null string.

Resizing

Views also have default behavior for resizing objects. When the user does a mouse down on a selection handle, the view goes into resizing mode. This causes the handleResizing() method to be called while the mouse is dragging the selection handle. This method in turn calls the handleResize() method on the selected object, assuming it isResizable(). The object can then decide how to interpret the resize request. JGoView's default behavior is to draw an XOR box during the resizing, and to reshape the object when the resizing is done. If the user cancels the resizing with the Escape key, the object is restored to its original size and position.

Creating Links

Another important JGoView feature is the support for the user creating links between ports by "dragging" from a JGoPort to another one. The startNewLink() method uses validSourcePort() and validDestinationPort() to see if the port under the mouse point will permit the user's starting a new link. If so, the view creates a temporary port and a temporary link from the port to the temporary port. While the user remains in this creating-a-new-link mode, the temporary port is continuously moved to follow the mouse.

Furthermore the view checks to see which ports to which it could make a valid new link, by calling validLink() for all potential pairs of ports involving the original one. The default implementation of validLink() just asks the "from" port if it can be linked to the "to" port; this allows the behavior to be overridden either in the port class or in the view. You may want to investigate properties on JGoPort that have "valid" in their names, as well as JGoDocument's ValidCycle property.

To make drawing links easier for the user, there is also the notion of "port gravity", a distance. The temporary port automatically snaps to the location of the closest valid port within the port gravity distance.

Finally, when the user releases the mouse to create the link, the newLink() method is called. This method is responsible for creating the real JGoLink in the document connecting the two ports; the temporary port and link are discarded. If for some reason the link is not made, because the attempted link was invalid or because the user cancelled the link drawing process, the noNewLink() method is called. This allows views to clean up any other state or inform the user or do some other default failure action.

There are also methods to support modifying an existing link to allow interactive reconnection to a potentially different port. The startReLink method is similar to the startNewLink method. Upon the user's mouse-up, the reLink or noReLink methods are called instead of newLink or noNewLink.

Drag and Drop

JGoView has a default behavior for drag-and-drop. Each view has a drag gesture recognizer and acts as both a drag source and as a drop target. Within a view, a drag moves the selected objects; between views a drag and drop copies the selected objects, and from another drag source the view can decide to accept the drop and to handle it in an application specific manner. If the user cancels a drag from a JGoView, the selected objects are restored to their original locations.

To customize a view as a drop target, you'll want to override several methods: isDropFlavorAcceptable(), computeAcceptableDrop(), and drop(). If you want to make use of the default copy behavior for JGoSelection, you can call doDrop() from your override of drop(). If you need somewhat more extensive customization, you can just override all the standard DropTargetListener methods.

The implementation of drag-and-drop does not actually make the JGoView the listener for drag gestures, drag source events, or drop target events. It is actually the view's canvas, which delegates to internal methods of the view, which in turn call the respective standard listener methods. The reason for this additional step is to allow default support for dragging selection handles, drawing a rubber-band selection box, or starting a link between ports. If you really need complete control of mouse-related operations for a view, you'll need to override the internal handler methods, whose names are prefixed with "on".

The user can copy objects as well as move them, depending on whether the CTRL key is held down at the time of the drop. The default behavior now allows both copy and move; you can limit the behavior not to allow copying by calling setInternalMouseActions(DnDConstants.ACTION_MOVE).

An internal drag, when the CTRL key is held down, makes an outline copy of the current selection and drags it around to follow the mouse. The selection is left at its original position, or is moved back to that position if it had been drag-moved. When the drop-copy happens, the original selection is copied by calling the document's copyFromCollection method. The newly added objects become the new selection.

You can control whether a view handles any mouse events or any drag-and-drop behavior by setting the MouseEnabled, DragEnabled, and DropEnabled properties. For views that are part of Applets, you'll need to call initializeDragDropHandling first from a different thread, but only after the applet has been started.

The DragEnabled property controls whether a drag gesture listener operates to start a drag-and-drop operation from the view; the DropEnabled property controls whether a drop can occur in the view from any window. Note that both need to be true for a drag-and-drop to occur internally within the view. Setting both to false may still allow internal moves and/or copies within a view, depending on whether isMouseEnabled is still true and whether the selected objects may be dragged and the value of getInternalMouseActions().

Two other properties relating to dragging are DragsRealtime and DragsSelectionImage. The former controls whether selected objects are actually moved while the user drags them. The latter controls whether the user drags an image of the selection when drag-copying or when isDragsRealtime() is false, instead of dragging an outline.

Clipboard

JGoView supports copying the selection to and from the system clipboard; use the copy(), cut(), and paste() methods. These methods, like the default drag-and-drop implementation, depend on the document's DataFlavor, the document's and selection's implementation of Transferable, and the document's copyFromCollection() method.

The paste() method selects all of the newly copied objects that have been pasted into this view's document. This makes it easier to define a JGoViewEvent.CLIPBOARD_PASTED or JGoViewEvent.EXTERNAL_OBJECTS_DROPPED event handler that modifies those newly created objects.

In-place Text Editing

Another handy feature that JGoView offers is in-place text editing. If a JGoText object is editable, then clicking on it may put it into editing mode, where the user can change the string. This is accomplished by creating a temporary JGoTextEdit object in this view and having it be responsible for actually creating and displaying a Swing JTextComponent and handling its editing completion or cancellation. The JGoTextEdit object is held as a property of the view. Use doEndEdit() to stop any in-place text editing in progress.

Keyboard Commands

A view can accept keyboard focus and can respond to several keyboard commands by default. Override onKeyEvent() to change or augment the default commands. You can control whether there is any default key event handling by setting the KeyEnabled property.

The getDocumentSize method includes objects that are at negative coordinate positions. The getDocumentTopLeft method has been added so that you can tell where the document now starts; by default this just returns the document's documentTopLeft property. Both of these methods values are affected by the includingNegativeCoords property. When the includingNegativeCoords property is false, the documentTopLeft property is always (0,0) and the documentSize property is shrunk accordingly from the document's documentSize property. The default value for includingNegativeCoords is false, which is compatible with earlier versions.

Similarly, for printing, getPrintDocumentSize method has different behavior when isIncludingNegativeCoords() is true, and the getPrintDocumentTopLeft method has been added.

"Mode"

The current mouse state accessible, along with various constants describing pre-defined states. These include MouseStateNone (the default state), MouseStateMove, MouseStateCreateLink, MouseStateResize, and MouseStateDragBoxSelection, among others. By defining your own state identifiers greater than MouseStateLast, you can override the doMouseDown, doMouseMove, doMouseUp, and doCancelMouse methods to control how the view responds to the user. In addition to making the State property public, a view has a CurrentObject property that makes accessible the JGoObject that some mouse handling states operate on.

Version 5.1 adds a new state, MouseStateAction, to support direct interaction with JGoActionObjects. The JGoActionObject interface allows document objects to preempt the mouse down/move/up events that would otherwise cause the JGoView to enter other states such as MouseStateMove or MouseStateResize. This might be used by a button, wholly implemented with JGoObjects, that wants to support being clicked by the user rather than being selected and dragged or resized or whatever. Furthermore this interface support continuous feedback during mouse moves. A knob, for example, could be turned by the user.

The doMouseDown method first calls the pickActionObject method. If that method returns a JGoActionObject, doMouseDown calls the startActionObject method to activate the object and to set the view's state to MouseStateAction. Then doMouseMove and doMouseUp will call handleActionObject: mouse moves cause the action object to be adjusted by calls to onActionAdjusted; a mouse up invokes the action object's action by a call to onAction.

Grids

A view has many "grid" features, governing both appearance and behavior. One of several styles of grids can be drawn: Invisible, Dot, Cross, Line. You can set the origin and horizontal and vertical spacing of the grid points, and you can specify the JGoPen that is used to draw the grid.

The objects on display in this view can be set to snap to a particular grid point, either when moving or when resizing. You can also specify the object spot that needs to be snapped to the grid point; this defaults to JGoObject.TopLeft.

When the grid style is GridInvisible and the SnapMove and SnapResize are NoSnap, which are the default values for those properties, a JGoView appears and behaves as if there were no grid.

JGoView is not thread-safe.

See Also:
  `JGoDocument`, `JGoViewEvent`, `JGoViewListener`, `JGoObject`, `JGoObjectCollection`, `JGoSelection`, Serialized Form

Nested Class Summary
`class` | `JGoView.JGoViewCanvas`

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`static int` | `ChangedDimensions` a flag indicating that the dimensions (distance between grid points) has changed
`static int` | `ChangedOrigin` a flag indicating that the grid's origin has changed
`static int` | `ChangedPen` a flag indicating that the pen used for drawing the grid has changed
`static int` | `ChangedSnapMove` a flag indicating that the object moving snapping style has changed
`static int` | `ChangedSnapResize` a flag indicating that the object resizing snapping style has changed
`static int` | `ChangedSpot` a flag indicating that the object spot has changed
`static int` | `ChangedStyle` a flag indicating that the grid style has changed
`static int` | `DebugEvents` A flag used for debugging TRACE messages: drag-and-drop events
`static int` | `EventMouseDown` A mouse state indicator used by handleResizing and drawXORBox
`static int` | `EventMouseMove` A mouse state indicator used by handleResizing and drawXORBox
`static int` | `EventMouseUp` A mouse state indicator used by handleResizing and drawXORBox
`static int` | `GridCross` Display small grid line crosses at each grid point
`static int` | `GridDot` Display dots at each grid point
`static int` | `GridInvisible` Don't display any grid at all
`static int` | `GridLine` Display the grid as lines
`static int` | `MouseStateAction` The mouse state when the user is acting on a JGoActionObject
`static int` | `MouseStateCreateLink` The mouse state when the user is drawing a new link starting at a source port
`static int` | `MouseStateCreateLinkFrom` The mouse state when the user is drawing a new link starting at a destination port
`static int` | `MouseStateDragBoxSelection` The mouse state when the user is drawing a rubber-band selection box
`static int` | `MouseStateLast` If you define your own state, make sure the value is greater than this.
`static int` | `MouseStateMove` The mouse state when the user is dragging objects, for moving or copying
`static int` | `MouseStateNone` The mouse state when the user isn't doing much with the mouse
`static int` | `MouseStateResize` The mouse state when the user is resizing an object
`static int` | `MouseStateSelection` The mouse state when the user may be selecting something, and might drag it
`static int` | `NoSnap` Move or resize objects smoothly, ignoring any grid points.
`static int` | `SnapAfter` Move or resize objects to a grid point after release; objects move or resize smoothly while being dragged.
`static int` | `SnapJump` Move or resize objects to a grid point while being dragged.

Fields inherited from class javax.swing.JComponent
`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface java.awt.print.Printable
`NO_SUCH_PAGE, PAGE_EXISTS`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`JGoView()` Construct a new view of a document returned by calling createDefaultModel()
`JGoView(JGoDocument doc)` Construct a new view of a JGoDocument.

Method Summary
`void` | `addDocumentListener(JGoDocumentListener l)` Add a listener for JGoDocument events, such as changes to a JGoObject's properties or to a JGoObject having been added or removed from a JGoLayer.
`void` | `addNotify()` Only initialize drag-and-drop handling if there's a topmost Frame, and we're not inside an Applet.
`JGoListPosition` | `addObjectAtHead(JGoObject obj)` Adds an object behind all other objects in the view.
`JGoListPosition` | `addObjectAtTail(JGoObject obj)` Adds an object in front of all other objects in the view.
`void` | `addViewListener(JGoViewListener l)` Add a listener for JGoViewEvents, such as clicking on objects or in the background, or a link having been drawn by the user, or property changes on this JGoView.
`void` | `applyRenderingHints(java.awt.Graphics2D g2)` Set the standard RenderingHints for how shapes, images, and text are drawn.
`void` | `autoscroll(java.awt.Point location)` Implement the Autoscroll interface.
`void` | `bringObjectToFront(JGoObject obj)` Moves an object in front of other objects in the view (moved to the end of the list of objects).
`boolean` | `canPaste()` Return true if the document's DefaultLayer is Modifiable and if there is JGo data in the clipboard.
`void` | `completeDrop(java.awt.dnd.DropTargetDropEvent e, boolean success)` This method implements a work-around for a Java bug on Windows.
`int` | `computeAcceptableDrop(java.awt.dnd.DropTargetDragEvent e)` This method is called by the default implementations of DropTargetListener.dragEnter, dragOver, and dropActionChanged to dynamically determine the permissible drop actions.
`java.util.ArrayList` | `computeEffectiveSelection(JGoObjectSimpleCollection coll)` Try to avoid problems with double-moving due to duplicate entries or both a parent and its child being in the argument collection.
`java.util.ArrayList` | `computeEffectiveSelection(JGoObjectSimpleCollection coll, boolean move, boolean includelinks)` Try to avoid problems with double-moving due to duplicate entries or both a parent and its child being in the argument collection.
`int` | `convertActionToModifiers(int action)` This method converts a DropTarget event's dropAction to an InputEvent's modifiers.
`void` | `convertDocToView(java.awt.Dimension d)` Convert a Dimension in document coordinates to view coordinates.
`void` | `convertDocToView(java.awt.Point p)` Convert a Point in document coordinates to view coordinates.
`void` | `convertDocToView(java.awt.Rectangle r)` Convert a Rectangle in document coordinates to view coordinates.
`void` | `convertViewToDoc(java.awt.Dimension d)` Convert a Dimension in view coordinates to document coordinates.
`void` | `convertViewToDoc(java.awt.Point p)` Convert a Point in view coordinates to document coordinates.
`void` | `convertViewToDoc(java.awt.Rectangle r)` Convert a Rectangle in view coordinates to document coordinates.
`void` | `copy()` Copy the document objects in the current selection to the system clipboard.
`void` | `copySelection(JGoSelection sel, int modifiers, int offsetx, int offsety, int event)` Make copies of all currently selected objects and add them to this document at positions adjusted by the given offset.
`void` | `copyToClipboard(java.awt.datatransfer.Clipboard clipboard)` Copy document objects from the current selection to the given clipboard.
`JGoDocument` | `createDefaultModel()` The default model is an instance of JGoDocument.
`JGoSelection` | `createDefaultSelection()` Create an instance of a JGoSelection.
`protected JGoLink` | `createTemporaryLinkForNewLink(JGoPort from, JGoPort to)` Return a temporary link used by the user-invoked link creating routines.
`protected JGoPort` | `createTemporaryPortForNewLink(JGoPort port, java.awt.Point dc)` Return a temporary port used by the user-invoked link creating or reconnecting routines.
`void` | `cut()` Copy the current selection to the system clipboard and then remove the selected objects from the document.
`void` | `deleteSelection()` Remove the objects of the current selection from the document without copying them to the clipboard.
`void` | `disposeJGoGraphics(java.awt.Graphics2D g)` This convenience function disposes the Graphics object that is passed, or is a no-op if the object is null.
`void` | `doBackgroundClick(int modifiers, java.awt.Point dc, java.awt.Point vc)` This method is called when a click happens in the canvas and there is no object underneath and there is no selection.
`void` | `doCancelMouse()` When one needs to cancel any mouse operation, this function restores the view to the normal state.
`void` | `doCancelMoveSelection(java.awt.Point offset)` Called when the user's dragging of the current selection is cancelled.
`void` | `doCancelResize(java.awt.Rectangle orig)` Called when the user's resizing of an object is cancelled.
`java.awt.Dimension` | `docToViewCoords(java.awt.Dimension d)` Convert document dimensions to view coordinates.
`java.awt.Rectangle` | `docToViewCoords(int x, int y, int w, int h)` Convert a rectangle in document coordinates to a rectangle in view coordinates.
`java.awt.Point` | `docToViewCoords(java.awt.Point d)` Convert a point from document coordinates to view coordinates.
`java.awt.Rectangle` | `docToViewCoords(java.awt.Point p, java.awt.Dimension d)` Convert a rectangle in document coordinates to a rectangle in view coordinates.
`java.awt.Rectangle` | `docToViewCoords(java.awt.Rectangle d)` Convert a rectangle in document coordinates to a rectangle in document coordinates.
`void` | `documentChanged(JGoDocumentEvent evt)` This method is called whenever a document modification occurs that may require the view to repaint some portion of itself.
`boolean` | `doDrop(java.awt.dnd.DropTargetDropEvent e, JGoCopyEnvironment copyenv)` Perform the default drop operation, as a result of a DropTargetListener.drop(DropTargetDropEvent).
`void` | `doEndEdit()` Tell any edit control (JGoTextEdit) that it's time to stop being in edit mode.
`void` | `doLayout()` This method actually performs the layout of the canvas, the scrollbars, and the corner component.
`boolean` | `doMouseClick(int modifiers, java.awt.Point dc, java.awt.Point vc)` Handle single click behavior for an object in the document.
`boolean` | `doMouseDblClick(int modifiers, java.awt.Point dc, java.awt.Point vc)` Handle double click behavior for an object in the document.
`boolean` | `doMouseDown(int modifiers, java.awt.Point dc, java.awt.Point vc)` Called when a mouse button is pressed.
`boolean` | `doMouseMove(int modifiers, java.awt.Point dc, java.awt.Point vc)` Called when the mouse is moved.
`boolean` | `doMouseUp(int modifiers, java.awt.Point dc, java.awt.Point vc)` Performs the required processing when the mouse button is released.
`void` | `doMoveSelection(int modifiers, int offsetx, int offsety, int event)` Moves all currently selected draggable objects by the given offset.
`void` | `doUncapturedMouseMove(int modifiers, java.awt.Point dc, java.awt.Point vc)` This method is called when the mouse is moved over the canvas and no other mouse behavior is happening.
`void` | `dragDropEnd(java.awt.dnd.DragSourceDropEvent e)` This implements the default drag source listener, a no-op.
`void` | `dragEnter(java.awt.dnd.DragSourceDragEvent e)` This implements the default drag source listener, a no-op.
`void` | `dragEnter(java.awt.dnd.DropTargetDragEvent e)` This implements the default drop target listener, calling isDropFlavorAcceptable() to see if any drop is possible, and then calling computeAcceptableDrop() to decide whether to reject or accept the drag.
`void` | `dragExit(java.awt.dnd.DragSourceEvent e)` This implements the default drag source listener, a no-op.
`void` | `dragExit(java.awt.dnd.DropTargetEvent e)` This implements the default drop target listener, a no-op.
`void` | `dragGestureRecognized(java.awt.dnd.DragGestureEvent e)` This implements the default drag gesture listener, starting a drag.
`void` | `dragOver(java.awt.dnd.DragSourceDragEvent e)` This implements the default drag source listener, a no-op.
`void` | `dragOver(java.awt.dnd.DropTargetDragEvent e)` This implements the default drop target listener, calling isDropFlavorAcceptable() and computeAcceptableDrop() to decide whether to reject or accept the drag.
`protected void` | `drawGridCrosses(java.awt.Graphics2D g, int crossHeight, int crossWidth, java.awt.Rectangle clipRect)` This method draws little crosses at the grid points.
`protected void` | `drawGridLines(java.awt.Graphics2D g, java.awt.Rectangle clipRect)` This method draws grid lines.
`protected void` | `drawXORBox(java.awt.Graphics2D g, int corner1x, int corner1y, int corner2x, int corner2y, int event)` Draw an XOR'ed rectangle on the view screen given two opposite corners.
`protected void` | `drawXORRect(java.awt.Graphics2D g, int x, int y, int w, int h)` Performs the actual drawing of the XOR'ed rectangle.
`void` | `drop(java.awt.dnd.DropTargetDropEvent e)` This implements the default drop target listener, calling doDrop() and rejecting the drop if it returned false.
`void` | `dropActionChanged(java.awt.dnd.DragSourceDragEvent e)` This implements the default drag source listener, a no-op.
`void` | `dropActionChanged(java.awt.dnd.DropTargetDragEvent e)` This implements the default drop target listener, calling isDropFlavorAcceptable() and computeAcceptableDrop() to decide whether to reject or accept the drag.
`java.awt.Point` | `findNearestGridPoint(int x, int y, java.awt.Point result)` Find the grid point that is closest to the given point
`JGoListPosition` | `findObject(JGoObject obj)` Return the position of a specific object in the collection.
`void` | `fireUpdate(int hint, int flags, java.lang.Object x)` Call this method whenever an event occurs in the view that may require the view to repaint some portion of itself or perform other processing.
`void` | `fireUpdate(int hint, int flags, java.lang.Object x, java.awt.Point vc, java.awt.Point dc, int modifiers)` This method is called whenever an event occurs in the view that may require the view to repaint some portion of itself or perform other processing.
`java.awt.Insets` | `getAutoscrollInsets()` Returns the inset margins in which autoscrolling will occur.
`java.awt.Image` | `getBackgroundImage()` Return the Image displayed in the background of this view.
`JGoView.JGoViewCanvas` | `getCanvas()` Return the component representing the canvas--where JGoObjects will be drawn.
`javax.swing.JComponent` | `getCorner()` Return the component used at the corner between the horizontal and vertical scrollbars.
`protected java.awt.event.MouseEvent` | `getCurrentMouseEvent()` Return the MouseEvent associated with the ongoing doMouseDown, doMouseMove, doMouseUp, doMouseClick, doMouseDblClick, or doUncapturedMouseMove methods.
`JGoObject` | `getCurrentObject()` Return the current JGoObject, if any, associated with any mouse event handling.
`int` | `getDebugFlags()` Return the conditions under which this view generates TRACE messages.
`java.awt.Cursor` | `getDefaultCursor()` Return the default cursor for the view.
`static int` | `getDefaultPortGravity()` Return the default distance at which a link will snap to a port.
`static java.awt.Color` | `getDefaultPrimarySelectionColor()` Return the default primary selection color.
`static java.awt.Color` | `getDefaultSecondarySelectionColor()` Return the default secondary selection color.
`JGoDocument` | `getDocument()` Gets the document model associated with this view.
`JGoDocumentListener[]` | `getDocumentListeners()` Return an array of the JGoDocumentListeners that are currently listening for JGoDocumentEvents on this view's JGoDocument.
`java.awt.Dimension` | `getDocumentSize()` Return the size of the document as seen by this view.
`java.awt.Point` | `getDocumentTopLeft()` Return the top-left corner of the document as seen by this view.
`JGoTextEdit` | `getEditControl()` This returns the single JGoTextEdit that is used for in-place editing for this whole view.
`java.lang.String` | `getEditPresentationName(int act)` Return a name for each of the different kinds of actions that this view provides, suitable for an UndoableEdit's presentation name.
`java.awt.Dimension` | `getExtentSize()` Return the size in document coordinates of what is shown in the view.
`JGoLayer` | `getFirstLayer()` Return the bottom-most layer of objects in this document.
`JGoListPosition` | `getFirstObjectPos()` Return the position of the first object in the collection.
`java.awt.Frame` | `getFrame()` Return the Frame that this view is in.
`int` | `getGridHeight()` Get the vertical spacing of the grid.
`java.awt.Point` | `getGridOrigin()` Return the current origin for the grid.
`JGoPen` | `getGridPen()` Get the pen that is currently used for drawing the grid's dots, crosses or lines.
`int` | `getGridSpot()` Get which spot on the objects will be snapped to the nearest grid point.
`int` | `getGridStyle()` Return the current style of the grid.
`int` | `getGridWidth()` Returns the horizontal spacing of the grid.
`javax.swing.JScrollBar` | `getHorizontalScrollBar()` Return the horizontal scrollbar, or null if there is none.
`int` | `getInternalMouseActions()` Return which kinds of drag-and-drop actions are permitted for mouse drags that start and end in this view.
`java.awt.Graphics2D` | `getJGoGraphics()` This convenience function returns a Graphics2D object for painting on the view's canvas.
`JGoLayer` | `getLastLayer()` Return the top-most layer of objects in this document.
`JGoListPosition` | `getLastObjectPos()` Return the position of the last object in the collection.
`java.awt.Dimension` | `getMinimumSize()` The minimum size for this JComponent defaults to (50, 50).
`JGoLayer` | `getNextLayer(JGoLayer layer)` Return the layer just above the given layer.
`JGoListPosition` | `getNextObjectPos(JGoListPosition pos)` Return the position for the next object in the collection.
`JGoListPosition` | `getNextObjectPosAtTop(JGoListPosition pos)` Return the position for the next top-level object in the collection.
`int` | `getNumObjects()` Returns the number of top-level objects in the view only.
`JGoObject` | `getObjectAtPos(JGoListPosition pos)` Return the object for the given position.
`int` | `getPortGravity()` Return the port gravity for this view.
`java.awt.Dimension` | `getPreferredSize()` The preferred size for a view normally comes from the document.
`JGoLayer` | `getPrevLayer(JGoLayer layer)` Return the layer just below the given layer.
`JGoListPosition` | `getPrevObjectPos(JGoListPosition pos)` Return the position of the previous object in the collection.
`java.awt.Color` | `getPrimarySelectionColor()` Returns the primary selection color.
`java.awt.Dimension` | `getPrintDocumentSize()` Return the size of the document to be printed, in document coordinates.
`java.awt.Point` | `getPrintDocumentTopLeft()` This method returns the coordinates of the document's top-left corner, where printing should start from.
`protected java.awt.geom.Rectangle2D.Double` | `getPrintPageRect(java.awt.Graphics2D g2, java.awt.print.PageFormat pf)` Return the bounds for the part of the print page that should hold the rendered graph.
`protected double` | `getPrintScale(java.awt.Graphics2D g2, java.awt.print.PageFormat pf)` Return the scale at which the graph should be printed.
`double` | `getScale()` Return the current scale at which JGoObjects are displayed.
`java.awt.Color` | `getSecondarySelectionColor()` Returns the secondary selection color.
`JGoSelection` | `getSelection()` Return the object representing the selection for this view.
`int` | `getSnapMove()` Return the current policy when objects are moved.
`int` | `getSnapResize()` Return the current policy when objects are resized.
`int` | `getState()` Return the current state of this view in its handling of the mouse.
`java.lang.String` | `getToolTipText(java.awt.event.MouseEvent evt)` Implement tooltips for JGoObjects by finding the object at the given point as specified by the MouseEvent, and asking for it's tooltip.
`javax.swing.JScrollBar` | `getVerticalScrollBar()` Return the vertical scrollbar, or null if there is none.
`JGoViewListener[]` | `getViewListeners()` Return an array of the JGoViewListeners that are currently listening for JGoViewEvents on this view.
`java.awt.Point` | `getViewPosition()` Return the position in the document of the top-left point of the view.
`java.awt.Rectangle` | `getViewRect()` Return a rectangle whose origin is getViewPosition() and size is getExtentSize().
`void` | `handleActionObject(int modifiers, java.awt.Point dc, java.awt.Point vc, int event)` Handle further mouse events on a JGoActionObject.
`protected void` | `handleResizing(java.awt.Graphics2D g, java.awt.Point vc, java.awt.Point dc, int event)` This method is called in resize mode as the user is dragging a resize handle.
`void` | `initializeDragDropHandling()` This initializes drag and drop handling, both as a source and as a target.
`protected void` | `initializeMouseHandling()` This initializes the handling of mouse events.
`JGoListPosition` | `insertObjectAfter(JGoListPosition pos, JGoObject obj)` Adds an object to the view after the given position.
`JGoListPosition` | `insertObjectBefore(JGoListPosition pos, JGoObject obj)` Adds an object to the view before the given position.
`protected void` | `internalPrint(java.awt.print.PrinterJob pj)`
`boolean` | `isDragDropEnabled()` Return whether the drag-and-drop mechanism is enabled for this view, equivalent to isDragEnabled() && isDropEnabled().
`boolean` | `isDragEnabled()` Return whether the drag gesture listener is enabled, to allow users to start a drag-and-drop operation from this view.
`boolean` | `isDragsRealtime()` Gets whether a user's drag of objects in this view actually moves the objects continuously, rather than dragging around an outline or an image of the selected objects.
`boolean` | `isDragsSelectionImage()` Gets whether the selection being copied or dragged is displayed as an image or with an outline.
`boolean` | `isDrawsXorMode()` Returns whether drawXORBox uses drawXORRect to really draw a rectangle using XOR mode, rather than simulating the rectangle using regular drawing.
`boolean` | `isDropEnabled()` Return whether the drop target listener is enabled, to allow users to perform a drop operation to this view.
`boolean` | `isDropFlavorAcceptable(java.awt.dnd.DropTargetDragEvent e)` This predicate is called by the default implementation of DropTargetListener.dragEnter, dragOver, and dropActionChanged to see if there is an acceptable DataFlavor available.
`boolean` | `isEditingTextControl()` Return true if the user is in the midst of in-place text editing.
`boolean` | `isEmpty()` Returns true if the view contains no (view-only) objects.
`boolean` | `isFocusTraversable()` This returns true to allow tabbing to this component.
`boolean` | `isHidingDisabledScrollbars()` This predicate is true when a scroll bars should disappear when the view is big enough to show the whole document range for that scroll bar.
`boolean` | `isIgnoreNextMouseDown()` Return whether the view's mouse pressed handler will ignore the next mouse pressed event.
`boolean` | `isIncludingNegativeCoords()` This predicate is true when the view may show parts of a document that are at negative document coordinates.
`boolean` | `isInternalDragDrop()` Return whether a dragging operation started within this JGoView or is coming from another window.
`boolean` | `isKeyEnabled()` Return true if keyboard key strokes are handled normally, or return false if those events are ignored.
`boolean` | `isMouseEnabled()` Return true if mouse presses, drags, releases, and clicks are handled normally or return false if those actions are ignored.
`boolean` | `isPrinting()` This predicate is true while printView is called.
`protected boolean` | `keyClearSelection(int modifiers)` Return true if the state of the modifier keys indicates that we should clear the selection when a click occurs on the background.
`protected boolean` | `keyExtendSelection(int modifiers)` Return true if the modifiers keys indicate that a click on an object should add the current object to the selection.
`protected boolean` | `keyMultipleSelect(int modifiers)` Deprecated. -- replaced by keyExtendSelection and keyToggleSelection
`void` | `keyPressed(java.awt.event.KeyEvent evt)` This method implements KeyListener.
`void` | `keyReleased(java.awt.event.KeyEvent evt)` This method implements KeyListener as a no-op.
`protected boolean` | `keySingleSelection(int modifiers)` Return true if clicking on an object should make it the only selected object.
`protected boolean` | `keyToggleSelection(int modifiers)` Return true if the state of the modifier keys indicates whether we should deselect a selected object or select an unselected object.
`void` | `keyTyped(java.awt.event.KeyEvent evt)` This method implements KeyListener as a no-op.
`double` | `limitScale(double s)` This method is called by the setScale method to make sure that the view only displays objects at a reasonable scale.
`void` | `lostOwnership(java.awt.datatransfer.Clipboard c, java.awt.datatransfer.Transferable t)` This method implements ClipboardOwner.
`void` | `moveSelection(JGoSelection sel, int modifiers, int offsetx, int offsety, int event)` Moves all currently selected draggable objects of modifiable layers by the given offset.
`void` | `newLink(JGoPort from, JGoPort to)` Called to create a new link from the from port to the to port.
`protected void` | `noNewLink(JGoPort from, JGoPort to)` Called when a link creation failed.
`protected void` | `noReLink(JGoLink oldlink, JGoPort from, JGoPort to)` Called when a link reconnection failed.
`void` | `onDragDropEnd(java.awt.dnd.DragSourceDropEvent e)` This implements the internal drag source listener
`void` | `onDragEnter(java.awt.dnd.DragSourceDragEvent e)` This implements the internal drag source listener
`void` | `onDragEnter(java.awt.dnd.DropTargetDragEvent e)` This implements the internal drop target listener
`void` | `onDragExit(java.awt.dnd.DragSourceEvent e)` This implements the internal drag source listener
`void` | `onDragExit(java.awt.dnd.DropTargetEvent e)` This implements the internal drop target listener
`void` | `onDragGestureRecognized(java.awt.dnd.DragGestureEvent e)` This implements the internal drag gesture listener
`void` | `onDragOver(java.awt.dnd.DragSourceDragEvent e)` This implements the internal drag source listener
`void` | `onDragOver(java.awt.dnd.DropTargetDragEvent e)` This implements the internal drop target listener
`void` | `onDrop(java.awt.dnd.DropTargetDropEvent e)` This implements the internal drop target listener
`void` | `onDropActionChanged(java.awt.dnd.DragSourceDragEvent e)` This implements the internal drag source listener
`void` | `onDropActionChanged(java.awt.dnd.DropTargetDragEvent e)` This implements the internal drop target listener
`void` | `onGridChange(int what)` Called when some characteristic of the grid has changed.
`void` | `onKeyEvent(java.awt.event.KeyEvent evt)` This is the default event handler for keystroke commands.
`protected void` | `onMouseDragged(java.awt.event.MouseEvent evt)` This is the internal event handler for mouse motion drag events.
`protected void` | `onMouseMoved(java.awt.event.MouseEvent evt)` This is the internal event handler for mouse motion non-drag events.
`protected void` | `onMousePressed(java.awt.event.MouseEvent evt)` This is the internal event handler for mouse down events.
`protected void` | `onMouseReleased(java.awt.event.MouseEvent evt)` This is the internal event handler for mouse up events.
`protected void` | `onPaintComponent(java.awt.Graphics g)` This method is invoked by the canvas's paintComponent().
`protected void` | `onScrollEvent(java.awt.event.AdjustmentEvent evt)` This is the event handler for the scrollbars.
`protected void` | `paintBackgroundDecoration(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` Draw any background image or decorations before any of the document or the view objects are drawn.
`protected void` | `paintDocumentObjects(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` Draw all of the visible document objects that intersect the given clipping rectangle.
`protected void` | `paintPaperColor(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` Fill the background with the with the document's paper color.
`protected void` | `paintView(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` Render everything for this view that is within a given rectangle.
`protected void` | `paintViewObjects(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` Draw all of the visible view objects that intersect the given clipping rectangle.
`void` | `paste()` Copy JGoObjects from the system clipboard into this document.
`JGoCopyEnvironment` | `pasteFromClipboard(java.awt.datatransfer.Clipboard clipboard)` Copy JGoObjects from the clipboard into this document.
`JGoActionObject` | `pickActionObject(java.awt.Point dc)` Return a JGoActionObject that is in the document at a given point.
`JGoObject` | `pickDocObject(java.awt.Point pointToCheck, boolean selectableOnly)` Find the topmost object in the document under the given point.
`protected JGoHandle` | `pickHandle(java.awt.Point point)` Return a JGoHandle under the given document coordinate point.
`JGoPort` | `pickNearestPort(java.awt.Point dc)` Return the nearest valid port to the given position in the document while the user is in the midst of drawing a new link.
`JGoObject` | `pickObject(java.awt.Point pointToCheck, boolean selectableOnly)` Find the topmost view object under the given point.
`protected JGoPort` | `pickPort(java.awt.Point dc)` Return a JGoPort under the given document coordinate point.
`void` | `print()` Call this to print the current view.
`int` | `print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pnum)` Implement the Printable interface; called by the PrinterJob.
`protected void` | `printBegin(java.awt.Graphics2D g2, java.awt.print.PageFormat pf)` This method is called once at the beginning of the printing process.
`protected void` | `printDecoration(java.awt.Graphics2D g2, java.awt.print.PageFormat pf, int hpnum, int vpnum)` Print any decorations on each page.
`protected void` | `printEnd(java.awt.Graphics2D g2, java.awt.print.PageFormat pf)` This method is called once at the end of the printing process.
`void` | `printPreview()` Bring up a JGoPrintPreview to preview the pages to be printed, if this is running in a Frame.
`void` | `printPreview(java.lang.String title, java.awt.print.PageFormat pf)` Bring up a JGoPrintPreview to preview the pages to be printed, if this is running in a Frame.
`protected java.awt.print.PageFormat` | `printShowPageDialog(java.awt.print.PrinterJob pj)` This method is called in order to call PrinterJob.pageDialog.
`protected void` | `printView(java.awt.Graphics2D g2, java.awt.Rectangle clipRect)` This is called to print everything for this view that is within the given rectangle in document coordinates.
`void` | `reLink(JGoLink oldlink, JGoPort from, JGoPort to)` Called to reconnect an existing link from the from port to the to port.
`void` | `removeDocumentListener(JGoDocumentListener l)` Remove a listener for JGoDocument events.
`void` | `removeObject(JGoObject obj)` Removes an object from the view.
`JGoObject` | `removeObjectAtPos(JGoListPosition pos)` Remove an object at specified position from the collection.
`void` | `removeViewListener(JGoViewListener l)` Remove a listener for JGoViewEvents.
`void` | `scrollRectToVisible(java.awt.Rectangle contentRect)` Scroll the view so that the given rectangle in document coordinates is at least partly visible (i.e., within getViewRect()).
`void` | `selectAll()` Select all the top-level, visible, selectable objects in the document.
`void` | `selectInBox(java.awt.Rectangle rect)` Select all visible, selectable objects in the document that are within the given rectangle.
`JGoObject` | `selectObject(JGoObject obj)` Make the given object the one and only selected object in this view.
`void` | `sendObjectToBack(JGoObject obj)` Moves an object behind other objects in the view (moved to the head of the list of objects).
`void` | `setAutoscrollInsets(java.awt.Insets insets)` Set the canvas's Autoscroll Insets.
`void` | `setBackgroundImage(java.awt.Image img)` Set the Image displayed in the background.
`void` | `setBounds(int x, int y, int w, int h)` This overrides Component.setBounds to make sure we re-layout the scroll bars.
`void` | `setBounds(java.awt.Rectangle r)` This overrides Component.setBounds to make sure we re-layout the scroll bars.
`void` | `setCorner(javax.swing.JComponent box)` Set the corner component, where the horizontal and vertical scrollbars would intersect.
`void` | `setCurrentObject(JGoObject obj)` Change the current JGoObject, if any, associated with any mouse event handling.
`void` | `setCursor(java.awt.Cursor cur)` This method implements a work-around for a Java bug on Windows, by delaying the actual setCursor call.
`void` | `setCursorImmediately(java.awt.Cursor cur)` This method helps implement a work-around for a Java bug on Windows.
`void` | `setDebugFlags(int f)` Control whether this view generates TRACE messages during various operations.
`void` | `setDefaultCursor(java.awt.Cursor cursor)` Set the default cursor for the view.
`static void` | `setDefaultPortGravity(int gravity)` Set the default distance at which a link will snap to a port.
`static void` | `setDefaultPrimarySelectionColor(java.awt.Color c)` Set the default primary selection color.
`static void` | `setDefaultSecondarySelectionColor(java.awt.Color c)` Set the default secondary selection color.
`void` | `setDocument(JGoDocument doc)` Change the document model that this view is displaying.
`void` | `setDragDropEnabled(boolean m)` Specify whether the drag-and-drop mechanism is enabled for this view.
`void` | `setDragEnabled(boolean m)` Specify whether the drag mechanism is enabled for this view.
`void` | `setDragsRealtime(boolean bFlag)` Change whether dragging in this view actually continuously moves the objects to follow the mouse.
`void` | `setDragsSelectionImage(boolean bFlag)` Change whether the objects being copied, or being dragged when isDragsRealtime() is false, are drawn as an image or with an outline.
`void` | `setDrawsXorMode(boolean d)` When set to true, drawXORBox tries to draw using the underlying graphics's XOR mode, rather than using regular drawing.
`void` | `setDropEnabled(boolean m)` Specify whether the drop mechanism is enabled for this view.
`void` | `setEditControl(JGoTextEdit edit)` Specify the in-place text editor to use.
`void` | `setGridHeight(int height)` Set the vertical spacing of the grid.
`void` | `setGridOrigin(java.awt.Point point)` Set the origin for the grid.
`void` | `setGridPen(JGoPen pen)` Set the pen that is used for drawing the grid's dots, crosses or lines.
`void` | `setGridSpot(int spot)` Set which spot on the objects should snap to the nearest grid point, if snapping is enabled.
`void` | `setGridStyle(int style)` Set the style of the grid that will be draw.
`void` | `setGridWidth(int width)` Sets the horizontal spacing of the grid.
`void` | `setHidingDisabledScrollbars(boolean b)` Change whether a scroll bar show remain visible but disabled, or if it should be hidden, when it is no longer needed due to the document being small enough to be seen in its entirety by the view (for that horizontal or vertical direction).
`void` | `setHorizontalScrollBar(javax.swing.JScrollBar bar)` Set the horizontal scrollbar.
`void` | `setIgnoreNextMouseDown(boolean bFlag)` Set the view's flag to ignore the next mouse pressed event.
`void` | `setIncludingNegativeCoords(boolean b)` Change whether the view can display parts of a document at negative coordinates.
`void` | `setInternalMouseActions(int m)` Change the permitted drag-and-drop actions for internal mouse drags of selected objects.
`void` | `setKeyEnabled(boolean m)` This function enables or disables key event handling.
`void` | `setMouseEnabled(boolean m)` This function enables or disables mouse event handling, for all cases except those handled by drag-drop.
`void` | `setPrimarySelectionColor(java.awt.Color newcolor)` Set the primary selection color.
`void` | `setScale(double scale)` Change the scale at which JGoObjects are displayed in this view.
`void` | `setSecondarySelectionColor(java.awt.Color newcolor)` Set the secondary selection color.
`void` | `setSize(java.awt.Dimension d)` This overrides Component.setSize to make sure we re-layout the scroll bars.
`void` | `setSize(int width, int height)` This overrides Component.setSize to make sure we re-layout the scroll bars.
`void` | `setSnapMove(int snap)` Set this view's policy on moving objects.
`void` | `setSnapResize(int snap)` Set this view's policy on resizing objects.
`void` | `setState(int s)` Change the current state of this view for handling mouse events.
`void` | `setVerticalScrollBar(javax.swing.JScrollBar bar)` Set the vertical scrollbar.
`void` | `setViewPosition(int x, int y)` Scroll the view to place the given document coordinates at the top-left corner of the view.
`void` | `setViewPosition(java.awt.Point p)` Scroll the view to place the given document coordinates at the top-left corner of the view.
`void` | `snapAllObjects()` For each object, aligns the default spot for this view with the nearest grid position.
`void` | `snapAllObjects(int spotNumber)` For each object, aligns the spot specified by spotNumber with the nearest grid position.
`void` | `snapObject(JGoObject object)` Puts the spot of this object that corresponds with this GridView's default object spot at the nearest grid location.
`void` | `snapObject(JGoObject object, int spotNumber)` Puts the given spot of this object at the nearest grid location.
`boolean` | `startActionObject(JGoActionObject actionobj, int modifiers, java.awt.Point dc, java.awt.Point vc)` Start acting on a JGoActionObject.
`protected boolean` | `startDragBoxSelection(int modifiers, java.awt.Point dc, java.awt.Point vc)` This method is called by doMouseMove when the mouse state is MouseStateSelection and there are no objects at the current point.
`protected boolean` | `startMoveSelection(int modifiers, java.awt.Point dc, java.awt.Point vc)` This method is called by doMouseMove when the mouse state is MouseStateSelection and there is an object at the current point.
`boolean` | `startNewLink(JGoPort port, java.awt.Point dc)` This method is called in response to the user's pressing on and dragging over a valid port in order to create a new link.
`boolean` | `startReLink(JGoLink oldlink, JGoPort oldport, java.awt.Point dc)` Start the process of handling a user's drawing a link between two ports.
`protected boolean` | `startResizing(JGoHandle handle, java.awt.Point dc, java.awt.Point vc)` This method is called in response to the user's mouse press on a resize handle in order to start resizing an object.
`void` | `updateScrollbars()` Make sure the horizontal and vertical scrollbars, if any, properly reflect the view position and document size.
`void` | `updateView()` Repaint the whole view, including scrollbars.
`void` | `updateView(java.awt.Rectangle viewRect)` Request repainting a part of the view's canvas.
`boolean` | `validDestinationPort(JGoPort to)` Return whether or not a link can end at a port.
`boolean` | `validLink(JGoPort from, JGoPort to)` Return whether or not a link from "from" to "to" is valid.
`boolean` | `validSourcePort(JGoPort from)` Return whether or not a link can begin at the given port.
`java.awt.Dimension` | `viewToDocCoords(java.awt.Dimension v)` Convert view dimensions to document coordinates.
`java.awt.Rectangle` | `viewToDocCoords(int x, int y, int w, int h)` Convert a rectangle in view coordinates to a rectangle in document coordinates.
`java.awt.Point` | `viewToDocCoords(java.awt.Point v)` Convert view coordinates to document coordinates.
`java.awt.Rectangle` | `viewToDocCoords(java.awt.Point p, java.awt.Dimension d)` Convert a rectangle in view coordinates to a rectangle in document coordinates.
`java.awt.Rectangle` | `viewToDocCoords(java.awt.Rectangle v)` Convert a rectangle in view coordinates to a rectangle in document coordinates.

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, show, size, toString, transferFocus, transferFocusUpCycle`

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

Field Detail

### MouseStateNone

    public static final int MouseStateNone

  The mouse state when the user isn't doing much with the mouse

  See Also:
    Constant Field Values

### MouseStateSelection

    public static final int MouseStateSelection

  The mouse state when the user may be selecting something, and might drag it

  See Also:
    Constant Field Values

### MouseStateMove

    public static final int MouseStateMove

  The mouse state when the user is dragging objects, for moving or copying

  See Also:
    Constant Field Values

### MouseStateCreateLink

    public static final int MouseStateCreateLink

  The mouse state when the user is drawing a new link starting at a source port

  See Also:
    Constant Field Values

### MouseStateCreateLinkFrom

    public static final int MouseStateCreateLinkFrom

  The mouse state when the user is drawing a new link starting at a destination port

  See Also:
    Constant Field Values

### MouseStateResize

    public static final int MouseStateResize

  The mouse state when the user is resizing an object

  See Also:
    Constant Field Values

### MouseStateDragBoxSelection

    public static final int MouseStateDragBoxSelection

  The mouse state when the user is drawing a rubber-band selection box

  See Also:
    Constant Field Values

### MouseStateAction

    public static final int MouseStateAction

  The mouse state when the user is acting on a JGoActionObject

  See Also:
    Constant Field Values

### MouseStateLast

    public static final int MouseStateLast

  If you define your own state, make sure the value is greater than this.

  See Also:
    Constant Field Values

### EventMouseDown

    public static final int EventMouseDown

  A mouse state indicator used by handleResizing and drawXORBox

  See Also:
    Constant Field Values

### EventMouseMove

    public static final int EventMouseMove

  A mouse state indicator used by handleResizing and drawXORBox

  See Also:
    Constant Field Values

### EventMouseUp

    public static final int EventMouseUp

  A mouse state indicator used by handleResizing and drawXORBox

  See Also:
    Constant Field Values

### DebugEvents

    public static final int DebugEvents

  A flag used for debugging TRACE messages: drag-and-drop events

  See Also:
    Constant Field Values

### GridInvisible

    public static final int GridInvisible

  Don't display any grid at all

  See Also:
    Constant Field Values

### GridDot

    public static final int GridDot

  Display dots at each grid point

  See Also:
    Constant Field Values

### GridCross

    public static final int GridCross

  Display small grid line crosses at each grid point

  See Also:
    Constant Field Values

### GridLine

    public static final int GridLine

  Display the grid as lines

  See Also:
    Constant Field Values

### NoSnap

    public static final int NoSnap

  Move or resize objects smoothly, ignoring any grid points.

  See Also:
    Constant Field Values

### SnapJump

    public static final int SnapJump

  Move or resize objects to a grid point while being dragged.

  See Also:
    Constant Field Values

### SnapAfter

    public static final int SnapAfter

  Move or resize objects to a grid point after release; objects move or resize smoothly while being dragged.

  See Also:
    Constant Field Values

### ChangedDimensions

    public static final int ChangedDimensions

  a flag indicating that the dimensions (distance between grid points) has changed

  See Also:
    Constant Field Values

### ChangedStyle

    public static final int ChangedStyle

  a flag indicating that the grid style has changed

  See Also:
    Constant Field Values

### ChangedSpot

    public static final int ChangedSpot

  a flag indicating that the object spot has changed

  See Also:
    Constant Field Values

### ChangedSnapMove

    public static final int ChangedSnapMove

  a flag indicating that the object moving snapping style has changed

  See Also:
    Constant Field Values

### ChangedSnapResize

    public static final int ChangedSnapResize

  a flag indicating that the object resizing snapping style has changed

  See Also:
    Constant Field Values

### ChangedPen

    public static final int ChangedPen

  a flag indicating that the pen used for drawing the grid has changed

  See Also:
    Constant Field Values

### ChangedOrigin

    public static final int ChangedOrigin

  a flag indicating that the grid's origin has changed

  See Also:
    Constant Field Values

Constructor Detail

### JGoView

    public JGoView()

  Construct a new view of a document returned by calling createDefaultModel()

### JGoView

    public JGoView(JGoDocument doc)

  Construct a new view of a JGoDocument.

Parameters:
  `doc` - the document that serves as the model for this new view.

Method Detail

### getFrame

    public java.awt.Frame getFrame()

  Return the Frame that this view is in. This will return null if the view is in an Applet.

### addNotify

    public void addNotify()

  Only initialize drag-and-drop handling if there's a topmost Frame, and we're not inside an Applet. Programmers should call initializeDragDropHandling() explicitly if part of an Applet, and only after the applet starts (not in Applet.init).

### getCanvas

    public JGoView.JGoViewCanvas getCanvas()

  Return the component representing the canvas--where JGoObjects will be drawn.

  Returns:
    a component

### getVerticalScrollBar

    public javax.swing.JScrollBar getVerticalScrollBar()

  Return the vertical scrollbar, or null if there is none.

  You may wish to set the scrollbar's unit increment or block increment.

### setVerticalScrollBar

    public void setVerticalScrollBar(javax.swing.JScrollBar bar)

  Set the vertical scrollbar.

  If the value is set to null, the scrollbar is removed from the view.

  Parameters:
    `bar` - the new scrollbar to be used by the view.

### getHorizontalScrollBar

    public javax.swing.JScrollBar getHorizontalScrollBar()

  Return the horizontal scrollbar, or null if there is none.

  You may wish to set the scrollbar's unit increment or block increment.

### setHorizontalScrollBar

    public void setHorizontalScrollBar(javax.swing.JScrollBar bar)

  Set the horizontal scrollbar.

  If the value is null, the scrollbar is removed from the view.

  Parameters:
    `bar` - the new scrollbar to be used by the view.

### getCorner

    public javax.swing.JComponent getCorner()

  Return the component used at the corner between the horizontal and vertical scrollbars.

### setCorner

    public void setCorner(javax.swing.JComponent box)

  Set the corner component, where the horizontal and vertical scrollbars would intersect. You may wish to have your own specialized component there, with application specific appearance and behavior.

  This corner component will be visible only if both horizontal and vertical scrollbars are used in the view.

  If the value is null, the corner is removed from the view.

  Parameters:
    `box` - the new corner component to be used by the view.

### getBackgroundImage

    public java.awt.Image getBackgroundImage()

  Return the Image displayed in the background of this view. By default this property is null.

### setBackgroundImage

    public void setBackgroundImage(java.awt.Image img)

  Set the Image displayed in the background.

  The paintBackgroundDecoration method normally draws the Image after painting any document paper color or any view background color.

  Parameters:
    `img` - the new background image; a value of null removes any background image.

### createDefaultModel

    public JGoDocument createDefaultModel()

  The default model is an instance of JGoDocument.

### getDocument

    public JGoDocument getDocument()

  Gets the document model associated with this view.

  Returns:
    the document for this view.

### setDocument

    public void setDocument(JGoDocument doc)

  Change the document model that this view is displaying.

  Parameters:
    `doc` - a JGoDocument that will be the new model.

### getDocumentSize

    public java.awt.Dimension getDocumentSize()

  Return the size of the document as seen by this view.

  By default the size is increased to account for any handles on any objects. This method may need to be overridden if there are other view objects that may extend beyond the document objects.

  If isIncludingNegativeCoords() is false this method only returns the size of the document that is in positive coordinate space.

  The Dimension returned by this method must not be modified.

  Returns:
    the size of the document in document coordinates.

### getDocumentTopLeft

    public java.awt.Point getDocumentTopLeft()

  Return the top-left corner of the document as seen by this view.

  If isIncludingNegativeCoords() is false this method returns (0, 0).

  The Point returned by this method must not be modified.

  Returns:
    the top-left corner of the document in document coordinates.

### isIncludingNegativeCoords

    public boolean isIncludingNegativeCoords()

  This predicate is true when the view may show parts of a document that are at negative document coordinates.

  By default, this predicate is false.

### setIncludingNegativeCoords

    public void setIncludingNegativeCoords(boolean b)

  Change whether the view can display parts of a document at negative coordinates.

  This method does not set the viewPosition property to make sure the position is valid after setting this property value to false.

### isHidingDisabledScrollbars

    public boolean isHidingDisabledScrollbars()

  This predicate is true when a scroll bars should disappear when the view is big enough to show the whole document range for that scroll bar.

  By default, this predicate is false.

### setHidingDisabledScrollbars

    public void setHidingDisabledScrollbars(boolean b)

  Change whether a scroll bar show remain visible but disabled, or if it should be hidden, when it is no longer needed due to the document being small enough to be seen in its entirety by the view (for that horizontal or vertical direction).

  Note that even if the view is big enough, not all of the document might be shown by the view if the ViewPosition isn't right.

### convertViewToDoc

    public void convertViewToDoc(java.awt.Point p)

  Convert a Point in view coordinates to document coordinates. This modifies the given Point.

  Parameters:
    `p` - a Point in view coordinates

### convertViewToDoc

    public void convertViewToDoc(java.awt.Dimension d)

  Convert a Dimension in view coordinates to document coordinates. This modifies the given Dimension.

  Parameters:
    `d` - a Dimension in view coordinates

### convertViewToDoc

    public void convertViewToDoc(java.awt.Rectangle r)

  Convert a Rectangle in view coordinates to document coordinates. This modifies the given Rectangle.

  Parameters:
    `r` - a Rectangle in view coordinates

### viewToDocCoords

    public final java.awt.Point viewToDocCoords(java.awt.Point v)

  Convert view coordinates to document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `v` - the view coordinates
  Returns:
    the document coordinates

### viewToDocCoords

    public final java.awt.Dimension viewToDocCoords(java.awt.Dimension v)

  Convert view dimensions to document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `v` - a width and height in view coordinates
  Returns:
    a Dimension in document coordinates

### viewToDocCoords

    public final java.awt.Rectangle viewToDocCoords(java.awt.Rectangle v)

  Convert a rectangle in view coordinates to a rectangle in document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `v` - a rectangle in view coordinates
  Returns:
    a Rectangle in document coordinates

### viewToDocCoords

    public final java.awt.Rectangle viewToDocCoords(java.awt.Point p,
                                                    java.awt.Dimension d)

  Convert a rectangle in view coordinates to a rectangle in document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `p` - a top-left point in view coordinates
    `d` - a dimension in view coordinates
  Returns:
    a Rectangle in document coordinates

### viewToDocCoords

    public final java.awt.Rectangle viewToDocCoords(int x,
                                                    int y,
                                                    int w,
                                                    int h)

  Convert a rectangle in view coordinates to a rectangle in document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `x` - the X position in view coordinates
    `y` - the Y position in view coordinates
    `w` - the width in view coordinates
    `h` - the height in view coordinates
  Returns:
    a Rectangle in document coordinates

### convertDocToView

    public void convertDocToView(java.awt.Point p)

  Convert a Point in document coordinates to view coordinates. This modifies the given Point.

  Parameters:
    `p` - a Point in doc coordinates

### convertDocToView

    public void convertDocToView(java.awt.Dimension d)

  Convert a Dimension in document coordinates to view coordinates. This modifies the given Dimension.

  Parameters:
    `d` - a Dimension in doc coordinates

### convertDocToView

    public void convertDocToView(java.awt.Rectangle r)

  Convert a Rectangle in document coordinates to view coordinates. This modifies the given Rectangle.

  Parameters:
    `r` - a Rectangle in doc coordinates

### docToViewCoords

    public final java.awt.Point docToViewCoords(java.awt.Point d)

  Convert a point from document coordinates to view coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `d` - a point in document coordinates
  Returns:
    a point in view coordinates

### docToViewCoords

    public final java.awt.Dimension docToViewCoords(java.awt.Dimension d)

  Convert document dimensions to view coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `d` - a width and height in document coordinates
  Returns:
    a Dimension in view coordinates

### docToViewCoords

    public final java.awt.Rectangle docToViewCoords(java.awt.Rectangle d)

  Convert a rectangle in document coordinates to a rectangle in document coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `d` - a rectangle in document coordinates
  Returns:
    a Rectangle in view coordinates

### docToViewCoords

    public final java.awt.Rectangle docToViewCoords(java.awt.Point p,
                                                    java.awt.Dimension d)

  Convert a rectangle in document coordinates to a rectangle in view coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `p` - a top-left point in document coordinates
    `d` - a dimension in document coordinates
  Returns:
    a Rectangle in view coordinates

### docToViewCoords

    public final java.awt.Rectangle docToViewCoords(int x,
                                                    int y,
                                                    int w,
                                                    int h)

  Convert a rectangle in document coordinates to a rectangle in view coordinates.

  This is a convenience routine that allocates a new object for the return value.

  Parameters:
    `x` - the X position in document coordinates
    `y` - the Y position in document coordinates
    `w` - the width in document coordinates
    `h` - the height in document coordinates
  Returns:
    a Rectangle in view coordinates

### setViewPosition

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

  Scroll the view to place the given document coordinates at the top-left corner of the view.

  Parameters:
    `p` - the new top-left point, in document coordinates

### setViewPosition

    public void setViewPosition(int x,
                                int y)

  Scroll the view to place the given document coordinates at the top-left corner of the view.

  If isIncludingNegativeCoords() is false, we make sure the new X and Y are non-negative.

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

### getViewPosition

    public java.awt.Point getViewPosition()

  Return the position in the document of the top-left point of the view.

  The returned Point must not be modified. Use setViewPosition() to change the visible part of the document.

### getExtentSize

    public java.awt.Dimension getExtentSize()

  Return the size in document coordinates of what is shown in the view.

### getViewRect

    public java.awt.Rectangle getViewRect()

  Return a rectangle whose origin is getViewPosition() and size is getExtentSize(). This is the visible part of the view, in document coordinates.

### scrollRectToVisible

    public void scrollRectToVisible(java.awt.Rectangle contentRect)

  Scroll the view so that the given rectangle in document coordinates is at least partly visible (i.e., within getViewRect()).

  Parameters:
    `contentRect` - the desired rectangle, in document coordinates

### setScale

    public void setScale(double scale)

  Change the scale at which JGoObjects are displayed in this view.

  The scale is a fraction comparing the displayed size with the size as specified for the objects. For example, a scale of 0.5 means that the objects the user sees appear to be half the normal size.

  The permissible scale values are limited by calling limitScale(). The new value must be larger than zero.

  Parameters:
    `scale` - the new scale to be used by this view

### getScale

    public double getScale()

  Return the current scale at which JGoObjects are displayed.

  Values less than 1 mean that objects appear to the user smaller than normal. The initial value is 1.0d.

### limitScale

    public double limitScale(double s)

  This method is called by the setScale method to make sure that the view only displays objects at a reasonable scale.

  By default this limits the value to between 0.05d and 10.0d. The resulting value must be larger than zero.

  Parameters:
    `s` - the desired new scale for this view
  Returns:
    a valid new scale, larger than zero

### pickDocObject

    public JGoObject pickDocObject(java.awt.Point pointToCheck,
                                   boolean selectableOnly)

  Find the topmost object in the document under the given point. If selectableOnly is true, only objects that are marked as selectable will be included in the search.

  Parameters:
    `pointToCheck` - the point under which to find the object, in document coordinates
    `selectableOnly` - if true, consider only selectable objects

### pickObject

    public JGoObject pickObject(java.awt.Point pointToCheck,
                                boolean selectableOnly)

  Find the topmost view object under the given point. If selectableOnly is true, only objects that are marked as selectable will be included in the search.

  Note that this method ignores document objects. Use the pickDocObject method to find a document object at the given point.

  Specified by:
    `pickObject` in interface `JGoObjectCollection`
  Parameters:
    `pointToCheck` - the point under which to find the object
    `selectableOnly` - if true, consider only selectable objects
  Returns:
    the first object in the collection containing the indicated point.

### getNumObjects

    public int getNumObjects()

  Returns the number of top-level objects in the view only.

  Note that this method ignores document objects.

  Specified by:
    `getNumObjects` in interface `JGoObjectSimpleCollection`

### isEmpty

    public boolean isEmpty()

  Returns true if the view contains no (view-only) objects.

  Specified by:
    `isEmpty` in interface `JGoObjectSimpleCollection`

### addObjectAtHead

    public JGoListPosition addObjectAtHead(JGoObject obj)

  Adds an object behind all other objects in the view. Returns the position of the object in the list.

  Note that this method ignores document objects. All view objects will appear in front of all document objects.

  Specified by:
    `addObjectAtHead` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object to add to the view.
  Returns:
    the position of the new child object.

### addObjectAtTail

    public JGoListPosition addObjectAtTail(JGoObject obj)

  Adds an object in front of all other objects in the view. Returns the position of the object in the list.

  Note that this method ignores document objects. All view objects will appear in front of all document objects.

  Specified by:
    `addObjectAtTail` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object to add to the view.
  Returns:
    the position of the new child object.

### insertObjectBefore

    public JGoListPosition insertObjectBefore(JGoListPosition pos,
                                              JGoObject obj)

  Adds an object to the view before the given position. The object will appear behind the object at the given position.

  Note that this method ignores document objects. All view objects will appear in front of all document objects.

  If the object is already a top-level part of this view, the object is moved in the drawing order. The CHANGED view event will have a JGoObject.ChangedZOrder hint/flag, with no previous value.

  Specified by:
    `insertObjectBefore` in interface `JGoObjectCollection`
  Parameters:
    `pos` - the position before which to add the object.
    `obj` - the object to add.
  Returns:
    the position of the new object.

### insertObjectAfter

    public JGoListPosition insertObjectAfter(JGoListPosition pos,
                                             JGoObject obj)

  Adds an object to the view after the given position. The object will appear in front of the object at the given position.

  Note that this method ignores document objects. All view objects will appear in front of all document objects.

  If the object is already a top-level part of this view, the object is moved in the drawing order. The CHANGED view event will have a JGoObject.ChangedZOrder hint/flag, with no previous value.

  Specified by:
    `insertObjectAfter` in interface `JGoObjectCollection`
  Parameters:
    `pos` - the position after which to add the object.
    `obj` - the object to add.
  Returns:
    the position of the new object.

### bringObjectToFront

    public void bringObjectToFront(JGoObject obj)

  Moves an object in front of other objects in the view (moved to the end of the list of objects).

  Note that all view objects will appear in front of all document objects.

  The CHANGED view event will have a JGoObject.ChangedZOrder hint/flag, with no previous value.

  The object should already be a part of this view.

  Specified by:
    `bringObjectToFront` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object to move to the front.

### sendObjectToBack

    public void sendObjectToBack(JGoObject obj)

  Moves an object behind other objects in the view (moved to the head of the list of objects).

  Note that all view objects will appear in front of all document objects.

  The CHANGED view event will have a JGoObject.ChangedZOrder hint/flag, with no previous value.

  The object should already be a part of this view.

  Specified by:
    `sendObjectToBack` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object to move to the back.

### removeObject

    public void removeObject(JGoObject obj)

  Removes an object from the view.

  If the object is not a part of this view, this method is a no-op. If the object is a child of a JGoArea instead of being a top-level view object, it is removed from that area.

  Specified by:
    `removeObject` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object to remove.

### removeObjectAtPos

    public JGoObject removeObjectAtPos(JGoListPosition pos)

  Description copied from interface: `JGoObjectCollection`
  Remove an object at specified position from the collection.

  Specified by:
    `removeObjectAtPos` in interface `JGoObjectCollection`
  Parameters:
    `pos` - the position of the object to remove.
  Returns:
    the object removed from the collection.

### getFirstObjectPos

    public JGoListPosition getFirstObjectPos()

  Description copied from interface: `JGoObjectSimpleCollection`
  Return the position of the first object in the collection. This will be null if the list is empty.

  Specified by:
    `getFirstObjectPos` in interface `JGoObjectSimpleCollection`

### getLastObjectPos

    public JGoListPosition getLastObjectPos()

  Description copied from interface: `JGoObjectCollection`
  Return the position of the last object in the collection. This will be null if the list is empty.

  Specified by:
    `getLastObjectPos` in interface `JGoObjectCollection`
  Returns:
    the position of the last object in the collection.

### getNextObjectPos

    public JGoListPosition getNextObjectPos(JGoListPosition pos)

  Description copied from interface: `JGoObjectSimpleCollection`
  Return the position for the next object in the collection. This may recurse through the objects contained by a JGoArea.

  Specified by:
    `getNextObjectPos` in interface `JGoObjectSimpleCollection`
  Parameters:
    `pos` - the position previous to that which will be returned.
  Returns:
    an iterator for the next object in the collection; null if there are no more objects.

### getNextObjectPosAtTop

    public JGoListPosition getNextObjectPosAtTop(JGoListPosition pos)

  Description copied from interface: `JGoObjectSimpleCollection`
  Return the position for the next top-level object in the collection. A top-level JGoObject is one which is not contained in any JGoArea objects.

  Specified by:
    `getNextObjectPosAtTop` in interface `JGoObjectSimpleCollection`
  Parameters:
    `pos` - the position from which to start searching for the next top-level object.
  Returns:
    an iterator for the next top-level object in the collection; null if there are no more objects.

### getPrevObjectPos

    public JGoListPosition getPrevObjectPos(JGoListPosition pos)

  Description copied from interface: `JGoObjectCollection`
  Return the position of the previous object in the collection.

  Specified by:
    `getPrevObjectPos` in interface `JGoObjectCollection`
  Parameters:
    `pos` - the position of the object that follows the object position to be returned.
  Returns:
    the position of the previous object in the collection; null if there are no more objects.

### getObjectAtPos

    public JGoObject getObjectAtPos(JGoListPosition pos)

  Description copied from interface: `JGoObjectSimpleCollection`
  Return the object for the given position.

  Specified by:
    `getObjectAtPos` in interface `JGoObjectSimpleCollection`
  Parameters:
    `pos` - the position of an object in the collection.
  Returns:
    the object for this position in the collection.

### findObject

    public JGoListPosition findObject(JGoObject obj)

  Description copied from interface: `JGoObjectCollection`
  Return the position of a specific object in the collection.

  Specified by:
    `findObject` in interface `JGoObjectCollection`
  Parameters:
    `obj` - the object whose position in the collection is to be returned. to be returned.
  Returns:
    the position of the indicated object; null if not found.

### createDefaultSelection

    public JGoSelection createDefaultSelection()

  Create an instance of a JGoSelection. This is called once for each JGoView instance.

### getSelection

    public JGoSelection getSelection()

  Return the object representing the selection for this view.

  There is a separate selection for each view. There is only one selection per view, but there may be many objects in the selection.

### selectObject

    public JGoObject selectObject(JGoObject obj)

  Make the given object the one and only selected object in this view.

  This is just a convenience routine, calling selectObject on this view's JGoSelection object.

  Parameters:
    `obj` - the object to be selected

### selectAll

    public void selectAll()

  Select all the top-level, visible, selectable objects in the document. The actual selection may include non-top-level objects if the selection was redirected for some top-level objects.

### selectInBox

    public void selectInBox(java.awt.Rectangle rect)

  Select all visible, selectable objects in the document that are within the given rectangle. This method will recurse into areas if the area is not Selectable or if the given rectangle does not fully enclose the area. Once it finds a selectable object whose redirected selection is within the given rectangle, it does not search further within that object if the object is a JGoArea. The actual selection may also include non-top-level objects if the selection was redirected for some top-level objects.

  Parameters:
    `rect` - the Rectangle, in document coordinates

### getPrimarySelectionColor

    public java.awt.Color getPrimarySelectionColor()

  Returns the primary selection color.

  By default this returns getDefaultPrimarySelectionColor().

### setPrimarySelectionColor

    public void setPrimarySelectionColor(java.awt.Color newcolor)

  Set the primary selection color. If the new color value is null, this view's primary selection color will default to the value of getDefaultPrimarySelectionColor().

### getSecondarySelectionColor

    public java.awt.Color getSecondarySelectionColor()

  Returns the secondary selection color.

  By default this returns getDefaultSecondarySelectionColor().

### setSecondarySelectionColor

    public void setSecondarySelectionColor(java.awt.Color newcolor)

  Set the secondary selection color. If the new color value is null, this view's secondary selection color will default to the value of getDefaultSecondarySelectionColor().

### onPaintComponent

    protected void onPaintComponent(java.awt.Graphics g)

  This method is invoked by the canvas's paintComponent().

  This is infrequently overridden.

### applyRenderingHints

    public void applyRenderingHints(java.awt.Graphics2D g2)

  Set the standard RenderingHints for how shapes, images, and text are drawn.

  This is called by paintView and by printView. By default this specifies quality rendering, with antialiased lines, bicubic interpolation of images, and non-aliased text using fractional metrics.

  If you override this method to change its behavior, remember to apply the same changes to the Graphics2D returned by JGoGlobal.getGraphics2D(), particularly for rendering hints that apply to how text is drawn.

### paintView

    protected void paintView(java.awt.Graphics2D g2,
                             java.awt.Rectangle clipRect)

  Render everything for this view that is within a given rectangle. The normal behavior fills in the paper color, draws any additional background, draws all of the document objects, and then draws any view objects.

  This is infrequently overridden, except perhaps to change the default rendering hints.

  Parameters:
    `g2` - the Graphics2D graphics context to draw on.
    `clipRect` - the clipping rectangle in document coordinates

### paintPaperColor

    protected void paintPaperColor(java.awt.Graphics2D g2,
                                   java.awt.Rectangle clipRect)

  Fill the background with the with the document's paper color. If the document's paper color is null, the view's background color is used instead.

  You may wish to override this method in order to change the background color for this view. For example, you may want to have a gray background if you want to indicate that the view and/or document is read-only.

  Parameters:
    `g2` - the graphics context to draw on.
    `clipRect` - the clipping rectangle in document coordinates

### paintBackgroundDecoration

    protected void paintBackgroundDecoration(java.awt.Graphics2D g2,
                                             java.awt.Rectangle clipRect)

  Draw any background image or decorations before any of the document or the view objects are drawn.

  When getBackgroundImage() returns a non-null Image, that image is drawn at the current view scale with the top-left corner of the image at the (0, 0) position in document coordinates.

  This method also draws any grid lines.

  Parameters:
    `g2` - the graphics context on which to draw.
    `clipRect` - the clipping rectangle in document coordinates

### paintDocumentObjects

    protected void paintDocumentObjects(java.awt.Graphics2D g2,
                                        java.awt.Rectangle clipRect)

  Draw all of the visible document objects that intersect the given clipping rectangle. This method is called by the canvas's paintComponent().

  Parameters:
    `g2` - the graphics context to draw on.
    `clipRect` - the clipping rectangle in document coordinates

### paintViewObjects

    protected void paintViewObjects(java.awt.Graphics2D g2,
                                    java.awt.Rectangle clipRect)

  Draw all of the visible view objects that intersect the given clipping rectangle. This method is called by the canvas's paintComponent().

  Parameters:
    `g2` - the graphics context to draw on.
    `clipRect` - the clipping rectangle in document coordinates

### updateScrollbars

    public void updateScrollbars()

  Make sure the horizontal and vertical scrollbars, if any, properly reflect the view position and document size.

  Called when the scrollbars need to be updated, such as when the document size or view position change.

### updateView

    public void updateView(java.awt.Rectangle viewRect)

  Request repainting a part of the view's canvas.

  Called when part of the view needs to be redrawn, such as when a particular object needs to be redrawn.

  Parameters:
    `viewRect` - the area to be redrawn, in the canvas's Component coordinates

### updateView

    public void updateView()

  Repaint the whole view, including scrollbars.

  Called when the whole view and the scrollbars need to be repainted.

### addViewListener

    public void addViewListener(JGoViewListener l)

  Add a listener for JGoViewEvents, such as clicking on objects or in the background, or a link having been drawn by the user, or property changes on this JGoView.

  Parameters:
    `l` - an object supporting the JGoViewListener interface

### removeViewListener

    public void removeViewListener(JGoViewListener l)

  Remove a listener for JGoViewEvents.

  Parameters:
    `l` - an object supporting the JGoViewListener interface

### getViewListeners

    public JGoViewListener[] getViewListeners()

  Return an array of the JGoViewListeners that are currently listening for JGoViewEvents on this view.

### addDocumentListener

    public void addDocumentListener(JGoDocumentListener l)

  Add a listener for JGoDocument events, such as changes to a JGoObject's properties or to a JGoObject having been added or removed from a JGoLayer.

  Parameters:
    `l` - an object supporting the JGoDocumentListener interface

### removeDocumentListener

    public void removeDocumentListener(JGoDocumentListener l)

  Remove a listener for JGoDocument events.

  Parameters:
    `l` - an object supporting the JGoDocumentListener interface

### getDocumentListeners

    public JGoDocumentListener[] getDocumentListeners()

  Return an array of the JGoDocumentListeners that are currently listening for JGoDocumentEvents on this view's JGoDocument.

### fireUpdate

    public final void fireUpdate(int hint,
                                 int flags,
                                 java.lang.Object x)

  Call this method whenever an event occurs in the view that may require the view to repaint some portion of itself or perform other processing.

  This method is now final, because it just calls the other fireUpdate method.

  Parameters:
    `hint` - a value identifying what type of update is occurring. Hint constant values are identified in JGoViewEvent.
    `flags` - an integer value whose meaning depends on the kind of hint.
    `x` - an Object associated with the update, or null.

### fireUpdate

    public void fireUpdate(int hint,
                           int flags,
                           java.lang.Object x,
                           java.awt.Point vc,
                           java.awt.Point dc,
                           int modifiers)

  This method is called whenever an event occurs in the view that may require the view to repaint some portion of itself or perform other processing.

  By default it is also responsible for firing a JGoViewEvent to all JGoViewListeners.

  Parameters:
    `hint` - a value identifying what type of update is occurring. Hint constant values are identified in JGoViewEvent.
    `flags` - an integer value whose meaning depends on the kind of hint.
    `x` - an Object associated with the update, or null.
    `vc` - the current position of the mouse in view coords
    `dc` - the current position of the mouse in doc coords
    `modifiers` - which keys are pressed

### documentChanged

    public void documentChanged(JGoDocumentEvent evt)

  This method is called whenever a document modification occurs that may require the view to repaint some portion of itself.

  This implements JGoDocumentListener.

  Specified by:
    `documentChanged` in interface `JGoDocumentListener`
  Parameters:
    `evt` - the document event, including the hint type, any flags, and any relevant object

### print

    public void print()

  Call this to print the current view.

  By default this brings up the operating system print dialog and uses a default paper margin of 0.5 inch on each side.

### printShowPageDialog

    protected java.awt.print.PageFormat printShowPageDialog(java.awt.print.PrinterJob pj)

  This method is called in order to call PrinterJob.pageDialog.

  You may want to override this method in order to modify the PageFormat that is passed to PrinterJob.pageDialog, or not to call that method at all. For example, to change the default orientation to LANDSCAPE:

       protected PageFormat printShowPageDialog(PrinterJob pj) {
         PageFormat defaultpf = pj.validatePage(pj.defaultPage());
         // Change the default Orientation to be landscape.
         defaultpf.setOrientation(PageFormat.LANDSCAPE);
         // Ask the user what page size they're using, what the margins are,
         // and whether they are printing in landscape or portrait mode.
         PageFormat pf = pj.pageDialog(defaultpf);
         // PF will be the same as DEFAULTPF if the user cancels this dialog;
         // it will be a new PageFormat if the user OK'd it, perhaps having changed some values
         if (pf != defaultpf)
           return pf;
         else
           return null;
       }

  To avoid showing any page dialog at all, override as follows:

       protected PageFormat printShowPageDialog(PrinterJob pj) {
         PageFormat defaultpf = pj.validatePage(pj.defaultPage());
         defaultpf.setOrientation(PageFormat.LANDSCAPE);
         return defaultpf;
       }

  Returns:
    the PageFormat with which to print, or null if the user cancels the page dialog to cancel printing.

### internalPrint

    protected void internalPrint(java.awt.print.PrinterJob pj)

### printBegin

    protected void printBegin(java.awt.Graphics2D g2,
                              java.awt.print.PageFormat pf)

  This method is called once at the beginning of the printing process.

  Because there may be many calls to Printable.print for each document, we calculate a number of values once and remember their values.

  Parameters:
    `g2` - the Graphics2D that we are printing to; may be null
    `pf` - the PageFormat constraining our printing

### getPrintDocumentSize

    public java.awt.Dimension getPrintDocumentSize()

  Return the size of the document to be printed, in document coordinates. By default this differs from the view's getDocumentSize() because it finds the actual current bounds of all the document objects, thus avoiding printing empty pages at the right and at the bottom of the graph.

  Override this method to return getDocumentSize() if you always want to print the whole document, as determined by the document's Size.

  This method also considers document objects at negative coordinate positions, if isIncludingNegativeCoords() is true.

### getPrintDocumentTopLeft

    public java.awt.Point getPrintDocumentTopLeft()

  This method returns the coordinates of the document's top-left corner, where printing should start from.

  If isIncludingNegativeCoords() is true and there are document objects at negative coordinates, this method will find the top-left point of the bounding rectangle for all document objects. Otherwise this returns (0,0) by default.

### getPrintPageRect

    protected java.awt.geom.Rectangle2D.Double getPrintPageRect(java.awt.Graphics2D g2,
                                                                java.awt.print.PageFormat pf)

  Return the bounds for the part of the print page that should hold the rendered graph. This defaults to the Imageable area of the PageFormat.

  If you want to restrict the graph to a part of the Imageable area, override this method to return a smaller rectangle approriately positioned within the whole printed page.

  Parameters:
    `g2` - the Graphics2D that we are printing to; may be null
    `pf` - the PageFormat constraining our printing

### getPrintScale

    protected double getPrintScale(java.awt.Graphics2D g2,
                                   java.awt.print.PageFormat pf)

  Return the scale at which the graph should be printed. This defaults to 1.0d.

  For example, if you want to always print only one page, no matter how large the document is, you can scale down the printing to fit the page. In this case return the minimum of the horizontal and vertical ratios of the getPrintPageRect() and getPrintDocumentSize() widths and heights.

  Parameters:
    `g2` - the Graphics2D that we are printing to; may be null
    `pf` - the PageFormat constraining our printing

### printEnd

    protected void printEnd(java.awt.Graphics2D g2,
                            java.awt.print.PageFormat pf)

  This method is called once at the end of the printing process.

  Call this method to allow printBegin to be called again for the next printing operation on this JGoView.

  Parameters:
    `g2` - the Graphics2D that we are printing to; may be null
    `pf` - the PageFormat constraining our printing

### print

    public int print(java.awt.Graphics g,
                     java.awt.print.PageFormat pf,
                     int pnum)

  Implement the Printable interface; called by the PrinterJob.

  Specified by:
    `print` in interface `java.awt.print.Printable`

### isPrinting

    public boolean isPrinting()

  This predicate is true while printView is called.

  Currently this is only used for influencing Greeking behavior for text and ports.

### printDecoration

    protected void printDecoration(java.awt.Graphics2D g2,
                                   java.awt.print.PageFormat pf,
                                   int hpnum,
                                   int vpnum)

  Print any decorations on each page.

  The default decoration consists of small corners that bound the graph printing region, getPrintPageRect(), so that it is easy to physically cut and paste the pieces of paper into a large sheet.

  If you wish to add headers and/or footers on each page, override this method to render that information, and override getPrintPageRect to make sure the area for the printed graph is smaller than the Imageable area, to leave room for headers and/or footers.

  Parameters:
    `g2` - the Graphics2D that we are printing to
    `pf` - the PageFormat constraining our printing
    `hpnum` - the horizontal page number (zero based)
    `vpnum` - the vertical page number (zero based)

### printView

    protected void printView(java.awt.Graphics2D g2,
                             java.awt.Rectangle clipRect)

  This is called to print everything for this view that is within the given rectangle in document coordinates. The normal behavior only draws any additional background and draws all of the document objects; not the paper color or any view objects.

  If you do want to draw selection handles and other view objects, override this method to call paintViewObjects(g2, clipRect) after calling super.printView(g2, clipRect).

  Parameters:
    `g2` - the Graphics2D graphics context to draw on.
    `clipRect` - the clipping rectangle in document coordinates

### printPreview

    public void printPreview()

  Bring up a JGoPrintPreview to preview the pages to be printed, if this is running in a Frame.

### printPreview

    public void printPreview(java.lang.String title,
                             java.awt.print.PageFormat pf)

  Bring up a JGoPrintPreview to preview the pages to be printed, if this is running in a Frame.

  Parameters:
    `title` - the title to show in the preview window
    `pf` - a java.awt.print.PageFormat constant (e.g. PORTRAIT or LANDSCAPE)

### doLayout

    public void doLayout()

  This method actually performs the layout of the canvas, the scrollbars, and the corner component. It adjusts the scrollbars appropriately. It should not change the enablement, visibility, value, increment, or extent of the scrollbars. It may change the position, size, and block increment of the scrollbars. When doing a layout, update the scroll bar unit increments to match the grid spacing.

### setSize

    public void setSize(int width,
                        int height)

  This overrides Component.setSize to make sure we re-layout the scroll bars.

### setSize

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

  This overrides Component.setSize to make sure we re-layout the scroll bars.

### setBounds

    public void setBounds(int x,
                          int y,
                          int w,
                          int h)

  This overrides Component.setBounds to make sure we re-layout the scroll bars.

### setBounds

    public final void setBounds(java.awt.Rectangle r)

  This overrides Component.setBounds to make sure we re-layout the scroll bars.

### getPreferredSize

    public java.awt.Dimension getPreferredSize()

  The preferred size for a view normally comes from the document.

### getMinimumSize

    public java.awt.Dimension getMinimumSize()

  The minimum size for this JComponent defaults to (50, 50).

### onScrollEvent

    protected void onScrollEvent(java.awt.event.AdjustmentEvent evt)

  This is the event handler for the scrollbars. It calls setViewPosition() with the new document position for the view according to the scrollbar values.

### setKeyEnabled

    public void setKeyEnabled(boolean m)

  This function enables or disables key event handling.

  Parameters:
    `m` - true to allow handling keyboard key events; false to ignore them

### isKeyEnabled

    public boolean isKeyEnabled()

  Return true if keyboard key strokes are handled normally, or return false if those events are ignored.

### keyPressed

    public void keyPressed(java.awt.event.KeyEvent evt)

  This method implements KeyListener. If this view has enabled keystroke command handling, it calls onKeyEvent(), which implements both the default keyboard commands as well as any JGoView subclass overridden behavior.

  Specified by:
    `keyPressed` in interface `java.awt.event.KeyListener`

### keyTyped

    public void keyTyped(java.awt.event.KeyEvent evt)

  This method implements KeyListener as a no-op.

  Specified by:
    `keyTyped` in interface `java.awt.event.KeyListener`

### keyReleased

    public void keyReleased(java.awt.event.KeyEvent evt)

  This method implements KeyListener as a no-op.

  Specified by:
    `keyReleased` in interface `java.awt.event.KeyListener`

### onKeyEvent

    public void onKeyEvent(java.awt.event.KeyEvent evt)

  This is the default event handler for keystroke commands.

  By default, PageUp and PageDown scroll vertically; Ctrl-PageUp and Ctrl-PageDown scroll horizontally.

  Override this method to add behavior for other keys, or to change or disable the default keystroke behavior. Call setKeyEnabled() to turn on and off all keystroke handling.

  Parameters:
    `evt` - the keystroke event

### isFocusTraversable

    public boolean isFocusTraversable()

  This returns true to allow tabbing to this component.

### isIgnoreNextMouseDown

    public boolean isIgnoreNextMouseDown()

  Return whether the view's mouse pressed handler will ignore the next mouse pressed event.

### setIgnoreNextMouseDown

    public void setIgnoreNextMouseDown(boolean bFlag)

  Set the view's flag to ignore the next mouse pressed event. The mouse pressed handler will automatically clear this flag when it sees the first event, so that subsequent mouse press events are handled normally.

  Parameters:
    `bFlag` - true to ignore next mouse press

### keyToggleSelection

    protected boolean keyToggleSelection(int modifiers)

  Return true if the state of the modifier keys indicates whether we should deselect a selected object or select an unselected object.

  The default implementation returns true if shift or control is held down.

  Parameters:
    `modifiers` - the key state -- see InputEvent

### keyExtendSelection

    protected boolean keyExtendSelection(int modifiers)

  Return true if the modifiers keys indicate that a click on an object should add the current object to the selection.

  The default implementation returns true if shift is held down.

  Parameters:
    `modifiers` - the key state -- see InputEvent

### keySingleSelection

    protected boolean keySingleSelection(int modifiers)

  Return true if clicking on an object should make it the only selected object.

  The default implementation always returns true.

  Parameters:
    `modifiers` - the key state -- see InputEvent

### keyMultipleSelect

    protected final boolean keyMultipleSelect(int modifiers)

  Deprecated. -- replaced by keyExtendSelection and keyToggleSelection

### keyClearSelection

    protected boolean keyClearSelection(int modifiers)

  Return true if the state of the modifier keys indicates that we should clear the selection when a click occurs on the background.

  The default implementation is to return true unless shift or control is held down.

  Parameters:
    `modifiers` - the key state -- see InputEvent

### initializeMouseHandling

    protected void initializeMouseHandling()

  This initializes the handling of mouse events.

### setMouseEnabled

    public void setMouseEnabled(boolean m)

  This function enables or disables mouse event handling, for all cases except those handled by drag-drop.

  Parameters:
    `m` - true to allow user mouse actions; false to ignore mouse presses, drags, releases and drops

### isMouseEnabled

    public boolean isMouseEnabled()

  Return true if mouse presses, drags, releases, and clicks are handled normally or return false if those actions are ignored.

### getCurrentMouseEvent

    protected final java.awt.event.MouseEvent getCurrentMouseEvent()

  Return the MouseEvent associated with the ongoing doMouseDown, doMouseMove, doMouseUp, doMouseClick, doMouseDblClick, or doUncapturedMouseMove methods.

  The return value is invalid when not called from within those methods. Even so, the value may be null if those methods were not invoked from a mouse event handler.

### onMousePressed

    protected void onMousePressed(java.awt.event.MouseEvent evt)

  This is the internal event handler for mouse down events.

### onMouseReleased

    protected void onMouseReleased(java.awt.event.MouseEvent evt)

  This is the internal event handler for mouse up events.

### onMouseMoved

    protected void onMouseMoved(java.awt.event.MouseEvent evt)

  This is the internal event handler for mouse motion non-drag events.

### onMouseDragged

    protected void onMouseDragged(java.awt.event.MouseEvent evt)

  This is the internal event handler for mouse motion drag events. It will be called before the drag-drop gesture recognizer is activated.

### doMouseDown

    public boolean doMouseDown(int modifiers,
                               java.awt.Point dc,
                               java.awt.Point vc)

  Called when a mouse button is pressed. The default behavior depends on any JGoObjects at the specified point.

  If the object is a JGoActionObject (or part of one), we activate that object for handling further mouse events.

  If the object is a JGoHandle, we may start resizing the object.

  If the object is a JGoPort, we may start creating a link to another port.

  Otherwise if there is a selectable object at the point, we start doing something with the selection.

  If there is no selectable object at the point, we start a rubber-band selection box.

  Parameters:
    `modifiers` - which keys are pressed
    `dc` - the current position of the mouse in doc coords
    `vc` - the current position of the mouse in view coords

### doMouseMove

    public boolean doMouseMove(int modifiers,
                               java.awt.Point dc,
                               java.awt.Point vc)

  Called when the mouse is moved. The default behavior depends on any JGoObjects at the specified point.

  If we are acting on a JGoActionObject, we adjust it by calling handleActionObject.

  If we had started resizing an object, creating a link, doing a rubber-band selection, we continue that operation.

  If there is a selection, then the selection may be modified depending on whether the object is already part of the selection.

  The default behavior is to move the selection to the point, thus causing the selection to follow the mouse around the canvas.

  Parameters:
    `modifiers` - which keys are pressed
    `dc` - the current position of the mouse in doc coords
    `vc` - the current position of the mouse in view coords

### doMouseUp

    public boolean doMouseUp(int modifiers,
                             java.awt.Point dc,
                             java.awt.Point vc)

  Performs the required processing when the mouse button is released. What is done depends on what state we're currently in.

  Parameters:
    `modifiers` - which keys are pressed, etc.
    `vc` - the view coordinates.
    `dc` - the document coordinates.

### doMouseClick

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

  Handle single click behavior for an object in the document.

  By default, this picks the top object (perhaps not a Selectable one) in the document at the given position and fires JGoViewEvent.CLICKED on the that object. It then invokes doMouseClick on that object. If that call returns true, this method returns true. Otherwise it will go up the chain of that object's parents, invoking doMouseClick on each one until one returns true.

  If there is no object at the point, this method calls doBackgroundClick.

  No document transactions are involved with this method by default; your mouse click handlers may want to start and end transactions if they cause changes to the document, for example by bringing up a properties dialog.

  Parameters:
    `modifiers` - which keys are pressed
    `dc` - the destination point in document coordinates
    `vc` - the destination point in view coordinates

### doMouseDblClick

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

  Handle double click behavior for an object in the document.

  By default, this picks the object in the document at the given position and fires JGoViewEvent.DOUBLE_CLICKED with that object. It then invokes doMouseDblClick on that object. If that call returns true, this method returns true. Otherwise it will go up the chain of that object's parents, invoking doMouseDblClick on each one until one returns true.

  If there is no object at the point, this method fires the JGoViewEvent.BACKGROUND_DOUBLE_CLICKED event and returns false.

  The object need not be selectable, so the object may very well be a part of an area.

  No document transactions are involved with this method by default; your double-click handlers may want to start and end transactions if they cause changes to the document, for example by bringing up a properties dialog.

  Parameters:
    `modifiers` - which keys are pressed
    `dc` - the destination point in document coordinates
    `vc` - the destination point in view coordinates

### doCancelMouse

    public void doCancelMouse()

  When one needs to cancel any mouse operation, this function restores the view to the normal state.

  If the user was acting on a JGoActionObject, this calls JGoActionObject.setActionActivated(false). If the user was moving or copying with the mouse, this calls doCancelMoveSelection. If the user was resizing an object, this calls doCancelResize. If the user was linking or relinking ports, this calls noNewLink or noReLink appropriately and restores the original link's state. The selection handles are restored.

### getState

    public final int getState()

  Return the current state of this view in its handling of the mouse. The value is normally one of the "MouseState" constants, but may be a user-defined state.

### setState

    public void setState(int s)

  Change the current state of this view for handling mouse events. You should be careful to call this in a manner that is consistent with what is expected by all mouse handling code.

  Parameters:
    `s` - the new mouse state, normally a user-defined state or MouseStateNone

### getCurrentObject

    public final JGoObject getCurrentObject()

  Return the current JGoObject, if any, associated with any mouse event handling.

### setCurrentObject

    public void setCurrentObject(JGoObject obj)

  Change the current JGoObject, if any, associated with any mouse event handling.

### doUncapturedMouseMove

    public void doUncapturedMouseMove(int modifiers,
                                      java.awt.Point dc,
                                      java.awt.Point vc)

  This method is called when the mouse is moved over the canvas and no other mouse behavior is happening.

  The default behavior is to find the object at the given point and to call its doUncapturedMouseMove() method. If it returns null, we try calling the object's parents. If there is no object to handle the method, we just set the cursor to the default cursor.

  No document transactions are normally involved with this method.

  Parameters:
    `modifiers` - which keys are pressed
    `dc` - the destination point in document coordinates
    `vc` - the destination point in view coordinates

### setCursor

    public void setCursor(java.awt.Cursor cur)

  This method implements a work-around for a Java bug on Windows, by delaying the actual setCursor call. See Java Developer Connection bug 4269666.

### setCursorImmediately

    public void setCursorImmediately(java.awt.Cursor cur)

  This method helps implement a work-around for a Java bug on Windows. See Java Developer Connection bug 4269666.

### getDefaultCursor

    public java.awt.Cursor getDefaultCursor()

  Return the default cursor for the view.

### setDefaultCursor

    public void setDefaultCursor(java.awt.Cursor cursor)

  Set the default cursor for the view.

  If the new cursor value is null, the view will use the standard default Cursor.

  Parameters:
    `cursor` - the cursor to use when no object specifies a cursor

### doBackgroundClick

    public void doBackgroundClick(int modifiers,
                                  java.awt.Point dc,
                                  java.awt.Point vc)

  This method is called when a click happens in the canvas and there is no object underneath and there is no selection. By default this just fires the JGoViewEvent.BACKGROUND_CLICKED event.

### doMoveSelection

    public void doMoveSelection(int modifiers,
                                int offsetx,
                                int offsety,
                                int event)

  Moves all currently selected draggable objects by the given offset. This method is called by the mouse event handlers.

  This method calls moveSelection if the document is modifiable. Furthermore, if the CTRL key is held down at the time of the mouse up (a drop), we make a copy of the selection rather than moving it, by calling copySelection method, and the copied objects become the new selection. The moveSelection method has been added to separate out that functionality from the default event handling responsibilities of this method.

  The default implementation of this method starts a transaction on this view's document on an EventMouseDown, and ends it on an EventMouseUp. The transaction may also be aborted by a call to doCancelMoveSelection. If a move occurs, this method fires the JGoViewEvent.SELECTION_MOVED event. If a copy occurs, this method fires the JGoViewEvent.SELECTION_COPIED event.

  Parameters:
    `modifiers` - which keys are pressed
    `offsetx` - the distance to move horizontally, in document coordinates
    `offsety` - the distance to move vertically, in document coordinates
    `event` - one of: EventMouseDown, EventMouseMove, EventMouseUp

### isDragsRealtime

    public boolean isDragsRealtime()

  Gets whether a user's drag of objects in this view actually moves the objects continuously, rather than dragging around an outline or an image of the selected objects.

  By default this is true.

### setDragsRealtime

    public void setDragsRealtime(boolean bFlag)

  Change whether dragging in this view actually continuously moves the objects to follow the mouse.

  A value of false may be more responsive for large selections or for objects that require a lot of computation when moved.

  Parameters:
    `bFlag` - true to

### getInternalMouseActions

    public int getInternalMouseActions()

  Return which kinds of drag-and-drop actions are permitted for mouse drags that start and end in this view.

  The default value is Copy-or-Move.

  For drag-and-drops that occur between windows (Components), see computeAcceptableDrop and the DropTargetListener methods.

### setInternalMouseActions

    public void setInternalMouseActions(int m)

  Change the permitted drag-and-drop actions for internal mouse drags of selected objects. The values are: DnDConstants.ACTION_COPY_OR_MOVE (the default), DnDConstants.ACTION_MOVE, DnDConstants.ACTION_COPY, or DnDConstants.ACTION_NONE.

  This has no effect on drag-and-drops between other windows and this view, nor does it effect drag-box selection, resizing, and linking ports.

### isDragsSelectionImage

    public boolean isDragsSelectionImage()

  Gets whether the selection being copied or dragged is displayed as an image or with an outline.

  By default this is true.

### setDragsSelectionImage

    public void setDragsSelectionImage(boolean bFlag)

  Change whether the objects being copied, or being dragged when isDragsRealtime() is false, are drawn as an image or with an outline.

### moveSelection

    public void moveSelection(JGoSelection sel,
                              int modifiers,
                              int offsetx,
                              int offsety,
                              int event)

  Moves all currently selected draggable objects of modifiable layers by the given offset.

  For each object in the selection whose isDraggable() predicate is true (in layers that are modifiable), this method calls JGoObject.getDraggingObject to determine the real object to be moved. This method also tries to avoid moving the same object twice, in case both a parent area and its child are in the selection.

  By default this ignores the modifiers and event arguments, but overrides could change the behavior depending on those values.

  If a snap grid is active, move the selection to position each object's spot to a grid point, depending on the SnapMove property.

  Note that no change is made to the object's height or width to accommodate the snap behavior. In other words, after moving, the object's resize handles might no longer be on a grid point.

  The actual object-moving functionality is in this method, so that this could be called independently of a mouse move event handler, and so that the default mouse handling could be sensitive to whether the document is Modifiable. However, the decision on what objects to actually move, given the argument selection, is determined by the computeEffectiveSelection method.

  Parameters:
    `sel` - the selection of objects to be moved by the given offsets
    `modifiers` - which keys are pressed (not used by the default implementation)
    `offsetx` - the distance to move horizontally, in document coordinates
    `offsety` - the distance to move vertically, in document coordinates
    `event` - one of: EventMouseDown, EventMouseMove, EventMouseUp

### computeEffectiveSelection

    public java.util.ArrayList computeEffectiveSelection(JGoObjectSimpleCollection coll)

  Try to avoid problems with double-moving due to duplicate entries or both a parent and its child being in the argument collection. Also add all links that have both ports/nodes in the selection.

  Parameters:
    `coll` - a collection of JGoObjects to be dragged (moved or copied)
  Returns:
    an ArrayList of the actual objects to be dragged

### computeEffectiveSelection

    public java.util.ArrayList computeEffectiveSelection(JGoObjectSimpleCollection coll,
                                                         boolean move,
                                                         boolean includelinks)

  Try to avoid problems with double-moving due to duplicate entries or both a parent and its child being in the argument collection.

  Parameters:
    `coll` - a collection of JGoObjects to be dragged (moved or copied)
    `move` - whether the drag is intended to be a move instead of a copy
    `includelinks` - whether to add all links whose ports are part of the collection
  Returns:
    an ArrayList of the actual objects to be dragged

### doCancelMoveSelection

    public void doCancelMoveSelection(java.awt.Point offset)

  Called when the user's dragging of the current selection is cancelled. Besides moving the selection back to its original location, it also aborts the current transaction on this view's document.

### copySelection

    public void copySelection(JGoSelection sel,
                              int modifiers,
                              int offsetx,
                              int offsety,
                              int event)

  Make copies of all currently selected objects and add them to this document at positions adjusted by the given offset.

  This calls JGoDocument.copyFromCollection to actually copy the objects. This method then selects all the newly copied objects. If getSnapMove() specifies a snap, this method also moves all those newly copied objects to the nearest grid points, according to the getGridSpot().

  Parameters:
    `sel` - the selection of objects to be copied by the given offsets
    `modifiers` - which keys are pressed (not used by the default implementation)
    `offsetx` - the distance to move horizontally, in document coordinates
    `offsety` - the distance to move vertically, in document coordinates
    `event` - one of: EventMouseDown, EventMouseMove, EventMouseUp

### startMoveSelection

    protected boolean startMoveSelection(int modifiers,
                                         java.awt.Point dc,
                                         java.awt.Point vc)

  This method is called by doMouseMove when the mouse state is MouseStateSelection and there is an object at the current point.

  This changes the state to MouseStateMove and calls doMoveSelection with an event value of MouseStateDown to indicate that the move is just starting.

  This method does nothing if there is no current object, or if the current object is not draggable or if it is in a JGoLayer that is not modifiable, or if getInternalMouseActions() allows neither move nor copy.

  Parameters:
    `modifiers` - key modifers
    `dc` - the current mouse point in document coordinates
    `vc` - the current mouse point in view coordinates

### startDragBoxSelection

    protected boolean startDragBoxSelection(int modifiers,
                                            java.awt.Point dc,
                                            java.awt.Point vc)

  This method is called by doMouseMove when the mouse state is MouseStateSelection and there are no objects at the current point.

  This changes the state to MouseStateDragBoxSelection and starts drawing a rubber-band box in XOR mode from the given view-coordinates point.

  Parameters:
    `modifiers` - key modifers
    `dc` - the current mouse point in document coordinates
    `vc` - the current mouse point in view coordinates

### startResizing

    protected boolean startResizing(JGoHandle handle,
                                    java.awt.Point dc,
                                    java.awt.Point vc)

  This method is called in response to the user's mouse press on a resize handle in order to start resizing an object.

  By default this will also clear all the selection handles for the object being resized, to be restored after the resize is finished.

  Return true if the view should start calling handleResizing as the mouse is being dragged. By default this will return false if the object is in a not-modifiable layer or document.

  The default implementation of this method starts a transaction on this view's document. The handleResizing and doCancelResize methods are responsible for ending the transaction on EventMouseUp.

  Parameters:
    `handle` - the handle with which the user is doing the resize
    `dc` - the current mouse point in document coordinates
    `vc` - the current mouse point in view coordinates
  Returns:
    whether to go into resize mode

### handleResizing

    protected void handleResizing(java.awt.Graphics2D g,
                                  java.awt.Point vc,
                                  java.awt.Point dc,
                                  int event)

  This method is called in resize mode as the user is dragging a resize handle.

  This method commits a transaction on this view's document when the event is EventMouseUp. Presumably the transaction had been started by the startResizing method. On a mouse up when resizing, this fires a JGoViewEvent.OBJECT_RESIZED event.

  If SnapResizing is enabled, modify the standard resizing of the selected o bject to position the dragged resize handle to a grid point, depending on the SnapResize property.

  Not that no change is made to the object's location to accommodate the snap behavior. In other words, after resizing, the object's location might no longer be on a grid point.

  Parameters:
    `g` - the graphics to be used for drawing any resizing feedback
    `vc` - the current mouse point in view coordinates
    `dc` - the current mouse point in document coordinates
    `event` - one of: EventMouseUp, EventMouseMove, EventMouseDown

### doCancelResize

    public void doCancelResize(java.awt.Rectangle orig)

  Called when the user's resizing of an object is cancelled. Besides restoring the original geometry of the object, this method also aborts the transaction on this view's document.

### pickActionObject

    public JGoActionObject pickActionObject(java.awt.Point dc)

  Return a JGoActionObject that is in the document at a given point.

  This picks a document object; if it is not a JGoActionObject, this method proceeds up the parent chain. If it finds an action object, and if JGoActionObject.isActionEnabled() is true, this method returns that object. Otherwise this returns null.

  Parameters:
    `dc` - the current mouse point in document coordinates
  Returns:
    an enabled JGoActionObject at the mouse point, or null

### startActionObject

    public boolean startActionObject(JGoActionObject actionobj,
                                     int modifiers,
                                     java.awt.Point dc,
                                     java.awt.Point vc)

  Start acting on a JGoActionObject.

  Basically this method just calls JGoActionObject.setActionActivated(true) and sets the current JGoView mouse state to be MouseStateAction. The view's current object will be the action object. For a prototypical button, the activation will give it a chance to display differently, probably to look as it were being "pressed".

  Parameters:
    `actionobj` - a JGoObject implementing JGoActionObject
    `modifiers` - the key state
    `vc` - the current mouse point in view coordinates
    `dc` - the current mouse point in document coordinates
  Returns:
    true if the action object was activated

### handleActionObject

    public void handleActionObject(int modifiers,
                                   java.awt.Point dc,
                                   java.awt.Point vc,
                                   int event)

  Handle further mouse events on a JGoActionObject.

  This is called by doMouseDown, doMouseMove and doMouseUp when getState() == MouseStateAction. This assumes getCurrentObject() is a JGoActionObject. For mouse moves, this method calls JGoActionObject.onActionAdjusted. For a mouse up this method calls JGoActionObject.onAction. Thus for a typical button, there is no final "action" if the mouse up happens outside of the button.

  Parameters:
    `modifiers` - the key state
    `vc` - the current mouse point in view coordinates
    `dc` - the current mouse point in document coordinates
    `event` - one of JGoView.EventMouseDown, EventMouseMove, or EventMouseUp.

### getToolTipText

    public java.lang.String getToolTipText(java.awt.event.MouseEvent evt)

  Implement tooltips for JGoObjects by finding the object at the given point as specified by the MouseEvent, and asking for it's tooltip.

  If no string is returned, ask the object's parent, until either a non-null string is returned, or until there is no JGoObject parent.

  Parameters:
    `evt` - the mouse event generated when passing over the canvas.
  Returns:
    a string for a tooltip, or null if this object should have no tooltip and the view should ask this object's parent

### setEditControl

    public void setEditControl(JGoTextEdit edit)

  Specify the in-place text editor to use. Note that this editor is itself a JGoObject that is responsible for bringing up a Swing JTextComponent as the real editor.

  Parameters:
    `edit` - the JGoTextEdit object

### getEditControl

    public JGoTextEdit getEditControl()

  This returns the single JGoTextEdit that is used for in-place editing for this whole view.

### isEditingTextControl

    public boolean isEditingTextControl()

  Return true if the user is in the midst of in-place text editing.

### doEndEdit

    public void doEndEdit()

  Tell any edit control (JGoTextEdit) that it's time to stop being in edit mode.

### drawXORRect

    protected void drawXORRect(java.awt.Graphics2D g,
                               int x,
                               int y,
                               int w,
                               int h)

  Performs the actual drawing of the XOR'ed rectangle. If the Graphics2D object is null, this is a no-op.

  Parameters:
    `g` - the graphics context on which to draw
    `x` - the rectangle X position to draw (in view coordinates)
    `y` - the rectangle Y position to draw (in view coordinates)
    `w` - the rectangle width to draw (in view coordinates)
    `h` - the rectangle height to draw (in view coordinates)

### isDrawsXorMode

    public boolean isDrawsXorMode()

  Returns whether drawXORBox uses drawXORRect to really draw a rectangle using XOR mode, rather than simulating the rectangle using regular drawing.

  The default value is false.

### setDrawsXorMode

    public void setDrawsXorMode(boolean d)

  When set to true, drawXORBox tries to draw using the underlying graphics's XOR mode, rather than using regular drawing.

  Some platforms cannot handle drawing in XOR mode, so you should not set this to true without careful testing on all of the platforms you may want to run on.

### drawXORBox

    protected void drawXORBox(java.awt.Graphics2D g,
                              int corner1x,
                              int corner1y,
                              int corner2x,
                              int corner2y,
                              int event)

  Draw an XOR'ed rectangle on the view screen given two opposite corners. This erases any previous rectangle and stops drawing on EventMouseUp.

  Parameters:
    `g` - the graphics context on which to draw.
    `corner1x` - one corner of the rectangle in view coordinates
    `corner1y` - one corner of the rectangle in view coordinates
    `corner2x` - the opposite corner in view coordinates
    `corner2y` - the opposite corner in view coordinates
    `event` - one of: EventMouseUp, EventMouseMove, EventMouseDown

### getJGoGraphics

    public java.awt.Graphics2D getJGoGraphics()

  This convenience function returns a Graphics2D object for painting on the view's canvas. Remember to call disposeJGoGraphics on the result as soon as you are done with it.

  Returns:
    a Graphics2D for painting on the canvas.

### disposeJGoGraphics

    public void disposeJGoGraphics(java.awt.Graphics2D g)

  This convenience function disposes the Graphics object that is passed, or is a no-op if the object is null.

  Parameters:
    `g` - a Graphics2D produced by a call to getJGoGraphics

### pickHandle

    protected JGoHandle pickHandle(java.awt.Point point)

  Return a JGoHandle under the given document coordinate point.

  Return null if there is no such handle, or if you do not want the handle to particpate in user-controlled resizing gestures.

  Parameters:
    `point` - a point in document coordinates

### newLink

    public void newLink(JGoPort from,
                        JGoPort to)

  Called to create a new link from the from port to the to port. Both ports must belong to the view's document. By default the link will be a JGoLink that is added to the links layer of the view's document, JGoDocument.getLinksLayer(), or to the subgraph that includes both ports, if such a common parent subgraph exists.

  Override this method to create links that are derived from JGoLink. You can call JGoSubGraphBase.reparentToCommonSubGraph to add the new link to the appropriate subgraph or layer, or you can call JGoLayer.addObjectAtTail to add the new link to a particular layer.

  This method is responsible for firing the JGoViewEvent.LINK_CREATED event and for committing a transaction on the view's document.

  Parameters:
    `from` - the source port
    `to` - the destination port

### noNewLink

    protected void noNewLink(JGoPort from,
                             JGoPort to)

  Called when a link creation failed. Subclasses may override to get interesting behavior -- the default is to do nothing.

  This method is responsible for committing a transaction on the view's document.

  Parameters:
    `from` - the source port (may be null)
    `to` - the destination port (may be null)

### reLink

    public void reLink(JGoLink oldlink,
                       JGoPort from,
                       JGoPort to)

  Called to reconnect an existing link from the from port to the to port. Both ports must belong to the view's document. By default this just makes sure the oldlink's ports are the same as those specified, and reparents the link to the common parent subgraph, if any, or else as a top-level object in the oldlink's layer.

  This method is responsible for firing the JGoViewEvent.LINK_RELINKED event and for committing a transaction on the view's document.

  Parameters:
    `oldlink` - the existing link being reconnected
    `from` - the source port
    `to` - the destination port

### noReLink

    protected void noReLink(JGoLink oldlink,
                            JGoPort from,
                            JGoPort to)

  Called when a link reconnection failed. Subclasses may override to get interesting behavior -- the default is to just delete the link from the document.

  If the old link is removed from the document, this fires the JGoViewEvent.SELECTION_DELETED event. This method is responsible for committing a transaction on the view's document.

  Parameters:
    `oldlink` - the existing link being reconnected
    `from` - the source port (may be null)
    `to` - the destination port (may be null)

### validLink

    public boolean validLink(JGoPort from,
                             JGoPort to)

  Return whether or not a link from "from" to "to" is valid. By default, every link is valid as long as both ports are in modifiable layers (and document). Subclasses should override to get more interesting behavior.

  Parameters:
    `from` - the source port
    `to` - the destination port
  Returns:
    true if the link would be valid

### validSourcePort

    public boolean validSourcePort(JGoPort from)

  Return whether or not a link can begin at the given port. Subclasses should override to get more interesting behavior, either here in JGoView or JGoPort.isValidSource().

  By default this checks to make sure the port is in a modifiable layer/document and that the port is a valid source.

  Parameters:
    `from` - the source port
  Returns:
    true if the link should be considered

### validDestinationPort

    public boolean validDestinationPort(JGoPort to)

  Return whether or not a link can end at a port. Subclasses should override to get more interesting behavior, either here in JGoView or JGoPort.isValidDestination().

  By default this checks to make sure the port is in a modifiable layer/document and that the port is a valid destination.

  Parameters:
    `to` - the source port
  Returns:
    true if the link should be considered

### getPortGravity

    public int getPortGravity()

  Return the port gravity for this view.

  When the user is drawing a link, the link will automatically snap to the nearest valid port, if it is less than the port gravity distance away.

  The value defaults to getDefaultPortGravity().

### pickNearestPort

    public JGoPort pickNearestPort(java.awt.Point dc)

  Return the nearest valid port to the given position in the document while the user is in the midst of drawing a new link.

  This method makes use of the getPortGravity() method to "snap" a potential link to the nearest valid port within that distance. This method makes use of JGoPort.isValidLink() to determine which ports were checked to be valid connections for the potential link.

### pickPort

    protected JGoPort pickPort(java.awt.Point dc)

  Return a JGoPort under the given document coordinate point.

  Return null if there is no such port, or if you do not want the port to particpate in user-controlled linking gestures.

  Parameters:
    `dc` - a point in document coordinates

### startNewLink

    public boolean startNewLink(JGoPort port,
                                java.awt.Point dc)

  This method is called in response to the user's pressing on and dragging over a valid port in order to create a new link.

  The technique behind the interactive behavior is that the view creates a temporary hidden port and a temporary link between the given port and the temporary one. The hidden port is continuously dragged around following the still-depressed mouse. The temporary link is therefore continuously redrawn as it must connect both ports.

  You can override the default behavior by overriding createTemporaryPortForNewLink() and createTemporaryLinkForNewLink().

  If the given port is a valid source port, the new link's source will be that port. If not, then if the given port is a valid destination port, the user is drawing a link "backwards", and the port will be the "to" port of the new link. If the given port is neither a valid source or destination port, no link is created, and this method returns false.

  If the port is in a layer or document that is not modifiable, this method will return false, thereby disabling the user's link-drawing behavior.

  The default implementation of this method starts a transaction on this view's document on an EventMouseDown. The newLink, noNewLink, and doCancelMouse methods are responsible for ending the transaction.

  Parameters:
    `port` - represents the port at which the user pressed and starting dragging the mouse.
    `dc` - the point where the mouse is, in document coordinates
  Returns:
    whether to enter link-drawing mode

### startReLink

    public boolean startReLink(JGoLink oldlink,
                               JGoPort oldport,
                               java.awt.Point dc)

  Start the process of handling a user's drawing a link between two ports. This differs from startNewLink(JGoPort, Point) in that we want the user to modify an existing link (oldlink) by connecting it to a new port. The drawing will just re-link that existing link, rather than creating a completely new link. On mouse up either the reLink method or the noReLink method will be called. On cancelling the link will be relinked to its original port, oldport.

  The default implementation of this method starts a transaction on this view's document on an EventMouseDown. The reLink, noReLink, and doCancelMouse methods are responsible for ending the transaction.

  Parameters:
    `oldlink` - an existing document link with one null JGoPort that needs to be re-hooked up at that end
    `oldport` - represents the port near which the user pressed and starting dragging the mouse to start relinking. This port will represents the original port that the existing link used to be connected to.
    `dc` - the point where the mouse is, in document coordinates
  Returns:
    whether to enter link-drawing mode

### createTemporaryPortForNewLink

    protected JGoPort createTemporaryPortForNewLink(JGoPort port,
                                                    java.awt.Point dc)

  Return a temporary port used by the user-invoked link creating or reconnecting routines. See startNewLink() and startReLink() for more details. The view does not add the temporary port to either the view or the document.

  Parameters:
    `port` - the port at which the user started dragging to create a new link
    `dc` - the Point at which the user is starting the new link, in document coordinates

### createTemporaryLinkForNewLink

    protected JGoLink createTemporaryLinkForNewLink(JGoPort from,
                                                    JGoPort to)

  Return a temporary link used by the user-invoked link creating routines. See startNewLink() for more details. The view will add the temporary link as a view object.

  One of the two ports will be the temporary port created by createTemporaryPortForNewLink(). Which one depends on whether the user started dragging from a valid source port--if so, the from port will be the source port and the to port will be the temporary port.

  Parameters:
    `from` - the source port
    `to` - the destination port

### lostOwnership

    public void lostOwnership(java.awt.datatransfer.Clipboard c,
                              java.awt.datatransfer.Transferable t)

  This method implements ClipboardOwner. By default this method does nothing.

  Specified by:
    `lostOwnership` in interface `java.awt.datatransfer.ClipboardOwner`

### copy

    public void copy()

  Copy the document objects in the current selection to the system clipboard.

  The default implementation of this method starts a transaction on this view's document before calling copyToClipboard, firing the JGoViewEvent.CLIPBOARD_COPIED event, and then ending the transaction.

### copyToClipboard

    public void copyToClipboard(java.awt.datatransfer.Clipboard clipboard)

  Copy document objects from the current selection to the given clipboard. A new instance of this document is created, the selection's objects are copied to the new document, and then the document is serialized to the clipboard.

  The copy() and cut() methods are the normal callers of this method. This method does not start or finish any transaction.

  Parameters:
    `clipboard` - the clipboard to receive a new document containing a copy of the current selection

### cut

    public void cut()

  Copy the current selection to the system clipboard and then remove the selected objects from the document.

  The default implementation of this method starts a transaction on this view's document before calling copyToClipboard and deleteSelection, firing the JGoViewEvent.CLIPBOARD_COPIED event, and then ending the transaction.

### deleteSelection

    public void deleteSelection()

  Remove the objects of the current selection from the document without copying them to the clipboard.

  Top-level selected objects are removed from the document. Before version 4.1, non-top-level objects, i.e. parts of areas, cause the top-level areas to be removed from the document rather than from the parent area. For version 4.1, the result of JGoObject.getDraggingObject() determines what object really is removed from the document.

  This fires the JGoViewEvent.SELECTION_DELETED event. The default implementation of this method starts a transaction on this view's document before deleting all selected objects in modifiable layers and then ending the transaction.

### paste

    public void paste()

  Copy JGoObjects from the system clipboard into this document.

  The default implementation of this method starts a transaction on this view's document before calling pasteFromClipboard, firing the JGoViewEvent.CLIPBOARD_PASTED event, and then ending the transaction.

  For version 4.1, this method now resets the selection to be the set of top-level objects that were copied. If you do not want the selection to be changed, you can just call pasteFromClipboard (presumably within a document transaction).

### canPaste

    public boolean canPaste()

  Return true if the document's DefaultLayer is Modifiable and if there is JGo data in the clipboard.

### pasteFromClipboard

    public JGoCopyEnvironment pasteFromClipboard(java.awt.datatransfer.Clipboard clipboard)

  Copy JGoObjects from the clipboard into this document.

  The paste() method is the normal caller of this method. This method does not start or finish any transaction.

  Parameters:
    `clipboard` - the clipboard supporting the standard JGoDocument DataFlavor, containing objects to be copied to this document using the default copying method.

### initializeDragDropHandling

    public void initializeDragDropHandling()

  This initializes drag and drop handling, both as a source and as a target.

### setDragDropEnabled

    public void setDragDropEnabled(boolean m)

  Specify whether the drag-and-drop mechanism is enabled for this view. This is equivalent to calling setDragEnabled and setDropEnabled.

  Parameters:
    `m` - true to turn on performing standard Java drag-and-drop behavior

### setDragEnabled

    public void setDragEnabled(boolean m)

  Specify whether the drag mechanism is enabled for this view.

  If the argument is false, the user will not be able to start a drag operation from this window that might go to another window.

  Parameters:
    `m` - true to turn on initiating standard Java drag-and-drop behavior

### setDropEnabled

    public void setDropEnabled(boolean m)

  Specify whether the drop mechanism is enabled for this view.

  If the argument is false, the user will not be able to drop things from other windows into this one.

  Parameters:
    `m` - true to turn on handling standard Java drag-and-drop behavior

### isDragDropEnabled

    public boolean isDragDropEnabled()

  Return whether the drag-and-drop mechanism is enabled for this view, equivalent to isDragEnabled() && isDropEnabled().

### isDragEnabled

    public boolean isDragEnabled()

  Return whether the drag gesture listener is enabled, to allow users to start a drag-and-drop operation from this view.

  Even when this value is false, the user may be able to move and/or copy objects within this view, if isMouseEnabled() is true and the objects permit it. However, the standard Java Drag-and-Drop mechanism is not used, so the behavior may be slightly different.

### isDropEnabled

    public boolean isDropEnabled()

  Return whether the drop target listener is enabled, to allow users to perform a drop operation to this view.

### isInternalDragDrop

    public boolean isInternalDragDrop()

  Return whether a dragging operation started within this JGoView or is coming from another window.

### onDragGestureRecognized

    public void onDragGestureRecognized(java.awt.dnd.DragGestureEvent e)

  This implements the internal drag gesture listener

### dragGestureRecognized

    public void dragGestureRecognized(java.awt.dnd.DragGestureEvent e)

  This implements the default drag gesture listener, starting a drag.

  Specified by:
    `dragGestureRecognized` in interface `java.awt.dnd.DragGestureListener`

### onDragEnter

    public void onDragEnter(java.awt.dnd.DragSourceDragEvent e)

  This implements the internal drag source listener

### onDragOver

    public void onDragOver(java.awt.dnd.DragSourceDragEvent e)

  This implements the internal drag source listener

### onDropActionChanged

    public void onDropActionChanged(java.awt.dnd.DragSourceDragEvent e)

  This implements the internal drag source listener

### onDragExit

    public void onDragExit(java.awt.dnd.DragSourceEvent e)

  This implements the internal drag source listener

### onDragDropEnd

    public void onDragDropEnd(java.awt.dnd.DragSourceDropEvent e)

  This implements the internal drag source listener

### dragEnter

    public void dragEnter(java.awt.dnd.DragSourceDragEvent e)

  This implements the default drag source listener, a no-op.

  Specified by:
    `dragEnter` in interface `java.awt.dnd.DragSourceListener`

### dragOver

    public void dragOver(java.awt.dnd.DragSourceDragEvent e)

  This implements the default drag source listener, a no-op.

  Specified by:
    `dragOver` in interface `java.awt.dnd.DragSourceListener`

### dropActionChanged

    public void dropActionChanged(java.awt.dnd.DragSourceDragEvent e)

  This implements the default drag source listener, a no-op.

  Specified by:
    `dropActionChanged` in interface `java.awt.dnd.DragSourceListener`

### dragExit

    public void dragExit(java.awt.dnd.DragSourceEvent e)

  This implements the default drag source listener, a no-op.

  Specified by:
    `dragExit` in interface `java.awt.dnd.DragSourceListener`

### dragDropEnd

    public void dragDropEnd(java.awt.dnd.DragSourceDropEvent e)

  This implements the default drag source listener, a no-op.

  Specified by:
    `dragDropEnd` in interface `java.awt.dnd.DragSourceListener`

### convertActionToModifiers

    public int convertActionToModifiers(int action)

  This method converts a DropTarget event's dropAction to an InputEvent's modifiers.

### onDragEnter

    public void onDragEnter(java.awt.dnd.DropTargetDragEvent e)

  This implements the internal drop target listener

### onDragOver

    public void onDragOver(java.awt.dnd.DropTargetDragEvent e)

  This implements the internal drop target listener

### onDropActionChanged

    public void onDropActionChanged(java.awt.dnd.DropTargetDragEvent e)

  This implements the internal drop target listener

### onDragExit

    public void onDragExit(java.awt.dnd.DropTargetEvent e)

  This implements the internal drop target listener

### onDrop

    public void onDrop(java.awt.dnd.DropTargetDropEvent e)

  This implements the internal drop target listener

### dragEnter

    public void dragEnter(java.awt.dnd.DropTargetDragEvent e)

  This implements the default drop target listener, calling isDropFlavorAcceptable() to see if any drop is possible, and then calling computeAcceptableDrop() to decide whether to reject or accept the drag.

  Specified by:
    `dragEnter` in interface `java.awt.dnd.DropTargetListener`

### dragOver

    public void dragOver(java.awt.dnd.DropTargetDragEvent e)

  This implements the default drop target listener, calling isDropFlavorAcceptable() and computeAcceptableDrop() to decide whether to reject or accept the drag.

  Specified by:
    `dragOver` in interface `java.awt.dnd.DropTargetListener`

### dropActionChanged

    public void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)

  This implements the default drop target listener, calling isDropFlavorAcceptable() and computeAcceptableDrop() to decide whether to reject or accept the drag.

  Specified by:
    `dropActionChanged` in interface `java.awt.dnd.DropTargetListener`

### dragExit

    public void dragExit(java.awt.dnd.DropTargetEvent e)

  This implements the default drop target listener, a no-op.

  Specified by:
    `dragExit` in interface `java.awt.dnd.DropTargetListener`

### drop

    public void drop(java.awt.dnd.DropTargetDropEvent e)

  This implements the default drop target listener, calling doDrop() and rejecting the drop if it returned false. This method rejects the drop, by default, if the document's default layer is not modifiable.

  This method starts a transaction on this view's document. If the doDrop method returns true, it fires the JGoViewEvent.EXTERNAL_OBJECTS_DROPPED event and commits the transaction; if it returns false, it aborts the transaction.

  Specified by:
    `drop` in interface `java.awt.dnd.DropTargetListener`

### isDropFlavorAcceptable

    public boolean isDropFlavorAcceptable(java.awt.dnd.DropTargetDragEvent e)

  This predicate is called by the default implementation of DropTargetListener.dragEnter, dragOver, and dropActionChanged to see if there is an acceptable DataFlavor available.

  Override this method to control what kinds of sources could possibly be acceptable for a drop.

  The default behavior is to see if the standard JGoDocument DataFlavor is supported.

### computeAcceptableDrop

    public int computeAcceptableDrop(java.awt.dnd.DropTargetDragEvent e)

  This method is called by the default implementations of DropTargetListener.dragEnter, dragOver, and dropActionChanged to dynamically determine the permissible drop actions.

  Override this method to look at the source, and possibly at the destination, to decide whether to allow COPY, MOVE, LINK, or some combination thereof or no drop at all.

  The default behavior is allow only COPY or MOVE, and only if the document's default layer is modifiable.

### doDrop

    public boolean doDrop(java.awt.dnd.DropTargetDropEvent e,
                          JGoCopyEnvironment copyenv)

  Perform the default drop operation, as a result of a DropTargetListener.drop(DropTargetDropEvent).

  The default behavior is to copy the Transferable's collection of JGoObjects into this document at the drop point.

  This method should call acceptDrop on the DropTargetDropEvent, then JGoView.completeDrop on this view when the drop has finished, and finally return true.

  If you do not want to perform the drop, just return false.

  Parameters:
    `e` - the event passed in from drop()
    `copyenv` - the copy environment to be used for controlling the copy to the document; specify null to use the document's default copy environment. If the copy environment is supplied, the caller will be able to examine the results of the drop, as well as control how any newly copied objects are merged into this document.
  Returns:
    true if the drop was accepted and completed, false otherwise

### completeDrop

    public void completeDrop(java.awt.dnd.DropTargetDropEvent e,
                             boolean success)

  This method implements a work-around for a Java bug on Windows. Call this method instead of calling DropTargetDropEvent.dropComplete directly. See Java Developer Connection bug 4269666.

### getAutoscrollInsets

    public java.awt.Insets getAutoscrollInsets()

  Returns the inset margins in which autoscrolling will occur.

  Specified by:
    `getAutoscrollInsets` in interface `java.awt.dnd.Autoscroll`
  Returns:
    the autoscrolling Insets

### setAutoscrollInsets

    public void setAutoscrollInsets(java.awt.Insets insets)

  Set the canvas's Autoscroll Insets.

  Parameters:
    `insets` - the margins in which autoscrolling will occur

### autoscroll

    public void autoscroll(java.awt.Point location)

  Implement the Autoscroll interface.

  Specified by:
    `autoscroll` in interface `java.awt.dnd.Autoscroll`
  Parameters:
    `location` - a point in the canvas, not in this view component, (nor in the document).

### getFirstLayer

    public JGoLayer getFirstLayer()

  Return the bottom-most layer of objects in this document.

### getLastLayer

    public JGoLayer getLastLayer()

  Return the top-most layer of objects in this document.

### getNextLayer

    public JGoLayer getNextLayer(JGoLayer layer)

  Return the layer just above the given layer. Return null if the given layer is the top-most one.

### getPrevLayer

    public JGoLayer getPrevLayer(JGoLayer layer)

  Return the layer just below the given layer. Return null if the given layer is the bottom-most one.

### getEditPresentationName

    public java.lang.String getEditPresentationName(int act)

  Return a name for each of the different kinds of actions that this view provides, suitable for an UndoableEdit's presentation name. Override this method if you want to provide your own custom names for undo/redo edits. Return null to use a default name.

### getDebugFlags

    public int getDebugFlags()

  Return the conditions under which this view generates TRACE messages. By default this returns 0.

### setDebugFlags

    public void setDebugFlags(int f)

  Control whether this view generates TRACE messages during various operations.

  Currently the following flags are defined:

  - DebugEvents drag-and-drop events

  Parameters:
    `f` -

### getDefaultPrimarySelectionColor

    public static java.awt.Color getDefaultPrimarySelectionColor()

  Return the default primary selection color.

### setDefaultPrimarySelectionColor

    public static void setDefaultPrimarySelectionColor(java.awt.Color c)

  Set the default primary selection color.

### getDefaultSecondarySelectionColor

    public static java.awt.Color getDefaultSecondarySelectionColor()

  Return the default secondary selection color.

### setDefaultSecondarySelectionColor

    public static void setDefaultSecondarySelectionColor(java.awt.Color c)

  Set the default secondary selection color.

### getDefaultPortGravity

    public static int getDefaultPortGravity()

  Return the default distance at which a link will snap to a port.

### setDefaultPortGravity

    public static void setDefaultPortGravity(int gravity)

  Set the default distance at which a link will snap to a port. This can be set globally, or can be overridden for each JGoView.

### setGridWidth

    public void setGridWidth(int width)

  Sets the horizontal spacing of the grid. Also changes the horizontal scroll bar's unit increment.

  If the grid size given is different than the current grid size, then we call onGridChange().

  Parameters:
    `width` - the new horizontal spacing, in document coordinates

### getGridWidth

    public int getGridWidth()

  Returns the horizontal spacing of the grid.

  The default grid width is 50.

  Returns:
    the horizontal spacing, in document coordinates

### setGridHeight

    public void setGridHeight(int height)

  Set the vertical spacing of the grid. Also changes the vertical scroll bar's unit increment.

  Parameters:
    `height` - the new vertical spacing, in document coordinates

### getGridHeight

    public int getGridHeight()

  Get the vertical spacing of the grid.

  The default grid height is 50.

  Returns:
    the vertical spacing, in document coordinates

### setGridStyle

    public void setGridStyle(int style)

  Set the style of the grid that will be draw.

  The style should be one of: GridInvisible, GridDot, GridCross, GridLine. Or you may wish to define your own styles.

  If the grid style given is different than the current grid style, then we call onGridChange().

  Parameters:
    `style` - the new grid style

### getGridStyle

    public int getGridStyle()

  Return the current style of the grid.

  The default style is GridInvisible--no grid is drawn.

  Returns:
    the current style of the grid.

### setGridOrigin

    public void setGridOrigin(java.awt.Point point)

  Set the origin for the grid.

  If the new grid origin is different than the current grid origin, then we call onGridChange().

  Parameters:
    `point` - the new location of the start of the grid, in document coordinates

### getGridOrigin

    public java.awt.Point getGridOrigin()

  Return the current origin for the grid.

  The default position of the grid origin is (0,0).

  Returns:
    the current grid origin, in document coordinates. This Point must not be modified.

### setGridSpot

    public void setGridSpot(int spot)

  Set which spot on the objects should snap to the nearest grid point, if snapping is enabled.

  The spot value should be one of the spots defined on JGoObject.

  If the new grid object spot is different than the current value, then we call onGridChange().

  Parameters:
    `spot` - the object spot to snap
  See Also:
    `JGoObject`

### getGridSpot

    public int getGridSpot()

  Get which spot on the objects will be snapped to the nearest grid point.

  The default spot is JGoObject.TopLeft.

  Returns:
    the object spot that will be snapped

### setGridPen

    public void setGridPen(JGoPen pen)

  Set the pen that is used for drawing the grid's dots, crosses or lines.

  Parameters:
    `pen` - the pen to be used in drawing the grid

### getGridPen

    public JGoPen getGridPen()

  Get the pen that is currently used for drawing the grid's dots, crosses or lines.

  The view's initial grid pen is JGoPen.lightGray.

  Returns:
    the pen used to draw the grid

### getSnapMove

    public int getSnapMove()

  Return the current policy when objects are moved.

  This defaults to NoSnap.

### setSnapMove

    public void setSnapMove(int snap)

  Set this view's policy on moving objects.

  Parameters:
    `snap` - one of: NoSnap, SnapJump, SnapAfter

### getSnapResize

    public int getSnapResize()

  Return the current policy when objects are resized.

  This defaults to NoSnap.

### setSnapResize

    public void setSnapResize(int snap)

  Set this view's policy on resizing objects.

  Parameters:
    `snap` - one of: NoSnap, SnapJump, SnapAfter

### onGridChange

    public void onGridChange(int what)

  Called when some characteristic of the grid has changed.

  By default this method just fires a GRID_CHANGED view event. The flags property of the view event will be one of the Changed indicator constants defined on this class.

  Parameters:
    `what` - the aspect of the grid that has changed

### drawGridLines

    protected void drawGridLines(java.awt.Graphics2D g,
                                 java.awt.Rectangle clipRect)

  This method draws grid lines.

  Parameters:
    `g` - the graphics context onto which to draw.
    `clipRect` - the bounds for where we need to draw, in document coordinates

### drawGridCrosses

    protected void drawGridCrosses(java.awt.Graphics2D g,
                                   int crossHeight,
                                   int crossWidth,
                                   java.awt.Rectangle clipRect)

  This method draws little crosses at the grid points. The crosses are of height crossHeight and width crossWidth.

  Parameters:
    `g` - where to draw the crosses
    `crossHeight` - the height of the crosses, in document coordinates
    `crossWidth` - the width of the crosses, in document coordinates
    `clipRect` - the bounds for where we need to draw, in document coordinates

### snapObject

    public void snapObject(JGoObject object)

  Puts the spot of this object that corresponds with this GridView's default object spot at the nearest grid location.

  Parameters:
    `object` - the object to snap.

### snapObject

    public void snapObject(JGoObject object,
                           int spotNumber)

  Puts the given spot of this object at the nearest grid location.

  Parameters:
    `object` - the object to snap.
    `spotNumber` - which spot to snap.

### snapAllObjects

    public void snapAllObjects()

  For each object, aligns the default spot for this view with the nearest grid position.

### snapAllObjects

    public void snapAllObjects(int spotNumber)

  For each object, aligns the spot specified by spotNumber with the nearest grid position.

  This does not call snapObject on any JGoLinks.

  Parameters:
    `spotNumber` - which spot to snap

### findNearestGridPoint

    public java.awt.Point findNearestGridPoint(int x,
                                               int y,
                                               java.awt.Point result)

  Find the grid point that is closest to the given point

  Parameters:
    `x` - the X position in document coordinates
    `y` - the Y position in document coordinates
    `result` - a Point that is modified to be the closest grid point, in document coordinates
  Returns:
    the modified Point, or a newly allocated one if result was null

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