|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.Extent
A representation of a linear distance with units.
Extent
objects are immutable once constructed.
Field Summary | |
static int |
CM
Centimeter units. |
static int |
EM
Em units (height of font). |
static int |
EX
Ex units (height of character 'x' in font). |
static int |
IN
Inch units. |
static int |
MM
Millimeter units. |
static int |
PC
Picas (1pc = 12pt) |
static int |
PERCENT
Percentage units. |
static int |
PT
Points (1pt = 1/72in). |
static int |
PX
Pixel units. |
Constructor Summary | |
Extent(int value,
int units)
Creates a new Extent . |
Method Summary | |
static Extent |
add(Extent a,
Extent b)
Adds one Extent to another, returning the sum as a new
Extent . |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
|
int |
getUnits()
Returns the units of the Extent . |
int |
getValue()
Returns the value of the Extent . |
boolean |
isComparableTo(Extent that)
Determines whether this Extent can be compared to another
Extent to determine which is a greater length. |
boolean |
isEnglish()
Determines if the Extent has English units, i.e., the
units are of type IN (inches), PC (picas), or
PT (points). |
boolean |
isPercentage()
Determines if the Extent has percentage-based units. |
boolean |
isPrint()
Determines if this Extent has 'print' based units, i.e.,
the units are in real dimensions, such as SI or English values, rather
than screen-based units such as pixels or percentages. |
boolean |
isSI()
Determines if the Extent has SI (Metric) units, i.e., the
units are of type MM (millimeters) or CM
(centimeters). |
int |
toMm()
Returns the value of the extent in millimeters. |
int |
toPoint()
Returns the value of the extent in points. |
java.lang.String |
toString()
Returns a string describing the state of the Extent. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PX
public static final int PERCENT
public static final int PT
public static final int CM
public static final int MM
public static final int IN
public static final int EM
public static final int EX
public static final int PC
Constructor Detail |
public Extent(int value, int units)
Extent
.
value
- the value of the extent.units
- the units of the value, one of the following constants:
PX
: PixelsPERCENT
: Percent (of size of containing
component)PT
: PointsCM
: CentimetersMM
: MillimetersIN
: InchesEM
: Ems (height of 'M' character)EX
: Exs (height of 'x' character)PC
: PicasMethod Detail |
public static Extent add(Extent a, Extent b)
Extent
to another, returning the sum as a new
Extent
. Null is returned if the Extent
s have
incompatible units.
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
Comparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object o)
Object.equals(java.lang.Object)
public int getValue()
Extent
.
Extent
.public int getUnits()
Extent
.
Extent
, one of the following
constants:
PX
: PixelsPERCENT
: Percent (of size of containing
component)PT
: PointsCM
: CentimetersMM
: MillimetersIN
: InchesEM
: Ems (height of 'M' character)EX
: Exs (height of 'x' character)PC
: Picaspublic boolean isComparableTo(Extent that)
Extent
can be compared to another
Extent
to determine which is a greater length.
that
- The Extent
to test comparability to.
Extent
s can be compared.public boolean isEnglish()
Extent
has English units, i.e., the
units are of type IN
(inches), PC
(picas), or
PT
(points).
Extent
has English units.public boolean isSI()
Extent
has SI (Metric) units, i.e., the
units are of type MM
(millimeters) or CM
(centimeters).
Extent
has SI units.public boolean isPercentage()
Extent
has percentage-based units.
Extent
has percentage-based units.public boolean isPrint()
Extent
has 'print' based units, i.e.,
the units are in real dimensions, such as SI or English values, rather
than screen-based units such as pixels or percentages.
Extent
has 'print' based units.public int toMm()
java.lang.IllegalStateException
- if the value cannot be returned in
millimeters.
Verify that isPrint()
returns true to avoid
potentially receiving this exception.public int toPoint()
java.lang.IllegalStateException
- if the value cannot be returned in points.
Verify that isPrint()
returns true to avoid
potentially receiving this exception.public java.lang.String toString()
Object.toString()
|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |