|
||||||||||
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
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()
Getter for property attraction. |
double |
getFinalTemperature()
Getter for property finalTemperature. |
double |
getGravityFactor()
Returns the gravity factor. |
GroupBoundsCalculator |
getGroupBoundsCalculator()
Getter for property groupBoundsCalculator. |
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()
Getter for property initialTemperature. |
double |
getIterationFactor()
Returns the iteration factor of this layouter. |
long |
getMaximumDuration()
Returns the maximal 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()
Getter for property repulsion. |
byte |
getSphereOfAction()
Returns the sphere of action for this layouter. |
void |
setActivateDeterministicMode(boolean activate)
Whether or not this layouter should work in a deterministic mode. |
void |
setActivateTreeBeautifier(boolean activate)
Whether or not to activate the subtree beautifier. |
void |
setAttraction(int attraction)
Setter for property attraction. |
void |
setFinalTemperature(double finalTemperature)
Setter for property finalTemperature. |
void |
setGravityFactor(double factor)
Sets the gravity factor. |
void |
setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Setter for property groupBoundsCalculator. |
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)
Setter for property initialTemperature. |
void |
setIterationFactor(double factor)
Sets the iteration factor. |
void |
setMaximumDuration(long msec)
Sets the maximal duration granted to this layouter. |
void |
setObeyNodeSize(boolean obey)
Whether or not the node sizes should be considered by this layouter. |
void |
setPreferredEdgeLength(int edgeLength)
Sets the general edge length that should be attained by this layouter By default an edge length of 80 is set. |
void |
setRepulsion(int repulsion)
Setter for property 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)
,
OrganicLayouter.setSphereOfAction(byte)
public static final Object FIXED_GROUP_NODES_DPKEY
Graph.addDataProvider(Object, DataProvider)
,
OrganicLayouter.setGroupNodePolicy(byte)
,
OrganicLayouter.FIXED_GROUPS_POLICY
public static final byte RANDOM
OrganicLayouter.setInitialPlacement(byte)
,
Constant Field Valuespublic static final byte ZERO
OrganicLayouter.setInitialPlacement(byte)
,
Constant Field Valuespublic static final byte AS_IS
OrganicLayouter.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
OrganicLayouter.setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte MAINLY_SELECTION
OrganicLayouter.SPHERE_OF_ACTION_NODES
returns true
for that node.
OrganicLayouter.setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte ONLY_SELECTION
OrganicLayouter.SPHERE_OF_ACTION_NODES
returns true
for that node.
OrganicLayouter.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 OrganicLayouter.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 dataprovider 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)
repulsion
- New value of property repulsion.public int getAttraction()
public void setAttraction(int attraction)
attraction
- New value of property attraction.public GroupBoundsCalculator getGroupBoundsCalculator()
public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
groupBoundsCalculator
- New value of property groupBoundsCalculator.public double getGroupNodeCompactness()
public void setGroupNodeCompactness(double groupNodeCompactness)
groupNodeCompactness
- the new value.public byte getGroupNodePolicy()
OrganicLayouter.LAYOUT_GROUPS_POLICY
.
OrganicLayouter.FIXED_GROUPS_POLICY
, OrganicLayouter.LAYOUT_GROUPS_POLICY
, or
OrganicLayouter.IGNORE_GROUPS_POLICY
public void setGroupNodePolicy(byte groupNodePolicy)
OrganicLayouter.FIXED_GROUPS_POLICY
, OrganicLayouter.LAYOUT_GROUPS_POLICY
, or
OrganicLayouter.IGNORE_GROUPS_POLICY
.
public double getInitialTemperature()
0.1d
.
public void setInitialTemperature(double initialTemperature)
0.1d
.
initialTemperature
- New value of property initialTemperature.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()
OrganicLayouter.setActivateDeterministicMode(boolean)
public void setActivateTreeBeautifier(boolean activate)
By default this feature is inactive
public boolean getActivateTreeBeautifier()
OrganicLayouter.setActivateTreeBeautifier(boolean)
public void setGravityFactor(double factor)
0.0
is assumed.
public double getGravityFactor()
OrganicLayouter.setGravityFactor(double)
public void setSphereOfAction(byte p)
OrganicLayouter.SPHERE_OF_ACTION_NODES
public byte getSphereOfAction()
OrganicLayouter.ALL
public void setInitialPlacement(byte p)
public byte getInitialPlacement()
OrganicLayouter.AS_IS
public void setMaximumDuration(long msec)
public long getMaximumDuration()
public void setIterationFactor(double factor)
public double getIterationFactor()
OrganicLayouter.setIterationFactor(double)
public void setPreferredEdgeLength(int edgeLength)
public int getPreferredEdgeLength()
public void setObeyNodeSize(boolean obey)
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-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |