java.lang.Objectjavax.swing.text.LayeredHighlighter
javax.swing.text.DefaultHighlighter
public class DefaultHighlighter
Implements the Highlighter interfaces. Implements a simple highlight painter that renders in a solid color.
Highlighter| Nested Class Summary | |
|---|---|
static class |
DefaultHighlighter.DefaultHighlightPainter
Simple highlight painter that fills a highlighted area with a solid color. |
| Nested classes/interfaces inherited from class javax.swing.text.LayeredHighlighter |
|---|
LayeredHighlighter.LayerPainter |
| Nested classes/interfaces inherited from interface javax.swing.text.Highlighter |
|---|
Highlighter.Highlight, Highlighter.HighlightPainter |
| Field Summary | |
|---|---|
static LayeredHighlighter.LayerPainter |
DefaultPainter
Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights. |
| Constructor Summary | |
|---|---|
DefaultHighlighter()
Creates a new DefaultHighlighther object. |
|
| Method Summary | |
|---|---|
Object |
addHighlight(int p0,
int p1,
Highlighter.HighlightPainter p)
Adds a highlight to the view. |
void |
changeHighlight(Object tag,
int p0,
int p1)
Changes a highlight. |
void |
deinstall(JTextComponent c)
Called when the UI is being removed from the interface of a JTextComponent. |
boolean |
getDrawsLayeredHighlights()
|
Highlighter.Highlight[] |
getHighlights()
Makes a copy of the highlights. |
void |
install(JTextComponent c)
Called when the UI is being installed into the interface of a JTextComponent. |
void |
paint(Graphics g)
Renders the highlights. |
void |
paintLayeredHighlights(Graphics g,
int p0,
int p1,
Shape viewBounds,
JTextComponent editor,
View view)
When leaf Views (such as LabelView) are rendering they should call into this method. |
void |
removeAllHighlights()
Removes all highlights. |
void |
removeHighlight(Object tag)
Removes a highlight from the view. |
void |
setDrawsLayeredHighlights(boolean newValue)
If true, highlights are drawn as the Views draw the text. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final LayeredHighlighter.LayerPainter DefaultPainter
As of 1.4 this field is final.
| Constructor Detail |
|---|
public DefaultHighlighter()
| Method Detail |
|---|
public void paint(Graphics g)
g - the graphics contextpublic void install(JTextComponent c)
c - the editor componentHighlighter.install(javax.swing.text.JTextComponent)public void deinstall(JTextComponent c)
c - the componentHighlighter.deinstall(javax.swing.text.JTextComponent)public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter p) throws BadLocationException
p0 - the start offset of the range to highlight >= 0p1 - the end offset of the range to highlight >= p0p - the painter to use to actually render the highlight
BadLocationException - if the specified location is invalidpublic void removeHighlight(Object tag)
tag - the reference to the highlightpublic void removeAllHighlights()
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException
tag - the highlight tagp0 - the beginning of the range >= 0p1 - the end of the range >= p0
BadLocationException - if the specified location is invalidpublic Highlighter.Highlight[] getHighlights()
Highlighter.getHighlights()public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)
paintLayeredHighlights in class LayeredHighlighterg - Graphics used to drawp0 - starting offset of viewp1 - ending offset of viewviewBounds - Bounds of Vieweditor - JTextComponentview - View instance being renderedpublic void setDrawsLayeredHighlights(boolean newValue)
paintLayeredHighlight which
will result in a rectangle being drawn before the text is drawn
(if the offsets are in a highlighted region that is). For this to
work the painter supplied must be an instance of
LayeredHighlightPainter.
public boolean getDrawsLayeredHighlights()
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)