de.qfs.lib.option
Class KeyOption
java.lang.Object
|
+--java.util.Observable
|
+--de.qfs.lib.option.Option
|
+--de.qfs.lib.option.KeyOption
- All Implemented Interfaces:
- java.lang.Cloneable, ConfigurableOption, java.io.Serializable
- public class KeyOption
- extends Option
- implements ConfigurableOption
This option holds the specific data of a KeyEvent
.
- Since:
- 0.98.1
- Version:
- $Revision: 1.3 $
- Author:
- Gregor Schmid
- See Also:
- Serialized Form
Inner Class Summary |
static class |
KeyOption.Data
Struct that contains the data for the KeyOption. |
Constructor Summary |
KeyOption(java.lang.String name,
int keyCode,
char keyChar,
int modifiers)
Create a new KeyOption. |
KeyOption(java.lang.String name,
KeyOption.Data data)
Create a new KeyOption. |
Method Summary |
boolean |
equals(java.lang.Object object)
Two KeyOptions are considered equal if their names and values
are equal. |
java.lang.String |
getConfigurableValue()
Get the Option's value as a String. |
void |
setConfigurableValue(java.lang.String value)
Set the Option's value from a String. |
Methods inherited from class de.qfs.lib.option.Option |
addResources, addValidator, checkValue, clone, getName, getResources, getValue, hashCode, isNullOK, removeValidator, setName, setNullOK, setResources, setValue, toString |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
KeyOption
public KeyOption(java.lang.String name,
KeyOption.Data data)
- Create a new KeyOption.
- Parameters:
name
- The name of the option.data
- The initial value.
KeyOption
public KeyOption(java.lang.String name,
int keyCode,
char keyChar,
int modifiers)
- Create a new KeyOption.
- Parameters:
name
- The name of the option.keyCode
- The initial keyCode value.keyChar
- The initial keyChar value.modifiers
- The initial modifiers value.
equals
public boolean equals(java.lang.Object object)
- Two KeyOptions are considered equal if their names and values
are equal.
- Overrides:
equals
in class Option
- Parameters:
object
- The object to compare to.- Returns:
- True if objects are equal
getConfigurableValue
public java.lang.String getConfigurableValue()
- Get the Option's value as a String. A null value is represented
as the empty String, otherwise the result is of the form
"keyCode,keyChar,modifiers".
- Specified by:
getConfigurableValue
in interface ConfigurableOption
- Returns:
- The Option's value as a String.
setConfigurableValue
public void setConfigurableValue(java.lang.String value)
- Set the Option's value from a String.
- Specified by:
setConfigurableValue
in interface ConfigurableOption
- Parameters:
value
- The value to set. Guaranteed to be non-null.