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
TheGraphLayoutBehavioris 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 voidapplyLayout(boolean clean, java.lang.Object extra)Performs one layout pass using the static layout algorithm that is configured for the layout context.protected RectanglecomputeLayoutBounds()Determines the layout bounds for the graph.protected voiddoActivate()protected voiddoDeactivate()GraphPartgetHost()protected InfiniteCanvasgetInfiniteCanvas()protected LayoutContextgetLayoutContext()Returns theLayoutContextfor whichAbstractLayoutBehavior.preLayout()andAbstractLayoutBehavior.postLayout()shall be called before or after a layout pass, respectively.protected NodePartgetNestingPart()Returns theNodePartthat contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.protected voidpostLayout()Called after a layout pass.protected voidpreLayout()Called before a layout pass.protected voidupdateBounds()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 extraObjectthat 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:
doActivatein classAbstractLayoutBehavior
-
doDeactivate
protected void doDeactivate()
- Overrides:
doDeactivatein classAbstractLayoutBehavior
-
getHost
public GraphPart getHost()
- Specified by:
getHostin interfaceIBehavior- Overrides:
getHostin classAbstractBehavior
-
getInfiniteCanvas
protected InfiniteCanvas getInfiniteCanvas()
- Returns:
- The
InfiniteCanvasof theIViewerof thehost.
-
getLayoutContext
protected LayoutContext 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
protected NodePart 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)
-
-