|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.LayoutTool
This class is a container for several helper and utility functions for the LayoutGraph class.
LayoutGraph
Field Summary | |
static int |
CENTER
Constant which can be used for arrangeRectangleRows. |
static int |
JUSTIFIED
Constant which can be used for arrangeRectangleRows. |
static int |
LEADING
Constant which can be used for arrangeRectangleRows. |
static int |
TRAILING
Constant which can be used for arrangeRectangleRows. |
Constructor Summary | |
LayoutTool()
|
Method Summary | |
static Dimension |
arrangeRectangleGrid(Rectangle2D[] rects,
Rectangle2D finalRect,
double viewRatio)
Reassigns the bounds of the rectangles int rects to fit in a large rectangle, whose bounds will be stored in finalrect. |
static int |
arrangeRectangleRows(Rectangle2D[] rects,
Rectangle2D finalRect,
double viewRatio)
Reassigns the bounds of the rectangles int rects to fit in a large rectangle, whose bounds will be stored in finalrect. |
static int |
arrangeRectangleRows(Rectangle2D[] rects,
Rectangle2D finalRect,
double viewRatio,
int alignment)
Reassigns the bounds of the rectangles int rects to fit in a large rectangle, whose bounds will be stored in finalrect. |
static void |
assignReverseLayout(LayoutGraph graph,
Edge e1,
Edge e2)
Set the layout of two parallel edges with different direction identical. |
static void |
clipEdgeOnBB(LayoutGraph gd,
Edge e)
This helper method clips the path of the edge on the bounding box of the start and end points. |
static void |
clipEdgesOnBB(LayoutGraph gd)
This helper method clips the path of the edge on the bounding box of the start and end points. |
static String |
edgeLayoutString(LayoutGraph gd,
Edge edge)
Returns the path of the layout of a specific edge as a String. |
static Rectangle2D |
getBoundingBox(LayoutGraph graph,
EdgeCursor ec)
Returns the bounding box of the edges accessible through the given edge cursor. |
static Rectangle2D |
getBoundingBox(LayoutGraph graph,
NodeCursor nc)
Returns the bounding box of the nodes accessible through the given node cursor. |
static Rectangle2D |
getBoundingBox(LayoutGraph graph,
NodeCursor nc,
EdgeCursor ec)
Returns the bounding box of the nodes and edges accessible through the given cursors. |
static YPointPath |
getEdgeClippedOnBB(EdgeLayout edge,
NodeLayout sourceNode,
NodeLayout targetNode)
This helper method clips the path of an edge on the bounding box of the start and end vertices. |
static YPointPath |
getEdgeClippedOnBB(EdgeLayout edge,
NodeLayout sourceNode,
NodeLayout targetNode,
double inset)
This helper method clips the path of ab edge on the bounding box of the start and end vertices. |
static YPointPath |
getEdgeClippedOnBB(LayoutGraph gd,
Edge edge)
This helper method clips the path of an edge on the bounding box of the start and end vertices. |
static double |
getNodeDistance(LayoutGraph graph,
Node s,
Node t)
Returns the distance between the centers of two nodes |
static String |
getNodePositions(LayoutGraph gd)
Returns the positions of the nodes of agrapg diagram |
static double |
getPathLength(LayoutGraph graph,
Edge e)
Returns the length of path of a given edge. |
static void |
initDiagram(LayoutGraph gd)
This method assigns the position (0,0) to all nodes in the graph, and sets the edges to straight lines with ports in the center of the adjacent node. |
static boolean |
isEdgeOutsideNodes(EdgeLayout edge,
NodeLayout sourceNode,
NodeLayout targetNode,
double inset)
This helper method tests if the path of an edge is outside the bounding box of the start and end vertices. |
static boolean |
isEdgeOutsideNodes(LayoutGraph gd,
Edge edge)
This helper method tests if the path of an edge is outside the bounding box of the start and end vertices. |
static void |
moveEdge(LayoutGraph g,
Edge edge,
double dx,
double dy)
Moves the edge points of the given edge by the vector (dx,dy) . |
static void |
moveEdges(LayoutGraph g,
EdgeCursor edges,
double dx,
double dy)
Moves all edges accessible through the given edge cursor by the vector (dx,dy) . |
static void |
moveNode(LayoutGraph g,
Node node,
double dx,
double dy)
Moves the given node by the vector (dx,dy) . |
static void |
moveNodes(LayoutGraph g,
NodeCursor nodes,
double dx,
double dy)
Moves all nodes accessible through the given node cursor by the vector (dx,dy) . |
static void |
moveSubgraph(LayoutGraph g,
EdgeCursor edges,
double dx,
double dy)
Moves the subgraph induced by edges accessible through the given edge cursor by the vector (dx,dy) . |
static void |
moveSubgraph(LayoutGraph g,
NodeCursor nodes,
double dx,
double dy)
Moves the subgraph induced by nodes accessible through the given node cursor by the vector (dx,dy) . |
static void |
removeDuplicateBends(LayoutGraph gd)
This helper method removes duplicate bends from all edges in the graph |
static void |
removeDuplicateBends(LayoutGraph gd,
Edge edge)
This helper method removes duplicate bends from the given edge in the graph |
static void |
resetPath(LayoutGraph gd,
Edge edge)
This helper method assign an trivial path to an edges which has no controllpoints and the ports are in the center of the nodes. |
static void |
resetPaths(LayoutGraph gd)
This helper method assign an trivial path to all edges which has no controllpoints and the ports are in the center of the nodes. |
static void |
resetPaths(LayoutGraph gd,
boolean resetPorts)
This helper method assign an trivial path to all edges which has no controllpoints |
static void |
resetPorts(LayoutGraph gd)
Sets the ports to the center of the nodes. |
static void |
reverseEdgeLayout(EdgeLayout el)
Reverses the layout of an edge. |
static void |
roundEdgeLayout(LayoutGraph gd,
Edge edge)
Round the values of the controllpoints and ports of an edge. |
static void |
roundLayout(LayoutGraph gd)
Round the values of the layout of an entire layout. |
static void |
roundNodeLayout(LayoutGraph gd,
Node node)
Round the values of the layout of a node. |
static void |
routeEdgesParallel(LayoutGraph gd,
Edge e1,
Edge e2,
double lineDistance)
Routes two edges with are incident to the same nodes, in parallel. |
static void |
routeEdgesParallel(LayoutGraph gd,
Edge e1,
EdgeList list,
double lineDistance)
Routes a list of edges with are incident to the same nodes, in parallel. |
static void |
routeSelfLoop(LayoutGraph gd,
Edge e)
Routes an selfloop. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LEADING
public static final int TRAILING
public static final int JUSTIFIED
public static final int CENTER
Constructor Detail |
public LayoutTool()
Method Detail |
public static double getNodeDistance(LayoutGraph graph, Node s, Node t)
public static double getPathLength(LayoutGraph graph, Edge e)
public static void reverseEdgeLayout(EdgeLayout el)
public static void resetPaths(LayoutGraph gd)
gd
- a graph diagram.public static void resetPaths(LayoutGraph gd, boolean resetPorts)
gd
- a graph diagram.resetPorts
- whether to reset the ports to the center of the nodes.public static void resetPath(LayoutGraph gd, Edge edge)
gd
- a graph diagram.edge
- an edge in graph.public static void removeDuplicateBends(LayoutGraph gd)
gd
- a graph diagram.public static void removeDuplicateBends(LayoutGraph gd, Edge edge)
gd
- a graph diagram.edge
- the edge.public static void moveEdge(LayoutGraph g, Edge edge, double dx, double dy)
(dx,dy)
.
public static void moveEdges(LayoutGraph g, EdgeCursor edges, double dx, double dy)
(dx,dy)
.
public static void moveNode(LayoutGraph g, Node node, double dx, double dy)
(dx,dy)
.
public static void moveNodes(LayoutGraph g, NodeCursor nodes, double dx, double dy)
(dx,dy)
.
public static void moveSubgraph(LayoutGraph g, EdgeCursor edges, double dx, double dy)
(dx,dy)
.
public static void moveSubgraph(LayoutGraph g, NodeCursor nodes, double dx, double dy)
(dx,dy)
.
public static Rectangle2D getBoundingBox(LayoutGraph graph, NodeCursor nc, EdgeCursor ec)
public static Rectangle2D getBoundingBox(LayoutGraph graph, NodeCursor nc)
public static Rectangle2D getBoundingBox(LayoutGraph graph, EdgeCursor ec)
public static void resetPorts(LayoutGraph gd)
gd
- a graph diagram.public static YPointPath getEdgeClippedOnBB(EdgeLayout edge, NodeLayout sourceNode, NodeLayout targetNode)
public static YPointPath getEdgeClippedOnBB(LayoutGraph gd, Edge edge)
public static YPointPath getEdgeClippedOnBB(EdgeLayout edge, NodeLayout sourceNode, NodeLayout targetNode, double inset)
public static boolean isEdgeOutsideNodes(LayoutGraph gd, Edge edge)
public static boolean isEdgeOutsideNodes(EdgeLayout edge, NodeLayout sourceNode, NodeLayout targetNode, double inset)
public static void clipEdgesOnBB(LayoutGraph gd)
public static void clipEdgeOnBB(LayoutGraph gd, Edge e)
public static String edgeLayoutString(LayoutGraph gd, Edge edge)
public static void roundNodeLayout(LayoutGraph gd, Node node)
public static void roundEdgeLayout(LayoutGraph gd, Edge edge)
public static void roundLayout(LayoutGraph gd)
public static void routeEdgesParallel(LayoutGraph gd, Edge e1, Edge e2, double lineDistance)
public static void routeEdgesParallel(LayoutGraph gd, Edge e1, EdgeList list, double lineDistance)
public static void routeSelfLoop(LayoutGraph gd, Edge e)
e
- An edge with e.source.equals(e.target)
.public static void assignReverseLayout(LayoutGraph graph, Edge e1, Edge e2)
e1
- the edge for which the points are set.e2
- the template.public static String getNodePositions(LayoutGraph gd)
public static void initDiagram(LayoutGraph gd)
public static final int arrangeRectangleRows(Rectangle2D[] rects, Rectangle2D finalRect, double viewRatio)
rects
- the rectangles whose coordinates will be modifiedfinalRect
- the exact dimension will be placed in this rectangleviewRatio
- the preferred ratio of the resulting bounds
public static final Dimension arrangeRectangleGrid(Rectangle2D[] rects, Rectangle2D finalRect, double viewRatio)
rects
- the rectangles whose, coordinates will be modifiedfinalRect
- the exact dimension will be placed in this rectangleviewRatio
- the preferred ratio of the grid
public static final int arrangeRectangleRows(Rectangle2D[] rects, Rectangle2D finalRect, double viewRatio, int alignment)
alignment
- determines the alignment policy for rows, that are not
completely filled.rects
- the rectangles whose coordinates will be modifiedfinalRect
- the exact dimension will be placed in this rectangleviewRatio
- the preferred ratio of the resulting bounds
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |