java.lang.Objectjavax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
public class LabelView
A LabelView is a styled chunk of text
that represents a view mapped over an element in the
text model. It caches the character level attributes
used for rendering.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.text.GlyphView |
|---|
GlyphView.GlyphPainter |
| Field Summary |
|---|
| Fields inherited from class javax.swing.text.View |
|---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
|---|---|
LabelView(Element elem)
Constructs a new view wrapped on an element. |
|
| Method Summary | |
|---|---|
void |
changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification from the document that attributes were changed in a location that this view is responsible for. |
Color |
getBackground()
Fetches the background color to use to render the glyphs. |
Font |
getFont()
Fetches the font that the glyphs should be based upon. |
protected FontMetrics |
getFontMetrics()
Deprecated. FontMetrics are not used for glyph rendering when running in the JDK. |
Color |
getForeground()
Fetches the foreground color to use to render the glyphs. |
boolean |
isStrikeThrough()
Determines if the glyphs should have a strikethrough line. |
boolean |
isSubscript()
Determines if the glyphs should be rendered as superscript. |
boolean |
isSuperscript()
Determines if the glyphs should be rendered as subscript. |
boolean |
isUnderline()
Determines if the glyphs should be underlined. |
protected void |
setBackground(Color bg)
Sets the background color for the view. |
protected void |
setPropertiesFromAttributes()
Sets the cached properties from the attributes. |
protected void |
setStrikeThrough(boolean s)
Sets whether or not the view has a strike/line through it. |
protected void |
setSubscript(boolean s)
Sets whether or not the view represents a subscript. |
protected void |
setSuperscript(boolean s)
Sets whether or not the view represents a superscript. |
protected void |
setUnderline(boolean u)
Sets whether or not the view is underlined. |
| Methods inherited from class javax.swing.text.GlyphView |
|---|
breakView, checkPainter, clone, createFragment, getAlignment, getBreakWeight, getEndOffset, getGlyphPainter, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, insertUpdate, modelToView, paint, removeUpdate, setGlyphPainter, viewToModel |
| Methods inherited from class javax.swing.text.View |
|---|
append, forwardUpdate, forwardUpdateToView, getAttributes, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getMinimumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModel |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.text.TabableView |
|---|
getPartialSpan, getTabbedSpan |
| Constructor Detail |
|---|
public LabelView(Element elem)
elem - the element| Method Detail |
|---|
protected void setUnderline(boolean u)
u - true if the view is underlined, otherwise
falseisUnderline()protected void setStrikeThrough(boolean s)
s - true if the view has a strike/line
through it, otherwise falseisStrikeThrough()protected void setSuperscript(boolean s)
s - true if the view represents a
superscript, otherwise falseisSuperscript()protected void setSubscript(boolean s)
s - true if the view represents a
subscript, otherwise falseisSubscript()protected void setBackground(Color bg)
View. If you need
to customize the background color you should override
setPropertiesFromAttributes and invoke this method. A
value of null indicates no background should be rendered, so that the
background of the parent View will show through.
bg - background color, or nullsetPropertiesFromAttributes()protected void setPropertiesFromAttributes()
@Deprecated protected FontMetrics getFontMetrics()
FontMetrics used for this view.
public Color getBackground()
null.
getBackground in class GlyphViewpublic Color getForeground()
null.
getForeground in class GlyphViewpublic Font getFont()
public boolean isUnderline()
When you request this property, LabelView
re-syncs its state with the properties of the
Element's AttributeSet.
If Element's AttributeSet
does not have this property set, it will revert to false.
isUnderline in class GlyphViewunderline propertypublic boolean isStrikeThrough()
strikeThrough property.
When you request this property, LabelView
re-syncs its state with the properties of the
Element's AttributeSet.
If Element's AttributeSet
does not have this property set, it will revert to false.
isStrikeThrough in class GlyphViewstrikeThrough propertypublic boolean isSubscript()
isSubscript in class GlyphViewWhen you request this property, LabelView
re-syncs its state with the properties of the
Element's AttributeSet.
If Element's AttributeSet
does not have this property set, it will revert to false.
public boolean isSuperscript()
When you request this property, LabelView
re-syncs its state with the properties of the
Element's AttributeSet.
If Element's AttributeSet
does not have this property set, it will revert to false.
isSuperscript in class GlyphViewsuperscript propertypublic void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate in class GlyphViewe - the change information from the associated documenta - the current allocation of the viewf - the factory to use to rebuild if the view has childrenView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)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)