|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.util.KimlUtil
public final class KimlUtil
Utility methods for KGraphs and layout data.
Nested Class Summary | |
---|---|
static class |
KimlUtil.PortComparator
Comparator class used to sort ports according to their ranks. |
Method Summary | |
---|---|
static void |
addDummyEdgesForInterlevelConnections(KNode parentNode)
Recursively search parents of the source and target node to find the most common parent. |
static int |
calcFlow(KPort port)
Determines the flow of the given port, that is the difference between the number of outgoing edges and the number of incoming edges. |
static void |
calcPortRanks(KNode node)
Sets port ranks for all ports of the given node according to their relative positions. |
static PortSide |
calcPortSide(KPort port)
Determines the port side for the given port from its relative position at its corresponding node. |
static KEdge |
createInitializedEdge()
Creates a KEdge, initializes some attributes, and returns it. |
static KLabel |
createInitializedLabel(KGraphElement parent)
Creates a KLabel, initializes some attributes, and returns it. |
static KNode |
createInitializedNode()
Creates a KNode, initializes some attributes, and returns it. |
static KPort |
createInitializedPort()
Creates a KPort, initializes some attributes, and returns it. |
static void |
fillPortInfo(KNode node,
LayoutDirection layoutDirection)
Fills all missing data for the ports of the given node, such as port sides and port ranks. |
static KEdgeLayout |
getEdgeLayout(KGraphElement graphElement)
Deprecated. use graphElement.getData(KEdgeLayout.class) instead |
static KShapeLayout |
getShapeLayout(KGraphElement graphElement)
Deprecated. use graphElement.getData(KShapeLayout.class) instead |
static KPort[] |
getSortedPorts(KNode node)
Returns a sorted list of the ports of the given node. |
static boolean |
isDescendant(KNode child,
KNode parent)
Determines whether the given child node is a descendant of the parent node. |
static void |
placePoints(List<KPoint> points,
float minPos,
float maxPos,
float offset,
boolean vertical,
boolean forward)
Determines positions of a sorted set of points by placing them with equal distances. |
static void |
resizeNode(KNode node)
Sets the size of a given node, depending on the minimal size, the number of ports on each side, the insets, and the label. |
static void |
translate(KNode parent,
float xoffset,
float yoffset)
Translates the contents of the given node by an offset. |
static void |
translate(KPoint point,
float xoffset,
float yoffset)
Translates the given point by an offset. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static KShapeLayout getShapeLayout(KGraphElement graphElement)
graphElement.getData(KShapeLayout.class)
instead
graphElement
- the graph element
public static KEdgeLayout getEdgeLayout(KGraphElement graphElement)
graphElement.getData(KEdgeLayout.class)
instead
graphElement
- the graph element
public static KNode createInitializedNode()
public static KEdge createInitializedEdge()
public static KPort createInitializedPort()
public static KLabel createInitializedLabel(KGraphElement parent)
parent
- the parent graph element
public static PortSide calcPortSide(KPort port)
port
- port to analyze
public static KPort[] getSortedPorts(KNode node)
node
- a node
public static void calcPortRanks(KNode node)
node
- node for which port ranks shall be setpublic static void fillPortInfo(KNode node, LayoutDirection layoutDirection)
node
- node for which port data shall be createdlayoutDirection
- layout directionpublic static void placePoints(List<KPoint> points, float minPos, float maxPos, float offset, boolean vertical, boolean forward)
points
- list of pointsminPos
- minimal position for placingmaxPos
- maximal position for placingoffset
- offset to be added to positionsvertical
- if true, the vertical position is processed, else the
horizontal position is processedforward
- if true, ports are placed from the minimum to the maximum
positionpublic static void resizeNode(KNode node)
node
- the node that shall be resizedpublic static int calcFlow(KPort port)
port
- port for which the flow shall be calculated
public static boolean isDescendant(KNode child, KNode parent)
child
- a child nodeparent
- a parent node
child
is a direct or indirect child of parent
public static void translate(KNode parent, float xoffset, float yoffset)
parent
- parent node whose children shall be translatedxoffset
- x coordinate offsetyoffset
- y coordinate offsetpublic static void translate(KPoint point, float xoffset, float yoffset)
point
- point that shall be translatedxoffset
- x coordinate offsetyoffset
- y coordinate offsetpublic static void addDummyEdgesForInterlevelConnections(KNode parentNode)
parentNode
- the parent node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |