Packagecom.yworks.yfiles.layout
Classpublic class PortCandidate
InheritancePortCandidate Inheritance YObject Inheritance Object

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.

See also

com.yworks.yfiles.layout.PortCandidateSet


Public Properties
 PropertyDefined By
  cost : Number
[read-only] Returns the cost associated with the usage of this PortCandidate.
PortCandidate
  direction : int
[read-only] Returns the direction mask for this instance.
PortCandidate
  fixed : Boolean
[read-only] Returns whether this instance describes a fixed or strong (com.yworks.yfiles.layout.PortConstraint.strong) port.
PortCandidate
  xOffset : Number
[read-only] Returns the x offset of the port with respect to the corresponding node's center.
PortCandidate
  yOffset : Number
[read-only] Returns the y offset of the port with respect to the corresponding node's center.
PortCandidate
Public Methods
 MethodDefined By
  
PortCandidate(directionMask:int, init:Boolean = true)
Creates a new instance of PortCandidate using the given direction.
PortCandidate
  
createCandidate(directionMask:int):PortCandidate
[static] Factory method that returns an instance describing a non-fixed port with 0 cost penalty for the given direction.
PortCandidate
  
createCandidateFixed(xOffset:Number, yOffset:Number, directionMask:int):PortCandidate
[static] Factory method that returns an instance describing a fixed port with zero cost penalty for the given direction at the given offsets.
PortCandidate
  
createCandidateFixedWithCost(xOffset:Number, yOffset:Number, directionMask:int, cost:Number):PortCandidate
[static] Factory method that returns an instance describing a fixed port with the given cost penalty for the given direction at the given offset.
PortCandidate
  
[static] Factory method that returns an instance describing a non-fixed port with zero cost penalty for the direction specified by the given com.yworks.yfiles.layout.PortConstraint
PortCandidate
  
createCandidateWithPenalty(directionMask:int, cost:Number):PortCandidate
[static] Factory method that returns an instance describing a non-fixed port with the given cost penalty for the given direction.
PortCandidate
  
equals(other:Object):Boolean
[override] Tests for equality based on the internal attributes.
PortCandidate
  
getClass():Class
[override]
PortCandidate
  
getDirectionForLayoutOrientation(layoutOrientation:int):int
Returns the direction constant with respect to the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).
PortCandidate
  
getXOffsetForLayoutOrientation(layoutOrientation:int):Number
Yields the X-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).
PortCandidate
  
getXOffsetForLayoutOrientationAndMirrorMask(layoutOrientation:int, mirrorMask:int):Number
Yields the X-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation) and mirror mask (com.yworks.yfiles.layout.OrientationLayouter.mirrorMask).
PortCandidate
  
getYOffsetForLayoutOrientation(layoutOrientation:int):Number
Yields the Y-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).
PortCandidate
  
getYOffsetForLayoutOrientationAndMirrorMask(layoutOrientation:int, mirrorMask:int):Number
Yields the Y-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation) and mirror mask (com.yworks.yfiles.layout.OrientationLayouter.mirrorMask).
PortCandidate
  
hashCode():int
[override]
PortCandidate
  
isInDirection(directionMask:int):Boolean
Determines whether this instance lies in the given direction.
PortCandidate
  
A utility method for converting this instance to a com.yworks.yfiles.layout.PortConstraint
PortCandidate
  
A utility method for converting this instance to a com.yworks.yfiles.layout.PortConstraint interpreted for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).
PortCandidate
  
toString():String
Returns a human-readable string representation of this PortCandidate.
PortCandidate
Protected Methods
 MethodDefined By
  
initPortCandidate1(directionMask:int):void
Initializes this object.
PortCandidate
  
initPortCandidate2(directionMask:int, cost:Number):void
Initializes this object.
PortCandidate
  
initPortCandidate3(xOffset:Number, yOffset:Number, directionMask:int):void
Initializes this object.
PortCandidate
  
initPortCandidate4(xOffset:Number, yOffset:Number, fixed:Boolean, directionMask:int, cost:Number):void
Initializes this object.
PortCandidate
  
newPortCandidate1(directionMask:int):PortCandidate
[static] Creates a new instance of PortCandidate using the given direction.
PortCandidate
  
newPortCandidate2(directionMask:int, cost:Number):PortCandidate
[static] Creates a new instance of PortCandidate using the given values.
PortCandidate
  
