Package org.eclipse.gef.editpolicies
Class NonResizableEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.SelectionEditPolicy
org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy
org.eclipse.gef.editpolicies.NonResizableEditPolicy
- All Implemented Interfaces:
- IAdaptable,- EditPolicy,- RequestConstants
- Direct Known Subclasses:
- ResizableEditPolicy
Provide support for selecting and positioning a non-resizable editpart.
 Selection is indicated via four square handles at each corner of the
 editpart's figure, and a rectangular handle that outlines the editpart with a
 1-pixel black line. All of these handles return
 
DragEditPartsTrackers, which allows the current
 selection to be dragged.
 During feedback, a rectangle filled using XOR and outlined with dashes is drawn. Subclasses can tailor the feedback.
- 
Field SummaryFields inherited from class org.eclipse.gef.editpolicies.SelectionHandlesEditPolicyhandlesFields inherited from interface org.eclipse.gef.EditPolicyCOMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLEFields inherited from interface org.eclipse.gef.RequestConstantsREQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcreateDragHandle(List<Handle> handles, int direction) Creates a 'resize'/'drag' handle, which uses aDragEditPartsTrackerin caseisDragAllowed()returns true, and aSelectEditPartTrackerotherwise.protected IFigureCreates the figure used for feedback.protected voidcreateMoveHandle(List<Handle> handles) Creates a 'move' handle, which uses aDragEditPartsTrackerin caseisDragAllowed()returns true, and aSelectEditPartTrackerotherwise.Subclasses must implement to provide the list of handles.voidExtends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.protected voidErases drag feedback.voideraseSourceFeedback(Request request) Does nothing by default.protected CommandgetAlignCommand(AlignmentRequest request) Returns the command contribution to an alignment requestgetCommand(Request request) Returnsnullby default.protected IFigureLazily creates and returns the feedback figure used during drags.protected DragEditPartsTrackerReturns a drag tracker to use by a resize handle.protected RectangleReturns the bounds of the host's figure by reference to be used to calculate the initial location of the feedback.protected CommandgetMoveCommand(ChangeBoundsRequest request) Returns the command contribution to a change bounds request.protected CommandgetOrphanCommand(Request req) Subclasses may override to contribute to the orphan request.protected SelectEditPartTrackerReturns a selection tracker to use by a selection handle.protected voidHides the focus rectangle displayed inshowFocus().booleanReturns true if this EditPolicy allows its EditPart to be dragged.voidsetDragAllowed(boolean isDragAllowed) Sets the dragability of the EditPolicy to the given value.protected voidShows or updates feedback for a change bounds request.protected voidShows a focus rectangle around the host's figure.voidshowSourceFeedback(Request request) Calls other methods as appropriate.booleanunderstandsRequest(Request request) Returnstruefor move, align, add, and orphan request types.Methods inherited from class org.eclipse.gef.editpolicies.SelectionHandlesEditPolicyaddSelectionHandles, getAdapter, hideSelection, removeSelectionHandles, showSelectionMethods inherited from class org.eclipse.gef.editpolicies.SelectionEditPolicyactivate, addSelectionListener, getTargetEditPart, removeSelectionListener, setFocus, setSelectedState, showPrimarySelectionMethods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicyaddFeedback, getFeedbackLayer, getHost, getHostFigure, getLayer, removeFeedbackMethods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicydebugFeedback, eraseTargetFeedback, setHost, showTargetFeedback, toString
- 
Constructor Details- 
NonResizableEditPolicypublic NonResizableEditPolicy()
 
- 
- 
Method Details- 
createDragSourceFeedbackFigureCreates the figure used for feedback.- Returns:
- the new feedback figure
 
- 
createSelectionHandlesDescription copied from class:SelectionHandlesEditPolicySubclasses must implement to provide the list of handles.- Specified by:
- createSelectionHandlesin class- SelectionHandlesEditPolicy
- Returns:
- List of handles; cannot be null
- See Also:
 
- 
createDragHandleCreates a 'resize'/'drag' handle, which uses aDragEditPartsTrackerin caseisDragAllowed()returns true, and aSelectEditPartTrackerotherwise.- Parameters:
- handles- The list of handles to add the resize handle to
- direction- A position constant indicating the direction to create the handle for
- Since:
- 3.7
 
- 
getSelectTrackerReturns a selection tracker to use by a selection handle.- Returns:
- a new ResizeTracker
- Since:
- 3.7
 
