org.omegahat.Graphics.Primitives
Class Unit

java.lang.Object
  |
  +--org.omegahat.Graphics.Primitives.Unit

public class Unit
extends java.lang.Object

Units in which lengths can be specified.

The class constants define which units are being supplied; for example Unit.CM for centimetres. These constants can be supplied as arguments or embedded in UDouble objects.

Units can be absolute: centimetres, inches, or lines of text (the last depending on the associated fontsize). They can also be relative: native units are relative to the scale of the corresponding graphical element; NPC are relative to the normalized parent co-ordinates. See the graphics engine paper for more discussion.


Field Summary
static int CM
           
static int INCH
           
static int LINE
           
static int N_TYPES
           
static java.lang.String[] Names
           
static int NATIVE
           
static int NPC
           
static int NULL
           
static int SNPC
           
 
Constructor Summary
Unit()
           
 
Method Summary
static boolean absUnit(int unit)
           
static java.lang.String name(int which)
           
static double transformAbsToCM(double value, int unit, double fontSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final int NULL

NPC

public static final int NPC

NATIVE

public static final int NATIVE

CM

public static final int CM

LINE

public static final int LINE

INCH

public static final int INCH

SNPC

public static final int SNPC

N_TYPES

public static final int N_TYPES

Names

public static final java.lang.String[] Names
Constructor Detail

Unit

public Unit()
Method Detail

name

public static java.lang.String name(int which)

transformAbsToCM

public static double transformAbsToCM(double value,
                                      int unit,
                                      double fontSize)

absUnit

public static boolean absUnit(int unit)