Search this API

y.layout
Interface PortCandidateSet.CandidateMatcher

Enclosing class:
PortCandidateSet

public static interface PortCandidateSet.CandidateMatcher

A PortCandidateSet.CandidateMatcher retrieves the best matching entries from a PortCandidateSet.

How well a candidate is matching can be decided based on its cost, its currently available capacity, its offsets or whether or not its direction is consistent with the desired one.

To use custom implementations of this interface, method PortCandidateSet.createMatcher() should be overridden.

 
While the EdgeRouter supports PortCandidateSets, it doesn't support custom PortCandidateSet.CandidateMatcher implementations.
 

Method Summary
 PortCandidateSet.Entry findMatchingCandidate()
          Returns the next best matching PortCandidateSet.Entry.
 PortCandidateSet.Entry findMatchingCandidate(Edge edge, boolean source, double xOffset, double yOffset, int directionMask)
          Returns the next best matching PortCandidateSet.Entry for the given parameters.
 PortCandidateSet.Entry findMatchingCandidate(Edge edge, boolean source, int directionMask)
          Returns the next best matching PortCandidateSet.Entry for the given parameters.
 

Method Detail

findMatchingCandidate

PortCandidateSet.Entry findMatchingCandidate(Edge edge,
                                             boolean source,
                                             double xOffset,
                                             double yOffset,
                                             int directionMask)
Returns the next best matching PortCandidateSet.Entry for the given parameters.

Parameters:
edge - the edge for which to find a candidate
source - true if the given edge connects to its source node, false otherwise
xOffset - the preferred X-offset of the port relative to the center of the node
yOffset - the preferred Y-offset of the port relative to the center of the node
directionMask - any combination of default directions defined in PortCandidate
Returns:
a matching PortCandidateSet.Entry instance

findMatchingCandidate

PortCandidateSet.Entry findMatchingCandidate(Edge edge,
                                             boolean source,
                                             int directionMask)
Returns the next best matching PortCandidateSet.Entry for the given parameters.

Parameters:
edge - the edge for which to find a candidate
source - true if the given edge connects to its source node, false otherwise
directionMask - any combination of default directions defined in PortCandidate
Returns:
a matching PortCandidateSet.Entry instance

findMatchingCandidate

PortCandidateSet.Entry findMatchingCandidate()
Returns the next best matching PortCandidateSet.Entry.

Returns:
a matching PortCandidateSet.Entry instance

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