Package | com.yworks.yfiles.layout.seriesparallel |
Class | public class DefaultPortAssignment |
Inheritance | DefaultPortAssignment YObject Object |
Implements | PortAssignment |
If com.yworks.yfiles.layout.PortConstraint s are specified the strong PortConstraints
are handled separately and keep their initial location relative to the node while weak PortConstraints
just influence on which side the port is placed.
If there are edge groups specified the edges which belong to the same group get the same port locations.
See also
Property | Defined By | ||
---|---|---|---|
borderGapToPortGapRatio : Number
Specifies the ratio of the gap between the border of the node and the next port and the gap between the ports. | DefaultPortAssignment | ||
forkStyle : int
Specifies the fork style which influences the port assignment. | DefaultPortAssignment | ||
mode : int
Specifies the port assignment mode. | DefaultPortAssignment |
Method | Defined By | ||
---|---|---|---|
DefaultPortAssignment(init:Boolean = true)
Creates a new DefaultPortAssignment instance using mode PORT_ASSIGNMENT_MODE_CENTER. | DefaultPortAssignment | ||
DefaultPortAssignment | |||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | DefaultPortAssignment | ||
hashCode():int | YObject | ||
[static]
Creates a new DefaultPortAssignment instance using mode PORT_ASSIGNMENT_MODE_CENTER. | DefaultPortAssignment | ||
[static]
Creates a new DefaultPortAssignment instance using the given mode and the default value for the ratio of the gap between the border and the ports and the gap between the ports themselves. | DefaultPortAssignment | ||
newDefaultPortAssignment3(mode:int, ratio:Number):DefaultPortAssignment [static]
Creates a new DefaultPortAssignment instance using the given mode and a given value for the ratio of the gap between the border and the ports (borderGapToPortGapRatio) and the gap between the ports themselves. | DefaultPortAssignment |
Method | Defined By | ||
---|---|---|---|
getPortBorderGap(sideLength:Number, edgeCount:int):Number
Callback method used to determine the port border gap for each node and side. | DefaultPortAssignment | ||
getPortDistanceDelta(sideLength:Number, edgeCount:int, portBorderGap:Number):Number
Callback method used to determine the distance between two adjacent ports
| DefaultPortAssignment | ||
initDefaultPortAssignment1():void
Initializes this object. | DefaultPortAssignment | ||
initDefaultPortAssignment2(mode:int):void
Initializes this object. | DefaultPortAssignment | ||
initDefaultPortAssignment3(mode:int, ratio:Number):void
Initializes this object. | DefaultPortAssignment |
Constant | Defined By | ||
---|---|---|---|
FORK_STYLE_AT_NODE : int = 1 [static]
Constant that describes fork style on a node. | DefaultPortAssignment | ||
FORK_STYLE_OUTSIDE_NODE : int = 0 [static]
Constant that describes a fork style outside a node. | DefaultPortAssignment | ||
PORT_ASSIGNMENT_MODE_CENTER : int = 0 [static]
Mode constant describing the strategy where ports are reset to the center of their nodes unless their are strong com.yworks.yfiles.layout.PortConstraint s registered which will be kept. | DefaultPortAssignment | ||
PORT_ASSIGNMENT_MODE_DISTRIBUTED : int = 1 [static]
Mode constant describing the strategy where the ports of incoming and outgoing edges are distributed evenly at the side of their nodes. | DefaultPortAssignment |
borderGapToPortGapRatio | property |
borderGapToPortGapRatio:Number
Specifies the ratio of the gap between the border of the node and the next port and the gap between the ports.
For example, 0.5
sets the border gap as wide as half the gap between the ports. Thus, the lower the value is, the wider "spread" the ports at the side of the node.
Note: This setting is only useful for distributed port assignment.
public function get borderGapToPortGapRatio():Number
public function set borderGapToPortGapRatio(value:Number):void
forkStyle | property |
forkStyle:int
Specifies the fork style which influences the port assignment.
If the fork style is set to FORK_STYLE_OUTSIDE_NODE, edges without port constraints will be assigned in flow direction.
If the fork style is set to FORK_STYLE_AT_NODE the ports of edges in flow direction also get distributed to the sides unless they are without bends. Note that edges may overlap due to large minimum first/last segment lengths.
public function get forkStyle():int
public function set forkStyle(value:int):void
See also
mode | property |
mode:int
Specifies the port assignment mode. Possible values are
public function get mode():int
public function set mode(value:int):void
See also
DefaultPortAssignment | () | Constructor |
public function DefaultPortAssignment(init:Boolean = true)
Creates a new DefaultPortAssignment instance using mode PORT_ASSIGNMENT_MODE_CENTER.
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.
|
See also
assignPorts | () | method |
public function assignPorts(graph:LayoutGraph, node:Node):void
Parameters
graph:LayoutGraph | |
node:Node |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getPortBorderGap | () | method |
protected function getPortBorderGap(sideLength:Number, edgeCount:int):Number
Callback method used to determine the port border gap for each node and side.
Parameters
sideLength:Number — the width/height of the side
| |
edgeCount:int — the number of edges/port that connect to this side
|
Number — the absolute gap to be used on both sides of the ports
|
getPortDistanceDelta | () | method |
protected function getPortDistanceDelta(sideLength:Number, edgeCount:int, portBorderGap:Number):Number
Callback method used to determine the distance between two adjacent ports
Parameters
sideLength:Number — the width/height of the side
| |
edgeCount:int — the number of edges/port that connect to this side
| |
portBorderGap:Number — the previously calculated port border gap
|
Number — the absolute distance to be used between two adjacent ports
|
initDefaultPortAssignment1 | () | method |
protected final function initDefaultPortAssignment1():void
Initializes this object. See the documentation of the corresponding factory method newDefaultPortAssignment1()
for details.
See also
initDefaultPortAssignment2 | () | method |
protected final function initDefaultPortAssignment2(mode:int):void
Initializes this object. See the documentation of the corresponding factory method newDefaultPortAssignment2()
for details.
Parameters
mode:int |
See also
initDefaultPortAssignment3 | () | method |
protected final function initDefaultPortAssignment3(mode:int, ratio:Number):void
Initializes this object. See the documentation of the corresponding factory method newDefaultPortAssignment3()
for details.
Parameters
mode:int | |
ratio:Number |
See also
newDefaultPortAssignment1 | () | method |
public static function newDefaultPortAssignment1():DefaultPortAssignment
Creates a new DefaultPortAssignment instance using mode PORT_ASSIGNMENT_MODE_CENTER.
ReturnsDefaultPortAssignment |
See also
newDefaultPortAssignment2 | () | method |
public static function newDefaultPortAssignment2(mode:int):DefaultPortAssignment
Creates a new DefaultPortAssignment instance using the given mode and the default value for the ratio of the gap between the border and the ports and the gap between the ports themselves.
The default value is 0.5. Possible values for mode
are:
Parameters
mode:int |
DefaultPortAssignment |
See also
newDefaultPortAssignment3 | () | method |
public static function newDefaultPortAssignment3(mode:int, ratio:Number):DefaultPortAssignment
Creates a new DefaultPortAssignment instance using the given mode and a given value for the ratio of the gap between the border and the ports (borderGapToPortGapRatio) and the gap between the ports themselves.
Possible values for mode
are:
Parameters
mode:int | |
ratio:Number |
DefaultPortAssignment |
See also
FORK_STYLE_AT_NODE | Constant |
public static const FORK_STYLE_AT_NODE:int = 1
Constant that describes fork style on a node. Edges leave/enter the nodes south/north if they are straight (no bends) or east and west of the node.
FORK_STYLE_OUTSIDE_NODE | Constant |
public static const FORK_STYLE_OUTSIDE_NODE:int = 0
Constant that describes a fork style outside a node. Edges leave/enter the nodes south/north and bend between their source and target.
PORT_ASSIGNMENT_MODE_CENTER | Constant |
public static const PORT_ASSIGNMENT_MODE_CENTER:int = 0
Mode constant describing the strategy where ports are reset to the center of their nodes unless their are strong com.yworks.yfiles.layout.PortConstraint s registered which will be kept.
See also
PORT_ASSIGNMENT_MODE_DISTRIBUTED | Constant |
public static const PORT_ASSIGNMENT_MODE_DISTRIBUTED:int = 1
Mode constant describing the strategy where the ports of incoming and outgoing edges are distributed evenly at the side of their nodes.
The source ports of edges without com.yworks.yfiles.layout.PortConstraint s will be distributed at the sides of their source and target nodes. Edges with weak PortConstraint
s are distributed at the side of the nodes that is specified in the PortConstraint
. Strong PortConstraint
s are excluded from the even distribution to keep their port locations.
Grouped edges will get the same port location.
See also