Package org.eclipse.gef.editpolicies
Class FlowLayoutEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.LayoutEditPolicy
org.eclipse.gef.editpolicies.OrderedLayoutEditPolicy
org.eclipse.gef.editpolicies.FlowLayoutEditPolicy
- All Implemented Interfaces:
EditPolicy,RequestConstants
An EditPolicy for use with
FlowLayout. This
EditPolicy knows how to map an <x,y> coordinate on the layout container
to the appropriate index for the operation being performed. It also shows
target feedback consisting of an insertion line at the appropriate location.- Since:
- 2.0
-
Field Summary
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_ROLEFields 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 TypeMethodDescriptionprotected voideraseLayoutTargetFeedback(Request request) Erases target layout feedback.protected intgetFeedbackIndexFor(Request request) protected EditPartgetInsertionReference(Request request) Calculates a referenceEditPartusing the specifiedRequest.protected PolylineLazily creates and returns aPolylineFigure for use as feedback.protected booleanDeprecated.protected voidshowLayoutTargetFeedback(Request request) Shows an insertion line if there is one or more current children.Methods inherited from class org.eclipse.gef.editpolicies.OrderedLayoutEditPolicy
createAddCommand, createChildEditPolicy, createMoveChildCommand, getAddCommand, getMoveChildrenCommand, isLayoutHorizontalMethods inherited from class org.eclipse.gef.editpolicies.LayoutEditPolicy
activate, createListener, createSizeOnDropFeedback, deactivate, decorateChild, decorateChildren, eraseSizeOnDropFeedback, eraseTargetFeedback, getCloneCommand, getCommand, getCreateCommand, getCreationFeedbackOffset, getDeleteDependantCommand, getLayoutContainer, getLayoutOrigin, getOrphanChildrenCommand, getSizeOnDropFeedback, getSizeOnDropFeedback, getTargetEditPart, setListener, showSizeOnDropFeedback, showTargetFeedback, translateFromAbsoluteToLayoutRelative, translateFromLayoutRelativeToAbsolute, undecorateChild, undecorateChildrenMethods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getFeedbackLayer, getHost, getHostFigure, getLayer, removeFeedbackMethods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, setHost, showSourceFeedback, toString, understandsRequest
-
Constructor Details
-
FlowLayoutEditPolicy
public FlowLayoutEditPolicy()
-
-
Method Details
-
eraseLayoutTargetFeedback
Description copied from class:LayoutEditPolicyErases target layout feedback. This method is the inverse ofLayoutEditPolicy.showLayoutTargetFeedback(Request).- Overrides:
eraseLayoutTargetFeedbackin classLayoutEditPolicy- Parameters:
request- the Request- See Also:
-
getFeedbackIndexFor
- Parameters:
request- the Request- Returns:
- the index for the insertion reference
-
getInsertionReference
Description copied from class:OrderedLayoutEditPolicyCalculates a referenceEditPartusing the specifiedRequest. The EditPart returned is used to mark the index coming after that EditPart.nullis used to indicate the index that comes after no EditPart, that is, it indicates the very last index.- Specified by:
getInsertionReferencein classOrderedLayoutEditPolicy- Parameters:
request- the Request- Returns:
nullor a reference EditPart- See Also:
-
getLineFeedback
Lazily creates and returns aPolylineFigure for use as feedback.- Returns:
- a Polyline figure
-
isHorizontal
Deprecated.UseOrderedLayoutEditPolicy.isLayoutHorizontal()instead.- Returns:
trueif the host's LayoutManager is in a horizontal orientation
-
showLayoutTargetFeedback
Shows an insertion line if there is one or more current children.- Overrides:
showLayoutTargetFeedbackin classLayoutEditPolicy- Parameters:
request- the Request- See Also:
-
OrderedLayoutEditPolicy.isLayoutHorizontal()instead.