Package com.mxgraph.util
Class mxPoint
- java.lang.Object
-
- com.mxgraph.util.mxPoint
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
mxLine,mxRectangle
public class mxPoint extends java.lang.Object implements java.io.Serializable, java.lang.CloneableImplements a 2-dimensional point with double precision coordinates.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description mxPoint()Constructs a new point at (0, 0).mxPoint(double x, double y)Constructs a new point at (x, y).mxPoint(mxPoint point)Constructs a new point at the location of the given point.mxPoint(java.awt.geom.Point2D point)Constructs a new point at the location of the given point.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a new instance of the same point.booleanequals(java.lang.Object obj)Returns true if the given object equals this rectangle.java.awt.PointgetPoint()Returns the coordinates as a new point.doublegetX()Returns the x-coordinate of the point.doublegetY()Returns the x-coordinate of the point.voidsetX(double value)Sets the x-coordinate of the point.voidsetY(double value)Sets the y-coordinate of the point.java.lang.StringtoString()Returns aStringthat represents the value of thismxPoint.
-
-
-
Constructor Detail
-
mxPoint
public mxPoint()
Constructs a new point at (0, 0).
-
mxPoint
public mxPoint(java.awt.geom.Point2D point)
Constructs a new point at the location of the given point.- Parameters:
point- Point that specifies the location.
-
mxPoint
public mxPoint(mxPoint point)
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 Detail
-
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
public java.awt.Point getPoint()
Returns the coordinates as a new point.- Returns:
- Returns a new point for the location.
-
equals
public boolean equals(java.lang.Object obj)
Returns true if the given object equals this rectangle.- Overrides:
equalsin classjava.lang.Object
-
clone
public java.lang.Object clone()
Returns a new instance of the same point.- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns aStringthat represents the value of thismxPoint.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
mxPoint.
-
-