newPortCandidate3(xOffset:Number, yOffset:Number, directionMask:int):PortCandidate
[static] Creates a new instance of PortCandidate using the given values.
PortCandidate
  
newPortCandidate4(xOffset:Number, yOffset:Number, fixed:Boolean, directionMask:int, cost:Number):PortCandidate
[static] Creates a new instance of PortCandidate using the given values.
PortCandidate
Public Constants
 ConstantDefined By
  AGAINST_THE_FLOW : int = 0x20
[static] Constant indicating a port lying in the opposite direction of the main flow of the edge or overall layout.
PortCandidate
  ANY : int
[static] A bitwise combination of all possible direction constants.
PortCandidate
  EAST : int
[static] Constant indicating a port in the east of a node.
PortCandidate
  LEFT_IN_FLOW : int = 0x40
[static] Constant indicating a port lying to the left of the direction of the main flow of the edge or overall layout.
PortCandidate
  NORTH : int
[static] Constant indicating a port in the north of a node.
PortCandidate
  RIGHT_IN_FLOW : int = 0x80
[static] Constant indicating a port lying in the right of the direction of the main flow of the edge or overall layout.
PortCandidate
  SOURCE_PCLIST_DPKEY : Object = y.layout.PortCandidate.SOURCE_PCLIST_DPKEY
[static] com.yworks.yfiles.base.DataProvider key that holds a com.yworks.bridge.util.Collection of com.yworks.yfiles.layout.PortCandidate s for the source port of each edge.
PortCandidate
  SOUTH : int
[static] Constant indicating a port in the south of a node.
PortCandidate
  TARGET_PCLIST_DPKEY : Object = y.layout.PortCandidate.TARGET_PCLIST_DPKEY
[static] com.yworks.yfiles.base.DataProvider key that holds a com.yworks.bridge.util.Collection of com.yworks.yfiles.layout.PortCandidate s for the target port of each edge.
PortCandidate
  WEST : int
[static] Constant indicating a port in the west of a node.
PortCandidate
  WITH_THE_FLOW : int = 0x10
[static] Constant indicating a port lying in the direction of the main flow of the edge or overall layout.
PortCandidate
Property Detail
costproperty
cost:Number  [read-only]

Returns the cost associated with the usage of this PortCandidate.


Implementation
    public function get cost():Number
directionproperty 
direction:int  [read-only]

Returns the direction mask for this instance.


Implementation
    public function get direction():int

See also

fixedproperty 
fixed:Boolean  [read-only]

Returns whether this instance describes a fixed or strong (com.yworks.yfiles.layout.PortConstraint.strong) port.


Implementation
    public function get fixed():Boolean

See also

xOffsetproperty 
xOffset:Number  [read-only]

Returns the x offset of the port with respect to the corresponding node's center.


Implementation
    public function get xOffset():Number

See also

yOffsetproperty 
yOffset:Number  [read-only]

Returns the y offset of the port with respect to the corresponding node's center.


Implementation
    public function get yOffset():Number

See also

Constructor Detail
PortCandidate()Constructor
public function PortCandidate(directionMask:int, init:Boolean = true)

Creates a new instance of PortCandidate using the given direction. Clients use the factory methods instead.

Parameters
directionMask:int
 
init: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.

See also

Method Detail
createCandidate()method
public static function createCandidate(directionMask:int):PortCandidate

Factory method that returns an instance describing a non-fixed port with 0 cost penalty for the given direction.

Parameters

directionMask:int — a bitwise combination of the constants in this class.

Returns
PortCandidate
createCandidateFixed()method 
public static function createCandidateFixed(xOffset:Number, yOffset:Number, directionMask:int):PortCandidate

Factory method that returns an instance describing a fixed port with zero cost penalty for the given direction at the given offsets.

Parameters

xOffset:Number — the x offset
 
yOffset:Number — the y offset
 
directionMask:int — a bitwise combination of the constants in this class.

Returns
PortCandidate
createCandidateFixedWithCost()method 
public static function createCandidateFixedWithCost(xOffset:Number, yOffset:Number, directionMask:int, cost:Number):PortCandidate

Factory method that returns an instance describing a fixed port with the given cost penalty for the given direction at the given offset.

Parameters

