org.jrabbit.base.graphics.font
Class FontProfile

java.lang.Object
  extended by org.jrabbit.base.graphics.font.FontProfile

public class FontProfile
extends java.lang.Object

A convenience class for manipulating Java AWT Fonts.

Author:
Chris Molini

Field Summary
protected  boolean bold
          If the profile should apply a Bold typeface.
protected  boolean italic
          If the profile should apply an Italic typeface.
protected  int size
          The font size to apply.
 
Constructor Summary
FontProfile()
          Creates a default FontProfile that will simply apply a font size of 20.
FontProfile(boolean bold, boolean italic, int size)
          Creates a FontProfile with the indicated settings.
FontProfile(int size)
          Creates a FontProfile that will apply a specified font size.
 
Method Summary
 boolean bold()
          Accesses FontProfile settings.
 java.awt.Font derive(java.awt.Font font)
          Creates a new Font from the supplied Font, applying FontProfile settings.
 boolean italic()
          Accesses FontProfile settings.
 int size()
          Accesses FontProfile settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bold

protected boolean bold
If the profile should apply a Bold typeface.


italic

protected boolean italic
If the profile should apply an Italic typeface.


size

protected int size
The font size to apply.

Constructor Detail

FontProfile

public FontProfile()
Creates a default FontProfile that will simply apply a font size of 20.


FontProfile

public FontProfile(int size)
Creates a FontProfile that will apply a specified font size.

Parameters:
size - The size to apply on fonts.

FontProfile

public FontProfile(boolean bold,
                   boolean italic,
                   int size)
Creates a FontProfile with the indicated settings.

Parameters:
bold - Whether the font should be bold or not.
italic - Whether the font should be italicized or not
size - The size to apply to the font.
Method Detail

size

public int size()
Accesses FontProfile settings.

Returns:
The size the FontProfile will apply.

bold

public boolean bold()
Accesses FontProfile settings.

Returns:
Whether or not the FontProfile is applying bold typeface.

italic

public boolean italic()
Accesses FontProfile settings.

Returns:
Whether or not the FontProfile is applying italic typeface.

derive

public java.awt.Font derive(java.awt.Font font)
Creates a new Font from the supplied Font, applying FontProfile settings.

Parameters:
font - The base font.
Returns:
A new font, as indicated by this FontProfile.