Search in sources :

Example 1 with NonStupidISOMLayout

use of org.opennms.features.topology.app.internal.jung.ISOMLayoutAlgorithm.NonStupidISOMLayout in project opennms by OpenNMS.

the class RealUltimateLayoutAlgorithm method doISOMLayout.

private static void doISOMLayout(final Layout graphLayout, SparseGraph<VertexRef, EdgeRef> jungGraph, Dimension size) {
    NonStupidISOMLayout layout = new NonStupidISOMLayout(jungGraph, graphLayout);
    layout.setInitializer(initializer(graphLayout));
    layout.setSize(size);
    while (!layout.done()) {
        layout.step();
    }
    for (VertexRef v : jungGraph.getVertices()) {
        graphLayout.setLocation(v, new Point(layout.getX(v), layout.getY(v)));
    }
}
Also used : NonStupidISOMLayout(org.opennms.features.topology.app.internal.jung.ISOMLayoutAlgorithm.NonStupidISOMLayout) Point(org.opennms.features.topology.api.Point) VertexRef(org.opennms.features.topology.api.topo.VertexRef)

Aggregations

Point (org.opennms.features.topology.api.Point)1 VertexRef (org.opennms.features.topology.api.topo.VertexRef)1 NonStupidISOMLayout (org.opennms.features.topology.app.internal.jung.ISOMLayoutAlgorithm.NonStupidISOMLayout)1