|
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(String name,
String author,
String description)
Creates a new instance of LayoutModule . |
Method Summary | |
---|---|
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. |
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 y.module.YModule |
---|
addModuleListener, createOptionHandler, createThread, dispose, exceptionHappened, fitGraph2DView, getAuthor, getDescription, getExitStatus, getGraph2D, getGraph2DView, getModuleName, getOptionHandler, getTimer, getView, init, isBackupRealizersEnabled, mainrun, removeModuleListener, run, setBackupRealizersEnabled, setExitStatus, setGraph2D, setModuleName, setOptionHandler, start, startAsThread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LayoutModule(String name, String author, String description)
LayoutModule
.
name
- the module's nameauthor
- the module's authordescription
- a short description of the module's functionalityMethod 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
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |