Class FixedLength
java.lang.Object
org.apache.fop.fo.properties.Property
org.apache.fop.fo.properties.LengthProperty
org.apache.fop.fo.properties.FixedLength
An absolute length quantity in XSL
-
Nested Class Summary
Nested classes/interfaces inherited from class LengthProperty
LengthProperty.Maker -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PropertyCache<FixedLength> cache holding all canonical FixedLength instancesstatic final StringDescribes the unit centimeter.static final StringDescribes the unit inch.private intstatic final StringDescribes the unit millimeter.static final StringDescribes the unit millipoint.static final StringDescribes the unit pica.static final StringDescribes the unit point.static final FixedLengthcanonical zero-length instance -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFixedLength(double numUnits, String units, float res) Set the length given a number of units, a unit name and an assumed resolution (used in case the units are pixels) -
Method Summary
Modifier and TypeMethodDescriptionprivate static intConvert the given length to a dimensionless integer representing a whole number of base units (milli-points).booleanstatic FixedLengthgetInstance(double numUnits) Return the cachedFixedLengthinstance corresponding to the computed value.static FixedLengthgetInstance(double numUnits, String units) Return the cachedFixedLengthinstance corresponding to the computed value This method assumes a source-resolution of 1 (1px = 1pt)static FixedLengthgetInstance(double numUnits, String units, float sourceResolution) Return the cachedFixedLengthinstance corresponding to the computed value in base-units (millipoints).doubleReturn the value of this NumericdoublegetNumericValue(PercentBaseContext context) Return the value of this NumericintgetValue()Returns the length in 1/1000ths of a point (millipoints)intgetValue(PercentBaseContext context) Returns the length in 1/1000ths of a point (millipoints)inthashCode()booleanReturn true since a FixedLength is always absolute.toString()Methods inherited from class LengthProperty
getDimension, getLength, getNumeric, getObjectMethods inherited from class Property
getCharacter, getColor, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getNumber, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue
-
Field Details
-
PICA
-
POINT
-
MM
-
CM
-
INCH
-
MPT
-
CACHE
cache holding all canonical FixedLength instances -
ZERO_FIXED_LENGTH
canonical zero-length instance -
millipoints
private int millipoints
-
-
Constructor Details
-
FixedLength
Set the length given a number of units, a unit name and an assumed resolution (used in case the units are pixels)- Parameters:
numUnits- quantity of input unitsunits- input unit specifierres- input/source resolution
-
-
Method Details
-
getInstance
Return the cachedFixedLengthinstance corresponding to the computed value in base-units (millipoints).- Parameters:
numUnits- quantity of input unitsunits- input unit specifiersourceResolution- input/source resolution (= ratio of pixels per pt)- Returns:
- the canonical FixedLength instance corresponding to the given number of units and unit specifier in the given resolution
-
getInstance
Return the cachedFixedLengthinstance corresponding to the computed value This method assumes a source-resolution of 1 (1px = 1pt)- Parameters:
numUnits- input unitsunits- unit specifier- Returns:
- the canonical FixedLength instance corresponding to the given number of units and unit specifier
-
getInstance
Return the cachedFixedLengthinstance corresponding to the computed value. This method assumes 'millipoints' (non-standard) as units, and an implied source-resolution of 1 (1px = 1pt).- Parameters:
numUnits- input units- Returns:
- the canonical FixedLength instance corresponding to the given number of units and unit specifier
-
convert
Convert the given length to a dimensionless integer representing a whole number of base units (milli-points).- Parameters:
dvalue- quantity of input unitsunit- input unit specifier (in, cm, etc.)res- the input/source resolution (in case the unit spec is "px")
-
getValue
public int getValue()Returns the length in 1/1000ths of a point (millipoints)- Returns:
- the length in millipoints
-
getValue
Returns the length in 1/1000ths of a point (millipoints)- Parameters:
context- The context for the length calculation (for percentage based lengths)- Returns:
- the length in millipoints
-
getNumericValue
public double getNumericValue()Return the value of this Numeric- Returns:
- the computed value.
-
getNumericValue
Return the value of this Numeric- Parameters:
context- The context for the length calculation (for percentage based lengths)- Returns:
- the computed value.
-
isAbsolute
public boolean isAbsolute()Return true since a FixedLength is always absolute. Return true if the numeric is an absolute value. Relative values are percentages and table-column-units. All other numerics are absolute.- Returns:
- true when the numeric is absolute.
-
toString
-
equals
-
hashCode
-