java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.imp2d.layout.Layout
- All Implemented Interfaces:
Manageable
,Shareable
- Direct Known Subclasses:
CircleGraphLayout
,EdgeBasedLayout
,EnergyModelLayout
,ForceBasedLayout
,ForceBasedLayout2
,GeneralPurposeLayout
,HierarchyLayout
,RandomLayout
,SquareLayout
,SugiyamaLayout
,TouchLayout
,TreeLayout
This class is the abstract base class for two-dimensional graph layouts.
A layout is performed for a
View2D
using the
#invoke(View2D)
-method, the actual work is done in an instance
of Algorithm
which is returned by createAlgorithm()
.
In order to simplify the task of layouting, the graph of the
view's scene is transformed into a layout graph consisting of
Node
and Edge
.
The layout is then performed on the x
- and
y
-fields of these nodes, which specify global coordinates.
Finally, the layouted global coordinates are written back into the
original graph.
- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
AnAlgorithm
is created by aLayout
in order to perform the actual layout task.static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Layout.Type
static final SCOType.Field
static final SCOType.Field
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Layout.Algorithm
Creates an algorithm for this layout.int
getParam()
invoke
(View2D view, Layout.Algorithm algo) This method is invoked by aView2D
.void
setParam
(int param) void
setRedraw
(boolean value) void
setTransformationSteps
(int value) Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.persistence.Manageable
getManageableType
-
Field Details
-
$TYPE
-
fit$FIELD
-
transformationSteps$FIELD
-
-
Constructor Details
-
Layout
public Layout()
-
-
Method Details
-
setParam
public void setParam(int param) -
getParam
public int getParam() -
createAlgorithm
Creates an algorithm for this layout.- Returns:
- a new
Algorithm
instance
-
invoke
This method is invoked by aView2D
. It invokes therun
-method of the algorithm of this layout, or ofalgo
if this is notnull
. If this invocation returnstrue
, the algorithm is returned by this method, otherwise it returnsnull
. If the returned value is notnull
, the invokingView2D
re-invokes this method with the returned value asalgo
.- Parameters:
view
- invoking viewalgo
- existing algorithm instance to use, ornull
- Returns:
- a non-null instance if this method should be re-invoked by
view
, this is then passes asalgo
-parameter
-
setRedraw
public void setRedraw(boolean value) -
setTransformationSteps
public void setTransformationSteps(int value)
-