com.nwoods.jgo
Class JGoOverviewRectangle

java.lang.Object
  extended bycom.nwoods.jgo.JGoObject
      extended bycom.nwoods.jgo.JGoDrawable
          extended bycom.nwoods.jgo.JGoRectangle
              extended bycom.nwoods.jgo.JGoOverviewRectangle
All Implemented Interfaces:
org.eclipse.swt.events.ControlListener, java.util.EventListener, JGoViewListener, JGoXMLSaveRestore, java.io.Serializable, org.eclipse.swt.internal.SWTEventListener

public class JGoOverviewRectangle
extends JGoRectangle
implements JGoViewListener, org.eclipse.swt.events.ControlListener

The rectangle shown and dragged around in the overview window.

This class also takes up the additional responsibilities of keeping track of changes to the view, by being both a JGoViewListener and a ComponentListener.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.nwoods.jgo.JGoObject
Bottom, BottomCenter, BottomLeft, BottomMiddle, BottomRight, Center, CenterLeft, CenterRight, Changed4ResizeHandles, ChangedAutoRescale, ChangedBrush, ChangedDraggable, ChangedDragsNode, ChangedGeometry, ChangedGrabChildSelection, ChangedInitializing, ChangedPen, ChangedResizable, ChangedSelectable, ChangedUpdatePartner, ChangedVisible, ChangedZOrder, LastChangedHint, Left, LeftCenter, NoHandle, NoSpot, NumReservedHandles, RepaintAll, Right, RightCenter, SideLeft, SideRight, Top, TopCenter, TopLeft, TopMiddle, TopRight
 
Constructor Summary
JGoOverviewRectangle()
           
JGoOverviewRectangle(org.eclipse.swt.graphics.Point p, Dimension d)
          Construct a non-resizable rectangle with an extra-wide pen, so that it can show up reasonably at the reduced scale.
 
Method Summary
 void controlMoved(org.eclipse.swt.events.ControlEvent e)
           
 void controlResized(org.eclipse.swt.events.ControlEvent e)
           
protected  void gainedSelection(JGoSelection selection)
          Selecting the overview rectangle shouldn't show any handles or do anything else.
protected  void geometryChange(org.eclipse.swt.graphics.Rectangle prevRect)
          Handle any change in location (due to dragging) of this rectangle by changing the observed view's viewPosition.
protected  void lostSelection(JGoSelection selection)
          Selecting the overview rectangle shouldn't show any handles or do anything else.
 void setBoundingRect(int left, int top, int width, int height)
          Keep this rectangle within the bounds of the document.
 void updateRectFromView()
          Make this JGoRectangle's position and size correspond to the observed view's position and size in the document.
 void viewChanged(JGoViewEvent e)
          Handle basic changes to the observed view's viewPosition or scale.
 
Methods inherited from class com.nwoods.jgo.JGoRectangle
copyObject, getNearestIntersectionPoint, paint, SVGReadAttributes, SVGReadObject, SVGWriteAttributes, SVGWriteObject
 
Methods inherited from class com.nwoods.jgo.JGoDrawable
changeValue, copyNewValueForRedo, draw3DRect, draw3DRect, drawEllipse, drawEllipse, drawEllipse, drawLine, drawLine, drawPath, drawPolygon, drawPolygon, drawRect, drawRect, drawRect, drawRoundRect, drawRoundRect, expandRectByPenWidth, getBrush, getNearestIntersectionPoint, getPen, setBrush, setPen, SVGAddPathArgs, SVGUpdateReference
 
Methods inherited from class com.nwoods.jgo.JGoObject
canView, computeBoundingRect, computeMove, computeResize, copy, copyObjectDelayed, copyOldValueForUndo, copyRect, doMouseClick, doMouseDblClick, doUncapturedMouseMove, findCommonParent, foredate, geometryChangeChild, getBoundingRect, getDocument, getDraggingObject, getFlags, getHeight, getLayer, getLeft, getLocation, getLocation, getParent, getParentJGoNode, getParentNode, getPartner, getRectangleSpotLocation, getSize, getSize, getSpotLocation, getSpotLocation, getToolTipText, getTop, getTopLeft, getTopLeft, getTopLevelObject, getView, getWidth, growRect, handleMove, handleResize, hideSelectionHandles, is4ResizeHandles, isAutoRescale, isBoundingRectInvalid, isChildOf, isDraggable, isDragsNode, isInitializing, isPointInObj, isResizable, isSelectable, isSkipsUndoManager, isSuspendUpdates, isTopLevel, isUpdatePartner, isVisible, ownerChange, partnerUpdate, pick, redirectSelection, remove, set4ResizeHandles, setAutoRescale, setBoundingRect, setBoundingRect, setBoundingRectInvalid, setBoundsRect, setDraggable, setDragsNode, setFlags, setHeight, setInitializing, setLeft, setLocation, setLocation, setLocationOffset, setLocationOffset, setParent, setPartner, setRectangleSpotLocation, setResizable, setSelectable, setSize, setSize, setSizeKeepingLocation, setSkipsUndoManager, setSpotLocation, setSpotLocation, setSpotLocation, setSpotLocationOffset, setSuspendUpdates, setTop, setTopLeft, setTopLeft, setUpdatePartner, setVisible, setWidth, showSelectionHandles, spotOpposite, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGoOverviewRectangle

public JGoOverviewRectangle()

JGoOverviewRectangle

public JGoOverviewRectangle(org.eclipse.swt.graphics.Point p,
                            Dimension d)
Construct a non-resizable rectangle with an extra-wide pen, so that it can show up reasonably at the reduced scale.

Method Detail

updateRectFromView

public void updateRectFromView()
Make this JGoRectangle's position and size correspond to the observed view's position and size in the document.


setBoundingRect

public void setBoundingRect(int left,
                            int top,
                            int width,
                            int height)
Keep this rectangle within the bounds of the document. Don't let this rectangle go to negative positions if the observed view doesn't allow it.

Overrides:
setBoundingRect in class JGoObject
Parameters:
left - the left side of the new bounding box
top - the top side of the new bounding box
width - the width of the new bounding box
height - the height of the new bounding box

geometryChange

protected void geometryChange(org.eclipse.swt.graphics.Rectangle prevRect)
Handle any change in location (due to dragging) of this rectangle by changing the observed view's viewPosition. Ignore any change caused by a change in the observed view.

Overrides:
geometryChange in class JGoObject

gainedSelection

protected void gainedSelection(JGoSelection selection)
Selecting the overview rectangle shouldn't show any handles or do anything else.

Overrides:
gainedSelection in class JGoObject
Parameters:
selection - the selection into which this object was added

lostSelection

protected void lostSelection(JGoSelection selection)
Selecting the overview rectangle shouldn't show any handles or do anything else.

Overrides:
lostSelection in class JGoObject
Parameters:
selection - the selection from which this object was removed

viewChanged

public void viewChanged(JGoViewEvent e)
Handle basic changes to the observed view's viewPosition or scale.

Specified by:
viewChanged in interface JGoViewListener
Parameters:
e - the view event describing the change to the view

controlMoved

public void controlMoved(org.eclipse.swt.events.ControlEvent e)
Specified by:
controlMoved in interface org.eclipse.swt.events.ControlListener

controlResized

public void controlResized(org.eclipse.swt.events.ControlEvent e)
Specified by:
controlResized in interface org.eclipse.swt.events.ControlListener