PercentageCoordinates Class Reference

Inheritance diagram for PercentageCoordinates:

Coordinates List of all members.

Public Member Functions

 PercentageCoordinates (Percentage pctInX, Percentage pctInY)
Units getActualValueInXDirection ()
Units getActualValueInYDirection ()
double getPercentageInXDirection ()
 Not as useful as the actual value, because of the aspect ratio of the sheet/region.
double getPercentageInYDirection ()
void setX (Units xCoord)
 Verifies that the passed-in unit is in fact of the right type!
void setY (Units yCoord)
 Verifies that the passed-in unit is in fact of the right type!
String toString ()

Detailed Description

Can be used for specifying where we are on a sheet, region, etc. Instead of specifying absolute coordinates (number of pixels), we specify in a fraction relative to the upper left corner of the document (0,0).

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 18 of file PercentageCoordinates.java.


Constructor & Destructor Documentation

PercentageCoordinates ( Percentage  pctInX,
Percentage  pctInY 
)

Parameters:
pctInX 
pctInY 

Definition at line 24 of file PercentageCoordinates.java.


Member Function Documentation

Units getActualValueInXDirection (  ) 

Returns:

Definition at line 31 of file PercentageCoordinates.java.

References Coordinates.x.

Referenced by GestureHandler.handleEvent().

Units getActualValueInYDirection (  ) 

Returns:

Definition at line 38 of file PercentageCoordinates.java.

References Coordinates.y.

Referenced by GestureHandler.handleEvent().

double getPercentageInXDirection (  ) 

Not as useful as the actual value, because of the aspect ratio of the sheet/region.

If it's a wide sheet, 50% is a lot bigger in X than it is in Y.

Returns:
the percentage value in the horizontal direction.

Definition at line 48 of file PercentageCoordinates.java.

References Units.getValue(), and Coordinates.x.

Referenced by RegionComponent.RegionComponent().

double getPercentageInYDirection (  ) 

Returns:
the percentage value in the vertical direction.

Definition at line 55 of file PercentageCoordinates.java.

References Units.getValue(), and Coordinates.y.

Referenced by RegionComponent.RegionComponent().

void setX ( Units  xCoord  ) 

Verifies that the passed-in unit is in fact of the right type!

Parameters:
xCoord 
See also:
edu.stanford.hci.r3.units.coordinates.Coordinates.setX(edu.stanford.hci.r3.units.Units)

Reimplemented from Coordinates.

Definition at line 65 of file PercentageCoordinates.java.

References Coordinates.x.

void setY ( Units  yCoord  ) 

Verifies that the passed-in unit is in fact of the right type!

Parameters:
yCoord 
See also:
edu.stanford.hci.r3.units.coordinates.Coordinates.setY(edu.stanford.hci.r3.units.Units)

Reimplemented from Coordinates.

Definition at line 80 of file PercentageCoordinates.java.

References Coordinates.y.

String toString (  ) 

See also:
java.lang.Object.toString()

Reimplemented from Coordinates.

Definition at line 92 of file PercentageCoordinates.java.

References Units.toString(), Coordinates.x, and Coordinates.y.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:45 2007 for R3 Paper Toolkit by  doxygen 1.4.7