@OpenApiAll
public class SimpleStyle
extends javax.swing.text.SimpleAttributeSet
implements javax.swing.text.Style
Modifier and Type | Field and Description |
---|---|
protected javax.swing.event.ChangeEvent |
changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source
property.
|
protected javax.swing.event.EventListenerList |
listenerList
The change listeners for the model.
|
Constructor and Description |
---|
SimpleStyle()
Creates a new style, with a null name and parent.
|
SimpleStyle(java.lang.String name)
Creates a new style.
|
SimpleStyle(java.lang.String name,
javax.swing.text.Style parent)
Creates a new style.
|
SimpleStyle(javax.swing.text.Style parent)
Creates a new style.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.Object name,
java.lang.Object value)
Adds an attribute.
|
void |
addAttributes(javax.swing.text.AttributeSet attr)
Adds a set of attributes to the element.
|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a change listener.
|
boolean |
equals(java.lang.Object obj)
Compares this object to the specified object.
|
protected void |
fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type.
|
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the
ChangeListener s added to this SimpleStyle with addChangeListener(). |
<T extends java.util.EventListener> |
getListeners(java.lang.Class<T> listenerType)
Return an array of all the listeners of the given type that were added to this model.
|
java.lang.String |
getName()
Fetches the name of the style.
|
int |
hashCode()
Returns a hashcode for this set of attributes.
|
void |
removeAttribute(java.lang.Object name)
Removes an attribute from the set.
|
void |
removeAttributes(javax.swing.text.AttributeSet attrs)
Removes a set of attributes for the element.
|
void |
removeAttributes(java.util.Enumeration<?> names)
Removes a set of attributes for the element.
|
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a change listener.
|
void |
setName(java.lang.String name)
Changes the name of the style.
|
clone, containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEmpty, isEqual, setResolveParent, toString
protected javax.swing.event.EventListenerList listenerList
protected transient javax.swing.event.ChangeEvent changeEvent
public SimpleStyle()
public SimpleStyle(java.lang.String name)
name
- the style name, null for unnamedpublic SimpleStyle(javax.swing.text.Style parent)
parent
- the parent style, null if nonepublic SimpleStyle(java.lang.String name, javax.swing.text.Style parent)
name
- the style name, null for unnamedparent
- the parent style, null if nonepublic java.lang.String getName()
getName
in interface javax.swing.text.Style
public void setName(java.lang.String name)
name
- the new namepublic void addChangeListener(javax.swing.event.ChangeListener l)
addChangeListener
in interface javax.swing.text.Style
l
- the change listenerpublic void removeChangeListener(javax.swing.event.ChangeListener l)
removeChangeListener
in interface javax.swing.text.Style
l
- the change listenerpublic javax.swing.event.ChangeListener[] getChangeListeners()
ChangeListener
s added to this SimpleStyle with addChangeListener().ChangeListener
s added or an empty array if no listeners have been addedprotected void fireStateChanged()
EventListenerList
public <T extends java.util.EventListener> T[] getListeners(java.lang.Class<T> listenerType)
T
- EventListenerlistenerType
- listener classpublic void addAttribute(java.lang.Object name, java.lang.Object value)
addAttribute
in interface javax.swing.text.MutableAttributeSet
addAttribute
in class javax.swing.text.SimpleAttributeSet
name
- the non-null attribute namevalue
- the attribute valuepublic void addAttributes(javax.swing.text.AttributeSet attr)
addAttributes
in interface javax.swing.text.MutableAttributeSet
addAttributes
in class javax.swing.text.SimpleAttributeSet
attr
- the attributes to addpublic void removeAttribute(java.lang.Object name)
removeAttribute
in interface javax.swing.text.MutableAttributeSet
removeAttribute
in class javax.swing.text.SimpleAttributeSet
name
- the non-null attribute namepublic void removeAttributes(java.util.Enumeration<?> names)
removeAttributes
in interface javax.swing.text.MutableAttributeSet
removeAttributes
in class javax.swing.text.SimpleAttributeSet
names
- the attribute namespublic void removeAttributes(javax.swing.text.AttributeSet attrs)
removeAttributes
in interface javax.swing.text.MutableAttributeSet
removeAttributes
in class javax.swing.text.SimpleAttributeSet
attrs
- the attributespublic int hashCode()
hashCode
in class javax.swing.text.SimpleAttributeSet
public boolean equals(java.lang.Object obj)
true
if the object is an equivalent
set of attributes.equals
in class javax.swing.text.SimpleAttributeSet
obj
- the object to compare this attribute set withtrue
if the objects are equal; false
otherwiseCopyright © 2010 - No Magic Asia