edu.stanford.hci.r3.units.coordinates
Class PercentageCoordinates
java.lang.Object
edu.stanford.hci.r3.units.coordinates.Coordinates
edu.stanford.hci.r3.units.coordinates.PercentageCoordinates
public class PercentageCoordinates
- extends Coordinates
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.
Fields inherited from class edu.stanford.hci.r3.units.coordinates.Coordinates |
x, y |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PercentageCoordinates
public PercentageCoordinates(Percentage pctInX,
Percentage pctInY)
- Parameters:
pctInX
- pctInY
-
getActualValueInXDirection
public Units getActualValueInXDirection()
- Returns:
getActualValueInYDirection
public Units getActualValueInYDirection()
- Returns:
getPercentageInXDirection
public 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.
getPercentageInYDirection
public double getPercentageInYDirection()
- Returns:
- the percentage value in the vertical direction.
setX
public void setX(Units xCoord)
- Verifies that the passed-in unit is in fact of the right type!
- Overrides:
setX
in class Coordinates
- Parameters:
xCoord
- - See Also:
Coordinates.setX(edu.stanford.hci.r3.units.Units)
setY
public void setY(Units yCoord)
- Verifies that the passed-in unit is in fact of the right type!
- Overrides:
setY
in class Coordinates
- Parameters:
yCoord
- - See Also:
Coordinates.setY(edu.stanford.hci.r3.units.Units)
toString
public java.lang.String toString()
- Overrides:
toString
in class Coordinates
- See Also:
Object.toString()