|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectkawigi.properties.AbstractPrefs
public abstract class AbstractPrefs
This is the superclass of PrefProxy implementations used in KawigiEdit. The purpose here is to reduce duplicated code in converting the string representations of property values into other types. Then, other actually distinct implementations only really need to implement getProperty, setProperty and commit. Note the difference in semantics between this implementation and the way Java's and TopCoder's properties work and the way I want KawigiEdit's properties to work - in other implementations, the default value is just returned if there is no set property. Here I'm setting it if it's not set.
| Constructor Summary | |
|---|---|
AbstractPrefs()
AbstractPrefs constructor. |
|
| Method Summary | |
|---|---|
boolean |
getBoolean(java.lang.String property)
Gets the given property as a boolean value. |
boolean |
getBoolean(java.lang.String property,
boolean defaultValue)
Gets the given property as a boolean value, setting it to the defaultValue if it isn't set yet. |
java.awt.Color |
getColor(java.lang.String property)
Gets the given property as a color. |
java.awt.Color |
getColor(java.lang.String property,
java.awt.Color defaultValue)
Gets the given property as a color, setting it to defaultValue if it isn't set yet. |
double |
getDouble(java.lang.String property)
Gets the given property as a double. |
double |
getDouble(java.lang.String property,
double defaultValue)
Gets the given property as a double, setting it to defaultValue if it hasn't been set yet. |
java.awt.Font |
getFont(java.lang.String property)
Gets the given property as a Font object. |
java.awt.Font |
getFont(java.lang.String property,
java.awt.Font defaultValue)
Returns the given property as a Font object, setting the property to the value of the default value if it isn't set. |
int |
getInt(java.lang.String property)
Gets the given property as an int. |
int |
getInt(java.lang.String property,
int defaultValue)
Gets the given property as an int, setting the property to defaultValue if it hasn't been set yet. |
java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaultValue)
Gets the given property, setting it to defaultValue if it isn't set yet. |
java.io.File |
getWorkingDirectory()
Returns the value of the "kawigi.localpath" property as a File. |
void |
setBoolean(java.lang.String property,
boolean value)
Sets a given property to a boolean value. |
void |
setColor(java.lang.String property,
java.awt.Color value)
Sets the given property to the given Color value. |
void |
setDouble(java.lang.String property,
double value)
Sets the given property to the given double value. |
void |
setFont(java.lang.String property,
java.awt.Font value)
Sets the given property to the given Font value. |
void |
setInt(java.lang.String property,
int value)
Sets the given property to the given integer value. |
void |
setWorkingDirectory(java.io.File f)
Sets the "kawigi.localpath" property to the path of the given directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface kawigi.properties.PrefProxy |
|---|
commit, getProperty, setProperty |
| Constructor Detail |
|---|
public AbstractPrefs()
| Method Detail |
|---|
public boolean getBoolean(java.lang.String property)
getBoolean in interface PrefProxy
public boolean getBoolean(java.lang.String property,
boolean defaultValue)
getBoolean in interface PrefProxy
public void setBoolean(java.lang.String property,
boolean value)
setBoolean in interface PrefProxypublic java.awt.Font getFont(java.lang.String property)
getFont in interface PrefProxy
public java.awt.Font getFont(java.lang.String property,
java.awt.Font defaultValue)
getFont in interface PrefProxy
public void setFont(java.lang.String property,
java.awt.Font value)
setFont in interface PrefProxypublic java.awt.Color getColor(java.lang.String property)
getColor in interface PrefProxy
public java.awt.Color getColor(java.lang.String property,
java.awt.Color defaultValue)
getColor in interface PrefProxy
public void setColor(java.lang.String property,
java.awt.Color value)
setColor in interface PrefProxypublic int getInt(java.lang.String property)
getInt in interface PrefProxy
public int getInt(java.lang.String property,
int defaultValue)
getInt in interface PrefProxy
public void setInt(java.lang.String property,
int value)
setInt in interface PrefProxypublic double getDouble(java.lang.String property)
getDouble in interface PrefProxy
public double getDouble(java.lang.String property,
double defaultValue)
getDouble in interface PrefProxy
public void setDouble(java.lang.String property,
double value)
setDouble in interface PrefProxy
public java.lang.String getProperty(java.lang.String property,
java.lang.String defaultValue)
getProperty in interface PrefProxypublic java.io.File getWorkingDirectory()
getWorkingDirectory in interface PrefProxypublic void setWorkingDirectory(java.io.File f)
setWorkingDirectory in interface PrefProxy
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||