|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.module.YModule y.module.LayoutModule
public abstract class LayoutModule
Common base class for modules that launch layout algorithms.
Field Summary |
---|
Fields inherited from class y.module.YModule |
---|
FAILED, moduleListenerSupport, PRECONDITION_VIOLATED, SUCCESS |
Constructor Summary | |
---|---|
protected |
LayoutModule(java.lang.String name)
Creates a new instance of LayoutModule . |
protected |
LayoutModule(java.lang.String name,
java.lang.String author,
java.lang.String description)
Deprecated. Use LayoutModule(String) instead.
Proper module description should take place in the API documentation. |
Method Summary | |
---|---|
protected void |
backupDataProvider(Graph2D graph,
java.lang.Object providerKey)
Backs up and removes the data provider registered for the given key. |
protected AnimationPlayer |
createAnimationPlayer()
Factory method used by the layout executor that itself is used by launchLayouter(y.layout.Layouter, boolean) . |
protected Graph2DLayoutExecutor |
createLayoutExecutor()
Factory method for the layout executor property. |
protected LayoutMorpher |
createLayoutMorpher()
Callback method used by the layout executor to create the LayoutMorpher
instance that will be used for the animation of the layout. |
boolean |
getBufferedMode()
Returns whether or not to perform the layout process in buffered mode. |
Graph2DLayoutExecutor |
getLayoutExecutor()
Gets the Graph2DLayoutExecutor that will be used by this instance in
launchLayouter(y.layout.Layouter)
to execute the layout. |
boolean |
isAbortable()
Returns true ; LayoutModule s can be aborted. |
boolean |
isMorphingEnabled()
Getter for property morphingEnabled. |
boolean |
isPortIntersectionCalculatorEnabled()
Returns the value of property portIntersectionCalculatorEnabled. |
protected void |
launchLayouter(Layouter layouter)
Triggers the specified Layouter 's
Layouter.doLayout(y.layout.LayoutGraph) method on the
Graph2D instance associated with this module. |
protected void |
launchLayouter(Layouter layouter,
boolean buffered)
Triggers the specified Layouter 's
Layouter.doLayout(y.layout.LayoutGraph) method on the
Graph2D instance associated with this module after
determining and applying this module's context settings. |
protected void |
restoreDataProvider(Graph2D graph,
java.lang.Object providerKey)
Restores a data provider mapping that was backed up using method backupDataProvider(y.view.Graph2D, Object) . |
void |
setBufferedMode(boolean buffered)
Whether or not to perform the layout process in buffered mode. |
void |
setLayoutExecutor(Graph2DLayoutExecutor layoutExecutor)
Sets the layout executor that will be used in launchLayouter(y.layout.Layouter, boolean) |
void |
setMorphingEnabled(boolean morphingEnabled)
Setter for property morphingEnabled. |
void |
setPortIntersectionCalculatorEnabled(boolean enabled)
Sets whether or not layout stage PortCalculator should be
automatically prepended to the layouter before it is invoked. |
protected boolean |
useEventDispatchThread()
Determines whether to use the EDT for the those parts of the execution that typically need to be done on the EDT (assignment of the coordinates, creation of buffered instance, etc.). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LayoutModule(java.lang.String name, java.lang.String author, java.lang.String description)
LayoutModule(String)
instead.
Proper module description should take place in the API documentation.
LayoutModule
.
name
- the module's nameauthor
- the module's authordescription
- a short description of the module's functionalityprotected LayoutModule(java.lang.String name)
LayoutModule
.
name
- the module's nameMethod Detail |
---|
public Graph2DLayoutExecutor getLayoutExecutor()
Graph2DLayoutExecutor
that will be used by this instance in
launchLayouter(y.layout.Layouter)
to execute the layout.
createLayoutExecutor()
protected Graph2DLayoutExecutor createLayoutExecutor()
layout executor
property.
Graph2DLayoutExecutor
which uses
the createAnimationPlayer()
and the useEventDispatchThread()
callbacks from this instance for the corresponding methods.public void setLayoutExecutor(Graph2DLayoutExecutor layoutExecutor)
layout executor
that will be used in launchLayouter(y.layout.Layouter, boolean)
layoutExecutor
- The new executor to use.protected void launchLayouter(Layouter layouter)
Layouter
's
Layouter.doLayout(y.layout.LayoutGraph)
method on the
Graph2D
instance associated with this module. This method
is the equivalent of launchLayouter(layouter,bufferedMode);
.
layouter
- the layout algorithm to be applied to this module's graphlaunchLayouter(y.layout.Layouter, boolean)
protected void launchLayouter(Layouter layouter, boolean buffered)
Layouter
's
Layouter.doLayout(y.layout.LayoutGraph)
method on the
Graph2D
instance associated with this module after
determining and applying this module's context settings. This includes
Graph2DView
Graph2DView
slayout executor instance
.
layouter
- the layout algorithm to be applied to this module's graphbuffered
- specifies whether to calculate the layout for this
module's graph in buffered mode. Buffered mode means
that the actual layout calculation is done on a copy of
this module's graph and the calculated layout information
is applied to this module's graph only after the layout
algorithm has finished.Graph2DLayoutExecutor.doLayout(y.view.Graph2DView, y.layout.Layouter)
protected AnimationPlayer createAnimationPlayer()
layout executor
that itself is used by launchLayouter(y.layout.Layouter, boolean)
.
protected LayoutMorpher createLayoutMorpher()
layout executor
to create the LayoutMorpher
instance that will be used for the animation of the layout.
LayoutMorpher
protected boolean useEventDispatchThread()
!SwingUtilities.isEventDispatchThread() && getGraph2DView() != null && getGraph2DView().isShowing();
public boolean isAbortable()
true
; LayoutModule
s can be aborted.
isAbortable
in class YModule
true
.public void setBufferedMode(boolean buffered)
buffered
- whether or not to enable the buffered modepublic boolean getBufferedMode()
public boolean isMorphingEnabled()
public void setMorphingEnabled(boolean morphingEnabled)
morphingEnabled
- New value of property morphingEnabled.public boolean isPortIntersectionCalculatorEnabled()
setPortIntersectionCalculatorEnabled(boolean)
public void setPortIntersectionCalculatorEnabled(boolean enabled)
PortCalculator
should be
automatically prepended to the layouter before it is invoked.
If no IntersectionCalculator DataProviders are registered with the
graph, this class will use DataProviders of
type NodeRealizerIntersectionCalculator
.
By default this feature is disabled.
enabled
- whether or not to use the layout stage PortCalculator
protected void backupDataProvider(Graph2D graph, java.lang.Object providerKey)
restoreDataProvider(y.view.Graph2D, Object)
to restore
the original data provider mapping for the specified graph.
graph
- the affected graphproviderKey
- the look-up key identifying the data to backup
java.lang.IllegalStateException
- if data for the given key has
already been backed up.DataProvider
,
Graph.addDataProvider(Object, y.base.DataProvider)
,
Graph.getDataProvider(Object)
protected void restoreDataProvider(Graph2D graph, java.lang.Object providerKey)
backupDataProvider(y.view.Graph2D, Object)
.
graph
- the affected graphproviderKey
- the look-up key identifying the data to restore
java.lang.IllegalStateException
- if there is no backup data for the given key.DataProvider
,
Graph.addDataProvider(Object, y.base.DataProvider)
,
Graph.getDataProvider(Object)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |