com.jaxfront.swing.ui.tools
Class FontTools

java.lang.Object
  extended by com.jaxfront.swing.ui.tools.FontTools

public class FontTools
extends java.lang.Object

This class provides methodes to get, set or modifie a font.

Version:
1.60

Field Summary
static java.awt.Font BOLDFONT
          Default font, but bold
static java.awt.Font PLAINFONT
          Default font, but plain
 
Constructor Summary
FontTools()
           
 
Method Summary
static java.awt.Font evaluateDefaultFont()
          Evaluates the default font.
static java.awt.Font getBoldFont(float size)
          Returns the default font in bold with the specified size.
static java.awt.Font getDefaultFont()
          Returns the default font.
static java.awt.Font getFont(java.lang.String fontName)
          Returns the font with the specified name.
static java.awt.Font getFont(java.lang.String fontName, float size)
          Returns the font with the specified name and size.
static java.awt.Font getFont(java.lang.String fontname, int style, float size)
          Returns the font with the specified name, style and size.
static java.awt.Font getPlainFont(float size)
          Returns the plain font with the specified size.
static void main(java.lang.String[] args)
          Main method to start a demo of this class.
static void registerFont(java.lang.String name, java.awt.Font font)
          Registers the font with the specified name.
static void setDefaultFont(java.awt.Font font)
          Sets the default font with the specified font.
static void setFont(java.awt.Container c)
          Sets the default font for a container .
static void setFont(java.awt.Container c, java.awt.Font f)
          Sets the specified font for the specified container.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAINFONT

public static final java.awt.Font PLAINFONT
Default font, but plain


BOLDFONT

public static final java.awt.Font BOLDFONT
Default font, but bold

Constructor Detail

FontTools

public FontTools()
Method Detail

evaluateDefaultFont

public static java.awt.Font evaluateDefaultFont()
Evaluates the default font.

Returns:
default font

getBoldFont

public static java.awt.Font getBoldFont(float size)
Returns the default font in bold with the specified size.

Returns:
a bold font

getDefaultFont

public static java.awt.Font getDefaultFont()
Returns the default font.

Returns:
returns the default font

getFont

public static java.awt.Font getFont(java.lang.String fontName)
Returns the font with the specified name.

Parameters:
fontName - the name of the font
Returns:
the font with the specified name

getFont

public static java.awt.Font getFont(java.lang.String fontName,
                                    float size)
Returns the font with the specified name and size.

Parameters:
fontName - the name of the font
size - the size of the font
Returns:
the font with the specified name

getFont

public static java.awt.Font getFont(java.lang.String fontname,
                                    int style,
                                    float size)
Returns the font with the specified name, style and size.

Parameters:
fontName - the name of the font
style - style of the font eq. Font.ITALIC
size - the size of the font
Returns:
the font with the specified name

getPlainFont

public static java.awt.Font getPlainFont(float size)
Returns the plain font with the specified size.

Parameters:
size - size of the new font
Returns:
font with specified size

main

public static void main(java.lang.String[] args)
Main method to start a demo of this class.

Parameters:
args[] - none arguments are required to start this demo

registerFont

public static void registerFont(java.lang.String name,
                                java.awt.Font font)
Registers the font with the specified name.

Parameters:
name - name of the font
font - the font to be registered

setDefaultFont

public static void setDefaultFont(java.awt.Font font)
Sets the default font with the specified font.

Parameters:
font - the new default font

setFont

public static void setFont(java.awt.Container c)
Sets the default font for a container .

Parameters:
c - container that should have the new font

setFont

public static void setFont(java.awt.Container c,
                           java.awt.Font f)
Sets the specified font for the specified container.

Parameters:
c - container that should have the specified font
f - the font that should be setted to the container