public class GraphLayoutBehavior extends AbstractLayoutBehavior
GraphLayoutBehavior
is responsible for initiating layout passes.
It is only applicable to GraphPart
.active
ACTIVE_PROPERTY
Constructor and Description |
---|
GraphLayoutBehavior() |
Modifier and Type | Method and Description |
---|---|
protected void |
adaptFromLayout()
Called after a layout pass.
|
void |
applyLayout(boolean clean)
Performs one layout pass using the static layout algorithm that is
configured for the layout context.
|
protected void |
doActivate() |
protected void |
doDeactivate() |
protected GraphLayoutBehavior |
getGraphLayoutBehavior()
Returns the
GraphLayoutContext for which AbstractLayoutBehavior.provideToLayout()
and AbstractLayoutBehavior.adaptFromLayout() shall be called before or after a layout
pass, respectively. |
protected GraphLayoutContext |
getGraphLayoutContext()
Returns the
GraphLayoutContext that corresponds to the
host . |
GraphPart |
getHost() |
protected InfiniteCanvas |
getInfiniteCanvas()
|
protected NodePart |
getNestingPart()
Returns the
NodePart that contains the nested graph to which the
getGraphLayoutBehavior() corresponds. |
protected void |
onNestingVisualLayoutBoundsChange(javafx.geometry.Bounds oldLayoutBounds,
javafx.geometry.Bounds newLayoutBounds)
Sets the layout bounds on the layout context for nested graphs.
|
protected void |
onViewportModelPropertyChange(javafx.geometry.Bounds oldScrollableBounds,
javafx.geometry.Bounds newScrollableBounds)
Called upon viewport bounds changes to update the layout bounds.
|
protected void |
provideToLayout()
Called before a layout pass.
|
void |
scheduleAdaptToLayout(java.lang.Runnable adaptToLayout)
Schedules the given "adapt to layout"
Runnable for execution
after a layout pass. |
void |
schedulePostLayoutPass(java.lang.Runnable updateLabels)
Schedules the given "update label"
Runnable for execution after a
layout pass and after all "adapt to layout" runnables. |
void |
scheduleProvideLayout(java.lang.Runnable provideLayout)
Schedules the given "provide layout"
Runnable for execution
before a layout pass. |
void |
unscheduleAdaptToLayout(java.lang.Runnable adaptToLayout)
Unschedules the given "adapt to layout"
Runnable so that it will
no longer be executed after a layout pass. |
void |
unschedulePostLayoutPass(java.lang.Runnable updateLabels)
Unschedules the given "update label"
Runnable so that it will no
longer be executed after a layout pass and after all "adapt to layout"
runnables. |
void |
unscheduleProvideLayout(java.lang.Runnable provideLayout)
Unschedules the given "provide layout"
Runnable so that it will
no longer be executed before a layout pass. |
updateLabels
activate, activeProperty, addFeedback, addHandles, deactivate, getAdaptable, getFeedbackParts, getHandleParts, isActive, removeFeedback, removeHandles, setAdaptable, switchAdaptableScopes, updateHandles
protected void adaptFromLayout()
AbstractLayoutBehavior
adaptFromLayout
in class AbstractLayoutBehavior
public void applyLayout(boolean clean)
clean
- Whether to fully re-compute the layout or not.protected void doActivate()
doActivate
in class AbstractLayoutBehavior
protected void doDeactivate()
doDeactivate
in class AbstractLayoutBehavior
protected GraphLayoutBehavior getGraphLayoutBehavior()
AbstractLayoutBehavior
GraphLayoutContext
for which AbstractLayoutBehavior.provideToLayout()
and AbstractLayoutBehavior.adaptFromLayout()
shall be called before or after a layout
pass, respectively.getGraphLayoutBehavior
in class AbstractLayoutBehavior
GraphLayoutContext
for which AbstractLayoutBehavior.provideToLayout()
and AbstractLayoutBehavior.adaptFromLayout()
shall be called before or after a
layout pass, respectively.protected GraphLayoutContext getGraphLayoutContext()
GraphLayoutContext
that corresponds to the
host
.GraphLayoutContext
that corresponds to the
host
.public GraphPart getHost()
getHost
in interface IBehavior<javafx.scene.Node>
getHost
in class AbstractBehavior<javafx.scene.Node>
protected InfiniteCanvas getInfiniteCanvas()
InfiniteCanvas
of the IViewer
of the
host
.protected NodePart getNestingPart()
NodePart
that contains the nested graph to which the
getGraphLayoutBehavior()
corresponds.NodePart
that contains the nested graph to which the
getGraphLayoutBehavior()
corresponds.protected void onNestingVisualLayoutBoundsChange(javafx.geometry.Bounds oldLayoutBounds, javafx.geometry.Bounds newLayoutBounds)
oldLayoutBounds
- The previous nesting node's bounds.newLayoutBounds
- The current nesting node's bounds.protected void onViewportModelPropertyChange(javafx.geometry.Bounds oldScrollableBounds, javafx.geometry.Bounds newScrollableBounds)
oldScrollableBounds
- The old Bounds
.newScrollableBounds
- The new Bounds
.protected void provideToLayout()
AbstractLayoutBehavior
provideToLayout
in class AbstractLayoutBehavior
public void scheduleAdaptToLayout(java.lang.Runnable adaptToLayout)
Runnable
for execution
after a layout pass.adaptToLayout
- The Runnable
that will be executed after a layout pass
and before all "update label" runnables.public void schedulePostLayoutPass(java.lang.Runnable updateLabels)
Runnable
for execution after a
layout pass and after all "adapt to layout" runnables.updateLabels
- The Runnable
that will be executed after a layout pass
and after all "adapt to layout" runnables.public void scheduleProvideLayout(java.lang.Runnable provideLayout)
Runnable
for execution
before a layout pass.provideLayout
- The Runnable
that will be executed before a layout
pass.public void unscheduleAdaptToLayout(java.lang.Runnable adaptToLayout)
Runnable
so that it will
no longer be executed after a layout pass.adaptToLayout
- The Runnable
that will no longer be executed after a
layout pass and before all "update label" runnables.public void unschedulePostLayoutPass(java.lang.Runnable updateLabels)
Runnable
so that it will no
longer be executed after a layout pass and after all "adapt to layout"
runnables.updateLabels
- The Runnable
that will no longer be executed after a
layout pass and after all "adapt to layout" runnables.public void unscheduleProvideLayout(java.lang.Runnable provideLayout)
Runnable
so that it will
no longer be executed before a layout pass.provideLayout
- The Runnable
that will no longer be executed before a
layout pass.Copyright (c) 2014 itemis AG and others. All rights reserved.