mxGraph 1.10.4.0


com.mxgraph.util
Class mxPoint

java.lang.Object
  extended by com.mxgraph.util.mxPoint
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
mxLine, mxRectangle

public class mxPoint
extends Object
implements Serializable, Cloneable

Implements a 2-dimensional point with double precision coordinates.

See Also:
Serialized Form

Field Summary
protected  double x
          Holds the x- and y-coordinates of the point.
protected  double y
          Holds the x- and y-coordinates of the point.
 
Constructor Summary
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(Point2D point)
          Constructs a new point at the location of the given point.
 
Method Summary
 Object clone()
          Returns a new instance of the same point.
 boolean equals(Object obj)
          Returns true if the given object equals this rectangle.
 Point 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.
 String toString()
          Returns a String that represents the value of this mxPoint.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected double x
Holds the x- and y-coordinates of the point. Default is 0.


y

protected double y
Holds the x- and y-coordinates of the point. Default is 0.

Constructor Detail

mxPoint

public mxPoint()
Constructs a new point at (0, 0).


mxPoint

public mxPoint(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 Point getPoint()
Returns the coordinates as a new point.

Returns:
Returns a new point for the location.

equals

public boolean equals(Object obj)
Returns true if the given object equals this rectangle.

Overrides:
equals in class Object

clone

public Object clone()
Returns a new instance of the same point.

Overrides:
clone in class Object

toString

public String toString()
Returns a String that represents the value of this mxPoint.

Overrides:
toString in class Object
Returns:
a string representation of this mxPoint.

mxGraph 1.10.4.0


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.