|
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.GRIP
public class GRIP
This layout algorithm arranges graphs in an organic fashion.
It is strongly recommended to use SmartOrganicLayouter
instead of GRIP
.
SmartOrganicLayouter
is a much more advanced layout algorithm (e.g. it supports grouping and node labels),
while covering all functionality of GRIP
.
The organic layout style is characterized by a natural distribution of nodes. It is well suited to exhibit clusters and symmetric properties of a graph. Nodes are placed in a space-saving manner, close to their adjacent nodes. Distances between neighbors and edge lengths are highly uniform and edges are drawn as straight-line segments without bends.
Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise networking, visualizing social networks, mesh visualization or system management.
A mesh-like graph arranged using default settings
This algorithm implements a variant of the GRIP algorithm by P Gajer and SG Kobourov: Graph Drawing with Intelligent Placement.
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
GRIP()
Creates a new instance of GRIP with default settings. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Accepts general graphs without exception. |
void |
doLayoutCore(LayoutGraph graph)
Calculates an organic arrangement of the graph. |
int |
getFinalRounds()
Returns the number of Fruchterman-Reingold refinement rounds which are considered as the final algorithm rounds. |
int |
getInitialTemperature()
Returns the initial temperature for each optimization round. |
double |
getLaxity()
Returns the laxity value which is used in conjunction with the preferred
edge length and influences how strict the algorithm should be regarding that length. |
int |
getPreferredEdgeLength()
Returns the preferred edge length. |
int |
getRounds()
Returns the number of Kamada-Kawai refinement rounds which are considered as the initial algorithm rounds. |
boolean |
isDeterministic()
Returns whether or not the deterministic mode of the layout algorithm is enabled. |
boolean |
isMultiThreadingAllowed()
Returns whether or not the layout algorithm may use multi-threading to reduce the running time. |
boolean |
isNodeSizeAware()
Returns whether or not to consider average node sizes during layout calculation. |
boolean |
isSmartInitialPlacement()
Returns whether or not the initial placement of nodes is determined using a more involved, smart strategy. |
void |
setComponentLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage used for arranging the components of the graph is
activated. |
void |
setDeterministic(boolean deterministic)
Specifies whether or not the deterministic mode of the layout algorithm is enabled. |
void |
setFinalRounds(int finalRounds)
Specifies the number of Fruchterman-Reingold refinement rounds which are considered as the final algorithm rounds. |
void |
setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
Specifies whether or not the LayoutStage used for hiding group nodes is activated. |
void |
setInitialTemperature(int tInit)
Sets the initial temperature for each optimization round. |
void |
setLaxity(double laxity)
Specifies the laxity value which is used in conjunction with the preferred
edge length and influences how strict the algorithm should be regarding that length. |
void |
setMultiThreadingAllowed(boolean multiThreadingAllowed)
Specifies whether or not the layout algorithm may use multi-threading to reduce the running time. |
void |
setNodeSizeAware(boolean nodeSizeAware)
Specifies whether or not to consider average node sizes during layout calculation. |
void |
setOrientationLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage that modifies the orientation of the layout is activated. |
void |
setPreferredEdgeLength(int preferredEdgeLength)
Specifies the preferred edge length. |
void |
setRounds(int rounds)
Specifies the number of Kamada-Kawai refinement rounds which are considered as the initial algorithm rounds. |
void |
setSmartInitialPlacement(boolean smartInitialPlacement)
Specifies whether or not the initial placement of nodes is determined using a more involved, smart strategy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GRIP()
GRIP
with default settings.
Method Detail |
---|
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graph
true
for all general graphs, false
if the given graph is null
public boolean isMultiThreadingAllowed()
true
if multi-threading is used, false
otherwisesetMultiThreadingAllowed(boolean)
public void setMultiThreadingAllowed(boolean multiThreadingAllowed)
multiThreadingAllowed
- true
if multi-threading should be used, false
otherwisepublic void setRounds(int rounds)
[5,50]
.10
rounds are executed.rounds
- the number of initial roundspublic void setFinalRounds(int finalRounds)
[0,100]
.finalRounds
- the number of final roundspublic void setPreferredEdgeLength(int preferredEdgeLength)
This length does not define the actual absolute length of edges, but the layout algorithm considers the preference where possible.
The preferred edge length needs to be non-negative.
public void setInitialTemperature(int tInit)
The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature decreases and if it reaches a certain limit, the process terminates.
[10,80]
.tInit
- the initial temperaturepublic int getRounds()
[5,50]
.setRounds(int)
public int getFinalRounds()
[0,100]
.setFinalRounds(int)
public int getPreferredEdgeLength()
This length does not define the actual absolute length of edges, but the layout algorithm considers the preference where possible.
The preferred edge length needs to be non-negative.
setPreferredEdgeLength(int)
public int getInitialTemperature()
The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature decreases and if it reaches a certain limit, the process terminates.
[10,80]
.setInitialTemperature(int)
public void setComponentLayouterEnabled(boolean enabled)
LayoutStage
used for arranging the components of the graph is
activated.
setComponentLayouterEnabled
in class CanonicMultiStageLayouter
GRIP
can only handle single components. Disabling ComponentLayouter
will lead
to errors during execution.enabled
- true
if the stage that arranges the graph components is activated,
false
otherwiseCanonicMultiStageLayouter.isComponentLayouterEnabled()
,
CanonicMultiStageLayouter.setComponentLayouter(y.layout.LayoutStage)
,
ComponentLayouter
public void setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
LayoutStage
used for hiding group nodes is activated.
setGroupNodeHidingEnabled
in class CanonicMultiStageLayouter
GRIP
cannot handle group nodes. Disabling GroupNodeHider
will lead to
errors during execution.groupNodeHidingEnabled
- true
if the stage used for hiding group nodes is activated,
false
otherwiseCanonicMultiStageLayouter.isGroupNodeHidingEnabled()
,
CanonicMultiStageLayouter.setGroupNodeHider(y.layout.LayoutStage)
,
GroupNodeHider
public void setOrientationLayouterEnabled(boolean enabled)
LayoutStage
that modifies the orientation of the layout is activated.
setOrientationLayouterEnabled
in class CanonicMultiStageLayouter
LayoutOrientation.TOP_TO_BOTTOM
, the orientation of
the layout will not be modified.OrientationLayouter
has no significant
effect.LayoutStage
is activated.enabled
- true
if the stage that modifies the orientation is activated,
false
otherwiseCanonicMultiStageLayouter.isOrientationLayouterEnabled()
,
CanonicMultiStageLayouter.setOrientationLayouter(y.layout.LayoutStage)
,
CanonicMultiStageLayouter.setLayoutOrientation(byte)
,
OrientationLayouter
public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graphpublic boolean isSmartInitialPlacement()
true
if the smart strategy for the initial node placement is enabled,
false
otherwisesetSmartInitialPlacement(boolean)
public void setSmartInitialPlacement(boolean smartInitialPlacement)
smartInitialPlacement
- true
if the smart strategy for the initial node placement should be enabled,
false
otherwisepublic boolean isDeterministic()
In deterministic mode, the layout algorithm will yield the same results for the exact same input and algorithm settings.
true
if the layout algorithm operates in deterministic mode,
false
otherwisesetDeterministic(boolean)
public void setDeterministic(boolean deterministic)
In deterministic mode, the layout algorithm will yield the same results for the exact same input and algorithm settings.
deterministic
- true
if the layout algorithm should operate in deterministic mode,
false
otherwisepublic double getLaxity()
preferred
edge length
and influences how strict the algorithm should be regarding that length.
The laxity is defined to be a strictly positive value.
setLaxity(double)
public void setLaxity(double laxity)
preferred
edge length
and influences how strict the algorithm should be regarding that length.
The laxity is defined to be a strictly positive value.
laxity
- the laxity value
java.lang.IllegalArgumentException
- if the given laxity value is 0
or negativepublic boolean isNodeSizeAware()
If this feature is disabled, overlaps between nodes (e.g. due to large node sizes) may occur.
true
if the sizes of nodes are taken into account, false
otherwisesetNodeSizeAware(boolean)
public void setNodeSizeAware(boolean nodeSizeAware)
If this feature is disabled, overlaps between nodes (e.g. due to large node sizes) may occur.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |