Package org.eclipse.gef.editpolicies
Class XYLayoutEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.LayoutEditPolicy
org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy
org.eclipse.gef.editpolicies.XYLayoutEditPolicy
- All Implemented Interfaces:
EditPolicy
,RequestConstants
An EditPolicy for use with
Figures
in XYLayout
. The
constraint for XYLayout is a Rectangle
.
Created on :Nov 12, 2002- Since:
- 2.0
-
Field Summary
Fields inherited from class org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy
UNSPECIFIED_SIZE
Fields inherited from interface org.eclipse.gef.EditPolicy
COMPONENT_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_ROLE
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConstraintFor
(org.eclipse.draw2d.geometry.Point p) Returns a Rectangle at the given Point with width and height of -1.getConstraintFor
(org.eclipse.draw2d.geometry.Rectangle r) Returns a new Rectangle equivalent to the passed Rectangle.protected Object
getConstraintFor
(Request request, GraphicalEditPart child, org.eclipse.draw2d.geometry.Rectangle rect) Overridden to preserve existing width and height (as well as preferred sizes) during MOVE requests.protected org.eclipse.draw2d.geometry.Rectangle
Retrieves the child's current constraint from theLayoutManager
.protected org.eclipse.draw2d.geometry.Point
ReturnsXYLayout.getOrigin(IFigure)
.protected org.eclipse.draw2d.geometry.Dimension
Deprecated.Clients should no longer extend this method.protected org.eclipse.draw2d.XYLayout
void
setXyLayout
(org.eclipse.draw2d.XYLayout xyLayout) protected void
showSizeOnDropFeedback
(CreateRequest request) Shows size-on-drop feedback during creation.Methods inherited from class org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy
createAddCommand, createAddCommand, createChangeConstraintCommand, createChangeConstraintCommand, createChildEditPolicy, getAddCommand, getAlignChildrenCommand, getChangeConstraintCommand, getCommand, getConstraintFor, getConstraintFor, getConstraintForClone, getMoveChildrenCommand, getResizeChildrenCommand, translateToModelConstraint
Methods inherited from class org.eclipse.gef.editpolicies.LayoutEditPolicy
activate, createListener, createSizeOnDropFeedback, deactivate, decorateChild, decorateChildren, eraseLayoutTargetFeedback, eraseSizeOnDropFeedback, eraseTargetFeedback, getCloneCommand, getCreateCommand, getCreationFeedbackOffset, getDeleteDependantCommand, getLayoutContainer, getOrphanChildrenCommand, getSizeOnDropFeedback, getSizeOnDropFeedback, getTargetEditPart, setListener, showLayoutTargetFeedback, showTargetFeedback, translateFromAbsoluteToLayoutRelative, translateFromLayoutRelativeToAbsolute, undecorateChild, undecorateChildren
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedback
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString, understandsRequest
-
Constructor Details
-
XYLayoutEditPolicy
public XYLayoutEditPolicy()
-
-
Method Details
-
getConstraintFor
protected Object getConstraintFor(Request request, GraphicalEditPart child, org.eclipse.draw2d.geometry.Rectangle rect) Overridden to preserve existing width and height (as well as preferred sizes) during MOVE requests.- Overrides:
getConstraintFor
in classConstrainedLayoutEditPolicy
rect
- the Rectangle relative to thelayout origin
- Returns:
- the constraint
- See Also:
-
getConstraintFor
Returns a Rectangle at the given Point with width and height of -1.XYLayout
uses width or height equal to '-1' to mean use the figure's preferred size.- Specified by:
getConstraintFor
in classConstrainedLayoutEditPolicy
- Parameters:
p
- the input Point- Returns:
- a Rectangle
-
getConstraintFor
Returns a new Rectangle equivalent to the passed Rectangle.- Specified by:
getConstraintFor
in classConstrainedLayoutEditPolicy
- Parameters:
r
- the input Rectangle- Returns:
- a copy of the input Rectangle
-
getCurrentConstraintFor
Retrieves the child's current constraint from theLayoutManager
.- Parameters:
child
- the child- Returns:
- the current constraint
-
getLayoutOrigin
protected org.eclipse.draw2d.geometry.Point getLayoutOrigin()ReturnsXYLayout.getOrigin(IFigure)
.- Overrides:
getLayoutOrigin
in classLayoutEditPolicy
- Returns:
- Point
- See Also:
-
getXYLayout
protected org.eclipse.draw2d.XYLayout getXYLayout()- Returns:
- the XYLayout layout manager set on the
container
-
setXyLayout
public void setXyLayout(org.eclipse.draw2d.XYLayout xyLayout) - Parameters:
xyLayout
- The xyLayout to set.
-
showSizeOnDropFeedback
Description copied from class:LayoutEditPolicy
Shows size-on-drop feedback during creation.- Overrides:
showSizeOnDropFeedback
in classLayoutEditPolicy
- Parameters:
request
- the CreateRequest- See Also:
-
getMinimumSizeFor
Deprecated.Clients should no longer extend this method. Instead, the resize tracker, constructed by the 'satellite' primary drag edit policy should be parameterized with max and min size constraints.Determines the minimum size that the specified child can be resized to. Called fromConstrainedLayoutEditPolicy.getConstraintFor(ChangeBoundsRequest, GraphicalEditPart)
. By default, a smallDimension
is returned.- Parameters:
child
- the child- Returns:
- the minimum size
-