| |
|
| javax.swing.text.AttributeSet
All known Subclasses: javax.swing.text.rtf.MockAttributeSet, javax.swing.text.html.MuxingAttributeSet,
AttributeSet | public interface AttributeSet (Code) | | A collection of unique attributes. This is a read-only,
immutable interface. An attribute is basically a key and
a value assigned to the key. The collection may represent
something like a style run, a logical style, etc. These
are generally used to describe features that will contribute
to some graphical representation such as a font. The
set of possible keys is unbounded and can be anything.
Typically View implementations will respond to attribute
definitions and render something to represent the attributes.
Attributes can potentially resolve in a hierarchy. If a
key doesn't resolve locally, and a resolving parent
exists, the key will be resolved through the parent.
author: Timothy Prinzing version: 1.47 05/05/07 See Also: MutableAttributeSet |
Inner Class :public interface FontAttribute | |
Inner Class :public interface ColorAttribute | |
Inner Class :public interface CharacterAttribute | |
Inner Class :public interface ParagraphAttribute | |
Field Summary | |
final public static Object | NameAttribute Attribute name used to name the collection of
attributes. | final public static Object | ResolveAttribute Attribute name used to identify the resolving parent
set of attributes, if one is defined. |
NameAttribute | final public static Object NameAttribute(Code) | | Attribute name used to name the collection of
attributes.
|
ResolveAttribute | final public static Object ResolveAttribute(Code) | | Attribute name used to identify the resolving parent
set of attributes, if one is defined.
|
containsAttribute | public boolean containsAttribute(Object name, Object value)(Code) | | Returns
true if this set defines an attribute with the same
name and an equal value. If such an attribute is not found locally,
it is searched through in the resolving parent hierarchy.
Parameters: name - the non-null attribute name Parameters: value - the value true if the set defines the attribute with anequal value, either locally or through its resolving parent throws: NullPointerException - if either name or value is null |
containsAttributes | public boolean containsAttributes(AttributeSet attributes)(Code) | | Returns
true if this set defines all the attributes from the
given set with equal values. If an attribute is not found locally,
it is searched through in the resolving parent hierarchy.
Parameters: attributes - the set of attributes to check against true if this set defines all the attributes with equalvalues, either locally or through its resolving parent throws: NullPointerException - if attributes is null |
copyAttributes | public AttributeSet copyAttributes()(Code) | | Returns an attribute set that is guaranteed not
to change over time.
a copy of the attribute set |
getAttribute | public Object getAttribute(Object key)(Code) | | Fetches the value of the given attribute. If the value is not found
locally, the search is continued upward through the resolving
parent (if one exists) until the value is either
found or there are no more parents. If the value is not found,
null is returned.
Parameters: key - the non-null key of the attribute binding the value of the attribute, or null if not found |
getAttributeCount | public int getAttributeCount()(Code) | | Returns the number of attributes that are defined locally in this set.
Attributes that are defined in the parent set are not included.
the number of attributes >= 0 |
getAttributeNames | public Enumeration> getAttributeNames()(Code) | | Returns an enumeration over the names of the attributes that are
defined locally in the set. Names of attributes defined in the
resolving parent, if any, are not included. The values of the
Enumeration may be anything and are not constrained to
a particular Object type.
This method never returns
null . For a set with no attributes, it
returns an empty
Enumeration .
the names |
getResolveParent | public AttributeSet getResolveParent()(Code) | | Gets the resolving parent.
the parent |
isDefined | public boolean isDefined(Object attrName)(Code) | | Checks whether the named attribute has a value specified in
the set without resolving through another attribute
set.
Parameters: attrName - the attribute name true if the attribute has a value specified |
isEqual | public boolean isEqual(AttributeSet attr)(Code) | | Determines if the two attribute sets are equivalent.
Parameters: attr - an attribute set true if the sets are equivalent |
|
|
|