Package org.eclipse.gef.handles
Class AbstractHandle
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.gef.handles.AbstractHandle
- All Implemented Interfaces:
- AncestorListener,- IFigure,- Handle
- Direct Known Subclasses:
- MoveHandle,- SquareHandle
Base implementation for handles. This class keeps track of the typical data
 needed by a handle, such as a drag tracker, a locator to place the handle, a
 cursor, and the editpart to which the handle belongs. AbstractHandle will add
 an 
AncestorListener to the owner's figure, and will automatically
 revalidate this handle whenever the owner's figure moves.- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.AncestorListenerAncestorListener.StubNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructorsConstructorDescriptionNull constructorAbstractHandle(GraphicalEditPart owner, Locator loc) Creates a handle for the givenGraphicalEditPartusing the givenLocator.AbstractHandle(GraphicalEditPart owner, Locator loc, Cursor c) Creates a handle for the givenGraphicalEditPartusing the givenLocatorandCursor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds this as anAncestorListenerto the owner'sFigure.voidancestorAdded(IFigure ancestor) voidancestorMoved(IFigure ancestor) voidancestorRemoved(IFigure ancestor) protected abstract DragTrackerCreates a new drag tracker to be returned by getDragTracker().By default, the center of the handle is returned.Deprecated.use getCursor()Returns the drag tracker to use when the user clicks on this handle.Returns theLocatorused to position this handle.protected GraphicalEditPartgetOwner()Returns theGraphicalEditPartassociated with this handle.protected IFigureConvenience method to return the owner's figure.voidvoidDeprecated.use setCursor()voidSets the drag tracker for this handle.protected voidsetLocator(Locator locator) Sets the locator which position this handle.protected voidsetOwner(GraphicalEditPart editpart) Sets the owner editpart associated with this handle.voidvalidate()Extends validate() to place the handle using its locator.Methods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates
- 
Constructor Details- 
AbstractHandlepublic AbstractHandle()Null constructor
- 
AbstractHandleCreates a handle for the givenGraphicalEditPartusing the givenLocator.- Parameters:
- owner- The editpart which provided this handle
- loc- The locator to position the handle
 
- 
AbstractHandleCreates a handle for the givenGraphicalEditPartusing the givenLocatorandCursor.- Parameters:
- owner- The editpart which provided this handle
- loc- The locator to position the handle
- c- The cursor to display when the mouse is over the handle
 
 
- 
- 
Method Details- 
addNotifypublic void addNotify()Adds this as anAncestorListenerto the owner'sFigure.
- 
ancestorMoved- Specified by:
- ancestorMovedin interface- AncestorListener
- See Also:
 
- 
ancestorAdded- Specified by:
- ancestorAddedin interface- AncestorListener
- See Also:
 
- 
ancestorRemoved- Specified by:
- ancestorRemovedin interface- AncestorListener
- See Also:
 
- 
createDragTrackerCreates a new drag tracker to be returned by getDragTracker().- Returns:
- a new drag tracker
 
- 
getAccessibleLocationBy default, the center of the handle is returned.- Specified by:
- getAccessibleLocationin interface- Handle
- Returns:
- nullor the absolute location
- See Also:
 
- 
getDragCursorDeprecated.use getCursor()Returns the cursor. The cursor is displayed whenever the mouse is over the handle.- Returns:
- the cursor
 
- 
getDragTrackerReturns the drag tracker to use when the user clicks on this handle. If the drag tracker has not been set, it will be lazily created by callingcreateDragTracker().- Specified by:
- getDragTrackerin interface- Handle
- Returns:
- the drag tracker
 
- 
getLocatorReturns theLocatorused to position this handle.- Returns:
- the locator
 
- 
getOwnerReturns theGraphicalEditPartassociated with this handle.- Returns:
- the owner editpart
 
- 
getOwnerFigureConvenience method to return the owner's figure.- Returns:
- the owner editpart's figure
 
- 
removeNotifypublic void removeNotify()- Specified by:
- removeNotifyin interface- IFigure
- Overrides:
- removeNotifyin class- Figure
- See Also:
 
- 
setDragCursorDeprecated.use setCursor()Sets the Cursor for the handle.- Parameters:
- c- the cursor
- Throws:
- Exception- a bogus excpetion declaration
 
- 
setDragTrackerSets the drag tracker for this handle.- Parameters:
- t- the drag tracker
 
- 
setLocatorSets the locator which position this handle.- Parameters:
- locator- the new locator
 
- 
setOwnerSets the owner editpart associated with this handle.- Parameters:
- editpart- the owner
 
- 
validatepublic void validate()Extends validate() to place the handle using its locator.
 
-