Search in sources :

Example 1 with NodeRealizerIntersectionCalculator

use of y.view.NodeRealizerIntersectionCalculator in project binnavi by google.

the class LayoutFunctions method recalculatePorts.

public static void recalculatePorts(final CanonicMultiStageLayouter layouter, final Graph2D graph) {
    if (layouter instanceof CircularLayouter) {
        // Port correction
        LayoutTool.clipEdgesOnBB(graph);
        // Recalculate ports (necessary for circular proximity nodes)
        final PortCalculator pc = new PortCalculator();
        final NodeRealizerIntersectionCalculator nrics = new NodeRealizerIntersectionCalculator(graph, true);
        graph.addDataProvider(IntersectionCalculator.SOURCE_INTERSECTION_CALCULATOR_DPKEY, nrics);
        final NodeRealizerIntersectionCalculator nrict = new NodeRealizerIntersectionCalculator(graph, false);
        graph.addDataProvider(IntersectionCalculator.TARGET_INTERSECTION_CALCULATOR_DPKEY, nrict);
        pc.doLayout(graph);
    }
}
Also used : CircularLayouter(y.layout.circular.CircularLayouter) PortCalculator(y.layout.PortCalculator) NodeRealizerIntersectionCalculator(y.view.NodeRealizerIntersectionCalculator)

Aggregations

PortCalculator (y.layout.PortCalculator)1 CircularLayouter (y.layout.circular.CircularLayouter)1 NodeRealizerIntersectionCalculator (y.view.NodeRealizerIntersectionCalculator)1