ti.chimera.pref
Class FontNodeContract

java.lang.Object
  extended byti.chimera.registry.TypeNodeContract
      extended byti.chimera.pref.FontNodeContract
All Implemented Interfaces:
NodeContract

public class FontNodeContract
extends TypeNodeContract

A NodeContract which constrains the value to be a font matching the specified style. Note that some of the styles are mutually exclusive, so if you specify, for example a style BOLD | NOT_BOLD, then no possible font will match.

Version:
0.1
Author:
;Rob Clark;a0873619;San Diego;;

Field Summary
static int BOLD
          A style flag indicating that only bold fonts are acceptible.
static int ITALIC
          A style flag indicating that only italic fonts are acceptible.
static int MONOSPACE
          A style flag indicating that only monospace fonts are acceptible.
static int NOT_BOLD
          A style flag indicating that only non-bold fonts are acceptible.
static int NOT_ITALIC
          A style flag indicating that only non-italic fonts are acceptible.
static int NOT_MONOSPACE
          A style flag indicating that only non-monospace fonts are acceptible.
 
Fields inherited from interface ti.chimera.registry.NodeContract
BOOLEAN_CONTRACT, NULL_CONTRACT, NUMBER_CONTRACT, STRING_CONTRACT
 
Constructor Summary
FontNodeContract()
          Class Constructor.
FontNodeContract(int style)
          Class Constructor.
 
Method Summary
 boolean accepts(java.lang.Object value)
          Determine if the specified value meets this contract.
 int getStyle()
          Get the style
 java.lang.String toString()
          The contract implementation should overload toString so the contract can be displayed to the user in a sane format, for use in error messages, etc.
 
Methods inherited from class ti.chimera.registry.TypeNodeContract
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MONOSPACE

public static final int MONOSPACE
A style flag indicating that only monospace fonts are acceptible.

See Also:
Constant Field Values

NOT_MONOSPACE

public static final int NOT_MONOSPACE
A style flag indicating that only non-monospace fonts are acceptible.

See Also:
Constant Field Values

BOLD

public static final int BOLD
A style flag indicating that only bold fonts are acceptible.

See Also:
Constant Field Values

NOT_BOLD

public static final int NOT_BOLD
A style flag indicating that only non-bold fonts are acceptible.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
A style flag indicating that only italic fonts are acceptible.

See Also:
Constant Field Values

NOT_ITALIC

public static final int NOT_ITALIC
A style flag indicating that only non-italic fonts are acceptible.

See Also:
Constant Field Values
Constructor Detail

FontNodeContract

public FontNodeContract()
Class Constructor.


FontNodeContract

public FontNodeContract(int style)
Class Constructor.

Parameters:
style - a bitmask of constraints on the acceptible font
Method Detail

accepts

public boolean accepts(java.lang.Object value)
Determine if the specified value meets this contract.

Specified by:
accepts in interface NodeContract
Overrides:
accepts in class TypeNodeContract
Parameters:
value - the value to check
Returns:
true if meets contract

getStyle

public int getStyle()
Get the style


toString

public java.lang.String toString()
The contract implementation should overload toString so the contract can be displayed to the user in a sane format, for use in error messages, etc.

Specified by:
toString in interface NodeContract
Overrides:
toString in class TypeNodeContract