|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.DefaultPortAllocator
public class DefaultPortAllocator
Default implementation of the PortAllocator interface.
Constructor Summary | |
---|---|
DefaultPortAllocator()
Creates a new instance of DefaultPortAllocator with default settings |
Method Summary | |
---|---|
void |
assignPorts(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp,
ItemFactory itemFactory)
Assigns the port positions for the drawer. |
double |
getDefaultPortBorderGapRatio()
Returns the default port to border gap ratio. |
protected double |
getPortBorderGap(LayoutGraph graph,
LayoutDataProvider ldp,
Node node,
int sideIndex,
double sideLength,
int edgeCount)
Callback method used to determine the port border gap for each node and side. |
protected double |
getPortBorderGapRatio(LayoutGraph graph,
LayoutDataProvider ldp,
Node node,
int sideIndex,
double sideLength,
int edgeCount)
Callback method used to determine the port border gap ratio. |
protected double |
getPortDistanceDelta(LayoutGraph graph,
LayoutDataProvider ldp,
Node node,
int sideIndex,
double sideLength,
int edgeCount,
double portBorderGap)
Callback method used to determine the distance between two adjacent ports |
void |
setDefaultPortBorderGapRatio(double defaultPortBorderGapRatio)
Sets for default port to border gap ratio. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultPortAllocator()
setDefaultPortBorderGapRatio(double)
Method Detail |
---|
public void assignPorts(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
PortConstraint.ANY_SIDE
ports to appropriate sides.
Assigns weak
ports to appropriate positions between strong ones
assignPorts
in interface PortAllocator
graph
- the graphlayers
- the layeringldp
- the LayoutDataProvider that can be used to query informationitemFactory
- the ItemFactory that can be used for temporarily altering the graphprotected double getPortBorderGap(LayoutGraph graph, LayoutDataProvider ldp, Node node, int sideIndex, double sideLength, int edgeCount)
graph
- the graphldp
- the LayoutDataProvider that can be used to query information fromnode
- the nodesideIndex
- the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts)sideLength
- the width/height of the sideedgeCount
- the number of edges/port that connect to this side
getPortDistanceDelta(LayoutGraph, LayoutDataProvider, Node, int, double, int, double)
protected double getPortDistanceDelta(LayoutGraph graph, LayoutDataProvider ldp, Node node, int sideIndex, double sideLength, int edgeCount, double portBorderGap)
graph
- the graphldp
- the LayoutDataProvider that can be used to query information fromnode
- the nodesideIndex
- the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts)sideLength
- the width/height of the sideedgeCount
- the number of edges/port that connect to this sideportBorderGap
- the previously calculated port border gap
protected double getPortBorderGapRatio(LayoutGraph graph, LayoutDataProvider ldp, Node node, int sideIndex, double sideLength, int edgeCount)
setDefaultPortBorderGapRatio(double)
for an explanation.
This implementation returns the same value as getDefaultPortBorderGapRatio()
does.
graph
- the graphldp
- the LayoutDataProvider that can be used to query information fromnode
- the nodesideIndex
- the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts)sideLength
- the width/height of the sideedgeCount
- the number of edges/port that connect to this side
public double getDefaultPortBorderGapRatio()
setDefaultPortBorderGapRatio(double)
public void setDefaultPortBorderGapRatio(double defaultPortBorderGapRatio)
0.0d
results in ports being
placed directly on the corner of the node (if there is more than one port).
The default value of 0.5d
results in ports being distributed
along the side of the node so that the distance between the corner of the node
and the first port is half as wide as the distance between two adjacent ports.
A value of Double.POSITIVE_INFINITY
results in all ports being
centered at the side in one point.
defaultPortBorderGapRatio
- the new ratio
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |