public class MutableStyle extends java.lang.Object implements Style
Style implementation which may be modified.
Note that modifications to the Style will not necessarily be
reflected in Components that use the Style
unless the Components are specifically informed of the changes,
i.e., by resetting the shared style of a Component.
As such, shared Styles should not be updated once they are
in use by Components, as it will result in undefined behavior.| Modifier and Type | Class and Description |
|---|---|
class |
MutableStyle.IndexedPropertyValue
A value object which stores the indexed values of a property.
|
| Constructor and Description |
|---|
MutableStyle()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStyleContent(Style style)
Adds the content of the specified style to this style.
|
java.lang.Object |
get(java.lang.String propertyName)
Retrieves the value of the specified property.
|
java.lang.Object |
getIndex(java.lang.String propertyName,
int propertyIndex)
Retrieves the value of the specified indexed property.
|
java.lang.Object |
getIndexedProperty(java.lang.String propertyName,
int propertyIndex)
Deprecated.
Use
getIndex(String, int) instead. |
java.lang.Object |
getProperty(java.lang.String propertyName)
Deprecated.
Use
get(String) instead. |
java.util.Iterator |
getPropertyIndices(java.lang.String propertyName)
Determines which indices of a particular property are set.
|
java.util.Iterator |
getPropertyNames()
Retrieves the names of all set properties.
|
boolean |
isIndexedPropertySet(java.lang.String propertyName,
int index)
Determines if a particular index of an indexed property is set.
|
boolean |
isPropertySet(java.lang.String propertyName)
Determines if a particular property is set.
|
void |
removeIndexedProperty(java.lang.String propertyName,
int propertyIndex)
Removes a value of an indexed property from the
Style. |
void |
removeProperty(java.lang.String propertyName)
Removes a property from the
Style. |
void |
set(java.lang.String propertyName,
java.lang.Object propertyValue)
Sets a property of the
Style. |
void |
setIndex(java.lang.String propertyName,
int propertyIndex,
java.lang.Object propertyValue)
Sets an indexed property of the
Style |
void |
setIndexedProperty(java.lang.String propertyName,
int propertyIndex,
java.lang.Object propertyValue)
Deprecated.
use
setIndex(String, int, Object) instead. |
void |
setProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
Deprecated.
use
set(String, Object) instead. |
int |
size()
Returns the number of properties set.
|
java.lang.String |
toString()
Returns a debug representation.
|
public void addStyleContent(Style style)
style - the style to addpublic java.lang.Object get(java.lang.String propertyName)
Styleget in interface StyleStyle.get(java.lang.String)public java.lang.Object getIndex(java.lang.String propertyName,
int propertyIndex)
StylegetIndex in interface StyleStyle.getIndex(java.lang.String, int)public java.lang.Object getIndexedProperty(java.lang.String propertyName,
int propertyIndex)
getIndex(String, int) instead.StylegetIndexedProperty in interface StyleStyle.getIndexedProperty(String, int)public java.lang.Object getProperty(java.lang.String propertyName)
get(String) instead.StylegetProperty in interface StyleStyle.getProperty(java.lang.String)public java.util.Iterator getPropertyIndices(java.lang.String propertyName)
StylegetPropertyIndices in interface StyleIterator that returns the set indices in
incrementing order as IntegersStyle.getPropertyIndices(java.lang.String)public java.util.Iterator getPropertyNames()
StylegetPropertyNames in interface StyleIterator that returns the names of all set
propertiesStyle.getPropertyNames()public boolean isIndexedPropertySet(java.lang.String propertyName,
int index)
StyleisIndexedPropertySet in interface StylepropertyName - the property nameindex - the indexStyle.isIndexedPropertySet(java.lang.String, int)public boolean isPropertySet(java.lang.String propertyName)
StyleisPropertySet in interface StylepropertyName - the property nameStyle.isPropertySet(java.lang.String)public void removeIndexedProperty(java.lang.String propertyName,
int propertyIndex)
Style.propertyName - the name of the propertypropertyIndex - the index of the property to removepublic void removeProperty(java.lang.String propertyName)
Style.propertyName - the name of the property to removepublic void set(java.lang.String propertyName,
java.lang.Object propertyValue)
Style.
If propertyValue is null, the property will be
removed.propertyName - the name of the propertypropertyValue - the value of the propertypublic void setIndex(java.lang.String propertyName,
int propertyIndex,
java.lang.Object propertyValue)
StylepropertyName - the name of the propertypropertyIndex - the index of the propertypropertyValue - the value of the propertypublic void setIndexedProperty(java.lang.String propertyName,
int propertyIndex,
java.lang.Object propertyValue)
setIndex(String, int, Object) instead.StylepropertyName - the name of the propertypropertyIndex - the index of the propertypropertyValue - the value of the propertypublic void setProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
set(String, Object) instead.Style.
If propertyValue is null, the property will be
removed.propertyName - the name of the propertypropertyValue - the value of the propertypublic int size()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()