Package org.eclipse.gef.editpolicies
Class ResizableEditPolicy
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
org.eclipse.gef.editpolicies.ResizableEditPolicy
- All Implemented Interfaces:
- IAdaptable,- EditPolicy,- RequestConstants
Provides support for selecting, positioning, and resizing an edit part.
 Selection is indicated via eight square handles along the editpart's figure,
 and a rectangular handle that outlines the edit part with a 1-pixel black
 line. The eight square handles will resize the current selection in the eight
 primary directions. The rectangular handle will drag the current selection
 using a 
DragEditPartsTracker.
 During feedback, a rectangle filled using XOR and outlined with dashes is drawn. Subclasses may 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 voidcreateResizeHandle(List<Handle> handles, int direction) Creates a 'resize' handle, which uses aResizeTrackerin case resizing is allowed in the respective direction, otherwise returns a drag handle by delegating toNonResizableEditPolicy.createDragHandle(List, int).Subclasses must implement to provide the list of handles.voideraseSourceFeedback(Request request) Dispatches erase requests to more specific methods.getCommand(Request request) Returnsnullby default.protected CommandgetResizeCommand(ChangeBoundsRequest request) Returns the command contribution for the given resize request.intReturns the directions in which resizing should be allowed Valid values are bit-wise combinations of:PositionConstants.NORTHPositionConstants.SOUTHPositionConstants.EASTPositionConstants.WESTorPositionConstants.NONE.protected ResizeTrackergetResizeTracker(int direction) Returns a resize tracker for the given direction to be used by a resize handle.voidsetResizeDirections(int newDirections) Sets the directions in which handles should allow resizing.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.NonResizableEditPolicycreateDragHandle, createDragSourceFeedbackFigure, createMoveHandle, deactivate, eraseChangeBoundsFeedback, getAlignCommand, getDragSourceFeedbackFigure, getDragTracker, getInitialFeedbackBounds, getMoveCommand, getOrphanCommand, getSelectTracker, hideFocus, isDragAllowed, setDragAllowed, showChangeBoundsFeedback, showFocusMethods 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- 
ResizableEditPolicypublic ResizableEditPolicy()
 
- 
- 
Method Details- 
createSelectionHandlesDescription copied from class:SelectionHandlesEditPolicySubclasses must implement to provide the list of handles.- Overrides:
- createSelectionHandlesin class- NonResizableEditPolicy
- Returns:
- List of handles; cannot be null
- See Also:
 
- 
createResizeHandleCreates a 'resize' handle, which uses aResizeTrackerin case resizing is allowed in the respective direction, otherwise returns a drag handle by delegating toNonResizableEditPolicy.createDragHandle(List, int).- 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
 
- 
getResizeTrackerReturns a resize tracker for the given direction to be used by a resize handle.- Parameters:
- direction- the resize direction for the- ResizeTracker.
- Returns:
- a new ResizeTracker
- Since:
- 3.7
 
- 
eraseSourceFeedbackDispatches erase requests to more specific methods.- Specified by:
- eraseSourceFeedbackin interface- EditPolicy
- Overrides:
- eraseSourceFeedbackin class- NonResizableEditPolicy
- 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- NonResizableEditPolicy
- Parameters:
- request- the Request
- Returns:
- nullor a Command contribution
- See Also:
 
- 
getResizeCommandReturns the command contribution for the given resize request. By default, the request is re-dispatched to the host's parent as aRequestConstants.REQ_RESIZE_CHILDREN. The parent's edit policies determine how to perform the resize based on the layout manager in use.- Parameters:
- request- the resize request
- Returns:
- the command contribution obtained from the parent
 
- 
setResizeDirectionspublic void setResizeDirections(int newDirections) Sets the directions in which handles should allow resizing. Valid values are bit-wise combinations of:- Parameters:
- newDirections- the direction in which resizing is allowed
 
- 
showSourceFeedbackDescription copied from class:NonResizableEditPolicyCalls other methods as appropriate.- Specified by:
- showSourceFeedbackin interface- EditPolicy
- Overrides:
- showSourceFeedbackin class- NonResizableEditPolicy
- Parameters:
- request- the Request
- See Also:
 
- 
understandsRequestDescription copied from class:NonResizableEditPolicyReturnstruefor 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- NonResizableEditPolicy
- Parameters:
- request- the Request
- Returns:
- boolean trueif the EditPolicy understands the specified request
- See Also:
 
- 
getResizeDirectionspublic int getResizeDirections()Returns the directions in which resizing should be allowed Valid values are bit-wise combinations of: orPositionConstants.NONE.
 
-