com.nwoods.jgo
Class JGoOverview

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended bycom.nwoods.jgo.JGoView
                      extended bycom.nwoods.jgo.JGoOverview
All Implemented Interfaces:
org.eclipse.swt.events.ControlListener, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.dnd.DragSourceListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.dnd.DropTargetListener, java.util.EventListener, JGoDocumentListener, JGoObjectCollection, JGoObjectSimpleCollection, org.eclipse.swt.events.KeyListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseTrackListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.events.ShellListener, org.eclipse.swt.internal.SWTEventListener

public class JGoOverview
extends JGoView

A simple overview window, displaying another JGoView's document at a reduced scale, and allowing navigation by the user.

This view can be used once you call setObserved with another JGoView. This overview displays a rectangle that indicates the position and extent of the Observed's view onto the document. The user can change the position of the Observed view in the document by either dragging the rectangle or clicking.

The user cannot select objects in this view, nor can the user drop something from another window or drag something out of this window. This overview does display tooltips for objects, to make it easier for users to tell where they are.


Field Summary
 
Fields inherited from class com.nwoods.jgo.JGoView
ChangedDimensions, ChangedOrigin, ChangedPen, ChangedSnapMove, ChangedSnapResize, ChangedSpot, ChangedStyle, DebugEvents, EventMouseDown, EventMouseMove, EventMouseUp, GridCross, GridDot, GridInvisible, GridLine, MouseStateAction, MouseStateCreateLink, MouseStateCreateLinkFrom, MouseStateDragBoxSelection, MouseStateLast, MouseStateMove, MouseStateNone, MouseStateResize, MouseStateSelection, NoSnap, SnapAfter, SnapJump
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
JGoOverview(org.eclipse.swt.widgets.Composite parent, int style)
          Construct an overview window displaying objects at one eighth scale.
 
Method Summary
 int computeAcceptableDrop(org.eclipse.swt.dnd.DropTargetEvent e)
          Disallow dragging from other windows to here.
 void doBackgroundClick(int modifiers, org.eclipse.swt.graphics.Point dc, org.eclipse.swt.graphics.Point vc)
          Clicking somewhere other than in the overview rectangle will move the view to be centered at that point.
 JGoDocument getDocument()
          Make sure this is always looking at the same document as the observed's document.
 Dimension getDocumentSize()
          Ignore any view objects.
 JGoView getObserved()
          Get the JGoView that is being watched/tracked.
 JGoOverviewRectangle getOverviewRect()
          Returns the rectangle in this view that the user drags to change the ViewPosition of the observed view.
 java.lang.String getToolTipText(org.eclipse.swt.events.MouseEvent evt)
          Show tooltips, so users might get a clue about which object is which even though the objects are so small.
 boolean isIncludingNegativeCoords()
          This is true if the Observed view's isIncludeNegativeCoords() is true.
 JGoObject pickDocObject(org.eclipse.swt.graphics.Point pointToCheck, boolean selectableOnly)
          Ignore all document objects; only the JGoOverviewRectangle can be selected.
 void selectInBox(org.eclipse.swt.graphics.Rectangle rect)
          Don't allow anything to be selected by user's rubber band either.
 void setObserved(JGoView observed)
          Set the view that this overview is supposed to observe.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
          When the Overview window is no longer needed, make sure the observed view doesn't keep any references to this view.
 
