/*
* 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.
*/
/**
* An implementation of <code>AttributeSet</code> that can multiplex
* across a set of <code>AttributeSet</code>s.
*
*/
/**
* Creates a <code>MuxingAttributeSet</code> with the passed in
* attributes.
*/
}
/**
* Creates an empty <code>MuxingAttributeSet</code>. This is intended for
* use by subclasses only, and it is also intended that subclasses will
* set the constituent <code>AttributeSet</code>s before invoking any
* of the <code>AttributeSet</code> methods.
*/
protected MuxingAttributeSet() {
}
/**
* Directly sets the <code>AttributeSet</code>s that comprise this
* <code>MuxingAttributeSet</code>.
*/
}
/**
* Returns the <code>AttributeSet</code>s multiplexing too. When the
* <code>AttributeSet</code>s need to be referenced, this should be called.
*/
return attrs;
}
/**
* Inserts <code>as</code> at <code>index</code>. This assumes
* the value of <code>index</code> is between 0 and attrs.length,
* inclusive.
*/
int index) {
if (index > 0) {
}
else {
}
}
else {
}
}
/**
* Removes the AttributeSet at <code>index</code>. This assumes
* the value of <code>index</code> is greater than or equal to 0,
* and less than attrs.length.
*/
if (numAttrs > 0) {
if (index == 0) {
// FIRST
}
// MIDDLE
}
else {
// END
}
}
}
// --- AttributeSet methods ----------------------------
/**
* Gets the number of attributes that are defined.
*
* @return the number of attributes
* @see AttributeSet#getAttributeCount
*/
public int getAttributeCount() {
int n = 0;
n += as[i].getAttributeCount();
}
return n;
}
/**
* 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.
*
* @param key the attribute key
* @return true if the attribute is defined
* @see AttributeSet#isDefined
*/
return true;
}
}
return false;
}
/**
* Checks whether two attribute sets are equal.
*
* @param attr the attribute set to check against
* @return true if the same
* @see AttributeSet#isEqual
*/
}
/**
* Copies a set of attributes.
*
* @return the copy
* @see AttributeSet#copyAttributes
*/
MutableAttributeSet a = new SimpleAttributeSet();
int n = 0;
a.addAttributes(as[i]);
}
return a;
}
/**
* Gets the value of an attribute. If the requested
* attribute is a StyleConstants attribute that has
* a CSS mapping, the request will be converted.
*
* @param key the attribute name
* @return the attribute value
* @see AttributeSet#getAttribute
*/
for (int i = 0; i < n; i++) {
if (o != null) {
return o;
}
}
return null;
}
/**
* Gets the names of all attributes.
*
* @return the attribute names
* @see AttributeSet#getAttributeNames
*/
return new MuxingAttributeNameEnumeration();
}
/**
*
* @param name the attribute name
* @param value the attribute value
* @see AttributeSet#containsAttribute
*/
}
/**
* Checks whether the attribute set contains all of
* the given attributes.
*
* @param attrs the attributes to check
* @return true if the element contains all the attributes
* @see AttributeSet#containsAttributes
*/
boolean result = true;
}
return result;
}
/**
* Returns null, subclasses may wish to do something more
* intelligent with this.
*/
return null;
}
/**
* The <code>AttributeSet</code>s that make up the resulting
* <code>AttributeSet</code>.
*/
/**
* An Enumeration of the Attribute names in a MuxingAttributeSet.
* This may return the same name more than once.
*/
updateEnum();
}
public boolean hasMoreElements() {
if (currentEnum == null) {
return false;
}
return currentEnum.hasMoreElements();
}
if (currentEnum == null) {
throw new NoSuchElementException("No more names");
}
if (!currentEnum.hasMoreElements()) {
updateEnum();
}
return retObject;
}
void updateEnum() {
currentEnum = null;
if (!currentEnum.hasMoreElements()) {
currentEnum = null;
}
}
}
/** Index into attrs the current Enumeration came from. */
private int attrIndex;
/** Enumeration from attrs. */
}
}