|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.geom.Point2D
|
+--java.awt.geom.Point2D.Double
|
+--edu.neu.ccs.XPoint2D
Data model representing a point in graphics,
containing a double x coordinate
and a double y coordinate.
| Field Summary | |
protected SwingPropertyChangeSupport |
changeAdapter
Helper object for property change API. |
protected static String |
X_PROPERTY
Bound property name for the x property. |
protected static String |
Y_PROPERTY
Bound property name for the y property. |
| Fields inherited from class java.awt.geom.Point2D.Double |
x, y |
| Constructor Summary | |
XPoint2D()
Constructs a wrapper for the default Point2D.Double value. |
|
XPoint2D(double x,
double y)
Constructs a wrapper for the given double values. |
|
XPoint2D(Point2D p)
Constructs a wrapper for the given Point2D value. |
|
XPoint2D(String data)
Constructs an XPoint2D object from
a String representation of the data state. |
|
| Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the given object to listen for property change events generated by this object. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Registers the given object to listen for property change events generated by this object with the given property name. |
double |
angleInDegrees()
Computes the angle in degrees measured counter-clockwise from the positive x-axis. |
static double |
angleInDegrees(double x1,
double y1,
double x2,
double y2)
Computes the angle in degrees from the the point (x1,y1) to the point (x2,y2) measured counter-clockwise. |
static double |
angleInDegrees(Point2D p,
Point2D q)
Computes the angle in degrees from the point p to the point q measured counter-clockwise. |
double |
angleInRadians()
Computes the angle in radians measured counter-clockwise from the positive x-axis. |
static double |
angleInRadians(double x1,
double y1,
double x2,
double y2)
Computes the angle in radians from the the point (x1,y1) to the point (x2,y2) measured counter-clockwise. |
static double |
angleInRadians(Point2D p,
Point2D q)
Computes the angle in radians from the point p to the point q measured counter-clockwise. |
static String[] |
decodeIntoPair(String data)
Decode a pair of numeric strings encoded using a standard codec or encoded using the format [x;y] or the format (x,y). |
void |
fromStringData(String data)
Extracts the data state for this XPoint2D object
from a String representation of the data state. |
double |
radius()
Computes the distance of the point to the origin. |
double |
radiusSq()
Computes the distance squared of the point to the origin. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deregisters the given object from listening for property change events generated by this object. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deregisters the given object from listening for property change events generated by this object with the given property name. |
void |
setValue(double newX,
double newY)
Sets the values wrapped by this object to the given values. |
void |
setValue(Point2D p)
Sets the value wrapped by this object to the given value. |
String |
toString()
Returns a human readable String representing the
data state of this XPoint2D as [x;y]. |
String |
toStringData()
Returns a String representation of the data state
for this XPoint2D object. |
| Methods inherited from class java.awt.geom.Point2D.Double |
getX, getY, setLocation |
| Methods inherited from class java.awt.geom.Point2D |
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final String X_PROPERTY
protected static final String Y_PROPERTY
protected SwingPropertyChangeSupport changeAdapter
| Constructor Detail |
public XPoint2D()
Point2D.Double value.
XPoint2D(Point2D),
XPoint2D(double, double),
XPoint2D(String)public XPoint2D(Point2D p)
Point2D value.
p - the value to be wrappedXPoint2D(),
XPoint2D(double, double),
XPoint2D(String),
setValue(Point2D)
public XPoint2D(double x,
double y)
double values.
x - the x value to be wrappedy - the y value to be wrappedXPoint2D(),
XPoint2D(Point2D),
XPoint2D(String),
setValue(double, double)
public XPoint2D(String data)
throws ParseException
XPoint2D object from
a String representation of the data state.
data - String representation of the desired value
ParseException - if the data is malformedXPoint2D(),
XPoint2D(double, double),
XPoint2D(Point2D),
toStringData(),
fromStringData(String),
toString()| Method Detail |
public String toStringData()
String representation of the data state
for this XPoint2D object.
toStringData in interface StringableXPoint2D(String),
fromStringData(String),
toString()
public void fromStringData(String data)
throws ParseException
XPoint2D object
from a String representation of the data state.
fromStringData in interface Stringabledata - String representation
of the desired value
ParseException - if the data is malformedXPoint2D(String),
toStringData(),
toString(),
decodeIntoPair(String),
setValue(double, double)public String toString()
String representing the
data state of this XPoint2D as [x;y].
toString in class Point2D.DoubleXPoint2D(String),
toStringData(),
fromStringData(String)
public static String[] decodeIntoPair(String data)
throws ParseException
data - the String to decode into a String pair
ParseExceptionfromStringData(String)public void setValue(Point2D p)
p - the value to be wrappedsetValue(double, double)
public void setValue(double newX,
double newY)
newX - the x coordinatenewY - the y coordinatesetValue(Point2D)public double radius()
radiusSq()public double radiusSq()
radius()public double angleInRadians()
angleInDegrees()public double angleInDegrees()
angleInRadians()
public static double angleInRadians(Point2D p,
Point2D q)
p - point to start angle measurementq - point to finish angle measurementangleInRadians(double, double, double, double),
angleInDegrees(Point2D, Point2D)
public static double angleInRadians(double x1,
double y1,
double x2,
double y2)
x1 - x-coordinate of point to start angle measurementy1 - y-coordinate of point to start angle measurementx2 - x-coordinate of point to finish angle measurementy2 - y-coordinate of point to finish angle measurementangleInRadians(Point2D, Point2D),
angleInDegrees(double, double, double, double)
public static double angleInDegrees(Point2D p,
Point2D q)
p - point to start angle measurementq - point to finish angle measurementangleInDegrees(double, double, double, double),
angleInRadians(Point2D, Point2D)
public static double angleInDegrees(double x1,
double y1,
double x2,
double y2)
x1 - x-coordinate of point to start angle measurementy1 - y-coordinate of point to start angle measurementx2 - x-coordinate of point to finish angle measurementy2 - y-coordinate of point to finish angle measurementangleInDegrees(Point2D, Point2D),
angleInRadians(double, double, double, double)public void addPropertyChangeListener(PropertyChangeListener listener)
listener - the listener to be registered
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
propertyName - the name of the desired propertylistener - the listener to be registeredpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - the listener to be deregistered
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
propertyName - the name of the desired propertylistener - the listener to be deregistered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||