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
public class GraphLayoutBehavior extends AbstractLayoutBehavior
TheGraphLayoutBehavior
is responsible for initiating layout passes. It is only applicable toGraphPart
.
-
-
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 Constructor Description GraphLayoutBehavior()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyLayout(boolean clean, java.lang.Object extra)
Performs one layout pass using the static layout algorithm that is configured for the layout context.protected Rectangle
computeLayoutBounds()
Determines the layout bounds for the graph.protected void
doActivate()
protected void
doDeactivate()
GraphPart
getHost()
protected InfiniteCanvas
getInfiniteCanvas()
protected LayoutContext
getLayoutContext()
Returns theLayoutContext
for whichAbstractLayoutBehavior.preLayout()
andAbstractLayoutBehavior.postLayout()
shall be called before or after a layout pass, respectively.protected NodePart
getNestingPart()
Returns theNodePart
that contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.protected void
postLayout()
Called after a layout pass.protected void
preLayout()
Called before a layout pass.protected void
updateBounds()
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
-
-
-
-
Method Detail
-
applyLayout
public void applyLayout(boolean clean, java.lang.Object extra)
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
protected Rectangle 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
public GraphPart getHost()
- Specified by:
getHost
in interfaceIBehavior
- Overrides:
getHost
in classAbstractBehavior
-
getInfiniteCanvas
protected InfiniteCanvas getInfiniteCanvas()
- Returns:
- The
InfiniteCanvas
of theIViewer
of thehost
.
-
getLayoutContext
protected LayoutContext 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
protected NodePart 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)
-
-