|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.tree.DefaultPortAssignment
public class DefaultPortAssignment
This class provides simple default port assignment strategies.

| Field Summary | |
|---|---|
static byte |
MODE_NONE
Mode constant describing the strategy where all ports are reset to the center of their nodes. |
static byte |
MODE_PORT_CONSTRAINTS
Mode constant describing the strategy where edges having a weak port constraint, i.e., effectively a side constraint, will be anchored at the center of that side no port constraint set will be anchored at the center of the node Edges having a strong port constraint are anchored at that coordinates. |
| Constructor Summary | |
|---|---|
DefaultPortAssignment()
Creates a new DefaultPortAssignment instance using mode MODE_NONE. |
|
DefaultPortAssignment(byte mode)
Creates a new DefaultPortAssignment instance using the given mode. |
|
| Method Summary | |
|---|---|
protected void |
assignChildEdgeSourcePort(LayoutGraph graph,
Node node,
Edge edge,
int index)
This method assigns the source port of an edge that goes to a child node. |
protected void |
assignParentEdgeTargetPort(LayoutGraph graph,
Node node,
Edge edge)
This method assigns the target port of the edge that goes to the parent node. |
void |
assignPorts(LayoutGraph graph,
Node node)
Called by GenericTreeLayouter before the actual layout
of the graph takes place. |
byte |
getMode()
Gets the current mode constant. |
protected PortConstraint |
getSourcePortConstraint(LayoutGraph graph,
Edge edge,
int index)
Returns the PortConstraint for the given edge or null if no
PortConstraint is set. |
protected PortConstraint |
getTargetPortConstraint(LayoutGraph graph,
Edge edge)
Returns the PortConstraint for the given edge or null if no
PortConstraint is set. |
void |
setMode(byte mode)
Sets the new mode constant. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte MODE_PORT_CONSTRAINTS
public static final byte MODE_NONE
| Constructor Detail |
|---|
public DefaultPortAssignment()
MODE_NONE.
public DefaultPortAssignment(byte mode)
mode are MODE_NONE and MODE_PORT_CONSTRAINTS.
| Method Detail |
|---|
public void assignPorts(LayoutGraph graph,
Node node)
PortAssignmentGenericTreeLayouter before the actual layout
of the graph takes place. This method assigns both the single
incoming edge's target port as well as all source ports for all
outgoing child edges. Note that at the time this method gets invoked,
GenericTreeLayouter may have reversed some edges in order to normalize the
tree structure.
assignPorts in interface PortAssignmentgraph - the graph instance the node is part ofnode - the node whose adjacent edges' ports should be set
protected void assignParentEdgeTargetPort(LayoutGraph graph,
Node node,
Edge edge)
graph - the graph which contains the nodenode - the nodeedge - the edge to the parent node
protected void assignChildEdgeSourcePort(LayoutGraph graph,
Node node,
Edge edge,
int index)
graph - the graph which contains the nodenode - the parent nodeedge - the edge to the child nodeindex - the zero-based index of the child edge
protected PortConstraint getSourcePortConstraint(LayoutGraph graph,
Edge edge,
int index)
null if no
PortConstraint is set. This implementation uses the PortConstraint data provider
that is bound to the graph, if available.
graph - the graph the edge is part ofedge - the edge whose PortConstraint is to be determinedindex - the child's index
null
protected PortConstraint getTargetPortConstraint(LayoutGraph graph,
Edge edge)
null if no
PortConstraint is set. This implementation uses the PortConstraint data provider
that is bound to the graph, if available.
graph - the graph the edge is part ofedge - the edge whose PortConstraint is to be determined
nullpublic byte getMode()
MODE_NONE and MODE_PORT_CONSTRAINTS.
public void setMode(byte mode)
MODE_NONE and MODE_PORT_CONSTRAINTS.
mode - the new mode
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||