Task.Support.GUISupport
Class FontUtils

java.lang.Object
  extended by Task.Support.GUISupport.FontUtils

public class FontUtils
extends java.lang.Object

FontUtils is a convenience class that allows pre defined font sizes and styles to be accessed easily. These fonts are cached, once created, to enhance performance.

Since:
May 6, 2007, 1:33:40 PM
Version:
1.0
Author:
Nazmul Idris

Nested Class Summary
static class FontUtils.FontNames
           
static class FontUtils.FontStyles
           
 
Field Summary
static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.awt.Font> FontCache
           
 
Constructor Summary
FontUtils()
           
 
Method Summary
static java.awt.Font create(java.lang.String name, int style, float size)
          check to see if the entire name + style + size is in the cache, if not: 1. see if you have to load the name + style from the JAR file (cache this in FONT_FILES_IN_JAR) 2. derive this loaded font, and save that to the FONT_CACHE
static java.lang.String dumpFontCache()
           
static void setFonts()
          load all the fonts from the JAR file now
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FontCache

public static final java.util.concurrent.ConcurrentHashMap<java.lang.String,java.awt.Font> FontCache
Constructor Detail

FontUtils

public FontUtils()
Method Detail

setFonts

public static void setFonts()
load all the fonts from the JAR file now


create

public static java.awt.Font create(java.lang.String name,
                                   int style,
                                   float size)
                            throws java.lang.IllegalArgumentException
check to see if the entire name + style + size is in the cache, if not: 1. see if you have to load the name + style from the JAR file (cache this in FONT_FILES_IN_JAR) 2. derive this loaded font, and save that to the FONT_CACHE

Throws:
java.lang.IllegalArgumentException

dumpFontCache

public static java.lang.String dumpFontCache()


Copyright © 2011. All Rights Reserved.