xOffset:Number — the x offset
 
yOffset:Number — the y offset
 
directionMask:int — a bitwise combination of the constants in this class.
 
cost:Number — the cost to associate with the usage of this port

Returns
PortCandidate
createCandidateFromPortConstraint()method 
public static function createCandidateFromPortConstraint(fromPortConstraint:PortConstraint):PortCandidate

Factory method that returns an instance describing a non-fixed port with zero cost penalty for the direction specified by the given com.yworks.yfiles.layout.PortConstraint

Parameters

fromPortConstraint:PortConstraint — the port constraint to obtain the direction from

Returns
PortCandidate

See also

createCandidateWithPenalty()method 
public static function createCandidateWithPenalty(directionMask:int, cost:Number):PortCandidate

Factory method that returns an instance describing a non-fixed port with the given cost penalty for the given direction.

Parameters

directionMask:int — a bitwise combination of the constants in this class.
 
cost:Number — the cost to associate with the usage of this port

Returns
PortCandidate
equals()method 
override public function equals(other:Object):Boolean

Tests for equality based on the internal attributes.

Parameters

other:Object

Returns
Boolean
getClass()method 
override public function getClass():Class

Returns
Class
getDirectionForLayoutOrientation()method 
public function getDirectionForLayoutOrientation(layoutOrientation:int):int

Returns the direction constant with respect to the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).

Parameters

layoutOrientation:int — the orientation for which the direction should be interpreted.

Returns
int — the direction with respect to the orientation.

See also

getXOffsetForLayoutOrientation()method 
public function getXOffsetForLayoutOrientation(layoutOrientation:int):Number

Yields the X-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).

Parameters

layoutOrientation:int — The orientation for which to interpret the x offset.

Returns
Number — The x offset.

See also

getXOffsetForLayoutOrientationAndMirrorMask()method 
public function getXOffsetForLayoutOrientationAndMirrorMask(layoutOrientation:int, mirrorMask:int):Number

Yields the X-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation) and mirror mask (com.yworks.yfiles.layout.OrientationLayouter.mirrorMask).

Parameters

layoutOrientation:int — The orientation for which to interpret the x offset.
 
mirrorMask:int — The mirror mask for which to interpret the x offset.

Returns
Number — The x offset.

See also

getYOffsetForLayoutOrientation()method 
public function getYOffsetForLayoutOrientation(layoutOrientation:int):Number

Yields the Y-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).

Parameters

layoutOrientation:int — The orientation for which to interpret the x offset.

Returns
Number — The y offset.

See also

getYOffsetForLayoutOrientationAndMirrorMask()method 
public function getYOffsetForLayoutOrientationAndMirrorMask(layoutOrientation:int, mirrorMask:int):Number

Yields the Y-offset with respect for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation) and mirror mask (com.yworks.yfiles.layout.OrientationLayouter.mirrorMask).

Parameters

layoutOrientation:int — The orientation for which to interpret the y offset.
 
mirrorMask:int — The mirror mask for which to interpret the y offset.

Returns
Number — The y offset.

See also

hashCode()method 
override public function hashCode():int

Returns
int
initPortCandidate1()method 
protected final function initPortCandidate1(directionMask:int):void

Initializes this object. See the documentation of the corresponding factory method newPortCandidate1() for details.

Parameters

directionMask:int

See also

initPortCandidate2()method 
protected final function initPortCandidate2(directionMask:int, cost:Number):void

Initializes this object. See the documentation of the corresponding factory method newPortCandidate2() for details.

Parameters

directionMask:int
 
cost:Number

See also

initPortCandidate3()method 
protected final function initPortCandidate3(xOffset:Number, yOffset:Number, directionMask:int):void

Initializes this object. See the documentation of the corresponding factory method newPortCandidate3() for details.

Parameters

xOffset:Number
 
yOffset:Number
 
directionMask:int

See also

initPortCandidate4()method 
protected final function initPortCandidate4(xOffset:Number, yOffset:Number, fixed:Boolean, directionMask:int, cost:Number):void

Initializes this object. See the documentation of the corresponding factory method newPortCandidate4() for details.

Parameters

xOffset:Number
 
yOffset:Number
 
fixed:Boolean
 
directionMask:int
 
cost:Number

See also

isInDirection()method 
public function isInDirection(directionMask:int):Boolean

