|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.base.Graph y.layout.LayoutGraph
public abstract class LayoutGraph
A LayoutGraph
is a Graph
with attached layout information that basically represents a drawing of a graph.
It provides access to the layout information for nodes, edges and labels. This layout information consists of coordinates for the elements.
Layout algorithms
work on LayoutGraph
s and arrange their nodes and edges.
Field Summary |
---|
Fields inherited from class y.base.Graph |
---|
AFTER, BEFORE |
Constructor Summary | |
---|---|
LayoutGraph()
Creates a new, empty LayoutGraph with default settings. |
|
LayoutGraph(LayoutGraph subgraph)
Creates a new LayoutGraph which is a copy of the given subgraph. |
|
LayoutGraph(LayoutGraph graph,
YCursor nodeSubset)
Creates a new LayoutGraph which is a copy of the given subgraph. |
Method Summary | |
---|---|
protected abstract GraphCopier.CopyFactory |
createGraphCopyFactory()
Creates a GraphCopier.CopyFactory that can be used by
GraphCopier to create a copy of a LayoutGraph instance. |
protected abstract LabelLayoutFactory |
createLabelFactory()
Creates a new LabelLayoutFactory for this LayoutGraph that can be used for copying layout
information of labels. |
java.awt.Rectangle |
getBoundingBox()
Returns the bounding box of the diagram represented by this LayoutGraph . |
YPoint |
getCenter(Node node)
Returns the center coordinates of the given node. |
double |
getCenterX(Node node)
Returns the x-coordinate of the given node's center. |
double |
getCenterY(Node node)
Returns the y-coordinate of the given node's center. |
EdgeLabelLayout[] |
getEdgeLabelLayout(java.lang.Object edge)
Returns the layout information for all labels associated with the given edge. |
EdgeLayout |
getEdgeLayout(java.lang.Object edge)
Returns the layout information for the given edge. |
EdgeList |
getEdgeList()
Returns a list of all edges in the graph. |
abstract Edge |
getFeature(EdgeLabelLayout labelLayout)
Returns the edge to which the given EdgeLabelLayout belongs. |
abstract Node |
getFeature(NodeLabelLayout labelLayout)
Returns the node to which the given NodeLabelLayout belongs. |
double |
getHeight(Node node)
Returns the height of the given node. |
abstract EdgeLabelLayout[] |
getLabelLayout(Edge edge)
Returns the layout information for all labels associated with the given edge. |
abstract NodeLabelLayout[] |
getLabelLayout(Node node)
Returns the layout information for all labels associated with the given node. |
abstract EdgeLayout |
getLayout(Edge edge)
Returns the layout information for the given edge. |
abstract NodeLayout |
getLayout(Node node)
Returns the layout information for the given node. |
YPoint |
getLocation(Node node)
Returns the coordinates of the given node's upper-left corner. |
NodeLabelLayout[] |
getNodeLabelLayout(java.lang.Object node)
Returns the layout information for all labels associated with the given node. |
NodeLayout |
getNodeLayout(java.lang.Object node)
Returns the layout information for the given node. |
YPointPath |
getPath(Edge edge)
Returns the path of an edge, including the ports. |
YList |
getPathList(Edge edge)
Returns the path of an edge, including the ports. |
YList |
getPointList(Edge edge)
Returns the control points of an edge. |
YPointPath |
getPoints(Edge edge)
Returns the control points of an edge. |
YRectangle |
getRectangle(Node node)
Returns the rectangle describing the bounding box of the given node. |
YDimension |
getSize(Node node)
Returns the size of the given node. |
YPoint |
getSourcePointAbs(Edge edge)
Returns the absolute coordinates of the source point of the given edge. |
YPoint |
getSourcePointRel(Edge edge)
Returns the relative coordinates of the source point of the given edge. |
YPoint |
getTargetPointAbs(Edge edge)
Returns the absolute coordinates of the target point of the given edge. |
YPoint |
getTargetPointRel(Edge edge)
Returns the relative coordinates of the target point of the given edge. |
double |
getWidth(Node node)
Returns the width of the given node. |
double |
getX(Node node)
Returns the x-coordinate of the given node's upper-left corner. |
double |
getY(Node node)
Returns the y-coordinate of the given node's upper-left corner. |
void |
moveBy(Node node,
double dx,
double dy)
Moves the upper-left corner of a node by a given vector. |
void |
setCenter(Node node,
double x,
double y)
Specifies the center coordinates of the given node. |
void |
setCenter(Node node,
YPoint position)
Specifies the center coordinates of the given node. |
void |
setEndPointsAbs(Edge edge,
YPoint source,
YPoint target)
Specifies the two end points of the given edge in absolute coordinates. |
void |
setLocation(Node node,
double x,
double y)
Specifies the coordinates of the upper-left corner of the given node. |
void |
setLocation(Node node,
YPoint position)
Specifies the coordinates of the upper-left corner of the given node. |
void |
setPath(Edge edge,
YList path)
Sets the path of the given edge. |
void |
setPath(Edge edge,
YPointPath path)
Sets the path of the given edge. |
void |
setPoints(Edge edge,
YList points)
Sets the control points of the given edge. |
void |
setPoints(Edge edge,
YPointPath points)
Sets the control points of the given edge. |
void |
setSize(Node node,
double width,
double height)
Specifies the width and height of the given node. |
void |
setSize(Node node,
YDimension size)
Specifies the size of the given node. |
void |
setSourcePointAbs(Edge edge,
YPoint point)
Specifies the absolute coordinates of the source point of the given edge. |
void |
setSourcePointRel(Edge edge,
YPoint point)
Specifies the relative coordinates of the source point of the given edge. |
void |
setTargetPointAbs(Edge edge,
YPoint point)
Specifies the absolute coordinates of the target point of the given edge. |
void |
setTargetPointRel(Edge edge,
YPoint point)
Specifies the relative coordinates of the target point of the given edge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LayoutGraph()
LayoutGraph
with default settings.
public LayoutGraph(LayoutGraph subgraph)
LayoutGraph
which is a copy of the given subgraph.
subgraph
- the original subgraphpublic LayoutGraph(LayoutGraph graph, YCursor nodeSubset)
LayoutGraph
which is a copy of the given subgraph.
graph
- the original graphnodeSubset
- the nodes that induce the subgraphMethod Detail |
---|
protected abstract GraphCopier.CopyFactory createGraphCopyFactory()
GraphCopier.CopyFactory
that can be used by
GraphCopier
to create a copy of a LayoutGraph
instance.
createGraphCopyFactory
in class Graph
protected abstract LabelLayoutFactory createLabelFactory()
LabelLayoutFactory
for this LayoutGraph
that can be used for copying layout
information of labels.
LabelLayoutFactory
public abstract NodeLayout getLayout(Node node)
The layout information consists of the location and size of the node.
node
- the node
public abstract EdgeLayout getLayout(Edge edge)
The layout information consists of the locations of the control points and end points of the edge.
edge
- the edge
public abstract NodeLabelLayout[] getLabelLayout(Node node)
The layout information consists of the location, size and orientation of the label.
node
- the node
public abstract EdgeLabelLayout[] getLabelLayout(Edge edge)
The layout information consists of the location, size and orientation of the label.
edge
- the edge
public abstract Node getFeature(NodeLabelLayout labelLayout)
NodeLabelLayout
belongs.
labelLayout
- the label's layout information
public abstract Edge getFeature(EdgeLabelLayout labelLayout)
EdgeLabelLayout
belongs.
labelLayout
- the label's layout information
public NodeLayout getNodeLayout(java.lang.Object node)
The layout information consists of location and size of the node.
getNodeLayout
in interface GraphLayout
node
- the node
public EdgeLayout getEdgeLayout(java.lang.Object edge)
The layout information consists of the control points as well as the port locations of the edge.
getEdgeLayout
in interface GraphLayout
edge
- the edge
public NodeLabelLayout[] getNodeLabelLayout(java.lang.Object node)
The layout information consists of location, size and orientation of the label.
getNodeLabelLayout
in interface GraphLayout
node
- the node
public EdgeLabelLayout[] getEdgeLabelLayout(java.lang.Object edge)
The layout information consists of location, size and orientation of the label.
getEdgeLabelLayout
in interface GraphLayout
edge
- the edge
public double getCenterX(Node node)
node
- the node
NodeLayout
public double getCenterY(Node node)
node
- the node
NodeLayout
public YPoint getCenter(Node node)
node
- the node
NodeLayout
,
setCenter(Node, double, double)
public double getX(Node node)
node
- the node
NodeLayout.getX()
public double getY(Node node)
node
- the node
NodeLayout.getY()
public YPoint getLocation(Node node)
node
- the node
NodeLayout.getX()
,
NodeLayout.getY()
public double getWidth(Node node)
node
- the node
NodeLayout.getWidth()
public double getHeight(Node node)
node
- the node
NodeLayout.getHeight()
public YDimension getSize(Node node)
node
- the node
NodeLayout.getWidth()
,
NodeLayout.getHeight()
public YRectangle getRectangle(Node node)
node
- the node
getLocation(Node)
,
getSize(Node)
public void setCenter(Node node, YPoint position)
node
- the nodeposition
- the new location of the node's centerNodeLayout
,
setCenter(Node, double, double)
public void setCenter(Node node, double x, double y)
node
- the nodex
- the new x-coordinate of the node's centery
- the new y-coordinate of the node's centerNodeLayout
public void setSize(Node node, double width, double height)
node
- the nodewidth
- the new width of the nodeheight
- the new height of the nodeNodeLayout.setSize(double, double)
public void setSize(Node node, YDimension size)
node
- the nodesize
- the new size of the nodesetSize(Node, double, double)
,
NodeLayout.setSize(double, double)
public void setLocation(Node node, double x, double y)
node
- the nodex
- the new x-coordinate of the upper-left cornery
- the new y-coordinate of the upper-left cornerNodeLayout.setLocation(double, double)
public void setLocation(Node node, YPoint position)
node
- the nodeposition
- the new location of the upper-left cornerNodeLayout.setLocation(double, double)
,
setLocation(Node, double, double)
public void moveBy(Node node, double dx, double dy)
node
- the nodedx
- the x-component of the vectordy
- the y-component of the vectorpublic YPointPath getPoints(Edge edge)
edge
- the edge
YPointPath
representing the sequence of control points of the edgeEdgeLayout
public YList getPointList(Edge edge)
edge
- the edge
YPoint
s representing the sequence of control points of the edgeEdgeLayout
public YPointPath getPath(Edge edge)
edge
- the edge
public YList getPathList(Edge edge)
edge
- the edge
YPoint
s representing the path of the given edgepublic void setPath(Edge edge, YPointPath path)
Both source and target port are expected to be given in absolute coordinates.
2
.edge
- an edge in the graphpath
- the new path sequence of the edgepublic void setPath(Edge edge, YList path)
Both source and target port are expected to be given in absolute coordinates.
2
.edge
- an edge in the graphpath
- the list of YPoint
s representing the new path sequence of the edgepublic void setPoints(Edge edge, YPointPath points)
The source and target points of the edge will not be modified.
edge
- an edge in the graphpoints
- the new sequence of control pointspublic void setPoints(Edge edge, YList points)
The source and target points of the edge will not be modified.
edge
- an edge in the graphpoints
- the list of YPoint
s representing the new sequence of control pointspublic void setEndPointsAbs(Edge edge, YPoint source, YPoint target)
edge
- the edgesource
- the port on the source side of the edgetarget
- the port on the target side of the edgesetSourcePointAbs(Edge, YPoint)
,
setTargetPointAbs(Edge, YPoint)
public YPoint getSourcePointRel(Edge edge)
The coordinates are interpreted relative to the center of the source node.
edge
- the edge
EdgeLayout.getSourcePoint()
public YPoint getTargetPointRel(Edge edge)
The coordinates are interpreted relative to the center of the target node.
edge
- the edge
EdgeLayout.getTargetPoint()
public void setSourcePointRel(Edge edge, YPoint point)
The coordinates are interpreted relative to the center of the source node.
edge
- the edgepoint
- the new relative source point coordinates of the edgeEdgeLayout.setSourcePoint(YPoint)
public void setTargetPointRel(Edge edge, YPoint point)
The coordinates are interpreted relative to the center of the target node.
edge
- the edgepoint
- the new relative target point coordinates of the edgeEdgeLayout.setTargetPoint(YPoint)
public YPoint getSourcePointAbs(Edge edge)
edge
- the edge
public YPoint getTargetPointAbs(Edge edge)
edge
- the edge
public void setSourcePointAbs(Edge edge, YPoint point)
edge
- the edgepoint
- the new absolute source point coordinates of the edgepublic void setTargetPointAbs(Edge edge, YPoint point)
edge
- the edgepoint
- the new absolute target point coordinates of the edgepublic EdgeList getEdgeList()
public java.awt.Rectangle getBoundingBox()
LayoutGraph
.
This is the smallest rectangle containing the entire graph.
If the graph does not contain any nodes (and therefore no edges either),
the bounding box will have negative width and/or height.
getBoundingBox
in interface GraphLayout
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |