|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.html.MuxingAttributeSet
javax.swing.text.html.StyleSheet.ResolvedStyle
A subclass of MuxingAttributeSet that implements Style. Currently the MutableAttributeSet methods are unimplemented, that is they do nothing.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.text.AttributeSet |
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute |
| Field Summary | |
private int |
extendedIndex
Start index of styles coming from other StyleSheets. |
(package private) String |
name
The name of the Style, which is the selector. |
| Fields inherited from interface javax.swing.text.AttributeSet |
NameAttribute, ResolveAttribute |
| Constructor Summary | |
(package private) |
StyleSheet.ResolvedStyle(String name,
AttributeSet[] attrs,
int extendedIndex)
|
| Method Summary | |
void |
addAttribute(Object name,
Object value)
Creates a new attribute set similar to this one except that it contains an attribute with the given name and value. |
void |
addAttributes(AttributeSet attributes)
Creates a new attribute set similar to this one except that it contains the given attributes and values. |
void |
addChangeListener(ChangeListener l)
Adds a listener to track whenever an attribute has been changed. |
(package private) void |
addExtendedStyle(Style attr)
Adds s as one of the AttributeSets to look up
attributes in. |
(package private) int |
boundedIndexOf(String string,
char search,
int start,
int end)
Similiar to String.indexOf, but allows an upper bound (this is slower in that it will still check string starting at start. |
boolean |
containsAttribute(Object name,
Object value)
Checks whether a given attribute name/value is defined. |
boolean |
containsAttributes(AttributeSet attrs)
Checks whether the attribute set contains all of the given attributes. |
AttributeSet |
copyAttributes()
Copies a set of attributes. |
Object |
getAttribute(Object key)
Gets the value of an attribute. |
int |
getAttributeCount()
Gets the number of attributes that are defined. |
Enumeration |
getAttributeNames()
Gets the names of all attributes. |
protected AttributeSet[] |
getAttributes()
Returns the AttributeSets multiplexing too. |
ChangeListener[] |
getChangeListeners()
|
String |
getName()
Fetches the name of the style. |
AttributeSet |
getResolveParent()
Returns null, subclasses may wish to do something more intelligent with this. |
protected void |
insertAttributeSetAt(AttributeSet as,
int index)
Inserts as at index. |
(package private) void |
insertExtendedStyleAt(Style attr,
int index)
Adds s as one of the Attributesets to look up
attributes in. |
(package private) void |
insertStyle(Style style,
int specificity)
Inserts a Style into the receiver so that the styles the receiver represents are still ordered by specificity. |
boolean |
isDefined(Object key)
Checks whether a given attribute is defined. |
boolean |
isEqual(AttributeSet attr)
Checks whether two attribute sets are equal. |
protected boolean |
matches(String selector)
Returns true if the receiver matches selector, where
a match is defined by the CSS rule matching.
|
(package private) boolean |
matches(String selector,
int sCurrent,
int sLast,
int thisCurrent,
int thisLast)
Returns true if the substring of the receiver, in the range thisCurrent, thisLast matches the substring of selector in the ranme sCurrent to sLast based on CSS selector matching. |
void |
removeAttribute(Object name)
Removes an attribute with the given name. |
void |
removeAttributes(AttributeSet attributes)
Removes a set of attributes with the given name. |
void |
removeAttributes(Enumeration names)
Removes an attribute set with the given names. |
protected void |
removeAttributeSetAt(int index)
Removes the AttributeSet at index. |
void |
removeChangeListener(ChangeListener l)
Removes a listener that was tracking attribute changes. |
(package private) void |
removeExtendedStyleAt(int index)
Removes the style at index +
extendedIndex. |
(package private) void |
removeStyle(Style style)
Removes a previously added style. |
protected void |
setAttributes(AttributeSet[] attrs)
Directly sets the AttributeSets that comprise this
MuxingAttributeSet. |
void |
setResolveParent(AttributeSet parent)
Sets the resolving parent. |
| 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 |
| Field Detail |
String name
private int extendedIndex
| Constructor Detail |
StyleSheet.ResolvedStyle(String name,
AttributeSet[] attrs,
int extendedIndex)
| Method Detail |
void insertStyle(Style style,
int specificity)
style will be added before any extended styles, that
is before extendedIndex.
void removeStyle(Style style)
style is not referenced by the receiver.
void insertExtendedStyleAt(Style attr,
int index)
s as one of the Attributesets to look up
attributes in.
void addExtendedStyle(Style attr)
s as one of the AttributeSets to look up
attributes in. It will be the AttributeSet last checked.
void removeExtendedStyleAt(int index)
index +
extendedIndex.
protected boolean matches(String selector)
selector, where
a match is defined by the CSS rule matching.
Each simple selector must be separated by a single space.
boolean matches(String selector,
int sCurrent,
int sLast,
int thisCurrent,
int thisLast)
int boundedIndexOf(String string,
char search,
int start,
int end)
public void addAttribute(Object name,
Object value)
MutableAttributeSet
addAttribute in interface MutableAttributeSetname - the namevalue - the valuepublic void addAttributes(AttributeSet attributes)
MutableAttributeSet
addAttributes in interface MutableAttributeSetattributes - the set of attributespublic void removeAttribute(Object name)
MutableAttributeSetname.
removeAttribute in interface MutableAttributeSetname - the attribute namepublic void removeAttributes(Enumeration names)
MutableAttributeSetnames.
removeAttributes in interface MutableAttributeSetnames - the set of namespublic void removeAttributes(AttributeSet attributes)
MutableAttributeSetname.
removeAttributes in interface MutableAttributeSetattributes - the set of attributespublic void setResolveParent(AttributeSet parent)
MutableAttributeSet
setResolveParent in interface MutableAttributeSetparent - the parentpublic String getName()
Stylenull is returned if there is no name
associated with the style.
getName in interface Stylepublic void addChangeListener(ChangeListener l)
Style
addChangeListener in interface Stylel - the change listenerpublic void removeChangeListener(ChangeListener l)
Style
removeChangeListener in interface Stylel - the change listenerpublic ChangeListener[] getChangeListeners()
protected void setAttributes(AttributeSet[] attrs)
AttributeSets that comprise this
MuxingAttributeSet.
protected AttributeSet[] getAttributes()
AttributeSets multiplexing too. When the
AttributeSets need to be referenced, this should be called.
protected void insertAttributeSetAt(AttributeSet as,
int index)
as at index. This assumes
the value of index is between 0 and attrs.length,
inclusive.
protected void removeAttributeSetAt(int index)
index. This assumes
the value of index is greater than or equal to 0,
and less than attrs.length.
public int getAttributeCount()
getAttributeCount in interface AttributeSetAttributeSet.getAttributeCount()public boolean isDefined(Object key)
isDefined in interface AttributeSetkey - the attribute key
AttributeSet.isDefined(java.lang.Object)public boolean isEqual(AttributeSet attr)
isEqual in interface AttributeSetattr - the attribute set to check against
AttributeSet.isEqual(javax.swing.text.AttributeSet)public AttributeSet copyAttributes()
copyAttributes in interface AttributeSetAttributeSet.copyAttributes()public Object getAttribute(Object key)
getAttribute in interface AttributeSetkey - the attribute name
AttributeSet.getAttribute(java.lang.Object)public Enumeration getAttributeNames()
getAttributeNames in interface AttributeSetAttributeSet.getAttributeNames()
public boolean containsAttribute(Object name,
Object value)
containsAttribute in interface AttributeSetname - the attribute namevalue - the attribute value
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)public boolean containsAttributes(AttributeSet attrs)
containsAttributes in interface AttributeSetattrs - the attributes to check
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)public AttributeSet getResolveParent()
getResolveParent in interface AttributeSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||