|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCUnit
JCUnit
defines the supported linear units of measurement:
inches, centimeters, and points.
Nested Class Summary | |
static class |
JCUnit.Dimension
Dimension is similar in concept to java.awt.Dimension, but the values are stored as double-precision numbers and the units of measurement are recorded as well. |
static class |
JCUnit.Margins
Stores the sizes of the margins around a figure or area. |
static class |
JCUnit.Measure
Measure encapsulates a linear distance with its units of measurement. |
static class |
JCUnit.Point
Point is roughly equivalent to java.awt.Point, but the coordinates are stored as double-precision numbers and the units of measurement are recorded as well. |
Field Summary | |
static com.klg.jclass.page.JCUnit |
CM
|
static com.klg.jclass.page.JCUnit |
INCHES
|
static double |
INCHES_TO_CM_FACTOR
|
static com.klg.jclass.page.JCUnit |
INTERNAL
|
protected String |
name
|
static com.klg.jclass.page.JCUnit |
POINTS
|
static double |
POINTS_TO_CM_FACTOR
|
static com.klg.jclass.page.JCUnit[] |
UNITS
List of available built-in units. |
Constructor Summary | |
JCUnit(String name)
Creates a new unit instance. |
Method Summary | |
static boolean |
areProbablyEqual(double value1,
double value2)
Returns true if two numbers are within an accepted tolerance. |
static JCUnit.Measure[] |
doublesToMeasures(com.klg.jclass.page.JCUnit unit,
double[] doubles)
A convenience method that creates an array of measures from the specified array of doubles. |
boolean |
equals(Object o)
|
static double |
getAs(com.klg.jclass.page.JCUnit to,
com.klg.jclass.page.JCUnit from,
double measure)
|
static double |
getAsCentimeters(com.klg.jclass.page.JCUnit units,
double measure)
Converts a given distance in the given units to a distance in centimeters. |
static double |
getAsInches(com.klg.jclass.page.JCUnit units,
double measure)
Converts a given distance in the given units to a distance in inches. |
static double |
getAsPoints(com.klg.jclass.page.JCUnit units,
double measure)
Converts a given distance in the given units to a distance in points. |
static com.klg.jclass.page.JCUnit |
getDefaultUnits()
Gets the JCUnit which specifies the interpretation of all numeric distances. |
static double |
getIU(com.klg.jclass.page.JCUnit units,
double measure)
Converts a given distance, given as a JCUnit , to a distance in internal units. |
int |
hashCode()
Creates a hash that generates the same value depending on the property values. |
protected static int |
hashMeasure(double baseMeasure)
Derives a hash value for a measure that will return the same hash value when areProbablyEqual() returns true . |
static void |
setDefaultUnit(com.klg.jclass.page.JCUnit new_default)
Sets the JCUnit which specifies the interpretation of all numeric distances. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final com.klg.jclass.page.JCUnit INCHES
public static final com.klg.jclass.page.JCUnit CM
public static final com.klg.jclass.page.JCUnit POINTS
public static final com.klg.jclass.page.JCUnit INTERNAL
public static final double INCHES_TO_CM_FACTOR
public static final double POINTS_TO_CM_FACTOR
public static final com.klg.jclass.page.JCUnit[] UNITS
protected String name
Constructor Detail |
public JCUnit(String name)
name
- Method Detail |
public static final JCUnit.Measure[] doublesToMeasures(com.klg.jclass.page.JCUnit unit, double[] doubles)
doubles
- unit
-
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
protected static int hashMeasure(double baseMeasure)
areProbablyEqual()
returns true
.
baseMeasure
-
public static boolean areProbablyEqual(double value1, double value2)
true
if two numbers are within an accepted tolerance.
hashMeasure
, otherwise two objects that are equal will not return the same hashcode.
value1
- value2
-
true
if two numbers are within an accepted tolerancepublic static final com.klg.jclass.page.JCUnit getDefaultUnits()
JCUnit
which specifies the interpretation of all numeric distances.
public static final void setDefaultUnit(com.klg.jclass.page.JCUnit new_default)
JCUnit
which specifies the interpretation of all numeric distances.
new_default
- unit of measure to be applied globallypublic static final double getAsCentimeters(com.klg.jclass.page.JCUnit units, double measure)
units
- measure
-
public static final double getIU(com.klg.jclass.page.JCUnit units, double measure)
JCUnit
, to a distance in internal units.
measure
- units
-
public static final double getAsInches(com.klg.jclass.page.JCUnit units, double measure)
units
- measure
-
public static final double getAsPoints(com.klg.jclass.page.JCUnit units, double measure)
units
- measure
-
public static final double getAs(com.klg.jclass.page.JCUnit to, com.klg.jclass.page.JCUnit from, double measure)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |