rero.config

Class ClientState

public class ClientState extends Object

Field Summary
protected Propertiesbackup
protected static FilebaseDirectory
protected Setchanges
protected static ClientStateclientState
protected static HashMaplisteners
protected Propertiesstate
Constructor Summary
ClientState()
Method Summary
voidaddClientStateListener(String property, ClientStateListener l)
voidbackup()
performs a backup of the properties before making changes, it is the responsability of the changing class to call this function
voidfireChange(String property)
voidfireChange(String property, String parameter)
static FilegetBaseDirectory()
RectanglegetBounds(String key, Dimension areaSize, Dimension mySize)
static ClientStategetClientState()
ColorgetColor(String key, Color defaultColor)
static FilegetFile(String filename)
floatgetFloat(String key, float defaultValue)
FontgetFont(String key, Font defaultValue)
StringgetHelpString(String topic)
ImageIcongetIcon(String key, String defaultResource)
intgetInteger(String key, int defaultValue)
URLgetPackagedResource(String fileName, String subDir)
static InputStreamReadergetProperInputStream(InputStream stream)
static PrintStreamgetProperPrintStream(OutputStream stream)
PropertiesgetProperties()
URLgetResource(String fileName)
InputStreamgetResourceAsStream(String fileName)
StringgetString(String key, String defaultValue)
StringListgetStringList(String key)
booleanisOption(String key, boolean defaultBoolean)
booleanisValue(String key, String item)
voidrestore()
performs a restore of the properties effectively undoing everything since the last backup, it is the responsability of the changing class to call this function
static voidsetBaseDirectory(String directory)
voidsetBounds(String key, Rectangle value)
voidsetColor(String key, Color color)
voidsetFloat(String key, float value)
voidsetFont(String key, Font value)
voidsetInteger(String key, int value)
voidsetOption(String key, boolean value)
voidsetString(String key, String value)
voidsync()
sync the file system config file with the current client state

Field Detail

backup

protected Properties backup

baseDirectory

protected static File baseDirectory

changes

protected Set changes

clientState

protected static ClientState clientState

listeners

protected static HashMap listeners

state

protected Properties state

Constructor Detail

ClientState

public ClientState()

Method Detail

addClientStateListener

public void addClientStateListener(String property, ClientStateListener l)

backup

public void backup()
performs a backup of the properties before making changes, it is the responsability of the changing class to call this function

fireChange

public void fireChange(String property)

fireChange

public void fireChange(String property, String parameter)

getBaseDirectory

public static File getBaseDirectory()

getBounds

public Rectangle getBounds(String key, Dimension areaSize, Dimension mySize)

getClientState

public static ClientState getClientState()

getColor

public Color getColor(String key, Color defaultColor)

getFile

public static File getFile(String filename)

getFloat

public float getFloat(String key, float defaultValue)

getFont

public Font getFont(String key, Font defaultValue)

getHelpString

public String getHelpString(String topic)

getIcon

public ImageIcon getIcon(String key, String defaultResource)

getInteger

public int getInteger(String key, int defaultValue)

getPackagedResource

public URL getPackagedResource(String fileName, String subDir)

getProperInputStream

public static InputStreamReader getProperInputStream(InputStream stream)

getProperPrintStream

public static PrintStream getProperPrintStream(OutputStream stream)

getProperties

public Properties getProperties()

getResource

public URL getResource(String fileName)

getResourceAsStream

public InputStream getResourceAsStream(String fileName)

getString

public String getString(String key, String defaultValue)

getStringList

public StringList getStringList(String key)

isOption

public boolean isOption(String key, boolean defaultBoolean)

isValue

public boolean isValue(String key, String item)

restore

public void restore()
performs a restore of the properties effectively undoing everything since the last backup, it is the responsability of the changing class to call this function

setBaseDirectory

public static void setBaseDirectory(String directory)

setBounds

public void setBounds(String key, Rectangle value)

setColor

public void setColor(String key, Color color)

setFloat

public void setFloat(String key, float value)

setFont

public void setFont(String key, Font value)

setInteger

public void setInteger(String key, int value)

setOption

public void setOption(String key, boolean value)

setString

public void setString(String key, String value)

sync

public void sync()
sync the file system config file with the current client state