T
- the type of the TextTerminal.public class TerminalProperties<T extends TextTerminal<T>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
TerminalProperties.BooleanChangeListener<TT extends TextTerminal<TT>> |
static interface |
TerminalProperties.ChangeListener<TT extends TextTerminal<TT>,V> |
static interface |
TerminalProperties.DoubleChangeListener<TT extends TextTerminal<TT>> |
static interface |
TerminalProperties.ExtendedChangeListener<TT extends TextTerminal<TT>> |
static interface |
TerminalProperties.IntChangeListener<TT extends TextTerminal<TT>> |
static interface |
TerminalProperties.LongChangeListener<TT extends TextTerminal<TT>> |
static interface |
TerminalProperties.StringChangeListener<TT extends TextTerminal<TT>> |
Constructor and Description |
---|
TerminalProperties(T textTerminal) |
Modifier and Type | Method and Description |
---|---|
void |
addBooleanListener(java.lang.String key,
boolean defaultValue,
TerminalProperties.BooleanChangeListener<T> listener)
Convenience method that adds a listener for the boolean property with the specified key.
|
void |
addDoubleListener(java.lang.String key,
double defaultValue,
TerminalProperties.DoubleChangeListener<T> listener)
Convenience method that adds a listener for the double property with the specified key.
|
void |
addIntListener(java.lang.String key,
int defaultValue,
TerminalProperties.IntChangeListener<T> listener)
Convenience method that adds a listener for the int property with the specified key.
|
void |
addListener(TerminalProperties.ExtendedChangeListener<T> listener)
Adds a listener for this TerminalProperties instance.
|
void |
addLongListener(java.lang.String key,
long defaultValue,
TerminalProperties.LongChangeListener<T> listener)
Convenience method that adds a listener for the long property with the specified key.
|
void |
addStringListener(java.lang.String key,
java.lang.String defaultValue,
TerminalProperties.StringChangeListener<T> listener)
Convenience method that adds a listener for the String property with the specified key.
|
java.util.Set<java.lang.String> |
getAllKeys() |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Gets the boolean value of the property with the specified key.
|
double |
getDouble(java.lang.String key,
double defaultValue)
Gets the double value of the property with the specified key.
|
int |
getInt(java.lang.String key,
int defaultValue)
Gets the int value of the property with the specified key.
|
java.util.List<TerminalProperties.ExtendedChangeListener<T>> |
getListeners() |
long |
getLong(java.lang.String key,
long defaultValue)
Gets the long value of the property with the specified key.
|
java.util.Set<java.lang.String> |
getMatchingKeys(java.util.function.Predicate<java.lang.String> keyFilter) |
java.util.Set<java.lang.String> |
getMatchingKeys(java.lang.String regex) |
java.lang.String |
getString(java.lang.String key) |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Gets the String value of the property with the specified key.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Sets the value associated with the specified key.
|
void |
putAll(java.util.Map<java.lang.String,? extends java.lang.Object> map) |
java.lang.Object |
remove(java.lang.String key)
Removes the property with the specified key.
|
boolean |
removeListener(TerminalProperties.ExtendedChangeListener<T> listener)
Removes the listener passed as argument.
|
void |
setInputBackgroundColor(java.awt.Color bgcolor)
Convenience method that associates the hex representation of the specified
bgcolor with the key |
void |
setInputBackgroundColor(java.lang.String bgcolor)
Convenience method that associates the specified
bgcolor with the key |
void |
setInputBold(boolean bold)
Convenience method that associates the boolean value
bold with the key |
void |
setInputColor(java.awt.Color color)
Convenience method that associates the hex representation of the specified
color with the key |
void |
setInputColor(java.lang.String color)
Convenience method that associates the specified
color with the key |
void |
setInputItalic(boolean italic)
Convenience method that associates the boolean value
italic with the key |
void |
setInputUnderline(boolean underline)
Convenience method that associates the boolean value
underline with the key |
void |
setPaneBackgroundColor(java.awt.Color bgcolor)
Convenience method that associates the hex representation of the specified
bgcolor with the key |
void |
setPaneBackgroundColor(java.lang.String bgcolor)
Convenience method that associates the specified
bgcolor with the key |
void |
setPaneDimension(int width,
int height)
Convenience method that associates the specified
width and height with the keys and |
void |
setPaneHeight(int height)
Convenience method that associates the specified
height with the key |
void |
setPaneWidth(int width)
Convenience method that associates the specified
width with the key |
void |
setPromptBackgroundColor(java.awt.Color bgcolor)
Convenience method that associates the hex representation of the specified
bgcolor with the key |
void |
setPromptBackgroundColor(java.lang.String bgcolor)
Convenience method that associates the specified
bgcolor with the key |
void |
setPromptBold(boolean bold)
Convenience method that associates the boolean value
bold with the key |
void |
setPromptColor(java.awt.Color color)
Convenience method that associates the hex representation of the specified
color with the key |
void |
setPromptColor(java.lang.String color)
Convenience method that associates the specified
color with the key |
void |
setPromptItalic(boolean italic)
Convenience method that associates the boolean value
italic with the key |
void |
setPromptUnderline(boolean underline)
Convenience method that associates the boolean value
underline with the key |
public TerminalProperties(T textTerminal)
public java.util.List<TerminalProperties.ExtendedChangeListener<T>> getListeners()
TerminalProperties.ExtendedChangeListener
for this instance of TerminalProperties.public java.lang.Object remove(java.lang.String key)
key
- the key whose associated value should be removed.public java.lang.Object put(java.lang.String key, java.lang.Object value)
key
- the key with which the specified value should be associated.value
- the value to be associated with the specified key.public void putAll(java.util.Map<java.lang.String,? extends java.lang.Object> map)
public java.util.Set<java.lang.String> getAllKeys()
public java.util.Set<java.lang.String> getMatchingKeys(java.lang.String regex)
public java.util.Set<java.lang.String> getMatchingKeys(java.util.function.Predicate<java.lang.String> keyFilter)
public java.lang.String getString(java.lang.String key)
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
key
- the key whose associated value should be retrieved.defaultValue
- the value to be returned if no value is associated with the specified key or the associated value is null or empty.public int getInt(java.lang.String key, int defaultValue)
key
- the key whose associated value should be retrieved.defaultValue
- the value to be returned if no value is associated with the specified key or the string representation of the value cannot be converted to int.public long getLong(java.lang.String key, long defaultValue)
key
- the key whose associated value should be retrieved.defaultValue
- the value to be returned if no value is associated with the specified key or the string representation of the value cannot be converted to long.public double getDouble(java.lang.String key, double defaultValue)
key
- the key whose associated value should be retrieved.defaultValue
- the value to be returned if no value is associated with the specified key or the string representation of the value cannot be converted to double.public boolean getBoolean(java.lang.String key, boolean defaultValue)
key
- the key whose associated value should be retrieved.defaultValue
- the value to be returned if no value is associated with the specified key.public void addListener(TerminalProperties.ExtendedChangeListener<T> listener)
listener
- the listener to be added.public boolean removeListener(TerminalProperties.ExtendedChangeListener<T> listener)
listener
- the listener to be added.public void addStringListener(java.lang.String key, java.lang.String defaultValue, TerminalProperties.StringChangeListener<T> listener)
key
- the key of the property for which the listener is added.defaultValue
- the value to be used if the new value is null.listener
- the listener to be added.public void addIntListener(java.lang.String key, int defaultValue, TerminalProperties.IntChangeListener<T> listener)
key
- the key of the property for which the listener is added.defaultValue
- the value to be used if the new value cannot be converted to an int.listener
- the listener to be added.public void addLongListener(java.lang.String key, long defaultValue, TerminalProperties.LongChangeListener<T> listener)
key
- the key of the property for which the listener is added.defaultValue
- the value to be used if the new value cannot be converted to a long.listener
- the listener to be added.public void addDoubleListener(java.lang.String key, double defaultValue, TerminalProperties.DoubleChangeListener<T> listener)
key
- the key of the property for which the listener is added.defaultValue
- the value to be used if the new value cannot be converted to a double.listener
- the listener to be added.public void addBooleanListener(java.lang.String key, boolean defaultValue, TerminalProperties.BooleanChangeListener<T> listener)
key
- the key of the property for which the listener is added.defaultValue
- the value to be used if the new value is null.listener
- the listener to be added.public void setPromptColor(java.lang.String color)
color
with the key public void setPromptColor(java.awt.Color color)
color
with the key public void setPromptBackgroundColor(java.lang.String bgcolor)
bgcolor
with the key public void setPromptBackgroundColor(java.awt.Color bgcolor)
bgcolor
with the key public void setPromptBold(boolean bold)
bold
with the key public void setPromptItalic(boolean italic)
italic
with the key public void setPromptUnderline(boolean underline)
underline
with the key public void setInputColor(java.lang.String color)
color
with the key public void setInputColor(java.awt.Color color)
color
with the key public void setInputBackgroundColor(java.lang.String bgcolor)
bgcolor
with the key public void setInputBackgroundColor(java.awt.Color bgcolor)
bgcolor
with the key public void setInputBold(boolean bold)
bold
with the key public void setInputItalic(boolean italic)
italic
with the key public void setInputUnderline(boolean underline)
underline
with the key public void setPaneBackgroundColor(java.lang.String bgcolor)
bgcolor
with the key public void setPaneBackgroundColor(java.awt.Color bgcolor)
bgcolor
with the key public void setPaneWidth(int width)
width
with the key public void setPaneHeight(int height)
height
with the key public void setPaneDimension(int width, int height)
width
and height
with the keys and