info.aduna.linkmap.layout
Class GemLayoutManager
java.lang.Object
info.aduna.linkmap.layout.GraphLayoutManager
info.aduna.linkmap.layout.GemLayoutManager
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- LinkSubgraphLayoutManager2
public class GemLayoutManager
- extends GraphLayoutManager
GemLayoutManager is an implementation of the GEM spring embedder graph layout
algorithm (Frick et al., 1995), derived from the Java implementation used in
IGem. Changes w.r.t. GEM & IGem are:
- Greatly optimized the implementation of the algorithm.
- Added the capability to direct vertex movements with an adaptation-based
mechanism, instead of a heat-based mechanism.
- Added some bells and whistles (possibility to interrupt the algorithm,
change parameter settings, etc.).
- (probably a bug in IGem): in the insert phase, we only consider the
number of already inserted vertices for the calculation of the center of the
graph, instead of taking the total number of vertices (inserted or not) into
account.
Still lacking in this layout manager is functionality for making use of the
layout of a previous graph.
- See Also:
http://citeseer.nj.nec.com/frick94fast.html,
http://www.cs.brown.edu/people/acf/IGem/IGem.html
|
Method Summary |
void |
addListener(GemLayoutListener listener)
|
LayoutConverter |
createLayoutConverter()
Returns a LayoutConverter that allows the rendering mechanism to retrieve
and adapt the layout of a graph, while abstracting from the specified
GraphLayoutManager implementation that is used. |
void |
doLayout()
Calculate a layout for the Graph registered in this GraphLayoutManager. |
double |
getAdaptationDecreaseFactor()
|
double |
getAdaptationDecreaseThreshold()
|
double |
getAdaptationIncreaseFactor()
|
double |
getAdaptationIncreaseThreshold()
|
int |
getEdgeLength()
|
int |
getEdgeRepulsionRegion()
|
double |
getGravity(GemLayoutManager.LayoutPhase phase)
|
double |
getMaxEffort(GemLayoutManager.LayoutPhase phase)
|
int |
getMaximumAttraction()
|
double |
getMaximumHeat(GemLayoutManager.LayoutPhase phase)
|
GemLayoutManager.MoveStrategy |
getMoveStrategy(GemLayoutManager.LayoutPhase phase)
|
double |
getOscillation(GemLayoutManager.LayoutPhase phase)
|
long |
getRandomSeed()
|
double |
getRotation(GemLayoutManager.LayoutPhase phase)
|
int |
getRound()
|
double |
getShake(GemLayoutManager.LayoutPhase phase)
|
double |
getStartAdaptation(GemLayoutManager.LayoutPhase phase)
|
double |
getStartHeat(GemLayoutManager.LayoutPhase phase)
|
double |
getStopAvgSquaredMovement(GemLayoutManager.LayoutPhase phase)
|
double |
getStopHeat(GemLayoutManager.LayoutPhase phase)
|
void |
initialize(Graph graph)
Makes the Graph ready for layout calculation. |
void |
insert(GemLayoutManager.VertexAttribute[] attributes)
Gives the layout a quick initial layout, by inserting the vertices one by
one and moving them (and not the whole graph!) for a few iterations. |
void |
removeListener(GemLayoutListener listener)
|
void |
setAdaptationDecreaseFactor(double factor)
|
void |
setAdaptationDecreaseThreshold(double threshold)
|
void |
setAdaptationIncreaseFactor(double factor)
|
void |
setAdaptationIncreaseThreshold(double threshold)
|
void |
setDefaultAdaptationChangeParameters()
|
void |
setDefaultForceParameters()
|
void |
setDefaultMoveParameters()
|
void |
setDefaultPhaseParameters()
|
void |
setEdgeLength(int edgeLength)
|
void |
setEdgeRepulsionRegion(int region)
|
void |
setGravity(GemLayoutManager.LayoutPhase phase,
double gravity)
|
void |
setMaxEffort(GemLayoutManager.LayoutPhase phase,
double effort)
Sets the maximum effort that may be put in the specified phase. |
void |
setMaximumAttraction(int maxAttraction)
|
void |
setMaximumHeat(GemLayoutManager.LayoutPhase phase,
double heat)
|
void |
setMoveStrategy(GemLayoutManager.LayoutPhase phase,
GemLayoutManager.MoveStrategy strategy)
|
void |
setOscillation(GemLayoutManager.LayoutPhase phase,
double oscillation)
|
void |
setRandomSeed(long seed)
|
void |
setRotation(GemLayoutManager.LayoutPhase phase,
double rotation)
|
void |
setShake(GemLayoutManager.LayoutPhase phase,
double shake)
|
void |
setStartAdaptation(GemLayoutManager.LayoutPhase phase,
double adaptation)
|
void |
setStartHeat(GemLayoutManager.LayoutPhase phase,
double heat)
|
void |
setStopAvgSquaredMovement(GemLayoutManager.LayoutPhase phase,
double sqrMovement)
|
void |
setStopHeat(GemLayoutManager.LayoutPhase phase,
double heat)
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_EDGE_LENGTH
public static final int DEFAULT_EDGE_LENGTH
- See Also:
- Constant Field Values
DEFAULT_EDGE_REPULSION_REGION
public static final int DEFAULT_EDGE_REPULSION_REGION
- See Also:
- Constant Field Values
DEFAULT_MAX_ATTRACTION
public static final int DEFAULT_MAX_ATTRACTION
- See Also:
- Constant Field Values
DEFAULT_RANDOM_SEED
public static final long DEFAULT_RANDOM_SEED
- See Also:
- Constant Field Values
DEFAULT_INSERT_MAX_ITERATION
public static final int DEFAULT_INSERT_MAX_ITERATION
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_MAX_ROUNDS
public static final double DEFAULT_ARRANGE_MAX_ROUNDS
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_MAX_ROUNDS
public static final double DEFAULT_OPTIMIZE_MAX_ROUNDS
- See Also:
- Constant Field Values
DEFAULT_INSERT_START_HEAT
public static final double DEFAULT_INSERT_START_HEAT
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_START_HEAT
public static final double DEFAULT_ARRANGE_START_HEAT
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_START_HEAT
public static final double DEFAULT_OPTIMIZE_START_HEAT
- See Also:
- Constant Field Values
DEFAULT_INSERT_STOP_HEAT
public static final double DEFAULT_INSERT_STOP_HEAT
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_STOP_HEAT
public static final double DEFAULT_ARRANGE_STOP_HEAT
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_STOP_HEAT
public static final double DEFAULT_OPTIMIZE_STOP_HEAT
- See Also:
- Constant Field Values
DEFAULT_INSERT_MAXIMUM_HEAT
public static final double DEFAULT_INSERT_MAXIMUM_HEAT
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_MAXIMUM_HEAT
public static final double DEFAULT_ARRANGE_MAXIMUM_HEAT
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_MAXIMUM_HEAT
public static final double DEFAULT_OPTIMIZE_MAXIMUM_HEAT
- See Also:
- Constant Field Values
DEFAULT_INSERT_GRAVITY
public static final double DEFAULT_INSERT_GRAVITY
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_GRAVITY
public static final double DEFAULT_ARRANGE_GRAVITY
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_GRAVITY
public static final double DEFAULT_OPTIMIZE_GRAVITY
- See Also:
- Constant Field Values
DEFAULT_INSERT_OSCILLATION
public static final double DEFAULT_INSERT_OSCILLATION
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_OSCILLATION
public static final double DEFAULT_ARRANGE_OSCILLATION
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_OSCILLATION
public static final double DEFAULT_OPTIMIZE_OSCILLATION
- See Also:
- Constant Field Values
DEFAULT_INSERT_ROTATION
public static final double DEFAULT_INSERT_ROTATION
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_ROTATION
public static final double DEFAULT_ARRANGE_ROTATION
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_ROTATION
public static final double DEFAULT_OPTIMIZE_ROTATION
- See Also:
- Constant Field Values
DEFAULT_INSERT_SHAKE
public static final double DEFAULT_INSERT_SHAKE
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_SHAKE
public static final double DEFAULT_ARRANGE_SHAKE
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_SHAKE
public static final double DEFAULT_OPTIMIZE_SHAKE
- See Also:
- Constant Field Values
DEFAULT_INSERT_MOVE_STRATEGY
public static final GemLayoutManager.MoveStrategy DEFAULT_INSERT_MOVE_STRATEGY
DEFAULT_ARRANGE_MOVE_STRATEGY
public static final GemLayoutManager.MoveStrategy DEFAULT_ARRANGE_MOVE_STRATEGY
DEFAULT_OPTIMIZE_MOVE_STRATEGY
public static final GemLayoutManager.MoveStrategy DEFAULT_OPTIMIZE_MOVE_STRATEGY
DEFAULT_INSERT_ADAPTATION
public static final double DEFAULT_INSERT_ADAPTATION
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_ADAPTATION
public static final double DEFAULT_ARRANGE_ADAPTATION
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_ADAPTATION
public static final double DEFAULT_OPTIMIZE_ADAPTATION
- See Also:
- Constant Field Values
DEFAULT_ARRANGE_STOP_AVG_SQR_MOVEMENT
public static final double DEFAULT_ARRANGE_STOP_AVG_SQR_MOVEMENT
- See Also:
- Constant Field Values
DEFAULT_OPTIMIZE_STOP_AVG_SQR_MOVEMENT
public static final double DEFAULT_OPTIMIZE_STOP_AVG_SQR_MOVEMENT
- See Also:
- Constant Field Values
DEFAULT_ADAPTATION_INCREASE_THRESHOLD
public static final double DEFAULT_ADAPTATION_INCREASE_THRESHOLD
- See Also:
- Constant Field Values
DEFAULT_ADAPTATION_DECREASE_THRESHOLD
public static final double DEFAULT_ADAPTATION_DECREASE_THRESHOLD
- See Also:
- Constant Field Values
DEFAULT_ADAPTATION_INCREASE_FACTOR
public static final double DEFAULT_ADAPTATION_INCREASE_FACTOR
- See Also:
- Constant Field Values
DEFAULT_ADAPTATION_DECREASE_FACTOR
public static final double DEFAULT_ADAPTATION_DECREASE_FACTOR
- See Also:
- Constant Field Values
GemLayoutManager
public GemLayoutManager()
setDefaultPhaseParameters
public void setDefaultPhaseParameters()
setDefaultForceParameters
public void setDefaultForceParameters()
setDefaultMoveParameters
public void setDefaultMoveParameters()
setDefaultAdaptationChangeParameters
public void setDefaultAdaptationChangeParameters()
initialize
public void initialize(Graph graph)
- Description copied from class:
GraphLayoutManager
- Makes the Graph ready for layout calculation. This should therefore be
invoked before the GraphLayoutManager starts its layout calculation and
probably also before a GraphRenderer tries to display the Graph, since the
rendering coordinates it uses are most likely derived from the coordinates
in the layout attributes installed by this method.
- Specified by:
initialize in class GraphLayoutManager
doLayout
public void doLayout()
- Description copied from class:
GraphLayoutManager
- Calculate a layout for the Graph registered in this GraphLayoutManager.
- Specified by:
doLayout in class GraphLayoutManager
insert
public void insert(GemLayoutManager.VertexAttribute[] attributes)
- Gives the layout a quick initial layout, by inserting the vertices one by
one and moving them (and not the whole graph!) for a few iterations. The
result is an initial layout which, although aesthetically undesirable, is
untangled pretty well and should be easy to get into a reasonable local
minimum.
This method currently completely ignores the current layout of the graph.
addListener
public void addListener(GemLayoutListener listener)
removeListener
public void removeListener(GemLayoutListener listener)
setMaxEffort
public void setMaxEffort(GemLayoutManager.LayoutPhase phase,
double effort)
- Sets the maximum effort that may be put in the specified phase. For the
INSERT phase this is the maximum number of iterations per vertex, and it
is rounded to the nearest integer. For the ARRANGE and the OPTIMIZE phase
this is the maximum number of rounds (loops over all vertices) relative to
the number of vertices.
getMaxEffort
public double getMaxEffort(GemLayoutManager.LayoutPhase phase)
setRandomSeed
public void setRandomSeed(long seed)
getRandomSeed
public long getRandomSeed()
getRound
public int getRound()
setEdgeLength
public void setEdgeLength(int edgeLength)
getEdgeLength
public int getEdgeLength()
setEdgeRepulsionRegion
public void setEdgeRepulsionRegion(int region)
getEdgeRepulsionRegion
public int getEdgeRepulsionRegion()
setMaximumAttraction
public void setMaximumAttraction(int maxAttraction)
getMaximumAttraction
public int getMaximumAttraction()
setMoveStrategy
public void setMoveStrategy(GemLayoutManager.LayoutPhase phase,
GemLayoutManager.MoveStrategy strategy)
getMoveStrategy
public GemLayoutManager.MoveStrategy getMoveStrategy(GemLayoutManager.LayoutPhase phase)
setStartHeat
public void setStartHeat(GemLayoutManager.LayoutPhase phase,
double heat)
getStartHeat
public double getStartHeat(GemLayoutManager.LayoutPhase phase)
setStopHeat
public void setStopHeat(GemLayoutManager.LayoutPhase phase,
double heat)
getStopHeat
public double getStopHeat(GemLayoutManager.LayoutPhase phase)
setMaximumHeat
public void setMaximumHeat(GemLayoutManager.LayoutPhase phase,
double heat)
getMaximumHeat
public double getMaximumHeat(GemLayoutManager.LayoutPhase phase)
setGravity
public void setGravity(GemLayoutManager.LayoutPhase phase,
double gravity)
getGravity
public double getGravity(GemLayoutManager.LayoutPhase phase)
setShake
public void setShake(GemLayoutManager.LayoutPhase phase,
double shake)
getShake
public double getShake(GemLayoutManager.LayoutPhase phase)
setOscillation
public void setOscillation(GemLayoutManager.LayoutPhase phase,
double oscillation)
getOscillation
public double getOscillation(GemLayoutManager.LayoutPhase phase)
setRotation
public void setRotation(GemLayoutManager.LayoutPhase phase,
double rotation)
getRotation
public double getRotation(GemLayoutManager.LayoutPhase phase)
setStartAdaptation
public void setStartAdaptation(GemLayoutManager.LayoutPhase phase,
double adaptation)
getStartAdaptation
public double getStartAdaptation(GemLayoutManager.LayoutPhase phase)
setStopAvgSquaredMovement
public void setStopAvgSquaredMovement(GemLayoutManager.LayoutPhase phase,
double sqrMovement)
getStopAvgSquaredMovement
public double getStopAvgSquaredMovement(GemLayoutManager.LayoutPhase phase)
stop
public void stop()
setAdaptationIncreaseThreshold
public void setAdaptationIncreaseThreshold(double threshold)
getAdaptationIncreaseThreshold
public double getAdaptationIncreaseThreshold()
setAdaptationDecreaseThreshold
public void setAdaptationDecreaseThreshold(double threshold)
getAdaptationDecreaseThreshold
public double getAdaptationDecreaseThreshold()
setAdaptationIncreaseFactor
public void setAdaptationIncreaseFactor(double factor)
getAdaptationIncreaseFactor
public double getAdaptationIncreaseFactor()
setAdaptationDecreaseFactor
public void setAdaptationDecreaseFactor(double factor)
getAdaptationDecreaseFactor
public double getAdaptationDecreaseFactor()
createLayoutConverter
public LayoutConverter createLayoutConverter()
- Description copied from class:
GraphLayoutManager
- Returns a LayoutConverter that allows the rendering mechanism to retrieve
and adapt the layout of a graph, while abstracting from the specified
GraphLayoutManager implementation that is used.
- Specified by:
createLayoutConverter in class GraphLayoutManager
Copyright © 1997-2008 Aduna. All Rights Reserved.