java.io.Serializable
, java.lang.Cloneable
public class mxGeometry extends mxRectangle
Modifier and Type | Field | Description |
---|---|---|
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 java.util.List<mxPoint> |
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.
|
static boolean |
TRANSLATE_CONTROL_POINTS |
Global switch to translate the points in translate.
|
height, width
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
Returns a clone of the cell.
|
mxRectangle |
getAlternateBounds() |
Returns the alternate bounds.
|
mxPoint |
getOffset() |
Returns the offset.
|
java.util.List<mxPoint> |
getPoints() |
Returns the list of control points.
|
mxPoint |
getSourcePoint() |
Returns the source point.
|
mxPoint |
getTargetPoint() |
Returns the target point.
|
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(java.util.List<mxPoint> value) |
Sets the list of control points to the given list.
|
void |
setRelative(boolean value) |
Sets the relative state of the geometry.
|
void |
setSourcePoint(mxPoint sourcePoint) |
Sets the source point.
|
void |
setTargetPoint(mxPoint targetPoint) |
Sets the target point.
|
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.
|
void |
translate(double dx,
double dy) |
Translates the geometry by the specified amount.
|
add, contains, equals, getCenterX, getCenterY, getHeight, getRectangle, getWidth, grow, intersectLine, rotate90, setHeight, setRect, setWidth, toString
public static transient boolean TRANSLATE_CONTROL_POINTS
protected mxRectangle alternateBounds
protected mxPoint sourcePoint
protected mxPoint targetPoint
protected java.util.List<mxPoint> points
protected mxPoint offset
protected boolean relative
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 mxRectangle getAlternateBounds()
public void setAlternateBounds(mxRectangle rect)
rect
- Rectangle to be used for the alternate bounds.public mxPoint getSourcePoint()
public void setSourcePoint(mxPoint sourcePoint)
sourcePoint
- Source point to be used.public mxPoint getTargetPoint()
public void setTargetPoint(mxPoint targetPoint)
targetPoint
- Target point to be used.public java.util.List<mxPoint> getPoints()
public void setPoints(java.util.List<mxPoint> 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 void 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 java.lang.Object clone()
clone
in class mxRectangle
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.