|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.CanonicMultiStageLayouter y.layout.organic.OrganicLayouter
public class OrganicLayouter
A graph layout algorithm that is based on a force directed model.
Here is a sample output of the layouter:
Field Summary | |
---|---|
static byte |
ALL
Sphere of action specifier. |
static byte |
AS_IS
Initial placement strategy. |
static Object |
FIXED_GROUP_NODES_DPKEY
DataProvider key used in conjunction with hierarchically grouped graphs. |
static byte |
FIXED_GROUPS_POLICY
Node group policy specifier. |
static byte |
IGNORE_GROUPS_POLICY
Node group policy specifier. |
static byte |
LAYOUT_GROUPS_POLICY
Node group policy specifier. |
static byte |
MAINLY_SELECTION
Sphere of action specifier. |
static byte |
ONLY_SELECTION
Sphere of action specifier. |
static Object |
PREFERRED_EDGE_LENGTH_DATA
Key used to associate a DataProvider with a
LayoutGraph. |
static byte |
RANDOM
Initial placement strategy. |
static Object |
SPHERE_OF_ACTION_NODES
DataProvider key used in conjunction with the sphere-of-action feature. |
static byte |
ZERO
Initial placement strategy. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
OrganicLayouter()
Returns a new organic Layouter. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Returns always true because this algorithms has no
preconditions. |
void |
dispose()
Frees resources |
void |
doLayoutCore(LayoutGraph graph)
Invokes the core layout algorithm. |
boolean |
getActivateDeterministicMode()
Returns whether or not this layouter is in deterministic mode. |
boolean |
getActivateTreeBeautifier()
Returns whether or not to activate the subtree beautifier. |
int |
getAttraction()
Returns the current attraction. |
double |
getFinalTemperature()
Returns the final temperature. |
double |
getGravityFactor()
Returns the gravity factor. |
GroupBoundsCalculator |
getGroupBoundsCalculator()
Returns the GroupBoundsCalculator instance that is used for the calculation of the group nodes' bounds if a hierarchically grouped graph is being laid out. |
double |
getGroupNodeCompactness()
Returns the group node compactness factor. |
byte |
getGroupNodePolicy()
Returns the policy for group nodes. |
byte |
getInitialPlacement()
Returns the initial placement strategy. |
double |
getInitialTemperature()
Returns the initial temperature. |
double |
getIterationFactor()
Returns the iteration factor of this layouter. |
long |
getMaximumDuration()
Returns the maximum duration granted to this layouter. |
boolean |
getObeyNodeSize()
Returns whether or not node sizes should be considered by this layouter. |
int |
getPreferredEdgeLength()
Returns the general edge length that should be attained by this layouter. |
int |
getRepulsion()
Returns the current repulsion. |
byte |
getSphereOfAction()
Returns the sphere of action for this layouter. |
void |
setActivateDeterministicMode(boolean activate)
Specifies whether or not this layouter should work in a deterministic mode. |
void |
setActivateTreeBeautifier(boolean activate)
Specifies whether or not to activate the subtree beautifier. |
void |
setAttraction(int attraction)
Sets the current attraction. |
void |
setFinalTemperature(double finalTemperature)
Sets the final temperature. |
void |
setGravityFactor(double factor)
Sets the gravity factor. |
void |
setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Sets the instance used for the calculation of the group nodes' bounds if a hierarchically grouped graph is being laid out. |
void |
setGroupNodeCompactness(double groupNodeCompactness)
Sets the compactness of group nodes. |
void |
setGroupNodePolicy(byte groupNodePolicy)
Sets the policy for group nodes. |
void |
setInitialPlacement(byte p)
Sets the initial placement strategy. |
void |
setInitialTemperature(double initialTemperature)
Specifies the initial temperature. |
void |
setIterationFactor(double factor)
Sets the iteration factor of this layouter. |
void |
setMaximumDuration(long msec)
Sets the maximum duration granted to this layouter. |
void |
setObeyNodeSize(boolean obey)
Specifies whether or not node sizes should be considered by this layouter. |
void |
setPreferredEdgeLength(int edgeLength)
Sets the general edge length that should be attained by this layouter. |
void |
setRepulsion(int repulsion)
Sets the current repulsion. |
void |
setSphereOfAction(byte p)
Sets the sphere of action for this layouter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object SPHERE_OF_ACTION_NODES
Graph.addDataProvider(Object, DataProvider)
,
setSphereOfAction(byte)
public static final Object FIXED_GROUP_NODES_DPKEY
Graph.addDataProvider(Object, DataProvider)
,
setGroupNodePolicy(byte)
,
FIXED_GROUPS_POLICY
public static final byte RANDOM
setInitialPlacement(byte)
,
Constant Field Valuespublic static final byte ZERO
setInitialPlacement(byte)
,
Constant Field Valuespublic static final byte AS_IS
setInitialPlacement(byte)
,
Constant Field Valuespublic static final byte LAYOUT_GROUPS_POLICY
public static final byte FIXED_GROUPS_POLICY
public static final byte IGNORE_GROUPS_POLICY
public static final byte ALL
setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte MAINLY_SELECTION
SPHERE_OF_ACTION_NODES
returns true
for that node.
setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte ONLY_SELECTION
SPHERE_OF_ACTION_NODES
returns true
for that node.
setSphereOfAction(byte)
,
Constant Field Valuespublic static final Object PREFERRED_EDGE_LENGTH_DATA
DataProvider
with a
LayoutGraph. The associated DataProvider must return
an int
values for each edge of the LayoutGraph.
The value returned for a specific edge will be interpreted as
its preferred edge length.
If a DataProvider is bound to this key, then the global
preferredEdgeLength for all edges (see setPreferredEdgeLength(int)
)
will be ignored.
Example: Assuming that a method int getWeight(Edge)
is provided that returns for each edge a double value between 0.0 and 1.0,
then these edge weights can be translated to edge length preferences
between 0 and 200 that the OrganicLayouter tries to obey.
import y.util.DataProviderAdapter; //define an adequate data provider DataProviderAdapter edgeLengthData = new DataProviderAdapter() { public int getInt(Object o) { return (int)(200*getWeight((Edge)o)); } } LayoutGraph graph = ...; OrganicLayouter layouter = ...; //register the data provider graph.addDataProvider(PREFERRED_EDGE_LENGTH_DATA, edgeLengthData); //launch the layouter layouter.doLayout(graph);
Constructor Detail |
---|
public OrganicLayouter()
Method Detail |
---|
public int getRepulsion()
public void setRepulsion(int repulsion)
public int getAttraction()
public void setAttraction(int attraction)
attraction
- a value in [0,2]
.public GroupBoundsCalculator getGroupBoundsCalculator()
MinimumSizeGroupBoundsCalculator
instance
is registered with this instance.
public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
groupBoundsCalculator
- the new instancepublic double getGroupNodeCompactness()
public void setGroupNodeCompactness(double groupNodeCompactness)
IllegalArgumentException
- if compactness value does not lie in [0..1]groupNodeCompactness
- the new value.public byte getGroupNodePolicy()
LAYOUT_GROUPS_POLICY
.
FIXED_GROUPS_POLICY
, LAYOUT_GROUPS_POLICY
, or
IGNORE_GROUPS_POLICY
public void setGroupNodePolicy(byte groupNodePolicy)
FIXED_GROUPS_POLICY
, LAYOUT_GROUPS_POLICY
, or
IGNORE_GROUPS_POLICY
.
public double getInitialTemperature()
preferredEdgeLength
and then assigned as the initial node heat.
The default is 0.1d
.
public void setInitialTemperature(double initialTemperature)
preferredEdgeLength
and then assigned as the initial node heat.
The default is 0.1d
.
public double getFinalTemperature()
1.0d
.
public void setFinalTemperature(double finalTemperature)
1.0d
.
finalTemperature
- New value of property finalTemperature.public void setActivateDeterministicMode(boolean activate)
By default deterministic mode is inactive.
public boolean getActivateDeterministicMode()
setActivateDeterministicMode(boolean)
public void setActivateTreeBeautifier(boolean activate)
By default this feature is inactive.
public boolean getActivateTreeBeautifier()
setActivateTreeBeautifier(boolean)
public void setGravityFactor(double factor)
By default a value of 0.0
is assumed.
public double getGravityFactor()
setGravityFactor(double)
public void setSphereOfAction(byte p)
The default value is ALL
.
SPHERE_OF_ACTION_NODES
public byte getSphereOfAction()
The default value is ALL
.
public void setInitialPlacement(byte p)
The default value is AS_IS
.
public byte getInitialPlacement()
The default value is AS_IS
.
public void setMaximumDuration(long msec)
public long getMaximumDuration()
public void setIterationFactor(double factor)
By default an iteration factor of 3
is set.
public double getIterationFactor()
setIterationFactor(double)
public void setPreferredEdgeLength(int edgeLength)
By default an edge length of 80
is set.
public int getPreferredEdgeLength()
public void setObeyNodeSize(boolean obey)
true
.
Defaults to true
.
public boolean getObeyNodeSize()
public boolean canLayoutCore(LayoutGraph graph)
true
because this algorithms has no
preconditions.
canLayoutCore
in class CanonicMultiStageLayouter
true
.public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
public void dispose()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |