API java : SimpleAttributeSet


javax.swing.text
Class SimpleAttributeSet

java.lang.Object
  extended by javax.swing.text.SimpleAttributeSet
All Implemented Interfaces:
Serializable, Cloneable, AttributeSet, MutableAttributeSet

public class SimpleAttributeSet
extends Object
implements MutableAttributeSet, Serializable, Cloneable

A straightforward implementation of MutableAttributeSet using a hash table.

Warning: 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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
Field Summary
static AttributeSet EMPTY
          An empty attribute set.
 
Fields inherited from interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute
 
Constructor Summary
SimpleAttributeSet()
          Creates a new attribute set.
SimpleAttributeSet(AttributeSet source)
          Creates a new attribute set based on a supplied set of attributes.
 
Method Summary
 void addAttribute(Object name, Object value)
          Adds an attribute to the list.
 void addAttributes(AttributeSet attributes)
          Adds a set of attributes to the list.
 Object clone()
          Clones a set of attributes.
 boolean containsAttribute(Object name, Object value)
          Checks whether the attribute list contains a specified attribute name/value pair.
 boolean containsAttributes(AttributeSet attributes)
          Checks whether the attribute list contains all the specified name/value pairs.
 AttributeSet copyAttributes()
          Makes a copy of the attributes.
 boolean equals(Object obj)
          Compares this object to the specified object.
 Object getAttribute(Object name)
          Gets the value of an attribute.
 int getAttributeCount()
          Gets a count of the number of attributes.
 Enumeration<?> getAttributeNames()
          Gets the names of the attributes in the set.
 AttributeSet getResolveParent()
          Gets the resolving parent.
 int hashCode()
          Returns a hashcode for this set of attributes.
 boolean isDefined(Object attrName)
          Tells whether a given attribute is defined.
 boolean isEmpty()
          Checks whether the set of attributes is empty.
 boolean isEqual(AttributeSet attr)
          Compares two attribute sets.
 void removeAttribute(Object name)
          Removes an attribute from the list.
 void removeAttributes(AttributeSet attributes)
          Removes a set of attributes from the list.
 void removeAttributes(Enumeration<?> names)
          Removes a set of attributes from the list.
 void setResolveParent(AttributeSet parent)
          Sets the resolving parent.
 String toString()
          Converts the attribute set to a String.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final AttributeSet EMPTY
An empty attribute set.

Constructor Detail

SimpleAttributeSet

public SimpleAttributeSet()
Creates a new attribute set.


SimpleAttributeSet

public SimpleAttributeSet(AttributeSet source)
Creates a new attribute set based on a supplied set of attributes.

Parameters:
source - the set of attributes
Method Detail

isEmpty

public boolean isEmpty()
Checks whether the set of attributes is empty.

Returns:
true if the set is empty else false

getAttributeCount

public int getAttributeCount()
Gets a count of the number of attributes.

Specified by:
getAttributeCount in interface AttributeSet
Returns:
the count

isDefined

public boolean isDefined(Object attrName)
Tells whether a given attribute is defined.

Specified by:
isDefined in interface AttributeSet
Parameters:
attrName - the attribute name
Returns:
true if the attribute is defined

isEqual

public boolean isEqual(AttributeSet attr)
Compares two attribute sets.

Specified by:
isEqual in interface AttributeSet
Parameters:
attr - the second attribute set
Returns:
true if the sets are equal, false otherwise

copyAttributes

public AttributeSet copyAttributes()
Makes a copy of the attributes.

Specified by:
copyAttributes in interface AttributeSet
Returns:
the copy

getAttributeNames

public Enumeration<?> getAttributeNames()
Gets the names of the attributes in the set.

Specified by:
getAttributeNames in interface AttributeSet
Returns:
the names as an Enumeration

getAttribute

public Object getAttribute(Object name)
Gets the value of an attribute.

Specified by:
getAttribute in interface AttributeSet
Parameters:
name - the attribute name
Returns:
the value

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)
Checks whether the attribute list contains a specified attribute name/value pair.

Specified by:
containsAttribute in interface AttributeSet
Parameters:
name - the name
value - the value
Returns:
true if the name/value pair is in the list

containsAttributes

public boolean containsAttributes(AttributeSet attributes)
Checks whether the attribute list contains all the specified name/value pairs.

Specified by:
containsAttributes in interface AttributeSet
Parameters:
attributes - the attribute list
Returns:
true if the list contains all the name/value pairs

addAttribute

public void addAttribute(Object name,
                         Object value)
Adds an attribute to the list.

Specified by:
addAttribute in interface MutableAttributeSet
Parameters:
name - the attribute name
value - the attribute value

addAttributes

public void addAttributes(AttributeSet attributes)
Adds a set of attributes to the list.

Specified by:
addAttributes in interface MutableAttributeSet
Parameters:
attributes - the set of attributes to add

removeAttribute

public void removeAttribute(Object name)
Removes an attribute from the list.

Specified by:
removeAttribute in interface MutableAttributeSet
Parameters:
name - the attribute name

removeAttributes

public void removeAttributes(Enumeration<?> names)
Removes a set of attributes from the list.

Specified by:
removeAttributes in interface MutableAttributeSet
Parameters:
names - the set of names to remove

removeAttributes

public void removeAttributes(AttributeSet attributes)
Removes a set of attributes from the list.

Specified by:
removeAttributes in interface MutableAttributeSet
Parameters:
attributes - the set of attributes to remove

getResolveParent

public AttributeSet getResolveParent()
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.

Specified by:
getResolveParent in interface AttributeSet
Returns:
the parent

setResolveParent

public void setResolveParent(AttributeSet parent)
Sets the resolving parent.

Specified by:
setResolveParent in interface MutableAttributeSet
Parameters:
parent - the parent

clone

public Object clone()
Clones a set of attributes.

Overrides:
clone in class Object
Returns:
the new set of attributes
See Also:
Cloneable

hashCode

public int hashCode()
Returns a hashcode for this set of attributes.

Overrides:
hashCode in class Object
Returns:
a hashcode value for this set of attributes.
See Also:
Object.equals(java.lang.Object), Hashtable

equals

public boolean equals(Object obj)
Compares this object to the specified object. The result is true if the object is an equivalent set of attributes.

Overrides:
equals in class Object
Parameters:
obj - the object to compare this attribute set with
Returns:
true if the objects are equal; false otherwise
See Also:
Object.hashCode(), Hashtable

toString

public String toString()
Converts the attribute set to a String.

Overrides:
toString in class Object
Returns:
the string

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

6 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-2361
Document créé le 31/08/06 03:24, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-javax/swing/text/SimpleAttributeSet.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,33 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Le sage ne s'afflige pas de ce que les hommes ne le connaissent pas ; il s'afflige de ne pas connaître les hommes.

Confucius
 
l'infobrol
Nous sommes le Samedi 02 Juin 2012, 09:20, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)