/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A straightforward implementation of MutableAttributeSet using a
* hash table.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Tim Prinzing
*/
{
/**
* An empty attribute set.
*/
/**
* Creates a new attribute set.
*/
public SimpleAttributeSet() {
}
/**
* Creates a new attribute set based on a supplied set of attributes.
*
* @param source the set of attributes
*/
}
}
/**
* Checks whether the set of attributes is empty.
*
* @return true if the set is empty else false
*/
public boolean isEmpty()
{
}
/**
* Gets a count of the number of attributes.
*
* @return the count
*/
public int getAttributeCount() {
}
/**
* Tells whether a given attribute is defined.
*
* @param attrName the attribute name
* @return true if the attribute is defined
*/
}
/**
* Compares two attribute sets.
*
* @param attr the second attribute set
* @return true if the sets are equal, false otherwise
*/
}
/**
* Makes a copy of the attributes.
*
* @return the copy
*/
return (AttributeSet) clone();
}
/**
* Gets the names of the attributes in the set.
*
* @return the names as an <code>Enumeration</code>
*/
}
/**
* Gets the value of an attribute.
*
* @param name the attribute name
* @return the value
*/
}
}
return value;
}
/**
* Checks whether the attribute list contains a
*
* @param name the name
* @param value the value
*/
}
/**
* Checks whether the attribute list contains all the
*
* @param attributes the attribute list
*/
boolean result = true;
}
return result;
}
/**
* Adds an attribute to the list.
*
* @param name the attribute name
* @param value the attribute value
*/
}
/**
* Adds a set of attributes to the list.
*
* @param attributes the set of attributes to add
*/
while (names.hasMoreElements()) {
}
}
/**
* Removes an attribute from the list.
*
* @param name the attribute name
*/
}
/**
* Removes a set of attributes from the list.
*
* @param names the set of names to remove
*/
while (names.hasMoreElements())
}
/**
* Removes a set of attributes from the list.
*
* @param attributes the set of attributes to remove
*/
if (attributes == this) {
}
else {
while (names.hasMoreElements()) {
}
}
}
/**
* Gets the resolving parent. This is the set
* of attributes to resolve through if an attribute
* isn't defined locally. This is null if there
* are no other sets of attributes to resolve
* through.
*
* @return the parent
*/
}
/**
* Sets the resolving parent.
*
* @param parent the parent
*/
}
// --- Object methods ---------------------------------
/**
* Clones a set of attributes.
*
* @return the new set of attributes
*/
try {
} catch (CloneNotSupportedException cnse) {
}
return attr;
}
/**
* Returns a hashcode for this set of attributes.
* @return a hashcode value for this set of attributes.
*/
public int hashCode() {
}
/**
* Compares this object to the specified object.
* The result is <code>true</code> if the object is an equivalent
* set of attributes.
* @param obj the object to compare this attribute set with
* @return <code>true</code> if the objects are equal;
* <code>false</code> otherwise
*/
if (this == obj) {
return true;
}
if (obj instanceof AttributeSet) {
}
return false;
}
/**
* Converts the attribute set to a String.
*
* @return the string
*/
String s = "";
while (names.hasMoreElements()) {
if (value instanceof AttributeSet) {
// don't go recursive
s = s + key + "=**AttributeSet** ";
} else {
}
}
return s;
}
s.defaultWriteObject();
StyleContext.writeAttributeSet(s, this);
}
throws ClassNotFoundException, IOException {
s.defaultReadObject();
StyleContext.readAttributeSet(s, this);
}
/**
* An AttributeSet that is always empty.
*/
public int getAttributeCount() {
return 0;
}
return false;
}
}
return this;
}
return null;
}
return Collections.emptyEnumeration();
}
return false;
}
}
return null;
}
if (this == obj) {
return true;
}
return ((obj instanceof AttributeSet) &&
}
public int hashCode() {
return 0;
}
}
}