- 
getDragTrackerReturns a drag tracker to use by a resize handle.- Returns:
- a new ResizeTracker
- Since:
- 3.7
 
- 
createMoveHandleCreates a 'move' handle, which uses aDragEditPartsTrackerin caseisDragAllowed()returns true, and aSelectEditPartTrackerotherwise.- Parameters:
- handles- The list of handles to add the move handle to.
- Since:
- 3.7
 
- 
deactivatepublic void deactivate()Description copied from class:SelectionEditPolicyExtends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.- Specified by:
- deactivatein interface- EditPolicy
- Overrides:
- deactivatein class- SelectionEditPolicy
- See Also:
 
- 
eraseChangeBoundsFeedbackErases drag feedback. This method called whenever an erase feedback request is received of the appropriate type.- Parameters:
- request- the request
 
- 
eraseSourceFeedbackDescription copied from class:AbstractEditPolicyDoes nothing by default.- Specified by:
- eraseSourceFeedbackin interface- EditPolicy
- Overrides:
- eraseSourceFeedbackin class- AbstractEditPolicy
- Parameters:
- request- the Request
- See Also:
 
- 
getCommandDescription copied from class:AbstractEditPolicyReturnsnullby default.nullis used to indicate that the EditPolicy does not contribute to the specifiedRequest.- Specified by:
- getCommandin interface- EditPolicy
- Overrides:
- getCommandin class- AbstractEditPolicy
- Parameters:
- request- the Request
- Returns:
- nullor a Command contribution
- See Also:
 
- 
getDragSourceFeedbackFigureLazily creates and returns the feedback figure used during drags.- Returns:
- the feedback figure
 
- 
getAlignCommandReturns the command contribution to an alignment request- Parameters:
- request- the alignment request
- Returns:
- the contribution to the alignment
 
- 
getInitialFeedbackBoundsReturns the bounds of the host's figure by reference to be used to calculate the initial location of the feedback. The returned Rectangle should not be modified. Uses handle bounds if available.- Returns:
- the host figure's bounding Rectangle
 
- 
getMoveCommandReturns the command contribution to a change bounds request. The implementation actually redispatches the request to the host's parent editpart as aRequestConstants.REQ_MOVE_CHILDRENrequest. The parent's contribution is returned.- Parameters:
- request- the change bounds request
- Returns:
- the command contribution to the request
 
- 
getOrphanCommandSubclasses may override to contribute to the orphan request. By default,nullis returned to indicate no participation. Orphan requests are not forwarded to the host's parent here. That is done inComponentEditPolicy. So, if the host has a component editpolicy, then the parent will already have a chance to contribute.- Parameters:
- req- the orphan request
- Returns:
- nullby default
 
- 
hideFocusprotected void hideFocus()Hides the focus rectangle displayed inshowFocus().- Overrides:
- hideFocusin class- SelectionEditPolicy
- See Also:
 
- 
isDragAllowedpublic boolean isDragAllowed()Returns true if this EditPolicy allows its EditPart to be dragged.- Returns:
- true if the EditPart can be dragged.
 
- 
setDragAllowedpublic void setDragAllowed(boolean isDragAllowed) Sets the dragability of the EditPolicy to the given value. If the value is false, the EditPolicy should not allow its EditPart to be dragged.- Parameters:
- isDragAllowed- whether or not the EditPolicy can be dragged.
 
- 
showChangeBoundsFeedbackShows or updates feedback for a change bounds request.- Parameters:
- request- the request
 
- 
showFocusprotected void showFocus()Shows a focus rectangle around the host's figure. The focus rectangle is expanded by 5 pixels from the figure's bounds.- Overrides:
- showFocusin class- SelectionEditPolicy
- See Also:
 
- 
showSourceFeedbackCalls other methods as appropriate.- Specified by:
- showSourceFeedbackin interface- EditPolicy
- Overrides:
- showSourceFeedbackin class- AbstractEditPolicy
- Parameters:
- request- the Request
- See Also:
 
- 
understandsRequestReturnstruefor move, align, add, and orphan request types. This method is never called for some of these types, but they are included for possible future use.- Specified by:
- understandsRequestin interface- EditPolicy
- Overrides:
- understandsRequestin class- AbstractEditPolicy
- Parameters:
- request- the Request
- Returns:
- boolean trueif the EditPolicy understands the specified request
- See Also:
 
 
-