SourceForge.net Logo
aXSL API 0.2

org.axsl.font
Enum Font.Weight

java.lang.Object
  extended by java.lang.Enum<Font.Weight>
      extended by org.axsl.font.Font.Weight
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Font.Weight>
Enclosing interface:
Font

public static enum Font.Weight
extends java.lang.Enum<Font.Weight>

Enumeration of constants needed to describe the weight of a font.


Enum Constant Summary
ANY
          Font-weight constant indicating no preference.
BLACK
          Font-weight constant indicating a weight of 900 (black).
BOLD
          Font-weight constant indicating a weight of 700 (bold).
DARK
          Font-weight constant indicating a weight of 500 (dark).
EXTRA_BOLD
          Font-weight constant indicating a weight of 800 (extra bold).
EXTREMELY_LIGHT
          Font-weight constant indicating a weight of 100 (extremely light).
LIGHT
          Font-weight constant indicating a weight of 300 (light).
NORMAL
          Font-weight constant indicating a weight of 400 (normal).
SEMI_BOLD
          Font-weight constant indicating a weight of 600 (semi-bold).
VERY_LIGHT
          Font-weight constant indicating a weight of 200 (very light).
 
Method Summary
static Font.Weight fromNumeric(int numericWeight)
          Returns the Weight constant corresponding to a given numeric weight.
 short getNumericWeight()
          Return this weight's numeric weight.
static boolean isValidNumericWeight(int numericWeight)
          Indicates whether a given numeric weight has a corresponding Weight instance.
 Font.Weight nextHeaviest()
          Returns the next heaviest weight.
 Font.Weight nextLightest()
          Returns the next lightest weight.
static Font.Weight valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Font.Weight[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ANY

public static final Font.Weight ANY
Font-weight constant indicating no preference.


EXTREMELY_LIGHT

public static final Font.Weight EXTREMELY_LIGHT
Font-weight constant indicating a weight of 100 (extremely light).


VERY_LIGHT

public static final Font.Weight VERY_LIGHT
Font-weight constant indicating a weight of 200 (very light).


LIGHT

public static final Font.Weight LIGHT
Font-weight constant indicating a weight of 300 (light).


NORMAL

public static final Font.Weight NORMAL
Font-weight constant indicating a weight of 400 (normal).


DARK

public static final Font.Weight DARK
Font-weight constant indicating a weight of 500 (dark).


SEMI_BOLD

public static final Font.Weight SEMI_BOLD
Font-weight constant indicating a weight of 600 (semi-bold).


BOLD

public static final Font.Weight BOLD
Font-weight constant indicating a weight of 700 (bold).


EXTRA_BOLD

public static final Font.Weight EXTRA_BOLD
Font-weight constant indicating a weight of 800 (extra bold).


BLACK

public static final Font.Weight BLACK
Font-weight constant indicating a weight of 900 (black).

Method Detail

values

public static final Font.Weight[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Font.Weight c : Font.Weight.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Font.Weight valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getNumericWeight

public short getNumericWeight()
Return this weight's numeric weight. This is useful for mathematical comparisons of the relative weights.

Returns:
This weight's numeric weight. Valid values range from 100 to 900. Invalid values return Short.MIN_VALUE.

nextHeaviest

public Font.Weight nextHeaviest()
Returns the next heaviest weight.

Returns:
The next heaviest weight, null if this is not a valid weight, or if this is the heaviest weight, returns itself.

nextLightest

public Font.Weight nextLightest()
Returns the next lightest weight.

Returns:
The next lightest weight, null if this is not a valid weight, or if this is the lightest weight, returns itself.

fromNumeric

public static Font.Weight fromNumeric(int numericWeight)
Returns the Weight constant corresponding to a given numeric weight.

Parameters:
numericWeight - The numeric weight for which a constant is needed. This should be 100, 200, 300, 400, 500, 600, 700, 800, or 900.
Returns:
The Weight instance, or null if none corresponds to numericWeight.

isValidNumericWeight

public static boolean isValidNumericWeight(int numericWeight)
Indicates whether a given numeric weight has a corresponding Weight instance.

Parameters:
numericWeight - The numeric weight being tested.
Returns:
True iff there is a Weight instance corresponding to numericWeight

SourceForge.net Logo
aXSL API 0.2

This documentation was created August 8 2007 by The aXSL Group and may be freely copied. See license for details.