|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.layout.util.KimlLayoutUtil
public final class KimlLayoutUtil
Utility methods for KGraphs and layout data.
Nested Class Summary | |
---|---|
static class |
KimlLayoutUtil.PortComparator
Comparator class used to sort ports according to their ranks. |
Method Summary | |
---|---|
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)
Returns edge layout data for a given graph element. |
static KShapeLayout |
getShapeLayout(KGraphElement graphElement)
Returns shape layout data for a given graph element. |
static Object |
getValue(KOption koption,
LayoutOptionData optionData)
Returns the value of the given KOption as an Object . |
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 |
setValue(KOption koption,
LayoutOptionData optionData,
Object value)
Sets the value of the given KOption . |
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
- the graph element
public static KEdgeLayout getEdgeLayout(KGraphElement graphElement)
graphElement
- the graph element
public static Object getValue(KOption koption, LayoutOptionData optionData)
KOption
as an Object
.
koption
- the KOption
for which the value shall be retrievedoptionData
- the layout option data related with the option
public static void setValue(KOption koption, LayoutOptionData optionData, Object value)
KOption
.
koption
- the KOption
for which the value shall be setoptionData
- the layout option data related with the optionvalue
- the new value of the optionpublic 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 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 offset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |