edu.stanford.hci.r3.units
Class Percentage
java.lang.Object
edu.stanford.hci.r3.units.Units
edu.stanford.hci.r3.units.Percentage
- All Implemented Interfaces:
- java.lang.Cloneable
public class Percentage
- extends Units
A percentage of a maximum value. If the maximum value is set to 8.5 inches, 50% will give us an
equivalent of 4.25 inches.
This software is distributed under the BSD License.
Field Summary |
static Units |
ONE
"Identity Element", representing one hundred percent of 8.5 inches. |
Constructor Summary |
Percentage(double percentage,
Units maxValue)
Represents a percentage value of a maximum. |
Methods inherited from class edu.stanford.hci.r3.units.Units |
add, clone, equals, getConversionTo, getCopy, getUnitName, getUnitsObjectOfSameLengthIn, getUnitsObjectOfSameTypeWithValue, getValue, getValueIn, getValueInCentimeters, getValueInInches, getValueInMillimeters, getValueInPatternDots, getValueInPixels, getValueInPoints, subtract, toInches, toPixels, toPoints |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ONE
public static final Units ONE
- "Identity Element", representing one hundred percent of 8.5 inches. Width of a US
Letter-sized sheet.
Percentage
public Percentage(double percentage,
Units maxValue)
- Represents a percentage value of a maximum. Sometimes, it's easier to express a location of
x,y=50%,50% on a sheet, especially if the sheet is later resized.
- Parameters:
percentage
- maxValue
-
getActualValue
public Units getActualValue()
- Returns:
getMaximumValue
public Units getMaximumValue()
- Returns:
getNumberOfUnitsInOneInch
protected double getNumberOfUnitsInOneInch()
- Specified by:
getNumberOfUnitsInOneInch
in class Units
- Returns:
- how many of these units fit in one inch.
- See Also:
Units.getNumberOfUnitsInOneInch()
toString
public java.lang.String toString()
- Overrides:
toString
in class Units
- See Also:
Units.toString()