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 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyLayout
(boolean clean, Object extra) Performs one layout pass using the static layout algorithm that is configured for the layout context.protected Rectangle
Determines the layout bounds for the graph.protected void
protected void
getHost()
protected InfiniteCanvas
protected LayoutContext
Returns theLayoutContext
for whichAbstractLayoutBehavior.preLayout()
andAbstractLayoutBehavior.postLayout()
shall be called before or after a layout pass, respectively.protected NodePart
Returns theNodePart
that contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.protected void
Called after a layout pass.protected void
Called before a layout pass.protected void
Updates the bounds property from the visual (viewport or nesting node)Methods inherited from class org.eclipse.gef.zest.fx.behaviors.AbstractLayoutBehavior
layoutLabels
Methods 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 extraObject
that 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:
doActivate
in classAbstractLayoutBehavior
-
doDeactivate
protected void doDeactivate()- Overrides:
doDeactivate
in classAbstractLayoutBehavior
-
getHost
- Specified by:
getHost
in interfaceIBehavior
- Overrides:
getHost
in classAbstractBehavior
-
getInfiniteCanvas
- Returns:
- The
InfiniteCanvas
of theIViewer
of thehost
.
-
getLayoutContext
Description copied from class:AbstractLayoutBehavior
Returns theLayoutContext
for whichAbstractLayoutBehavior.preLayout()
andAbstractLayoutBehavior.postLayout()
shall be called before or after a layout pass, respectively.- Specified by:
getLayoutContext
in classAbstractLayoutBehavior
- Returns:
- The
LayoutContext
for whichAbstractLayoutBehavior.preLayout()
andAbstractLayoutBehavior.postLayout()
shall be called before or after a layout pass, respectively.
-
getNestingPart
Returns theNodePart
that contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.- Returns:
- The
NodePart
that contains the nested graph to which the behavior corresponds.
-
postLayout
protected void postLayout()Description copied from class:AbstractLayoutBehavior
Called after a layout pass. Should be used to transfer layout information from the layout model.- Specified by:
postLayout
in classAbstractLayoutBehavior
-
preLayout
protected void preLayout()Description copied from class:AbstractLayoutBehavior
Called before a layout pass. Should be used to transfer layout information to the layout model.- Specified by:
preLayout
in classAbstractLayoutBehavior
-
updateBounds
protected void updateBounds()Updates the bounds property from the visual (viewport or nesting node)
-