platypus
Class PlatyConst

java.lang.Object
  extended by platypus.PlatyConst

public final class PlatyConst
extends java.lang.Object

Immutable constants used in Platypus (Does not include status and error codes, which are located in Status.java)

Author:
alb

Nested Class Summary
static class PlatyConst.unit
          units of measure
 
Field Summary
static float CMS_PER_INCH
          one inch = 2.54 centimeters
static Alignment.type DEFAULT_ALIGNMENT
           
static float DEFAULT_FONT_SIZE_PTS
           
static float DEFAULT_FOOTER_FONT_SIZE_PTS
           
static int DEFAULT_FOOTER_PAGES_TO_SKIP
           
static java.lang.String DEFAULT_FOOTER_TYPEFACE
           
static float DEFAULT_LEADING_PTS
           
static float DEFAULT_MARGIN_PTS
           
static int DEFAULT_NUMBER_OF_COLUMNS
           
static float DEFAULT_PAGE_HT_PTS
           
static float DEFAULT_PAGE_WD_PTS
           
static float DEFAULT_PARA_INDENT_PTS
           
static float DEFAULT_STRIKETHRU_LINE_WIDTH
           
static java.lang.String DEFAULT_TYPEFACE
           
static float DEFAULT_UNDERLINE_LOCATION
           
static float DEFAULT_UNDERLINE_THICKNESS
           
static float FONT_SIZE_TO_STRIKETHRU_RATIO
          unless otherwise stated, strikethrough location is 1/4 of font size above the baseline
static float LEADING_TO_FONT_RATIO
           
static int MIN_TOKEN_LEN
          must be at least two characters in a token
static float MINIMUM_FONT_SIZE
           
static float MMS_PER_CM
          one cm = 10mm
static float POINTS_PER_INCH
          one inch = 72 points
 
Constructor Summary
PlatyConst()
           
 
Method Summary
static float cmsToPoints(float cms)
           
static float cmsToPoints(int cms)
           
static float convertUnitsToPoints(PlatyConst.unit unit, float amount)
          converts type and value to points
static float inchesToPoints(float inches)
           
static float inchesToPoints(int inches)
           
static float linesToPoints(float lines)
          Converts lines to points.
static float linesToPoints(int lines)
           
static float pointsToInches(float points)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_TOKEN_LEN

public static final int MIN_TOKEN_LEN
must be at least two characters in a token

See Also:
Constant Field Values

DEFAULT_ALIGNMENT

public static final Alignment.type DEFAULT_ALIGNMENT

DEFAULT_FONT_SIZE_PTS

public static final float DEFAULT_FONT_SIZE_PTS
See Also:
Constant Field Values

DEFAULT_FOOTER_FONT_SIZE_PTS

public static final float DEFAULT_FOOTER_FONT_SIZE_PTS
See Also:
Constant Field Values

DEFAULT_TYPEFACE

public static final java.lang.String DEFAULT_TYPEFACE
See Also:
Constant Field Values

DEFAULT_FOOTER_TYPEFACE

public static final java.lang.String DEFAULT_FOOTER_TYPEFACE
See Also:
Constant Field Values

MINIMUM_FONT_SIZE

public static final float MINIMUM_FONT_SIZE
See Also:
Constant Field Values

DEFAULT_STRIKETHRU_LINE_WIDTH

public static final float DEFAULT_STRIKETHRU_LINE_WIDTH
See Also:
Constant Field Values

DEFAULT_UNDERLINE_LOCATION

public static final float DEFAULT_UNDERLINE_LOCATION
See Also:
Constant Field Values

DEFAULT_UNDERLINE_THICKNESS

public static final float DEFAULT_UNDERLINE_THICKNESS
See Also:
Constant Field Values

LEADING_TO_FONT_RATIO

public static final float LEADING_TO_FONT_RATIO
See Also:
Constant Field Values

DEFAULT_LEADING_PTS

public static final float DEFAULT_LEADING_PTS
See Also:
Constant Field Values

FONT_SIZE_TO_STRIKETHRU_RATIO

public static final float FONT_SIZE_TO_STRIKETHRU_RATIO
unless otherwise stated, strikethrough location is 1/4 of font size above the baseline

See Also:
Constant Field Values

DEFAULT_PARA_INDENT_PTS

public static final float DEFAULT_PARA_INDENT_PTS
See Also:
Constant Field Values

DEFAULT_PAGE_HT_PTS

public static final float DEFAULT_PAGE_HT_PTS
See Also:
Constant Field Values

DEFAULT_PAGE_WD_PTS

public static final float DEFAULT_PAGE_WD_PTS
See Also:
Constant Field Values

DEFAULT_MARGIN_PTS

public static final float DEFAULT_MARGIN_PTS
See Also:
Constant Field Values

DEFAULT_NUMBER_OF_COLUMNS

public static final int DEFAULT_NUMBER_OF_COLUMNS
See Also:
Constant Field Values

DEFAULT_FOOTER_PAGES_TO_SKIP

public static final int DEFAULT_FOOTER_PAGES_TO_SKIP
See Also:
Constant Field Values

POINTS_PER_INCH

public static final float POINTS_PER_INCH
one inch = 72 points

See Also:
Constant Field Values

CMS_PER_INCH

public static final float CMS_PER_INCH
one inch = 2.54 centimeters

See Also:
Constant Field Values

MMS_PER_CM

public static final float MMS_PER_CM
one cm = 10mm

See Also:
Constant Field Values
Constructor Detail

PlatyConst

public PlatyConst()
Method Detail

inchesToPoints

public static float inchesToPoints(float inches)

inchesToPoints

public static float inchesToPoints(int inches)

pointsToInches

public static float pointsToInches(float points)

cmsToPoints

public static float cmsToPoints(float cms)

cmsToPoints

public static float cmsToPoints(int cms)

linesToPoints

public static float linesToPoints(float lines)
Converts lines to points. A line is defined as current font size * LEADING_TO_FONT_RATIO. (The temptation to make 1 line = to the current leading fails in the event that a user asks for double space (2li). If this new leading becomes the new equivalent of a single line, then the user has no way to go from this double-space back to single-space.)

Parameters:
lines -
Returns:
points

linesToPoints

public static float linesToPoints(int lines)

convertUnitsToPoints

public static float convertUnitsToPoints(PlatyConst.unit unit,
                                         float amount)
converts type and value to points

Parameters:
unit - an enum representing the type of unit (inch, point, pixel, etc.)
amount - the number of units
Returns:
the number of points, or Float.NaN if the unit is invalid


Copyright © 2006-7 Pacific Data Works LLC