Search this API

y.layout.seriesparallel
Class DefaultOutEdgeComparator

java.lang.Object
  extended by y.layout.seriesparallel.DefaultOutEdgeComparator
All Implemented Interfaces:
java.util.Comparator

public class DefaultOutEdgeComparator
extends java.lang.Object
implements java.util.Comparator

DefaultOutEdgeComparator is the default implementation for the out-edge comparator used in SeriesParallelLayouter.

It keeps the order of the edges in the graph for edges without PortConstraints and considers the PortConstraints such that the order of the target nodes of the outgoing edges is similar to the port location at the source node. Note that this won't work for all cases because the target nodes may not be completely independent.

See Also:
SeriesParallelLayouter.getDefaultOutEdgeComparator()
 
Your browser does not support SVG content.

Constructor Summary
DefaultOutEdgeComparator()
          Creates a DefaultOutEdgeComparator instance with default settings.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares the two given edges considering their PortConstraints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DefaultOutEdgeComparator

public DefaultOutEdgeComparator()
Creates a DefaultOutEdgeComparator instance with default settings.

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares the two given edges considering their PortConstraints.

The order of edges is kept unless there are PortConstraints assigned. Then the edges will be sorted to avoid edge crossings.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - the first edge
o2 - the second edge
Returns:
the order of the given two edges

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