|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.html.MultiStyle
public class MultiStyle
A Style implementation that is able to multiplex between several other Styles. This is used for CSS style resolving.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet |
|---|
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute |
| Field Summary |
|---|
| Fields inherited from interface javax.swing.text.AttributeSet |
|---|
NameAttribute, ResolveAttribute |
| Constructor Summary | |
|---|---|
MultiStyle(String n,
AttributeSet[] m)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addAttribute(Object name,
Object value)
Adds an attribute with the given name and value
to the set. |
void |
addAttributes(AttributeSet atts)
Adds all the attributes from attributes to this set. |
void |
addChangeListener(ChangeListener listener)
Adds a ChangeListener object to the style. |
boolean |
containsAttribute(Object name,
Object value)
Returns true if this AttributeSet contains
an attribute with the specified name and value,
false otherwise. |
boolean |
containsAttributes(AttributeSet attributes)
Returns true of this AttributeSet contains all
of the specified attributes. |
AttributeSet |
copyAttributes()
Creates and returns a copy of this AttributeSet. |
Object |
getAttribute(Object key)
Returns the attribute with the specified key or
null if no such attribute is defined in this
AttributeSet and its resolving parents. |
int |
getAttributeCount()
Returns the number of attributes that are stored locally in this AttributeSet. |
Enumeration |
getAttributeNames()
Returns the names of the attributes that are stored in this AttributeSet. |
String |
getName()
Returns the name of the style. |
AttributeSet |
getResolveParent()
Returns the resolving parent of this AttributeSet. |
boolean |
isDefined(Object attrName)
Returns true if an attribute with the specified name is
defined locally in this AttributeSet, without resolving
through the resolving parents. |
boolean |
isEqual(AttributeSet attr)
Returns true if all of the attributes in attr
are equal to the attributes in this AttributeSet,
false otherwise. |
void |
removeAttribute(Object name)
Removes the attribute with the specified name, if this
attribute is defined. |
void |
removeAttributes(AttributeSet atts)
Removes attributes from this set if they are found in the given set. |
void |
removeAttributes(Enumeration names)
Removes the attributes listed in names. |
void |
removeChangeListener(ChangeListener listener)
Removes a ChangeListener from to the style. |
void |
setResolveParent(AttributeSet parent)
Sets the reolving parent for this set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.text.AttributeSet |
|---|
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqual |
| Constructor Detail |
|---|
public MultiStyle(String n,
AttributeSet[] m)
n - the namem - the styles to multiplex| Method Detail |
|---|
public String getName()
getName in interface Stylepublic void addChangeListener(ChangeListener listener)
StyleChangeListener object to the style.
addChangeListener in interface Stylelistener - the listener object to addpublic void removeChangeListener(ChangeListener listener)
StyleChangeListener from to the style.
removeChangeListener in interface Stylelistener - the listener object to remove,
public void addAttribute(Object name,
Object value)
MutableAttributeSetname and value
to the set. If the set already contains an attribute with the given
name, the attribute value is updated.
addAttribute in interface MutableAttributeSetname - the attribute name (null not permitted).value - the value (null not permitted).public void addAttributes(AttributeSet atts)
MutableAttributeSetattributes to this set.
addAttributes in interface MutableAttributeSetatts - the set of attributes to add (null not
permitted).public void removeAttribute(Object name)
MutableAttributeSetname, if this
attribute is defined. This method will only remove an attribute from
this set, not from the resolving parent.
removeAttribute in interface MutableAttributeSetname - the attribute name (null not permitted).public void removeAttributes(Enumeration names)
MutableAttributeSetnames.
removeAttributes in interface MutableAttributeSetnames - the attribute names (null not permitted).public void removeAttributes(AttributeSet atts)
MutableAttributeSetattributes has the same resolving parent as this set, the
parent will be removed from this set.
removeAttributes in interface MutableAttributeSetatts - the attributes (null not permitted).public void setResolveParent(AttributeSet parent)
MutableAttributeSet
setResolveParent in interface MutableAttributeSetparent - the parent attribute set (null not permitted).
public boolean containsAttribute(Object name,
Object value)
AttributeSettrue if this AttributeSet contains
an attribute with the specified name and value,
false otherwise.
containsAttribute in interface AttributeSetname - the name of the requested attributevalue - the value of the requested attribute
true if this AttributeSet contains
an attribute with the specified name and
value, false otherwisepublic boolean containsAttributes(AttributeSet attributes)
AttributeSettrue of this AttributeSet contains all
of the specified attributes.
containsAttributes in interface AttributeSetattributes - the requested attributes
true of this AttributeSet contains all
of the specified attributespublic AttributeSet copyAttributes()
AttributeSetAttributeSet.
copyAttributes in interface AttributeSetAttributeSetpublic Object getAttribute(Object key)
AttributeSetkey or
null if no such attribute is defined in this
AttributeSet and its resolving parents.
getAttribute in interface AttributeSetkey - the key of the attribute that is looked up
key or
null if no such attribute is defined in this
AttributeSet and its resolving parentspublic int getAttributeCount()
AttributeSetAttributeSet.
getAttributeCount in interface AttributeSetAttributeSetpublic Enumeration getAttributeNames()
AttributeSetAttributeSet.
getAttributeNames in interface AttributeSetAttributeSetpublic AttributeSet getResolveParent()
AttributeSetAttributeSet.
If a key is not stored locally, then a AttributeSet.getAttribute(Object)
request is resolved up in the resolving parent of this
AttributeSet.
getResolveParent in interface AttributeSetAttributeSetpublic boolean isDefined(Object attrName)
AttributeSettrue if an attribute with the specified name is
defined locally in this AttributeSet, without resolving
through the resolving parents.
isDefined in interface AttributeSettrue if an attribute with the specified name is
defined locally in this AttributeSetpublic boolean isEqual(AttributeSet attr)
AttributeSettrue if all of the attributes in attr
are equal to the attributes in this AttributeSet,
false otherwise.
isEqual in interface AttributeSetattr - the attributes to be compared to this
true if all of the attributes in attr
are equal to the attributes in this AttributeSet,
false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||