Class GraphLayoutBehavior
java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.zest.fx.behaviors.AbstractLayoutBehavior
org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior
- All Implemented Interfaces:
IActivatable,IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>,IBehavior
The
GraphLayoutBehavior is responsible for initiating layout passes.
It is only applicable to GraphPart.-
Property Summary
Properties inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
active, adaptable -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable> -
Field Summary
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyLayout(boolean clean, Object extra) Performs one layout pass using the static layout algorithm that is configured for the layout context.protected RectangleDetermines the layout bounds for the graph.protected voidprotected voidgetHost()protected InfiniteCanvasprotected LayoutContextReturns theLayoutContextfor whichAbstractLayoutBehavior.preLayout()andAbstractLayoutBehavior.postLayout()shall be called before or after a layout pass, respectively.protected NodePartReturns theNodePartthat contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.protected voidCalled after a layout pass.protected voidCalled before a layout pass.protected voidUpdates the bounds property from the visual (viewport or nesting node)Methods inherited from class org.eclipse.gef.zest.fx.behaviors.AbstractLayoutBehavior
layoutLabelsMethods inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
activate, activeProperty, adaptableProperty, addAnchoreds, addAnchoreds, addFeedback, addFeedback, addHandles, addHandles, clearFeedback, clearHandles, deactivate, getAdaptable, getFeedback, getFeedback, getFeedbackPartFactory, getFeedbackPartFactory, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, hasFeedback, hasFeedback, hasHandles, hasHandles, isActive, removeAnchoreds, removeFeedback, removeFeedback, removeFeedback, removeHandles, removeHandles, removeHandles, setAdaptable, updateHandles, updateHandles
-
Constructor Details
-
GraphLayoutBehavior
public GraphLayoutBehavior()
-
-
Method Details
-
applyLayout
Performs one layout pass using the static layout algorithm that is configured for the layout context.- Parameters:
clean- Whether to fully re-compute the layout or not.extra- An extraObjectthat is passed-on to theILayoutAlgorithm.
-
computeLayoutBounds
Determines the layout bounds for the graph.- Returns:
- The bounds used to layout the graph.
-
doActivate
protected void doActivate()- Overrides:
doActivatein classAbstractLayoutBehavior
-
doDeactivate
protected void doDeactivate()- Overrides:
doDeactivatein classAbstractLayoutBehavior
-
getHost
- Specified by:
getHostin interfaceIBehavior- Overrides:
getHostin classAbstractBehavior
-
getInfiniteCanvas
- Returns:
- The
InfiniteCanvasof theIViewerof thehost.
-
getLayoutContext
Description copied from class:AbstractLayoutBehaviorReturns theLayoutContextfor whichAbstractLayoutBehavior.preLayout()andAbstractLayoutBehavior.postLayout()shall be called before or after a layout pass, respectively.- Specified by:
getLayoutContextin classAbstractLayoutBehavior- Returns:
- The
LayoutContextfor whichAbstractLayoutBehavior.preLayout()andAbstractLayoutBehavior.postLayout()shall be called before or after a layout pass, respectively.
-
getNestingPart
Returns theNodePartthat contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.- Returns:
- The
NodePartthat contains the nested graph to which the behavior corresponds.
-
postLayout
protected void postLayout()Description copied from class:AbstractLayoutBehaviorCalled after a layout pass. Should be used to transfer layout information from the layout model.- Specified by:
postLayoutin classAbstractLayoutBehavior
-
preLayout
protected void preLayout()Description copied from class:AbstractLayoutBehaviorCalled before a layout pass. Should be used to transfer layout information to the layout model.- Specified by:
preLayoutin classAbstractLayoutBehavior
-
updateBounds
protected void updateBounds()Updates the bounds property from the visual (viewport or nesting node)
-