JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCUnit.Point

java.lang.Object
  |
  +--com.klg.jclass.page.JCUnit.Point
All Implemented Interfaces:
Cloneable
Enclosing class:
JCUnit

public static class JCUnit.Point
extends Object
implements Cloneable

Point is roughly equivalent to java.awt.Point, but the coordinates are stored as double-precision numbers and the units of measurement are recorded as well.


Field Summary
 com.klg.jclass.page.JCUnit units
          JCUnit object representing the units of linear measurement.
 double x
          The coordinates of the point being represented.
 double y
          The coordinates of the point being represented.
 
Constructor Summary
JCUnit.Point()
          Creates a point at (0, 0) using the default units.
JCUnit.Point(double x, double y)
          Creates a point at (x, y) using the current units.
JCUnit.Point(com.klg.jclass.page.JCUnit units)
          Creates a point at (0, 0) using the given units.
JCUnit.Point(com.klg.jclass.page.JCUnit units, double x, double y)
          Creates a point at (x, y) using the given units.
 
Method Summary
 void assign(JCUnit.Point newValue)
          Sets this point equal to the given one.
 Object clone()
          Creates a clone of this Point.
 boolean equals(Object obj)
          Compares an object to this Point.
 JCUnit.Measure getX()
          Returns the x position as a measure.
 JCUnit.Measure getY()
          Returns the y position as a measure.
 int hashCode()
          Creates a hash that generates the same value depending on the property values.
 void setX(JCUnit.Measure newX)
          Sets the value of the x coordinate based on a measure.
 void setY(JCUnit.Measure newY)
          Sets the value of the y coordinate based on a measure.
 String toString()
          Returns the point co-ordinates and units as a String.
 double xInt()
          Gets the x position as a distance in internal units.
 double yInt()
          Gets the y position as a distance in internal units.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

units

public com.klg.jclass.page.JCUnit units
JCUnit object representing the units of linear measurement.


x

public double x
The coordinates of the point being represented.


y

public double y
The coordinates of the point being represented.

Constructor Detail

JCUnit.Point

public JCUnit.Point()
Creates a point at (0, 0) using the default units.


JCUnit.Point

public JCUnit.Point(com.klg.jclass.page.JCUnit units)
Creates a point at (0, 0) using the given units.

Parameters:
units - the units in which the point is represented

JCUnit.Point

public JCUnit.Point(double x,
                    double y)
Creates a point at (x, y) using the current units.

Parameters:
x - the x-coordinate of the point (measured in units)
y - the y-coordinate of the point (measured in units)

JCUnit.Point

public JCUnit.Point(com.klg.jclass.page.JCUnit units,
                    double x,
                    double y)
Creates a point at (x, y) using the given units.

Parameters:
units - the units in which the point is represented
x - the x-coordinate of the point (measured in units)
y - the y-coordinate of the point (measured in units)
Method Detail

clone

public Object clone()
Creates a clone of this Point.

Overrides:
clone in class Object
Returns:
a new Point, which is a clone

getX

public JCUnit.Measure getX()
Returns the x position as a measure.

Returns:
the x-coordinate in the units used by the Point

setX

public void setX(JCUnit.Measure newX)
Sets the value of the x coordinate based on a measure.

Parameters:
newX - a Measure specifying the new x position of the Point

xInt

public double xInt()
Gets the x position as a distance in internal units.

Returns:
the x-coordinate measured in internal units

getY

public JCUnit.Measure getY()
Returns the y position as a measure.

Returns:
the y-coordinate in the units used by the Point

setY

public void setY(JCUnit.Measure newY)
Sets the value of the y coordinate based on a measure.

Parameters:
newY - a Measure specifying the new y position of the Point

yInt

public double yInt()
Gets the y position as a distance in internal units.

Returns:
the y-coordinate measured in internal units

assign

public void assign(JCUnit.Point newValue)
Sets this point equal to the given one.

Parameters:
newValue - the value to assign to this point

hashCode

public int hashCode()
Creates a hash that generates the same value depending on the property values.

Overrides:
hashCode in class Object
Returns:

equals

public boolean equals(Object obj)
Compares an object to this Point.

Overrides:
equals in class Object
Parameters:
obj - an Object to test for equality with this Point
Returns:
true if both objects are points and they are congruent (independent of units)

toString

public String toString()
Returns the point co-ordinates and units as a String.

Overrides:
toString in class Object
Returns:
point co-ordinates and units

Copyright © 2004 Quest Software Inc..
All rights reserved.