jcreek.cke.visualizer
Class AppSettings

java.lang.Object
  extended byjcreek.cke.visualizer.AppSettings

public class AppSettings
extends java.lang.Object

Implements a properties storage class. This is used to store a variety of properties, each associated with a key string. Each key string must be unique or otherwise you will overwrite existing properties in the table. The properties can be saved to a file and restored at a later time, allowing persistent data storage.

This class implements the Singleton design pattern to ensure that only one instance of this class exists in the system. To get the single instance you can call the instanceOf() method.

Version:
Author:

Field Summary
protected  javax.swing.event.EventListenerList changeListeners
           
static java.lang.String HORIZONTAL_ALLIGNMENT
           
protected  java.lang.String iniFileName
           
protected static AppSettings instance
           
static java.lang.String ISINSTANCE
           
static java.lang.String ISSUBCLASS
           
static java.lang.String LOOK_FEEL
          Name of the property that determines which look & feel is to be used in the user interface.
static java.lang.String RELATION_NAME
           
protected  java.util.Properties table
           
static java.lang.String VERTICAL_ALLIGNMENT
           
 
Constructor Summary
protected AppSettings()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
           
 void clear()
           
 void commit()
           
 boolean contains(java.lang.String key)
           
protected  void fireChange()
           
 boolean getBoolean(java.lang.String key)
           
 java.lang.String getCurrentDirectory()
           
 double getDouble(java.lang.String key)
           
 int getRelation(java.lang.String key)
           
 java.lang.String[] getSelectedRelations()
           
 java.lang.String getString(java.lang.String key)
           
static AppSettings instanceOf()
           
 boolean isEmpty()
           
 boolean load(java.lang.String fileName)
           
 void remove(java.lang.String key)
           
 void removeChangeListener(javax.swing.event.ChangeListener listener)
           
 boolean save(java.lang.String fileName, java.lang.String comment)
           
 void setBoolean(java.lang.String key, boolean value)
           
 void setCurrentDirectory(java.lang.String dir)
           
 void setDouble(java.lang.String key, double value)
           
 void setRelation(java.lang.String key, int value)
           
 void setString(java.lang.String key, java.lang.String value)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELATION_NAME

public static final java.lang.String RELATION_NAME
See Also:
Constant Field Values

ISSUBCLASS

public static final java.lang.String ISSUBCLASS
See Also:
Constant Field Values

ISINSTANCE

public static final java.lang.String ISINSTANCE
See Also:
Constant Field Values

HORIZONTAL_ALLIGNMENT

public static final java.lang.String HORIZONTAL_ALLIGNMENT
See Also:
Constant Field Values

VERTICAL_ALLIGNMENT

public static final java.lang.String VERTICAL_ALLIGNMENT
See Also:
Constant Field Values

LOOK_FEEL

public static final java.lang.String LOOK_FEEL
Name of the property that determines which look & feel is to be used in the user interface. Accepts string values.

See Also:
Constant Field Values

table

protected java.util.Properties table

changeListeners

protected javax.swing.event.EventListenerList changeListeners

instance

protected static AppSettings instance

iniFileName

protected java.lang.String iniFileName
Constructor Detail

AppSettings

protected AppSettings()
Method Detail

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)

clear

public void clear()

commit

public void commit()

contains

public boolean contains(java.lang.String key)

fireChange

protected void fireChange()

getBoolean

public boolean getBoolean(java.lang.String key)

getDouble

public double getDouble(java.lang.String key)

getString

public java.lang.String getString(java.lang.String key)

getCurrentDirectory

public java.lang.String getCurrentDirectory()

setCurrentDirectory

public void setCurrentDirectory(java.lang.String dir)

instanceOf

public static AppSettings instanceOf()

isEmpty

public boolean isEmpty()

load

public boolean load(java.lang.String fileName)

remove

public void remove(java.lang.String key)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)

save

public boolean save(java.lang.String fileName,
                    java.lang.String comment)

setBoolean

public void setBoolean(java.lang.String key,
                       boolean value)

setDouble

public void setDouble(java.lang.String key,
                      double value)

setString

public void setString(java.lang.String key,
                      java.lang.String value)

setRelation

public void setRelation(java.lang.String key,
                        int value)

getRelation

public int getRelation(java.lang.String key)

getSelectedRelations

public java.lang.String[] getSelectedRelations()

size

public int size()


Created at IDI, NTNU by the Artificial Intelligence and Learning group