Package com.mxgraph.util
Class mxPoint
java.lang.Object
com.mxgraph.util.mxPoint
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
mxLine
,mxRectangle
Implements a 2-dimensional point with double precision coordinates.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a new instance of the same point.boolean
Returns true if the given object equals this rectangle.getPoint()
Returns the coordinates as a new point.double
getX()
Returns the x-coordinate of the point.double
getY()
Returns the x-coordinate of the point.void
setX
(double value) Sets the x-coordinate of the point.void
setY
(double value) Sets the y-coordinate of the point.toString()
Returns aString
that represents the value of thismxPoint
.
-
Field Details
-
x
protected double xHolds the x- and y-coordinates of the point. Default is 0. -
y
protected double yHolds the x- and y-coordinates of the point. Default is 0.
-
-
Constructor Details
-
mxPoint
public mxPoint()Constructs a new point at (0, 0). -
mxPoint
Constructs a new point at the location of the given point.- Parameters:
point
- Point that specifies the location.
-
mxPoint
Constructs a new point at the location of the given point.- Parameters:
point
- Point that specifies the location.
-
mxPoint
public mxPoint(double x, double y) Constructs a new point at (x, y).- Parameters:
x
- X-coordinate of the point to be created.y
- Y-coordinate of the point to be created.
-
-
Method Details
-
getX
public double getX()Returns the x-coordinate of the point.- Returns:
- Returns the x-coordinate.
-
setX
public void setX(double value) Sets the x-coordinate of the point.- Parameters:
value
- Double that specifies the new x-coordinate.
-
getY
public double getY()Returns the x-coordinate of the point.- Returns:
- Returns the x-coordinate.
-
setY
public void setY(double value) Sets the y-coordinate of the point.- Parameters:
value
- Double that specifies the new x-coordinate.
-
getPoint
Returns the coordinates as a new point.- Returns:
- Returns a new point for the location.
-
equals
Returns true if the given object equals this rectangle. -
clone
Returns a new instance of the same point. -
toString
Returns aString
that represents the value of thismxPoint
.
-