Methods inherited from class com.nwoods.jgo.JGoView
addDocumentListener, addObjectAtHead, addObjectAtTail, addViewListener, applyRenderingHints, bringObjectToFront, canPaste, computeAutoscrollViewPosition, computeEffectiveSelection, computeEffectiveSelection, computeSize, computeSize, controlMoved, controlResized, convertActionToModifiers, convertDocToView, convertDocToView, convertDocToView, convertViewToDoc, convertViewToDoc, convertViewToDoc, copy, copySelection, copyToClipboard, createDefaultModel, createDefaultSelection, createTemporaryLinkForNewLink, createTemporaryPortForNewLink, cut, deleteSelection, disposeJGoGraphics, doAutoscroll, doBackgroundToolTip, doCancelMouse, doCancelMoveSelection, doCancelResize, docToViewCoords, docToViewCoords, docToViewCoords, docToViewCoords, docToViewCoords, documentChanged, doDrop, doEndEdit, doLayout, doMouseClick, doMouseDblClick, doMouseDown, doMouseMove, doMouseUp, doMoveSelection, doToolTip, doUncapturedMouseMove, dragAccept, dragEnter, dragFinished, dragLeave, dragOperationChanged, dragOver, dragSetData, dragStart, drawGridCrosses, drawGridLines, drawXORBox, drawXORRect, drop, dropAccept, findNearestGridPoint, findObject, fireUpdate, fireUpdate, getAutoscrollInsets, getBackgroundColor, getBackgroundImage, getCurrentMouseEvent, getCurrentObject, getCursorType, getDebugFlags, getDefaultCursorType, getDefaultPortGravity, getDefaultPrimarySelectionColor, getDefaultSecondarySelectionColor, getDocumentListeners, getDocumentTopLeft, getDragSource, getDropTarget, getEditControl, getEditPresentationName, getExtentSize, getFirstLayer, getFirstObjectPos, getGridHeight, getGridOrigin, getGridPen, getGridSpot, getGridStyle, getGridWidth, getInternalMouseActions, getJGoGraphics, getLastLayer, getLastObjectPos, getNextLayer, getNextObjectPos, getNextObjectPosAtTop, getNumObjects, getObjectAtPos, getPortGravity, getPrevLayer, getPrevObjectPos, getPrimarySelectionColor, getPrintDocumentSize, getPrintDocumentTopLeft, getPrintPageRect, getPrintScale, getScale, getSecondarySelectionColor, getSelection, getSnapMove, getSnapResize, getState, getViewListeners, getViewPosition, getViewRect, handleActionObject, handleResizing, initializeDragDropHandling, initializeMouseHandling, insertObjectAfter, insertObjectBefore, isDragDropEnabled, isDragEnabled, isDragsRealtime, isDragsSelectionImage, isDrawsXorMode, isDropEnabled, isEditingTextControl, isEmpty, isHidingDisabledScrollbars, isIgnoreNextMouseDown, isInternalDragDrop, isKeyEnabled, isMouseEnabled, isPrinting, keyClearSelection, keyExtendSelection, keyMultipleSelect, keyPressed, keyReleased, keySingleSelection, keyToggleSelection, keyTyped, limitScale, mouseDoubleClick, mouseDown, mouseEnter, mouseExit, mouseHover, mouseMove, mouseUp, moveSelection, newLink, noNewLink, noReLink, onExternalDragOver, onExternalDrop, onGridChange, onKeyEvent, paintBackgroundDecoration, paintControl, paintDocumentObjects, paintPaperColor, paintView, paintViewObjects, paste, pasteFromClipboard, pickActionObject, pickHandle, pickNearestPort, pickObject, pickPort, print, print, printBegin, printDecoration, printEnd, printView, reLink, removeDocumentListener, removeObject, removeObjectAtPos, removeViewListener, scrollRectToVisible, selectAll, selectObject, sendObjectToBack, setAutoscrollInsets, setBackgroundColor, setBackgroundImage, setCurrentObject, setCursorType, setDebugFlags, setDefaultCursorType, setDefaultPortGravity, setDefaultPrimarySelectionColor, setDefaultSecondarySelectionColor, setDocument, setDragDropEnabled, setDragEnabled, setDragsRealtime, setDragsSelectionImage, setDrawsXorMode, setDropEnabled, setEditControl, setGridHeight, setGridOrigin, setGridPen, setGridSpot, setGridStyle, setGridWidth, setHidingDisabledScrollbars, setIgnoreNextMouseDown, setIncludingNegativeCoords, setInternalMouseActions, setKeyEnabled, setMouseEnabled, setPrimarySelectionColor, setScale, setSecondarySelectionColor, setSnapMove, setSnapResize, setState, setViewPosition, setViewPosition, shellActivated, shellClosed, shellDeactivated, shellDeiconified, shellIconified, snapAllObjects, snapAllObjects, snapObject, snapObject, startActionObject, startDragBoxSelection, startMoveSelection, startNewLink, startReLink, startResizing, stopAutoscroll, updateScrollbars, updateView, updateView, validDestinationPort, validLink, validSourcePort, viewToDocCoords, viewToDocCoords, viewToDocCoords, viewToDocCoords, viewToDocCoords, widgetDefaultSelected, widgetSelected
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGoOverview

public JGoOverview(org.eclipse.swt.widgets.Composite parent,
                   int style)
Construct an overview window displaying objects at one eighth scale.

Method Detail

widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
When the Overview window is no longer needed, make sure the observed view doesn't keep any references to this view.

Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener
Overrides:
widgetDisposed in class JGoView

setObserved

public void setObserved(JGoView observed)
Set the view that this overview is supposed to observe.

Parameters:
observed - a JGoView that must not be a JGoOverview, but may be null to turn this overview "off"/blank

getObserved

public JGoView getObserved()
Get the JGoView that is being watched/tracked.


computeAcceptableDrop

public int computeAcceptableDrop(org.eclipse.swt.dnd.DropTargetEvent e)
Disallow dragging from other windows to here.

Overrides:
computeAcceptableDrop in class JGoView

getOverviewRect

public JGoOverviewRectangle getOverviewRect()
Returns the rectangle in this view that the user drags to change the ViewPosition of the observed view.


pickDocObject

public JGoObject pickDocObject(org.eclipse.swt.graphics.Point pointToCheck,
                               boolean selectableOnly)
Ignore all document objects; only the JGoOverviewRectangle can be selected.

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

selectInBox

public void selectInBox(org.eclipse.swt.graphics.Rectangle rect)
Don't allow anything to be selected by user's rubber band either.

Overrides:
selectInBox in class JGoView
Parameters:
rect - the Rectangle, in document coordinates

doBackgroundClick

public void doBackgroundClick(int modifiers,
                              org.eclipse.swt.graphics.Point dc,
                              org.eclipse.swt.graphics.Point vc)
Clicking somewhere other than in the overview rectangle will move the view to be centered at that point.

Overrides:
doBackgroundClick in class JGoView

getDocument

public JGoDocument getDocument()
Make sure this is always looking at the same document as the observed's document.

Overrides:
getDocument in class JGoView
Returns:
the document for this view.

getDocumentSize

public Dimension getDocumentSize()
Ignore any view objects.

Overrides:
getDocumentSize in class JGoView
Returns:
the size of the document in document coordinates.

isIncludingNegativeCoords

public boolean isIncludingNegativeCoords()
This is true if the Observed view's isIncludeNegativeCoords() is true.

Overrides:
isIncludingNegativeCoords in class JGoView

getToolTipText

public java.lang.String getToolTipText(org.eclipse.swt.events.MouseEvent evt)
Show tooltips, so users might get a clue about which object is which even though the objects are so small.

Note that it might not be possible for the user to position the mouse pointer over every objects, because thin objects may take less than one pixel.

Overrides:
getToolTipText in class JGoView
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