public class ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable
Constructor and Description |
---|
ElementStyleSheet()
Creates a new element style-sheet.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(ElementStyleSheet sourceStyleSheet) |
void |
addDefault(ElementStyleSheet sourceStyleSheet) |
void |
addInherited(ElementStyleSheet sourceStyleSheet) |
void |
addInherited(SimpleStyleSheet sourceStyleSheet) |
void |
addListener(StyleChangeListener l)
Adds a
StyleChangeListener . |
void |
clear() |
ElementStyleSheet |
clone()
Creates and returns a copy of this object.
|
void |
copyFrom(ElementStyleSheet style) |
ElementStyleSheet |
derive(boolean preserveId) |
long |
getChangeTracker() |
long |
getChangeTrackerHash() |
StyleKey[] |
getDefinedPropertyNamesArray() |
long |
getModificationCount() |
List<StyleKey> |
getPropertyKeyList() |
StyleKey[] |
getPropertyKeys()
Returns the property keys.
|
Object |
getStyleProperty(StyleKey key,
Object defaultValue)
Returns the value of a style.
|
boolean |
isLocalKey(StyleKey key)
Returns true, if the given key is locally defined, false otherwise.
|
void |
removeListener(StyleChangeListener l)
Removes a
StyleChangeListener . |
void |
setBooleanStyleProperty(StyleKey key,
boolean value)
Sets a boolean style property.
|
protected void |
setChangeTrackerHash(long changeTracker) |
protected void |
setModificationCount(long modificationCount) |
void |
setStyleProperty(StyleKey key,
Object value)
Sets a style property (or removes the style if the value is
null ). |
Object[] |
toArray() |
getBooleanStyleProperty, getBooleanStyleProperty, getDoubleStyleProperty, getId, getIntStyleProperty, getStyleProperty, setId
public ElementStyleSheet()
public long getChangeTracker()
getChangeTracker
in interface StyleSheet
public boolean isLocalKey(StyleKey key)
isLocalKey
in interface StyleSheet
isLocalKey
in class AbstractStyleSheet
key
- the key to testpublic final Object[] toArray()
toArray
in interface StyleSheet
public Object getStyleProperty(StyleKey key, Object defaultValue)
null
) is returned.getStyleProperty
in interface StyleSheet
key
- the style key.defaultValue
- the default value (null
permitted).public void setBooleanStyleProperty(StyleKey key, boolean value)
key
- the style key (null
not permitted).value
- the value.NullPointerException
- if the given key is null.ClassCastException
- if the value cannot be assigned with the given key.public void setStyleProperty(StyleKey key, Object value)
null
).key
- the style key (null
not permitted).value
- the value.NullPointerException
- if the given key is null.ClassCastException
- if the value cannot be assigned with the given key.public ElementStyleSheet clone()
clone
in class AbstractStyleSheet
Cloneable
public ElementStyleSheet derive(boolean preserveId)
derive
in class AbstractStyleSheet
public StyleKey[] getDefinedPropertyNamesArray()
public void addListener(StyleChangeListener l)
StyleChangeListener
.l
- the listener.public void removeListener(StyleChangeListener l)
StyleChangeListener
.l
- the listener.public StyleKey[] getPropertyKeys()
public void addAll(ElementStyleSheet sourceStyleSheet)
public void addInherited(ElementStyleSheet sourceStyleSheet)
public void addInherited(SimpleStyleSheet sourceStyleSheet)
public void addDefault(ElementStyleSheet sourceStyleSheet)
public void clear()
public long getModificationCount()
getModificationCount
in interface StyleSheet
getModificationCount
in class AbstractStyleSheet
protected void setModificationCount(long modificationCount)
public long getChangeTrackerHash()
getChangeTrackerHash
in interface StyleSheet
getChangeTrackerHash
in class AbstractStyleSheet
protected void setChangeTrackerHash(long changeTracker)
public void copyFrom(ElementStyleSheet style)
Copyright © 2017 Hitachi Vantara. All rights reserved.