edu.stanford.hci.r3.units
Class Pixels
java.lang.Object
edu.stanford.hci.r3.units.Units
edu.stanford.hci.r3.units.Pixels
- All Implemented Interfaces:
- java.lang.Cloneable
public class Pixels
- extends Units
Represents a screen based unit. This depends on the Pixels Per Inch of the screen, of course.
This software is distributed under the BSD License.
Field Summary |
static java.lang.String |
CONFIG_FILE_KEY
The Key to access the configuration file for Pixels. |
static java.lang.String |
CONFIG_FILE_VALUE
|
static Pixels |
ONE
The Identity Element representing one Pixel on a "default" screen at a default pixelsPerInch. |
Constructor Summary |
Pixels()
One little square on your monitor, containing a color. |
Pixels(double numPixels)
|
Pixels(double numPixels,
double pixPerInch)
|
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, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CONFIG_FILE_KEY
public static final java.lang.String CONFIG_FILE_KEY
- The Key to access the configuration file for Pixels.
- See Also:
- Constant Field Values
CONFIG_FILE_VALUE
public static final java.lang.String CONFIG_FILE_VALUE
- See Also:
- Constant Field Values
ONE
public static final Pixels ONE
- The Identity Element representing one Pixel on a "default" screen at a default pixelsPerInch.
Pixels
public Pixels()
- One little square on your monitor, containing a color. =)
Pixels
public Pixels(double numPixels)
- Parameters:
numPixels
-
Pixels
public Pixels(double numPixels,
double pixPerInch)
- Parameters:
numPixels
-
getPixelsPerInchObject
public static Pixels getPixelsPerInchObject(int ppi)
- Parameters:
ppi
-
- 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()
getPixelsPerInch
public double getPixelsPerInch()
- Returns:
- how many pixels per inch shall we use to interpret this value?