jgDataLoader
Class DataLoader

java.lang.Object
  extended byjgDataLoader.DataLoader

public class DataLoader
extends java.lang.Object

The data loader is resposible for maintaing a list of catagory folder locations, validating catagories, and loading media in the catagories. TODO: If wrapped in a jar file, use a default catagory (directory) in the jar file. TODO: Find out where Apple places user specific data, for both MAC OS X and previous OS versions....


Field Summary
protected  CatagoryList catagoryList
          Private instance of the catagory list
protected  java.io.File globalDir
          Global location of catagory folders
protected  java.io.File includeDir
          User specified directory.
protected  java.io.File userDir
          User specific location of catagory folders (in the user's home dir)
 
Constructor Summary
DataLoader()
          Constructor.
 
Method Summary
 void addCatagoriesFromDir(java.io.File dir)
          Adds catagory names to the list of catagories, using the directory entries in 'dir'.
 GlyphImageList getAvailableGlyphImages()
          Retrieves all available glyph images with no glyph restrictions
 GlyphImageList getAvailableGlyphImages(GlyphSet restrict)
          Retrieves all available glyph images restricted to the passed GlyphSet
 GlyphSet getAvailableGlyphs()
          Retrieves all available glyphs with no restrictions.
 GlyphSet getAvailableGlyphs(GlyphSet restrict)
          Retrieves a new GlyphSet indicating all available glyphs for the selected catagory, retstricted to the passed GlyphSet (if not empty).
 java.lang.String[] getCatagoryNames()
          Retrieves the names of all the available catagories.
 boolean isCatagoryValid(java.lang.String cat)
          Checks to see if a catagory is valid
 java.io.File locateCatagory(java.lang.String name)
          Locates a catagory by name.
 java.lang.String toString()
          Returns the string representation of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

catagoryList

protected CatagoryList catagoryList
Private instance of the catagory list


globalDir

protected java.io.File globalDir
Global location of catagory folders


userDir

protected java.io.File userDir
User specific location of catagory folders (in the user's home dir)


includeDir

protected java.io.File includeDir
User specified directory.

Constructor Detail

DataLoader

public DataLoader()
Constructor. Initializes the catagory locations.

Method Detail

toString

public java.lang.String toString()
Returns the string representation of this class


isCatagoryValid

public boolean isCatagoryValid(java.lang.String cat)
Checks to see if a catagory is valid


addCatagoriesFromDir

public void addCatagoriesFromDir(java.io.File dir)
Adds catagory names to the list of catagories, using the directory entries in 'dir'.

Parameters:
dir - the directory to look in

locateCatagory

public java.io.File locateCatagory(java.lang.String name)
Locates a catagory by name. The search order is the user specified directory (if applicable), the user specific directory (if applicable), and finally the global directory. The search is case sensative if the underlying file system is case sensative.

Parameters:
name - the name of the catagory.
Returns:
the File location of this catagory, or null if not found.

getCatagoryNames

public java.lang.String[] getCatagoryNames()
Retrieves the names of all the available catagories.

Returns:
a String array of catagory names.

getAvailableGlyphs

public GlyphSet getAvailableGlyphs(GlyphSet restrict)
Retrieves a new GlyphSet indicating all available glyphs for the selected catagory, retstricted to the passed GlyphSet (if not empty).

Parameters:
restrict - the GlyphSet to restrict the retreival to.
Returns:
a new GlyphSet indicating all available glyphs for the selected catagory

getAvailableGlyphs

public GlyphSet getAvailableGlyphs()
Retrieves all available glyphs with no restrictions.

Returns:
a new GlyphSet indicating all available glyphs for the selected catagory

getAvailableGlyphImages

public GlyphImageList getAvailableGlyphImages(GlyphSet restrict)
Retrieves all available glyph images restricted to the passed GlyphSet

Parameters:
restrict - the GlyphSet to filter on
Returns:
a GlyphImageList containing all available glyphs images

getAvailableGlyphImages

public GlyphImageList getAvailableGlyphImages()
Retrieves all available glyph images with no glyph restrictions

Returns:
a GlyphImageList containing all available glyph images