Search this API

y.layout.hierarchic
Class PortAssignment

java.lang.Object
  extended by y.layout.hierarchic.PortAssignment

public class PortAssignment
extends java.lang.Object

This class assigns port coordinates to the edges of a graph.

 
Your browser does not support SVG content.

Constructor Summary
PortAssignment()
          Creates a new PortAssignment instance.
 
Method Summary
static void assignPorts(LayoutGraph graph, DataProvider dummyMap, java.util.Comparator inComp, java.util.Comparator outComp)
          Assigns port coordinates to the edges.
static void assignPorts(LayoutGraph graph, NodeList[] layerLists, DataProvider dummyMap)
          Assigns port coordinates to the edges of a graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortAssignment

public PortAssignment()
Creates a new PortAssignment instance.

Method Detail

assignPorts

public static void assignPorts(LayoutGraph graph,
                               NodeList[] layerLists,
                               DataProvider dummyMap)
Assigns port coordinates to the edges of a graph.

It is assumed that all incoming edges of a node connect at its top side and all outgoing edges leave at its bottom side.

Port assignment will be such that the ports will be spread evenly at top and bottom sides of the nodes. Ports will be assigned such that no unnecessary edge crossings will be introduced.

Parameters:
graph - the input graph whose edges need port assignment
layerLists - an array of NodeLists containing nodes that belong to the same layer
dummyMap - the DataProvider that returns an object (the original edge) for each dummy node or null for real nodes

assignPorts

public static void assignPorts(LayoutGraph graph,
                               DataProvider dummyMap,
                               java.util.Comparator inComp,
                               java.util.Comparator outComp)
Assigns port coordinates to the edges.

It is assumed that all incoming edges of a node connect at its top side and all outgoing edges leave at its bottom side.

Port assignment will be such that the ports will be spread evenly at top and bottom sides of the nodes. Ports will be assigned according to the given Comparators.

Parameters:
graph - the input graph whose edges need port assignment
dummyMap - the DataProvider that returns an object (the original edge) for each dummy node or null for real nodes
inComp - a Comparator defining an ordering for the incoming edges
outComp - a Comparator defining an ordering for the outgoing edges

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.