public interface StyledDocument
Interface for a generic styled document.
| Field Summary |
|---|
| Fields inherited from interface javax.swing.text.Document |
|---|
StreamDescriptionProperty, TitleProperty |
| Method Summary | |
|---|---|
Style |
addStyle(String nm,
Style parent)
Adds a new style into the logical style hierarchy. |
Color |
getBackground(AttributeSet attr)
Takes a set of attributes and turn it into a background color specification. |
Element |
getCharacterElement(int pos)
Gets the element that represents the character that is at the given offset within the document. |
Font |
getFont(AttributeSet attr)
Takes a set of attributes and turn it into a font specification. |
Color |
getForeground(AttributeSet attr)
Takes a set of attributes and turn it into a foreground color specification. |
Style |
getLogicalStyle(int p)
Gets a logical style for a given position in a paragraph. |
Element |
getParagraphElement(int pos)
Gets the element that represents the paragraph that encloses the given offset within the document. |
Style |
getStyle(String nm)
Fetches a named style previously added. |
void |
removeStyle(String nm)
Removes a named style previously added to the document. |
void |
setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
Changes the content element attributes used for the given range of existing content in the document. |
void |
setLogicalStyle(int pos,
Style s)
Sets the logical style to use for the paragraph at the given position. |
void |
setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
Sets paragraph attributes. |
| Methods inherited from interface javax.swing.text.Document |
|---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Method Detail |
|---|
Style addStyle(String nm, Style parent)
nm - the name of the style (must be unique within the
collection of named styles). The name may be null if the style
is unnamed, but the caller is responsible
for managing the reference returned as an unnamed style can't
be fetched by name. An unnamed style may be useful for things
like character attribute overrides such as found in a style
run.parent - the parent style. This may be null if unspecified
attributes need not be resolved in some other style.
void removeStyle(String nm)
nm - the name of the style to removeStyle getStyle(String nm)
nm - the name of the style
void setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
offset - the start of the change >= 0length - the length of the change >= 0s - the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace - indicates whether or not the previous
attributes should be cleared before the new attributes
as set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.
void setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
offset - the start of the change >= 0length - the length of the change >= 0s - the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace - indicates whether or not the previous
attributes should be cleared before the new attributes
are set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.
void setLogicalStyle(int pos,
Style s)
pos - the starting position >= 0s - the style to setStyle getLogicalStyle(int p)
p - the position >= 0
Element getParagraphElement(int pos)
pos - the offset >= 0
Element getCharacterElement(int pos)
pos - the offset >= 0
Color getForeground(AttributeSet attr)
attr - the set of attributes
Color getBackground(AttributeSet attr)
attr - the set of attributes
Font getFont(AttributeSet attr)
attr - the set of attributes
Ces informations proviennent du site de http://java.sun.com
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 :
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.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
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.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)