org.proteinshader.graphics.typography
Class GlyphSetFactoryFactory

java.lang.Object
  extended by org.proteinshader.graphics.typography.GlyphSetFactoryFactory

public class GlyphSetFactoryFactory
extends Object

Use Java reflection to load a concrete GlyphSetFactory based on information held in a Properties object.


Field Summary
static String FONT_DIRECTORY
          Font files (glyph bitmaps) and their associated configuration file ('.conf' files) must be in the fonts directory, which has the relative pathname '/./../fonts/'.
 
Constructor Summary
GlyphSetFactoryFactory()
          Constructs a TextLabelFactory.
 
Method Summary
 GlyphSetFactory createGlyphSetFactory(String factoryName, String configName)
          Uses Java reflection to load the concrete GlyphSetFactory that is requested in the configuration file.
 Properties readConfigFile(String configName)
          Reads the config file and stores its key-value pairs in a Properties object, which is a type of hash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FONT_DIRECTORY

public static final String FONT_DIRECTORY
Font files (glyph bitmaps) and their associated configuration file ('.conf' files) must be in the fonts directory, which has the relative pathname '/./../fonts/'.

See Also:
Constant Field Values
Constructor Detail

GlyphSetFactoryFactory

public GlyphSetFactoryFactory()
Constructs a TextLabelFactory.

Method Detail

createGlyphSetFactory

public GlyphSetFactory createGlyphSetFactory(String factoryName,
                                             String configName)
                                      throws GlyphConfigException
Uses Java reflection to load the concrete GlyphSetFactory that is requested in the configuration file.

Parameters:
factoryName - the name of the GlyphSetFactory to load.
configName - the name of the configuration file.
Returns:
A concrete GlyphSetFactory for reading a '.glf' file.
Throws:
GlyphConfigException - if an error occurs while trying to obtain the factory.

readConfigFile

public Properties readConfigFile(String configName)
                          throws GlyphConfigException
Reads the config file and stores its key-value pairs in a Properties object, which is a type of hash.

Parameters:
configName - the name of the configuration file to read.
Returns:
A Properties object with the config file info.
Throws:
GlyphConfigException - if an error occurs while trying to read the config file into the hash.


Copyright © 2007-2008