net.sourceforge.jeuclid.elements.support.attributes
Class MathVariant

java.lang.Object
  extended by net.sourceforge.jeuclid.elements.support.attributes.MathVariant
All Implemented Interfaces:
Serializable

public final class MathVariant
extends Object
implements Serializable

Class to represent and use MathVariants.

Version:
$Revision: e6bd6c2d9bf4 $
See Also:
Serialized Form

Field Summary
static MathVariant BOLD
          Mathvariant constant.
static MathVariant BOLD_FRAKTUR
          Mathvariant constant.
static MathVariant BOLD_ITALIC
          Mathvariant constant.
static MathVariant BOLD_SANS_SERIF
          Mathvariant constant.
static MathVariant BOLD_SCRIPT
          Mathvariant constant.
static MathVariant DOUBLE_STRUCK
          Mathvariant constant.
static MathVariant FRAKTUR
          Mathvariant constant.
static MathVariant ITALIC
          Mathvariant constant.
static MathVariant MONOSPACE
          Mathvariant constant.
static MathVariant NORMAL
          Mathvariant constant.
static MathVariant SANS_SERIF
          Mathvariant constant.
static MathVariant SANS_SERIF_BOLD_ITALIC
          Mathvariant constant.
static MathVariant SANS_SERIF_ITALIC
          Mathvariant constant.
static MathVariant SCRIPT
          Mathvariant constant.
 
Constructor Summary
MathVariant(int awtstyle, FontFamily family)
          Creates a Mathvariant with the given AWT-Style and font-family.
 
Method Summary
 Font createFont(float size, int codepoint, LayoutContext context, boolean force)
          Create a font for the given attributes.
 boolean equals(Object obj)
          
 int getAwtStyle()
           
 FontFamily getFontFamily()
           
 int hashCode()
          
static MathVariant stringToMathVariant(String variant)
          Creates a Mathvariant object from an attribute value.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BOLD

public static final MathVariant BOLD
Mathvariant constant. Bold style.


BOLD_FRAKTUR

public static final MathVariant BOLD_FRAKTUR
Mathvariant constant. Bold fraktur style.


BOLD_ITALIC

public static final MathVariant BOLD_ITALIC
Mathvariant constant. Bold-italic style.


BOLD_SANS_SERIF

public static final MathVariant BOLD_SANS_SERIF
Mathvariant constant. Bold sans-serif style.


BOLD_SCRIPT

public static final MathVariant BOLD_SCRIPT
Mathvariant constant. Bold script style.


DOUBLE_STRUCK

public static final MathVariant DOUBLE_STRUCK
Mathvariant constant. Double struck style.


FRAKTUR

public static final MathVariant FRAKTUR
Mathvariant constant. Fraktur style.


ITALIC

public static final MathVariant ITALIC
Mathvariant constant. Italic style.


MONOSPACE

public static final MathVariant MONOSPACE
Mathvariant constant. Monospace style.


NORMAL

public static final MathVariant NORMAL
Mathvariant constant. Normal style.


SANS_SERIF

public static final MathVariant SANS_SERIF
Mathvariant constant. Sans-serif style.


SANS_SERIF_BOLD_ITALIC

public static final MathVariant SANS_SERIF_BOLD_ITALIC
Mathvariant constant. Bold italic sans-serif style.


SANS_SERIF_ITALIC

public static final MathVariant SANS_SERIF_ITALIC
Mathvariant constant. Italic sans-serif style.


SCRIPT

public static final MathVariant SCRIPT
Mathvariant constant. Script style.

Constructor Detail

MathVariant

public MathVariant(int awtstyle,
                   FontFamily family)
Creates a Mathvariant with the given AWT-Style and font-family.

Parameters:
awtstyle - the awt Style
family - the font family
Method Detail

stringToMathVariant

public static MathVariant stringToMathVariant(String variant)
Creates a Mathvariant object from an attribute value.

Parameters:
variant - the string representation of the attribute value
Returns:
a mathVariant object or null if none is found.

createFont

public Font createFont(float size,
                       int codepoint,
                       LayoutContext context,
                       boolean force)
Create a font for the given attributes.

Parameters:
size - size of the font to create
codepoint - a character that must exist in this font
context - LayoutContext to use.
force - if true will always return a font, otherwise will return null.
Returns:
a font object.

getAwtStyle

public int getAwtStyle()
Returns:
the awtStyle

getFontFamily

public FontFamily getFontFamily()
Returns:
the fontFamily

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2002-2010 The JEuclid project. All Rights Reserved.