Determines whether this instance lies in the given direction.

Parameters

directionMask:int — the mask of directions as defined by the constants in this class.

Returns
Boolean — whether this instance specifies on of the given directions
newPortCandidate1()method 
protected static function newPortCandidate1(directionMask:int):PortCandidate

Creates a new instance of PortCandidate using the given direction. Clients use the factory methods instead.

Parameters

directionMask:int

Returns
PortCandidate

See also

newPortCandidate2()method 
protected static function newPortCandidate2(directionMask:int, cost:Number):PortCandidate

Creates a new instance of PortCandidate using the given values. Clients use the factory methods instead.

Parameters

directionMask:int
 
cost:Number

Returns
PortCandidate

See also

newPortCandidate3()method 
protected static function newPortCandidate3(xOffset:Number, yOffset:Number, directionMask:int):PortCandidate

Creates a new instance of PortCandidate using the given values. Clients use the factory methods instead.

Parameters

xOffset:Number
 
yOffset:Number
 
directionMask:int

Returns
PortCandidate

See also

newPortCandidate4()method 
protected static function newPortCandidate4(xOffset:Number, yOffset:Number, fixed:Boolean, directionMask:int, cost:Number):PortCandidate

Creates a new instance of PortCandidate using the given values. Clients use the factory methods instead.

Parameters

xOffset:Number
 
yOffset:Number
 
fixed:Boolean
 
directionMask:int
 
cost:Number

Returns
PortCandidate

See also

toPortConstraint()method 
public function toPortConstraint():PortConstraint

A utility method for converting this instance to a com.yworks.yfiles.layout.PortConstraint

Returns
PortConstraint — a PortConstraint that matches this PortCandidate

See also

toPortConstraintForLayoutOrientation()method 
public function toPortConstraintForLayoutOrientation(layoutOrientation:int):PortConstraint

A utility method for converting this instance to a com.yworks.yfiles.layout.PortConstraint interpreted for the given layout orientation (com.yworks.yfiles.layout.OrientationLayouter.orientation).

Parameters

layoutOrientation:int

Returns
PortConstraint — a PortConstraint that matches this PortCandidate

See also

toString()method 
public function toString():String

Returns a human-readable string representation of this PortCandidate.

Returns
String
Constant Detail
AGAINST_THE_FLOWConstant
public static const AGAINST_THE_FLOW:int = 0x20

Constant indicating a port lying in the opposite direction of the main flow of the edge or overall layout. The exact direction is domain specific.

ANYConstant 
public static const ANY:int

A bitwise combination of all possible direction constants.

EASTConstant 
public static const EAST:int

Constant indicating a port in the east of a node.

LEFT_IN_FLOWConstant 
public static const LEFT_IN_FLOW:int = 0x40

Constant indicating a port lying to the left of the direction of the main flow of the edge or overall layout. The exact direction is domain specific.

NORTHConstant 
public static const NORTH:int

Constant indicating a port in the north of a node.

RIGHT_IN_FLOWConstant 
public static const RIGHT_IN_FLOW:int = 0x80

Constant indicating a port lying in the right of the direction of the main flow of the edge or overall layout. The exact direction is domain specific.

SOURCE_PCLIST_DPKEYConstant 
public static const SOURCE_PCLIST_DPKEY:Object = y.layout.PortCandidate.SOURCE_PCLIST_DPKEY

com.yworks.yfiles.base.DataProvider key that holds a com.yworks.bridge.util.Collection of com.yworks.yfiles.layout.PortCandidate s for the source port of each edge.

See also

SOUTHConstant 
public static const SOUTH:int

Constant indicating a port in the south of a node.

TARGET_PCLIST_DPKEYConstant 
public static const TARGET_PCLIST_DPKEY:Object = y.layout.PortCandidate.TARGET_PCLIST_DPKEY

com.yworks.yfiles.base.DataProvider key that holds a com.yworks.bridge.util.Collection of com.yworks.yfiles.layout.PortCandidate s for the target port of each edge.

See also

WESTConstant 
public static const WEST:int

Constant indicating a port in the west of a node.

WITH_THE_FLOWConstant 
public static const WITH_THE_FLOW:int = 0x10

Constant indicating a port lying in the direction of the main flow of the edge or overall layout. The exact direction is domain specific.