|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.util.mxPoint
com.mxgraph.util.mxRectangle
com.mxgraph.model.mxGeometry
public class mxGeometry
Represents the geometry of a cell. For vertices, the geometry consists of the x- and y-location, as well as the width and height. For edges, the geometry either defines the source- and target-terminal, or it defines the respective terminal points.
Field Summary | |
---|---|
protected mxRectangle |
alternateBounds
Stores alternate values for x, y, width and height in a rectangle. |
protected mxPoint |
offset
Holds the offset of the label for edges. |
protected List |
points
List of mxPoints which specifies the control points along the edge. |
protected boolean |
relative
Specifies if the coordinates in the geometry are to be interpreted as relative coordinates. |
protected mxPoint |
sourcePoint
Defines the source- and target-point of the edge. |
protected mxPoint |
targetPoint
Defines the source- and target-point of the edge. |
Fields inherited from class com.mxgraph.util.mxRectangle |
---|
height, width |
Fields inherited from class com.mxgraph.util.mxPoint |
---|
x, y |
Constructor Summary | |
---|---|
mxGeometry()
Constructs a new geometry at (0, 0) with the width and height set to 0. |
|
mxGeometry(double x,
double y,
double width,
double height)
Constructs a geometry using the given parameters. |
|
mxGeometry(mxGeometry geometry)
Constructs a copy of the given geometry. |
Method Summary | |
---|---|
Object |
clone()
Returns a new instance of the same geometry. |
mxRectangle |
getAlternateBounds()
Returns the alternate bounds. |
mxPoint |
getOffset()
Returns the offset. |
List |
getPoints()
Returns the list of control points. |
mxPoint |
getTerminalPoint(boolean isSource)
Returns the point representing the source or target point of this edge. |
boolean |
isRelative()
Returns true of the geometry is relative. |
void |
setAlternateBounds(mxRectangle rect)
Sets the alternate bounds to the given rectangle. |
void |
setOffset(mxPoint offset)
Sets the offset to the given point. |
void |
setPoints(List value)
Sets the list of control points to the given list. |
void |
setRelative(boolean value)
Sets the relative state of the geometry. |
mxPoint |
setTerminalPoint(mxPoint point,
boolean isSource)
Sets the sourcePoint or targetPoint to the given point and returns the new point. |
void |
swap()
Swaps the x, y, width and height with the values stored in alternateBounds and puts the previous values into alternateBounds as a rectangle. |
mxGeometry |
translate(double dx,
double dy)
Returns a modified clone of this geometry which is translated by the specified amount. |
Methods inherited from class com.mxgraph.util.mxRectangle |
---|
add, getHeight, getRectangle, getWidth, grow, setHeight, setWidth |
Methods inherited from class com.mxgraph.util.mxPoint |
---|
getPoint, getX, getY, setX, setY |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected mxRectangle alternateBounds
protected mxPoint sourcePoint
protected mxPoint targetPoint
protected List points
protected mxPoint offset
protected boolean relative
Constructor Detail |
---|
public mxGeometry()
public mxGeometry(double x, double y, double width, double height)
x
- X-coordinate of the new geometry.y
- Y-coordinate of the new geometry.width
- Width of the new geometry.height
- Height of the new geometry.public mxGeometry(mxGeometry geometry)
geometry
- Geometry to construct a copy of.Method Detail |
---|
public mxRectangle getAlternateBounds()
public void setAlternateBounds(mxRectangle rect)
rect
- Rectangle to be used for the alternate bounds.public List getPoints()
public void setPoints(List value)
value
- List that contains the new control points.public mxPoint getOffset()
public void setOffset(mxPoint offset)
offset
- Point to be used for the offset.public boolean isRelative()
public void setRelative(boolean value)
value
- Boolean value to be used as the new relative state.public void swap()
public mxPoint getTerminalPoint(boolean isSource)
isSource
- Boolean that specifies if the source or target point
should be returned.
public mxPoint setTerminalPoint(mxPoint point, boolean isSource)
point
- Point to be used as the new source or target point.isSource
- Boolean that specifies if the source or target point
should be set.
public mxGeometry translate(double dx, double dy)
dx
- Integer that specifies the x-coordinate of the translation.dy
- Integer that specifies the y-coordinate of the translation.
public Object clone()
clone
in class mxRectangle
|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |