From 1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 23 Sep 2005 21:31:04 +0000 Subject: Imported Classpath 0.18. * sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. From-SVN: r104586 --- .../classpath/javax/swing/text/AttributeSet.java | 121 ++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) (limited to 'libjava/classpath/javax/swing/text/AttributeSet.java') diff --git a/libjava/classpath/javax/swing/text/AttributeSet.java b/libjava/classpath/javax/swing/text/AttributeSet.java index 87e7b98af22..2f1f1890bae 100644 --- a/libjava/classpath/javax/swing/text/AttributeSet.java +++ b/libjava/classpath/javax/swing/text/AttributeSet.java @@ -1,5 +1,5 @@ /* AttributeSet.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,34 +39,153 @@ package javax.swing.text; import java.util.Enumeration; +/** + * A set of attributes. An attribute has a key and a value. They typically + * describe features of a piece of text that make up its graphical + * representation. + * + * An AttributeSet may have a resolving parent, + * that is another AttributeSet that is searched for attribute + * keys that are not stored locally in this AttributeSet. + * + * @author original author unknown + * @author Roman Kennke (roman@kennke.org) + */ public interface AttributeSet { + /** + * Used as keys to identify character-run attributes. + */ static interface CharacterAttribute { } + /** + * Used as keys to identify color attributes. + */ static interface ColorAttribute { } + /** + * Used as keys to identify font attributes. + */ static interface FontAttribute { } + /** + * Used as keys to identify paragraph level attributes. + */ static interface ParagraphAttribute { } + /** + * Key of the attribute that is used to describe the name of an + * AttributeSet. + */ Object NameAttribute = StyleConstants.NameAttribute; + + /** + * Key of the attribute that is used to identify the resolving parent of + * an AttributeSet. + */ Object ResolveAttribute = StyleConstants.ResolveAttribute; + /** + * Returns true if this AttributeSet contains + * an attribute with the specified name and value, + * false otherwise. + * + * @param name the name of the requested attribute + * @param the value of the requested attribute + * + * @return true if this AttributeSet contains + * an attribute with the specified name and + * value, false otherwise + */ boolean containsAttribute(Object name, Object value); + + /** + * Returns true of this AttributeSet contains all + * of the specified attributes. + * + * @param attributes the requested attributes + * + * @return true of this AttributeSet contains all + * of the specified attributes + */ boolean containsAttributes(AttributeSet attributes); + + /** + * Creates and returns a copy of this AttributeSet. + * + * @return a copy of this AttributeSet + */ AttributeSet copyAttributes(); + + /** + * Returns the attribute with the specified key or + * null if no such attribute is defined in this + * AttributeSet and its resolving parents. + * + * @param key the key of the attribute that is looked up + * + * @return the attribute with the specified key or + * null if no such attribute is defined in this + * AttributeSet and its resolving parents + */ Object getAttribute(Object key); + + /** + * Returns the number of attributes that are stored locally in this + * AttributeSet. + * + * @return the number of attributes that are stored locally in this + * AttributeSet + */ int getAttributeCount(); + + /** + * Returns the names of the attributes that are stored in this + * AttributeSet. + * + * @return the names of the attributes that are stored in this + * AttributeSet + */ Enumeration getAttributeNames(); + + /** + * Returns the resolving parent of this AttributeSet. + * If a key is not stored locally, then a {@link #getAttribute(Object)} + * request is resolved up in the resolving parent of this + * AttributeSet. + * + * @return the resolving parent of this AttributeSet + */ AttributeSet getResolveParent(); + + /** + * Returns true if an attribute with the specified name is + * defined locally in this AttributeSet, without resolving + * through the resolving parents. + * + * @return true if an attribute with the specified name is + * defined locally in this AttributeSet + */ boolean isDefined(Object attrName); + + /** + * Returns true if all of the attributes in attr + * are equal to the attributes in this AttributeSet, + * false otherwise. + * + * @param attr the attributes to be compared to this + * + * @return true if all of the attributes in attr + * are equal to the attributes in this AttributeSet, + * false otherwise + */ boolean isEqual(AttributeSet attr); } -- cgit v1.2.1