|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.PortConstraint
public class PortConstraint
This class represents a constraint for either a source or target port
of an edge. Objects of type PortConstraint are expected to be returned by
data providers that are registered by the keys defined in the
interface PortConstraintKeys
.
PortConstraint p = PortConstraint.create(PortConstraint.NORTH)
expresses that an edge should connect at the north side of a node. It is
a weak constraint.
On the other hand p = PortConstraint.create(PortConstraint.NORTH, true)
expresses that an edge should not only connect at the north side of a node
but also should use the current port coordinates. This is a strong constraint.
Field Summary | |
---|---|
static byte |
ANY_SIDE
Weak constraint specifier. |
static byte |
EAST
Weak constraint specifier. |
static byte |
NORTH
Weak constraint specifier. |
static byte |
SOUTH
Weak constraint specifier. |
static byte |
WEST
Weak constraint specifier. |
Fields inherited from interface y.layout.PortConstraintKeys |
---|
SOURCE_GROUPID_KEY, SOURCE_PORT_CONSTRAINT_KEY, TARGET_GROUPID_KEY, TARGET_PORT_CONSTRAINT_KEY |
Constructor Summary | |
---|---|
PortConstraint()
Deprecated. Use the factory method create(byte) instead |
|
PortConstraint(byte side)
Deprecated. Use the factory method create(byte) instead |
|
PortConstraint(byte side,
boolean strong)
Deprecated. Use the factory method create(byte, boolean) instead |
Method Summary | |
---|---|
static PortConstraint |
create(byte side)
Creates a weak port constraint. |
static PortConstraint |
create(byte side,
boolean strong)
Creates a port constraint. |
boolean |
equals(Object other)
Tests for equality based on the strong attribute and the side attribute. |
byte |
getSide()
Returns the side of a node at which a port should connect. |
static PortConstraint |
getSPC(LayoutGraph graph,
Edge e)
Returns the source port constraint associated with the given edge. |
static PortConstraint |
getTPC(LayoutGraph graph,
Edge e)
Returns the target port constraint associated with the given edge. |
int |
hashCode()
|
static boolean |
hasPC(LayoutGraph graph,
Edge e)
Returns whether or not there are non-trivial source or target port constraints associated with the given edge. |
static boolean |
hasSPC(LayoutGraph graph,
Edge e)
Returns whether or not there is a non-trivial source port constraint associated with the given edge. |
static boolean |
hasTPC(LayoutGraph graph,
Edge e)
Returns whether or not there is a non-trivial target port constraint associated with the given edge. |
boolean |
isAtAnySide()
Returns whether or not this port constraint has the weak constraint side ANY_SIDE associated
with it. |
boolean |
isAtEast()
Returns whether or not this port constraint has the weak constraint side EAST associated
with it. |
boolean |
isAtNorth()
Returns whether or not this port constraint has the weak constraint side NORTH associated
with it. |
boolean |
isAtSouth()
Returns whether or not this port constraint has the weak constraint side SOUTH associated
with it. |
boolean |
isAtWest()
Returns whether or not this port constraint has the weak constraint side WEST associated
with it. |
boolean |
isStrong()
Returns true if this PortConstraint represents
a strong constraint and false otherwise. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte ANY_SIDE
public static final byte NORTH
public static final byte SOUTH
public static final byte EAST
public static final byte WEST
Constructor Detail |
---|
public PortConstraint()
create(byte)
instead
public PortConstraint(byte side)
create(byte)
instead
side
- weak constraint specifier. One of ANY_SIDE
, NORTH
,
SOUTH
, EAST
or WEST
.public PortConstraint(byte side, boolean strong)
create(byte, boolean)
instead
side
- weak constraint specifier. One of ANY_SIDE
, NORTH
,
SOUTH
, EAST
or WEST
.strong
- whether the layouter should use the current port coordinates
(strong constraint)Method Detail |
---|
public boolean isStrong()
true
if this PortConstraint
represents
a strong constraint and false
otherwise.
public byte getSide()
ANY_SIDE
, NORTH
,
SOUTH
, EAST
or WEST
.public boolean isAtNorth()
NORTH
associated
with it.
public boolean isAtSouth()
SOUTH
associated
with it.
public boolean isAtEast()
EAST
associated
with it.
public boolean isAtWest()
WEST
associated
with it.
public boolean isAtAnySide()
ANY_SIDE
associated
with it.
public static boolean hasPC(LayoutGraph graph, Edge e)
PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY
and PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY
are used to lookup the data providers in the given graph.
public static boolean hasSPC(LayoutGraph graph, Edge e)
PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY
is used to lookup the source port constraint data
provider in the given graph.
public static boolean hasTPC(LayoutGraph graph, Edge e)
PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY
is used to lookup the source port constraint data
provider in the given graph.
public static PortConstraint getSPC(LayoutGraph graph, Edge e)
PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY
is used to lookup the source port constraint data
provider in the given graph.
public static PortConstraint getTPC(LayoutGraph graph, Edge e)
PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY
is used to lookup the source port constraint data
provider in the given graph.
public static PortConstraint create(byte side)
side
- One of ANY_SIDE
, NORTH
,
SOUTH
, EAST
or WEST
.public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public static PortConstraint create(byte side, boolean strong)
side
- One of ANY_SIDE
, NORTH
, SOUTH
, EAST
or WEST
.strong
- defines whether it is a strong or weak PortConstraint.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 |