|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary java.util.Hashtable edu.ksu.cis.kdd.util.Settings
Class for saving, loading, and querying the settings.
The setting is stored in an XML file with the following DTD:
See config.xml for details.
The XML parser is implemented using visitor pattern, which is natural for recursive structures.
Consequently:
And so forth.
It is evident that a lot of this code is just copy-and-paste.
Field Summary | |
protected java.util.Hashtable |
BNJSettings
|
protected java.util.Hashtable |
buttonGroups
|
protected java.util.Hashtable |
classOptions
|
protected TableSet |
converterTable
|
protected TableSet |
dataConverterTable
|
protected java.util.Hashtable |
dataDesc2Format
|
protected java.util.List |
dataDescriptionList
|
protected java.util.List |
dataExtensionList
|
static boolean |
DEBUG
|
protected static boolean |
isGUI
|
static java.lang.String |
license
|
static java.lang.String |
ln
|
protected java.util.Hashtable |
netDesc2Format
|
protected java.util.List |
netDescriptionList
|
protected java.util.List |
netExtensionList
|
static MersenneTwisterFast |
random
|
static long |
randomSeed
|
protected java.util.LinkedList |
RegisteredBBNs
|
static java.lang.String |
versionString
|
protected java.util.Hashtable |
windowTable
|
Constructor Summary | |
Settings()
|
Method Summary | |
static java.util.Hashtable |
getBNJSettings()
Get BNJ general setting. |
static java.util.Hashtable |
getClassOptions(java.lang.String tag)
|
static TableSet |
getConverterTable()
Get the Converter Table |
static TableSet |
getDataConverterTable()
Get the Data Converter Table |
static java.util.List |
getDataDescriptionList()
|
static java.lang.String |
getDataExtensionFromDescription(java.lang.String desc)
|
static java.util.List |
getDataExtensionList()
|
static java.util.List |
getNetDescriptionList()
|
static java.lang.String |
getNetExtensionFromDescription(java.lang.String desc)
|
static java.util.List |
getNetExtensionList()
|
static java.util.LinkedList |
getRegisteredBBNs()
gets options from config.xml which set the layout of the Options GUI for each BBN class. |
static java.util.Hashtable |
getWindowSettings(java.lang.String name)
Get window setting |
static boolean |
isDebug()
|
static boolean |
isLoaded()
Whether the settings has already loaded (for GUI) |
static void |
load()
Load the default configuration file |
static void |
load(boolean forGUI)
Load the default configuration file |
void |
load(java.io.InputStream stream,
boolean forGUI)
Load the default configuration file |
static void |
load(java.lang.String filename,
boolean forGUI)
|
static void |
loadEnglishGUISettings()
|
protected javax.swing.ImageIcon |
loadImage(java.lang.String url)
|
protected void |
registerBBN(org.w3c.dom.Node parent,
java.util.LinkedList list)
|
static void |
save()
|
static void |
setClassOptions(java.lang.String tag,
java.util.Hashtable t)
|
static void |
setDebug(boolean debug)
|
static void |
setLanguage(java.util.Locale locale,
boolean forGUI)
|
static void |
setRandomSeed(long seed)
|
protected void |
visitColorSettings(org.w3c.dom.Node parent,
java.util.Hashtable prop)
Visit the <COLORSETTING>. |
protected void |
visitConverter(org.w3c.dom.Node parent)
Visit the <CONVERTER>. |
protected void |
visitConverters(org.w3c.dom.Node parent)
Visit the <CONVERTERS>. |
protected void |
visitDataConverter(org.w3c.dom.Node parent)
Visit the <DATACONVERTER>. |
protected void |
visitDataConverters(org.w3c.dom.Node parent)
Visit the <DATACONVERTERS>. |
protected void |
visitDocument(org.w3c.dom.Node parent)
Visit the configuration document body. |
protected void |
visitFontSettings(org.w3c.dom.Node parent,
java.util.Hashtable prop)
Visit the <FONTSETTING>. |
protected void |
visitIconSettings(org.w3c.dom.Node parent,
java.util.Hashtable prop)
Visit the <ICONSETTING>. |
protected javax.swing.JMenuBar |
visitMenu(org.w3c.dom.Node parent)
Visit the <MENU>. |
protected javax.swing.JMenu |
visitMenuEntry(org.w3c.dom.Node parent)
Visit the <MENUENTRY>. |
protected javax.swing.JMenuItem |
visitMenuItem(org.w3c.dom.Node parent)
Visit the <MENUITEM>. |
protected void |
visitPopupMenu(org.w3c.dom.Node parent,
java.util.Hashtable prop)
Visit the <POPUPMENU>. |
protected void |
visitSettings(org.w3c.dom.Node parent,
java.util.Hashtable prop)
Visit the <SETTING>. |
protected javax.swing.JToolBar |
visitToolBar(org.w3c.dom.Node parent)
Visit the <TOOLBAR>. |
protected javax.swing.JButton |
visitToolBarButton(org.w3c.dom.Node parent)
Visit the <MENUITEM>. |
protected javax.swing.JToggleButton |
visitToolBarToggleButton(org.w3c.dom.Node parent)
|
protected void |
visitWindow(org.w3c.dom.Node parent)
Visit the <WINDOW>. |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean DEBUG
public static MersenneTwisterFast random
public static long randomSeed
public static java.lang.String versionString
public static java.lang.String ln
protected static boolean isGUI
protected TableSet converterTable
protected TableSet dataConverterTable
protected java.util.Hashtable windowTable
protected java.util.Hashtable BNJSettings
protected java.util.LinkedList RegisteredBBNs
protected java.util.Hashtable buttonGroups
protected java.util.List netExtensionList
protected java.util.List dataExtensionList
protected java.util.List netDescriptionList
protected java.util.List dataDescriptionList
protected java.util.Hashtable dataDesc2Format
protected java.util.Hashtable netDesc2Format
protected java.util.Hashtable classOptions
public static final java.lang.String license
Constructor Detail |
public Settings()
Method Detail |
public static boolean isLoaded()
public static void load()
public static void load(boolean forGUI)
forGUI
- specify whether GUI elements should be loaded too or notpublic static void load(java.lang.String filename, boolean forGUI)
public void load(java.io.InputStream stream, boolean forGUI)
stream
- The input stream.forGUI
- specify whether GUI elements should be loaded too or notpublic static void setLanguage(java.util.Locale locale, boolean forGUI)
public static void loadEnglishGUISettings()
public static void save()
public static java.util.Hashtable getClassOptions(java.lang.String tag)
public static void setClassOptions(java.lang.String tag, java.util.Hashtable t)
public static void setRandomSeed(long seed)
protected void visitDocument(org.w3c.dom.Node parent)
parent
- The node to traverseprotected void registerBBN(org.w3c.dom.Node parent, java.util.LinkedList list)
protected void visitWindow(org.w3c.dom.Node parent)
parent
- The node to traverseprotected javax.swing.JMenuBar visitMenu(org.w3c.dom.Node parent)
parent
- The node to traverseprotected javax.swing.JMenu visitMenuEntry(org.w3c.dom.Node parent)
parent
- The node to traverseprotected javax.swing.JMenuItem visitMenuItem(org.w3c.dom.Node parent)
parent
- The node to traverseprotected void visitPopupMenu(org.w3c.dom.Node parent, java.util.Hashtable prop)
parent
- The node to traverseprotected javax.swing.JToolBar visitToolBar(org.w3c.dom.Node parent)
parent
- The node to traverseprotected javax.swing.JButton visitToolBarButton(org.w3c.dom.Node parent)
parent
- The node to traverseprotected javax.swing.JToggleButton visitToolBarToggleButton(org.w3c.dom.Node parent)
protected void visitSettings(org.w3c.dom.Node parent, java.util.Hashtable prop)
parent
- The node to traverseprotected void visitColorSettings(org.w3c.dom.Node parent, java.util.Hashtable prop)
parent
- The node to traverseprotected void visitIconSettings(org.w3c.dom.Node parent, java.util.Hashtable prop)
parent
- The node to traverseprotected void visitFontSettings(org.w3c.dom.Node parent, java.util.Hashtable prop)
parent
- The node to traverseprotected void visitConverters(org.w3c.dom.Node parent)
parent
- The node to traverseprotected void visitDataConverters(org.w3c.dom.Node parent)
parent
- The node to traverseprotected void visitConverter(org.w3c.dom.Node parent)
parent
- The node to traverseprotected void visitDataConverter(org.w3c.dom.Node parent)
parent
- The node to traversepublic static TableSet getConverterTable()
public static TableSet getDataConverterTable()
public static java.util.Hashtable getWindowSettings(java.lang.String name)
name
- Window ID
public static java.util.Hashtable getBNJSettings()
public static java.util.List getNetExtensionList()
public static java.util.List getDataExtensionList()
public static java.util.List getNetDescriptionList()
public static java.util.List getDataDescriptionList()
public static java.lang.String getNetExtensionFromDescription(java.lang.String desc)
public static java.lang.String getDataExtensionFromDescription(java.lang.String desc)
public static java.util.LinkedList getRegisteredBBNs()
protected javax.swing.ImageIcon loadImage(java.lang.String url)
public static void setDebug(boolean debug)
public static boolean isDebug()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |