Package | com.yworks.yfiles.layout |
Class | public class PortConstraint |
Inheritance | PortConstraint YObject Object |
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.
See also
Property | Defined By | ||
---|---|---|---|
atAnySide : Boolean [read-only]
Returns whether or not this port constraint has the weak constraint side ANY_SIDE associated with it. | PortConstraint | ||
atEast : Boolean [read-only]
Returns whether or not this port constraint has the weak constraint side EAST associated with it. | PortConstraint | ||
atNorth : Boolean [read-only]
Returns whether or not this port constraint has the weak constraint side NORTH associated with it. | PortConstraint | ||
atSouth : Boolean [read-only]
Returns whether or not this port constraint has the weak constraint side SOUTH associated with it. | PortConstraint | ||
atWest : Boolean [read-only]
Returns whether or not this port constraint has the weak constraint side WEST associated with it. | PortConstraint | ||
side : int [read-only]
Returns the side of a node at which a port should connect. | PortConstraint | ||
strong : Boolean [read-only]
Returns true if this PortConstraint represents a strong constraint and false otherwise. | PortConstraint |
Method | Defined By | ||
---|---|---|---|
PortConstraint(init:Boolean = true)
Creates the empty constraint, that allows ports to connect at any side of a node. | PortConstraint | ||
create(side:int, strong:Boolean):PortConstraint [static]
Creates a port constraint. | PortConstraint | ||
createWeak(side:int):PortConstraint [static]
Creates a weak port constraint. | PortConstraint | ||
equals(other:Object):Boolean [override]
Tests for equality based on the strong attribute and the side attribute. | PortConstraint | ||
getClass():Class [override] | PortConstraint | ||
[static]
Returns the source port constraint associated with the given edge. | PortConstraint | ||
[static]
Returns the target port constraint associated with the given edge. | PortConstraint | ||
hashCode():int [override] | PortConstraint | ||
[static]
Returns whether or not there are non-trivial source or target port constraints associated with the given edge. | PortConstraint | ||
[static]
Returns whether or not there is a non-trivial source port constraint associated with the given edge. | PortConstraint | ||
[static]
Returns whether or not there is a non-trivial target port constraint associated with the given edge. | PortConstraint | ||
[static]
Creates the empty constraint, that allows ports to connect at any side of a node. | PortConstraint | ||
newPortConstraint2(side:int):PortConstraint [static]
Creates the weak constraint, that allows ports to connect to a specific side of a node. | PortConstraint | ||
newPortConstraint3(side:int, strong:Boolean):PortConstraint [static]
Creates a constraint, that allows ports to connect to a specific side of a node. | PortConstraint | ||
toString():String
Returns a string representation of this object. | PortConstraint |
Method | Defined By | ||
---|---|---|---|
initPortConstraint1():void
Initializes this object. | PortConstraint | ||
initPortConstraint2(side:int):void
Initializes this object. | PortConstraint | ||
initPortConstraint3(side:int, strong:Boolean):void
Initializes this object. | PortConstraint |
Constant | Defined By | ||
---|---|---|---|
ANY_SIDE : int = 0x0 [static]
Weak constraint specifier. | PortConstraint | ||
EAST : int = 0x4 [static]
Weak constraint specifier. | PortConstraint | ||
NORTH : int = 0x1 [static]
Weak constraint specifier. | PortConstraint | ||
SOUTH : int = 0x2 [static]
Weak constraint specifier. | PortConstraint | ||
WEST : int = 0x8 [static]
Weak constraint specifier. | PortConstraint |
atAnySide | property |
atAnySide:Boolean
[read-only] Returns whether or not this port constraint has the weak constraint side ANY_SIDE associated with it.
public function get atAnySide():Boolean
See also
atEast | property |
atEast:Boolean
[read-only] Returns whether or not this port constraint has the weak constraint side EAST associated with it.
public function get atEast():Boolean
See also
atNorth | property |
atNorth:Boolean
[read-only] Returns whether or not this port constraint has the weak constraint side NORTH associated with it.
public function get atNorth():Boolean
See also
atSouth | property |
atSouth:Boolean
[read-only] Returns whether or not this port constraint has the weak constraint side SOUTH associated with it.
public function get atSouth():Boolean
See also
atWest | property |
atWest:Boolean
[read-only] Returns whether or not this port constraint has the weak constraint side WEST associated with it.
public function get atWest():Boolean
See also
side | property |
side:int
[read-only] Returns the side of a node at which a port should connect.
public function get side():int
See also
strong | property |
strong:Boolean
[read-only]
Returns true
if this PortConstraint
represents a strong constraint and false
otherwise.
public function get strong():Boolean
PortConstraint | () | Constructor |
public function PortConstraint(init:Boolean = true)
Creates the empty constraint, that allows ports to connect at any side of a node.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
create | () | method |
public static function create(side:int, strong:Boolean):PortConstraint
Creates a port constraint. The boolean value defines whether it is a strong or weak one.
Parameters
side:int — One of ANY_SIDE, NORTH, SOUTH, EAST or WEST .
| |
strong:Boolean — defines whether it is a strong or weak PortConstraint.
|
PortConstraint |
See also
createWeak | () | method |
public static function createWeak(side:int):PortConstraint
Creates a weak port constraint.
Parameters
side:int — One of ANY_SIDE, NORTH, SOUTH, EAST or WEST .
|
PortConstraint |
See also
equals | () | method |
override public function equals(other:Object):Boolean
Tests for equality based on the strong attribute and the side attribute.
Parameters
other:Object |
Boolean |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getSPC | () | method |
public static function getSPC(graph:LayoutGraph, e:Edge):PortConstraint
Returns the source port constraint associated with the given edge. The data provider key com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY is used to lookup the source port constraint data provider in the given graph.
Parameters
graph:LayoutGraph | |
e:Edge |
PortConstraint |
See also
getTPC | () | method |
public static function getTPC(graph:LayoutGraph, e:Edge):PortConstraint
Returns the target port constraint associated with the given edge. The data provider key com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY is used to lookup the source port constraint data provider in the given graph.
Parameters
graph:LayoutGraph | |
e:Edge |
PortConstraint |
See also
hashCode | () | method |
override public function hashCode():int
Returnsint |
hasPC | () | method |
public static function hasPC(graph:LayoutGraph, e:Edge):Boolean
Returns whether or not there are non-trivial source or target port constraints associated with the given edge. The data provider keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY and com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY are used to lookup the data providers in the given graph.
Parameters
graph:LayoutGraph | |
e:Edge |
Boolean |
See also
hasSPC | () | method |
public static function hasSPC(graph:LayoutGraph, e:Edge):Boolean
Returns whether or not there is a non-trivial source port constraint associated with the given edge. The data provider key com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY is used to lookup the source port constraint data provider in the given graph.
Parameters
graph:LayoutGraph | |
e:Edge |
Boolean |
See also
hasTPC | () | method |
public static function hasTPC(graph:LayoutGraph, e:Edge):Boolean
Returns whether or not there is a non-trivial target port constraint associated with the given edge. The data provider key com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY is used to lookup the source port constraint data provider in the given graph.
Parameters
graph:LayoutGraph | |
e:Edge |
Boolean |
See also
initPortConstraint1 | () | method |
protected final function initPortConstraint1():void
Initializes this object. See the documentation of the corresponding factory method newPortConstraint1()
for details.
See also
initPortConstraint2 | () | method |
protected final function initPortConstraint2(side:int):void
Initializes this object. See the documentation of the corresponding factory method newPortConstraint2()
for details.
Parameters
side:int |
See also
initPortConstraint3 | () | method |
protected final function initPortConstraint3(side:int, strong:Boolean):void
Initializes this object. See the documentation of the corresponding factory method newPortConstraint3()
for details.
Parameters
side:int | |
strong:Boolean |
See also
newPortConstraint1 | () | method |
public static function newPortConstraint1():PortConstraint
Creates the empty constraint, that allows ports to connect at any side of a node.
ReturnsPortConstraint |
newPortConstraint2 | () | method |
public static function newPortConstraint2(side:int):PortConstraint
Creates the weak constraint, that allows ports to connect to a specific side of a node.
Parameters
side:int — weak constraint specifier. One of ANY_SIDE, NORTH, SOUTH, EAST or WEST.
|
PortConstraint |
See also
newPortConstraint3 | () | method |
public static function newPortConstraint3(side:int, strong:Boolean):PortConstraint
Creates a constraint, that allows ports to connect to a specific side of a node.
Parameters
side:int — weak constraint specifier. One of ANY_SIDE, NORTH, SOUTH, EAST or WEST.
| |
strong:Boolean — whether the layouter should use the current port coordinates (strong constraint)
|
PortConstraint |
See also
toString | () | method |
public function toString():String
Returns a string representation of this object.
ReturnsString |
ANY_SIDE | Constant |
public static const ANY_SIDE:int = 0x0
Weak constraint specifier. Indicates that any side of the node will do for the port direction.
EAST | Constant |
public static const EAST:int = 0x4
Weak constraint specifier. Indicates that a port has to connect at the east side (i.e. right side) of a node.
NORTH | Constant |
public static const NORTH:int = 0x1
Weak constraint specifier. Indicates that a port has to connect at the north side (i.e. top side) of a node.
SOUTH | Constant |
public static const SOUTH:int = 0x2
Weak constraint specifier. Indicates that a port has to connect at the south side (i.e. bottom side) of a node.
WEST | Constant |
public static const WEST:int = 0x8
Weak constraint specifier. Indicates that a port has to connect at the west side (i.e. left side) of a node.