javax.swing.text.html
Class StyleSheet.ViewAttributeSet

java.lang.Object
  extended byjavax.swing.text.html.MuxingAttributeSet
      extended byjavax.swing.text.html.StyleSheet.ViewAttributeSet
All Implemented Interfaces:
AttributeSet, Serializable
Enclosing class:
StyleSheet

class StyleSheet.ViewAttributeSet
extends MuxingAttributeSet

A subclass of MuxingAttributeSet that translates between CSS and HTML and StyleConstants. The AttributeSets used are the CSS rules that match the Views Elements.


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.AttributeSet
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
Field Summary
(package private)  View host
          View created for.
 
Fields inherited from interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute
 
Constructor Summary
(package private) StyleSheet.ViewAttributeSet(View v)
           
 
Method Summary
 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.
(package private)  Object doGetAttribute(Object key)
           
 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.
 AttributeSet getResolveParent()
          If not overriden, the resolving parent defaults to the parent element.
protected  void insertAttributeSetAt(AttributeSet as, int index)
          Inserts as at index.
 boolean isDefined(Object key)
          Checks whether a given attribute is defined.
 boolean isEqual(AttributeSet attr)
          Checks whether two attribute sets are equal.
protected  void removeAttributeSetAt(int index)
          Removes the AttributeSet at index.
protected  void setAttributes(AttributeSet[] attrs)
          Directly sets the AttributeSets that comprise this MuxingAttributeSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

View host
View created for.

Constructor Detail

StyleSheet.ViewAttributeSet

StyleSheet.ViewAttributeSet(View v)
Method Detail

isDefined

public boolean isDefined(Object key)
Checks whether a given attribute is defined. This will convert the key over to CSS if the key is a StyleConstants key that has a CSS mapping.

Specified by:
isDefined in interface AttributeSet
Overrides:
isDefined in class MuxingAttributeSet
Parameters:
key - the attribute key
Returns:
true if the attribute is defined
See Also:
AttributeSet.isDefined(java.lang.Object)

getAttribute

public Object getAttribute(Object key)
Gets the value of an attribute. If the requested attribute is a StyleConstants attribute that has a CSS mapping, the request will be converted.

Specified by:
getAttribute in interface AttributeSet
Overrides:
getAttribute in class MuxingAttributeSet
Parameters:
key - the attribute name
Returns:
the attribute value
See Also:
AttributeSet.getAttribute(java.lang.Object)

doGetAttribute

Object doGetAttribute(Object key)

getResolveParent

public AttributeSet getResolveParent()
If not overriden, the resolving parent defaults to the parent element.

Specified by:
getResolveParent in interface AttributeSet
Overrides:
getResolveParent in class MuxingAttributeSet
Returns:
the attributes from the parent
See Also:
AttributeSet.getResolveParent()

setAttributes

protected void setAttributes(AttributeSet[] attrs)
Directly sets the AttributeSets that comprise this MuxingAttributeSet.


getAttributes

protected AttributeSet[] getAttributes()
Returns the AttributeSets multiplexing too. When the AttributeSets need to be referenced, this should be called.


insertAttributeSetAt

protected void insertAttributeSetAt(AttributeSet as,
                                    int index)
Inserts as at index. This assumes the value of index is between 0 and attrs.length, inclusive.


removeAttributeSetAt

protected void removeAttributeSetAt(int index)
Removes the AttributeSet at index. This assumes the value of index is greater than or equal to 0, and less than attrs.length.


getAttributeCount

public int getAttributeCount()
Gets the number of attributes that are defined.

Specified by:
getAttributeCount in interface AttributeSet
Returns:
the number of attributes
See Also:
AttributeSet.getAttributeCount()

isEqual

public boolean isEqual(AttributeSet attr)
Checks whether two attribute sets are equal.

Specified by:
isEqual in interface AttributeSet
Parameters:
attr - the attribute set to check against
Returns:
true if the same
See Also:
AttributeSet.isEqual(javax.swing.text.AttributeSet)

copyAttributes

public AttributeSet copyAttributes()
Copies a set of attributes.

Specified by:
copyAttributes in interface AttributeSet
Returns:
the copy
See Also:
AttributeSet.copyAttributes()

getAttributeNames

public Enumeration getAttributeNames()
Gets the names of all attributes.

Specified by:
getAttributeNames in interface AttributeSet
Returns:
the attribute names
See Also:
AttributeSet.getAttributeNames()

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)
Checks whether a given attribute name/value is defined.

Specified by:
containsAttribute in interface AttributeSet
Parameters:
name - the attribute name
value - the attribute value
Returns:
true if the name/value is defined
See Also:
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)

containsAttributes

public boolean containsAttributes(AttributeSet attrs)
Checks whether the attribute set contains all of the given attributes.

Specified by:
containsAttributes in interface AttributeSet
Parameters:
attrs - the attributes to check
Returns:
true if the element contains all the attributes
See Also:
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)