|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.Bayesia.positioning.algorithm.SymmetricPositioning
The class SymmetricPositioning is used to compute the positions of the vertices of
a com.Bayesia.positioning.structure.Graph.
The SymmetricPositioning can be created specifying the initial length wanted for the edges of the graph,
if the multi-level option is enabled (this option is very powerful for very large graphs), the convergence thresold,
the repulsion factor and the optimization factor.
The inital edge length indicates what is the length the edges should have after positioning.
If this length is too big for the graph to fit in the available width and heigth, the length is recomputed in order
to fit the graph in the available area. The final length can be retrieved with the method getPreferredEdgeLength().
The convergence thresold indicates the distance allowed for a node to its best location. If you want very precise position, you can use 0.1 for example. A good compromise between performance and precision is to use 1.
The repulsion factor is used only when the multi-level option is enabled. It indicates the repulsion force between two nodes.
The optimization factor indicates the level of optimization of the graph positions. Higher the optimization factor is, better the positioning is.
To listen to the progress of the positioning , a ProgressListener can be added to it.
The start() method can be used in a thread so the algorithm could be stopped with stop().
Please see Graph
Please see ProgressListener
| Constructor Summary | |
SymmetricPositioning(java.lang.String licenseKey,
Graph graph,
double initialEdgeLength,
boolean multiLevel,
double convergenceThresold,
int repulsion,
int optimization)
Create a new SymmetricPositioning on the given Graph with the
specified parameters. |
|
| Method Summary | |
void |
addProgressListener(ProgressListener l)
Adds a listener to the list that's notified each time a change to the progress model occurs. |
double |
getPreferredEdgeLength()
Return the preferred length of the edges in order tofit the available area. |
void |
removeProgressListener(ProgressListener l)
Removes a listener from the list that's notified each time a change to the progress model occurs. |
void |
start()
Start the positioning algorithm. |
void |
stop()
Stop the running positioning algorithm if this one was run in a thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SymmetricPositioning(java.lang.String licenseKey,
Graph graph,
double initialEdgeLength,
boolean multiLevel,
double convergenceThresold,
int repulsion,
int optimization)
SymmetricPositioning on the given Graph with the
specified parameters.
licenseKey - a valid license keygraph - the graph on which the positioning is doneinitialEdgeLength - the preferred initial length of the edgesmultiLevel - true if the multi-level positioning is enabled, false otherwiseconvergenceThresold - the convergence thresold (>0)repulsion - the repulsion fatcor (>0)optimization - the optimization factor (>0)Graph| Method Detail |
public void addProgressListener(ProgressListener l)
l - the ProgressListenerpublic void removeProgressListener(ProgressListener l)
l - the ProgressListenerpublic void start()
Example :
final SymmetricPositioning positioning = new SymmetricPositioning(graph, 100, true, 0.1, 10, 100);
Thread t = new Thread() {
public void run() {
positioning.start();
}
};
t.setPriority(Thread.MIN_PRIORITY);
t.start();
To stop the algorithm before it ends, use the stop method.
stop()public void stop()
start()public double getPreferredEdgeLength()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||