|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.klodd.hierarchical.structures.LayerElement
public class LayerElement
A layer element representing a node or a long edge in the layered graph.
Field Summary | |
---|---|
static int |
UNDEF_RANK
value to use if the rank is undefined. |
Constructor Summary | |
---|---|
LayerElement(KGraphElement obj,
Layer thelayer,
KSlimNode thekNode)
Creates a layer element in an existing layer. |
Method Summary | |
---|---|
void |
addOutgoing(KEdge edge,
LayerElement target)
Adds a new cross-layer connection with given target. |
void |
addOutgoing(KEdge edge,
LayerElement target,
KPort sourcePort,
KPort targetPort)
Adds a new cross-layer connection with given target. |
void |
applyLayout(KPoint offset,
KInsets insets)
Applies the layout of this layer element to the contained object and updates position information according to given offset values. |
void |
clearPortRanks()
Clears the internal map of port ranks. |
List<Integer> |
getConnectionRanks(boolean forward)
Gets a list of combined element and port ranks for all incoming or for all outgoing connections. |
Map<KPort,List<Integer>> |
getConnectionRanksByPort(boolean forward)
Gets a list of combined element and port ranks of connections sorted by the port to which the connection is attached. |
int |
getEdgesBack()
Gets the number of edges that are routed in the back of this element. |
int |
getEdgesFront()
Gets the number of edges that are routed in front of this element. |
KGraphElement |
getElemObj()
Gets the object contained in this layer element. |
List<LayerConnection> |
getIncomingConnections()
Gets the list of incoming layer connections. |
KSlimNode |
getKNode()
Gets the KIELER node associated with this layer element. |
Layer |
getLayer()
Get the containing layer. |
LinearSegment |
getLinearSegment()
Returns the linear segment. |
List<ElementLoop> |
getLoops()
Gets the loops of this layer element. |
List<LayerConnection> |
getOutgoingConnections()
Gets the list of outgoing connections. |
List<KSlimEdge> |
getOutgoingEdges()
Gets the outgoing edges of the contained object. |
PortConstraints |
getPortConstraints()
Gets the port constraints for this layer element. |
int |
getPortRank(KPort port,
boolean forward)
Gets the port rank for a given port. |
KPoint |
getPosition()
Gets the current position of this layer element. |
KPoint |
getPosOffset()
Gets the current position offset of the contained node, or null
if the contained object is not a node. |
int |
getRank()
Returns the rank. |
int |
getRanks(PortSide side)
Returns the ranks for a specific side. |
int |
getRankWidth()
Gets the rank width of this layer element. |
float |
getRealHeight()
Returns the height of this layer element. |
float |
getRealWidth()
Returns the width of this layer element. |
float |
getTotalCrosswiseDim(float minDist,
boolean preSpacing)
Gets the total crosswise dimension of this layer element with routed edges. |
float |
getTotalLengthwiseDim(float minDist)
Gets the total lengthwise dimension of this layer element with routed edges. |
void |
placePorts()
Determines placements for the ports of the related node, based on the internally stored order. |
void |
setCrosswisePos(float pos,
float minDist)
Sets the crosswise position for this layer element, considering all edges that are routed before this element. |
void |
setLayer(Layer newLayer)
Set a new layer for this element. |
void |
setLengthwisePos(float pos,
float minDist)
Sets the lengthwise position for this layer element, considering all edges that are routed before this element. |
void |
setLinearSegment(LinearSegment thelinearSegment)
Sets the linear segment. |
void |
setRank(int therank)
Sets the rank. |
void |
setRanks(int ranks,
PortSide side)
Sets the ranks for a specific side. |
void |
sortPorts(Map<KPort,Double> abstractPortRanks,
boolean isoutgoing)
Sorts the ports on each side of the related node according to the given abstract ranks. |
void |
sortPorts(Map<KPort,Double> outgoingPortRanks,
Map<KPort,Double> incomingPortRanks)
Sorts the ports on each side of the related node according to the given abstract ranks. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEF_RANK
Constructor Detail |
---|
public LayerElement(KGraphElement obj, Layer thelayer, KSlimNode thekNode)
obj
- the element objectthelayer
- the containing layerthekNode
- the corresponding node in the acyclic KIELER graphMethod Detail |
---|
public String toString()
toString
in class Object
public Layer getLayer()
public void setLayer(Layer newLayer)
newLayer
- the new layerpublic List<KSlimEdge> getOutgoingEdges()
public void addOutgoing(KEdge edge, LayerElement target)
edge
- the edge between the two layout nodestarget
- target layer elementpublic void addOutgoing(KEdge edge, LayerElement target, KPort sourcePort, KPort targetPort)
edge
- the edge between the two layout nodestarget
- target layer elementsourcePort
- the source porttargetPort
- the target portpublic void applyLayout(KPoint offset, KInsets insets)
offset
- offset to be added to this element's positioninsets
- insets of the containing parent layout nodepublic PortConstraints getPortConstraints()
public int getRankWidth()
public List<LayerConnection> getIncomingConnections()
public List<LayerConnection> getOutgoingConnections()
public List<ElementLoop> getLoops()
public float getRealWidth()
public float getRealHeight()
public void setCrosswisePos(float pos, float minDist)
pos
- new crosswise positionminDist
- minimal distance for routed edgespublic void setLengthwisePos(float pos, float minDist)
pos
- new lengthwise positionminDist
- minimal distance for routed edgespublic float getTotalCrosswiseDim(float minDist, boolean preSpacing)
minDist
- minimal distance for routed edgespreSpacing
- whether the pre-spacing should be considered
public float getTotalLengthwiseDim(float minDist)
minDist
- minimal distance for routed edges
public KPoint getPosition()
public KPoint getPosOffset()
null
if the contained object is not a node.
public KGraphElement getElemObj()
public KSlimNode getKNode()
public void clearPortRanks()
public int getEdgesFront()
public int getEdgesBack()
public int getPortRank(KPort port, boolean forward)
port
- port for which the rank shall be obtainedforward
- if true, ranks are determined for a forward layer sweep,
else for a backwards layer sweep
port == null
public List<Integer> getConnectionRanks(boolean forward)
forward
- if true, only incoming connections are considered, else
only outgoing connections are considered
public Map<KPort,List<Integer>> getConnectionRanksByPort(boolean forward)
forward
- if true, only incoming connections are considered, else
only outgoing connections are considered
public void sortPorts(Map<KPort,Double> abstractPortRanks, boolean isoutgoing)
abstractPortRanks
- abstract port ranksisoutgoing
- if true, the abstract ranks are assumed to be for
outgoing connections, else for incoming connectionspublic void sortPorts(Map<KPort,Double> outgoingPortRanks, Map<KPort,Double> incomingPortRanks)
outgoingPortRanks
- ranks for ports with outgoing connectionsincomingPortRanks
- ranks for ports with incoming connectionspublic void placePorts()
public void setRank(int therank)
therank
- the rank to setpublic int getRank()
public void setLinearSegment(LinearSegment thelinearSegment)
thelinearSegment
- the linear segment to setpublic LinearSegment getLinearSegment()
public void setRanks(int ranks, PortSide side)
ranks
- the ranks to setside
- the side for which the ranks are setpublic int getRanks(PortSide side)
side
- the side for which ranks are returned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |