|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.PortCandidate
public class PortCandidate
This class represents a candidate for an edge's ports. It may be a fixed port, where the exact port coordinates are given or a free variant where the coordinates may be chosen arbitrarily. Additionally valid in- respectively outgoing directions may be specified for edges connecting to that PortCandidate's Port and a cost penalty may be specified that indicates the cost associated with the usage of the port.
PortCandidateSet
Field Summary | |
---|---|
static int |
AGAINST_THE_FLOW
Constant indicating a port lying in the opposite direction of the main flow of the edge or overall layout. |
static int |
ANY
A bitwise combination of all possible direction constants. |
static int |
EAST
Constant indicating a port in the east of a node. |
static int |
LEFT_IN_FLOW
Constant indicating a port lying to the left of the direction of the main flow of the edge or overall layout. |
static int |
NORTH
Constant indicating a port in the north of a node. |
static int |
RIGHT_IN_FLOW
Constant indicating a port lying in the right of the direction of the main flow of the edge or overall layout. |
static Object |
SOURCE_PCLIST_DPKEY
DataProvider key that holds a Collection of PortCandidate s for the
source port of each edge. |
static int |
SOUTH
Constant indicating a port in the south of a node. |
static Object |
TARGET_PCLIST_DPKEY
DataProvider key that holds a Collection of PortCandidate s for the
target port of each edge. |
static int |
WEST
Constant indicating a port in the west of a node. |
static int |
WITH_THE_FLOW
Constant indicating a port lying in the direction of the main flow of the edge or overall layout. |
Constructor Summary | |
---|---|
protected |
PortCandidate(double xOffset,
double yOffset,
boolean fixed,
int directionMask,
double cost)
Creates a new instance of PortCandidate using the given values. |
protected |
PortCandidate(double xOffset,
double yOffset,
int directionMask)
Creates a new instance of PortCandidate using the given values. |
protected |
PortCandidate(int directionMask)
Creates a new instance of PortCandidate using the given direction. |
protected |
PortCandidate(int directionMask,
double cost)
Creates a new instance of PortCandidate using the given values. |
Method Summary | |
---|---|
static PortCandidate |
createCandidate(double xOffset,
double yOffset,
int directionMask)
Factory method that returns an instance describing a fixed port with zero cost penalty for the given direction at the given offsets. |
static PortCandidate |
createCandidate(double xOffset,
double yOffset,
int directionMask,
double cost)
Factory method that returns an instance describing a fixed port with the given cost penalty for the given direction at the given offset. |
static PortCandidate |
createCandidate(int directionMask)
Factory method that returns an instance describing a non-fixed port with 0 cost penalty for the given direction. |
static PortCandidate |
createCandidate(int directionMask,
double cost)
Factory method that returns an instance describing a non-fixed port with the given cost penalty for the given direction. |
static PortCandidate |
createCandidate(PortConstraint fromPortConstraint)
Factory method that returns an instance describing a non-fixed port with zero cost penalty for the direction specified by the given PortConstraint |
boolean |
equals(Object other)
Tests for equality based on the internal attributes. |
double |
getCost()
Returns the cost associated with the usage of this PortCandidate. |
int |
getDirection()
Returns the direction mask for this instance. |
int |
getDirectionForLayoutOrientation(byte layoutOrientation)
Returns the direction constant with respect to the given layout orientation . |
double |
getXOffset()
Returns the x offset of the port with respect to the corresponding node's center. |
double |
getXOffsetForLayoutOrientation(byte layoutOrientation)
Yields the X-offset with respect for the given layout orientation . |
double |
getXOffsetForLayoutOrientation(byte layoutOrientation,
int mirrorMask)
Yields the X-offset with respect for the given layout orientation
and OrientationLayouter.getMirrorMask() mirror mask}. |
double |
getYOffset()
Returns the y offset of the port with respect to the corresponding node's center. |
double |
getYOffsetForLayoutOrientation(byte layoutOrientation)
Yields the Y-offset with respect for the given layout orientation . |
double |
getYOffsetForLayoutOrientation(byte layoutOrientation,
int mirrorMask)
Yields the Y-offset with respect for the given layout orientation
and OrientationLayouter.getMirrorMask() mirror mask}. |
int |
hashCode()
|
boolean |
isFixed()
Returns whether this instance describes a fixed or strong port. |
boolean |
isInDirection(int directionMask)
Determines whether this instance lies in the given direction. |
PortConstraint |
toPortConstraint()
A utility method for converting this instance to a PortConstraint |
PortConstraint |
toPortConstraintForLayoutOrientation(byte layoutOrientation)
A utility method for converting this instance to a PortConstraint
interpreted for the given layout orientation . |
String |
toString()
Returns a human-readable string representation of this PortCandidate. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NORTH
public static final int EAST
public static final int WEST
public static final int SOUTH
public static final int WITH_THE_FLOW
public static final int AGAINST_THE_FLOW
public static final int LEFT_IN_FLOW
public static final int RIGHT_IN_FLOW
public static final int ANY
public static final Object SOURCE_PCLIST_DPKEY
DataProvider
key that holds a Collection
of PortCandidate
s for the
source port of each edge.
public static final Object TARGET_PCLIST_DPKEY
DataProvider
key that holds a Collection
of PortCandidate
s for the
target port of each edge.
Constructor Detail |
---|
protected PortCandidate(double xOffset, double yOffset, boolean fixed, int directionMask, double cost)
createCandidate(double, double, int, double)
protected PortCandidate(double xOffset, double yOffset, int directionMask)
createCandidate(double, double, int)
protected PortCandidate(int directionMask)
createCandidate(int)
protected PortCandidate(int directionMask, double cost)
createCandidate(double, double, int, double)
Method Detail |
---|
public boolean isInDirection(int directionMask)
directionMask
- the mask of directions as defined by the constants in this class.
public int getDirection()
getDirectionForLayoutOrientation(byte)
public boolean isFixed()
strong
port.
public double getXOffset()
isFixed()
,
getXOffsetForLayoutOrientation(byte)
public double getYOffset()
isFixed()
,
getXOffsetForLayoutOrientation(byte)
public static PortCandidate createCandidate(int directionMask)
directionMask
- a bitwise combination of the constants in this class.public static PortCandidate createCandidate(int directionMask, double cost)
directionMask
- a bitwise combination of the constants in this class.cost
- the cost to associate with the usage of this portpublic static PortCandidate createCandidate(double xOffset, double yOffset, int directionMask)
directionMask
- a bitwise combination of the constants in this class.xOffset
- the x offsetyOffset
- the y offsetpublic static PortCandidate createCandidate(double xOffset, double yOffset, int directionMask, double cost)
directionMask
- a bitwise combination of the constants in this class.cost
- the cost to associate with the usage of this portxOffset
- the x offsetyOffset
- the y offsetpublic static PortCandidate createCandidate(PortConstraint fromPortConstraint)
PortConstraint
fromPortConstraint
- the port constraint to obtain the direction frompublic int hashCode()
hashCode
in class Object
public PortConstraint toPortConstraint()
PortConstraint
toPortConstraintForLayoutOrientation(byte)
public PortConstraint toPortConstraintForLayoutOrientation(byte layoutOrientation)
PortConstraint
interpreted for the given layout orientation
.
toPortConstraint()
public boolean equals(Object other)
equals
in class Object
public double getCost()
public int getDirectionForLayoutOrientation(byte layoutOrientation)
layout orientation
.
layoutOrientation
- the orientation for which the direction should be interpreted.
getDirection()
with respect to the orientation.getDirection()
public double getXOffsetForLayoutOrientation(byte layoutOrientation, int mirrorMask)
layout orientation
and OrientationLayouter.getMirrorMask()
mirror mask}.
layoutOrientation
- The orientation for which to interpret the x offset.mirrorMask
- The mirror mask for which to interpret the x offset.
getXOffset()
,
getXOffsetForLayoutOrientation(byte)
public double getYOffsetForLayoutOrientation(byte layoutOrientation, int mirrorMask)
layout orientation
and OrientationLayouter.getMirrorMask()
mirror mask}.
layoutOrientation
- The orientation for which to interpret the y offset.mirrorMask
- The mirror mask for which to interpret the y offset.
getYOffset()
,
getYOffsetForLayoutOrientation(byte)
public double getXOffsetForLayoutOrientation(byte layoutOrientation)
layout orientation
.
layoutOrientation
- The orientation for which to interpret the x offset.
getXOffset()
public double getYOffsetForLayoutOrientation(byte layoutOrientation)
layout orientation
.
layoutOrientation
- The orientation for which to interpret the x offset.
getYOffset()
public String toString()
toString
in class Object
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |