FileDocCategorySizeDatePackage
Highlighter.javaAPI DocJava SE 5 API3710Fri Aug 26 14:58:16 BST 2005javax.swing.text

Highlighter

public interface Highlighter
An interface for an object that allows one to mark up the background with colored areas.
author
Timothy Prinzing
version
1.22 12/19/03

(Omit source code)

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectaddHighlight(int p0, int p1, javax.swing.text.Highlighter$HighlightPainter p)
Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.

param
p0 the beginning of the range >= 0
param
p1 the end of the range >= p0
param
p the painter to use for the actual highlighting
return
an object that refers to the highlight
exception
BadLocationException for an invalid range specification

public voidchangeHighlight(java.lang.Object tag, int p0, int p1)
Changes the given highlight to span a different portion of the document. This may be more efficient than a remove/add when a selection is expanding/shrinking (such as a sweep with a mouse) by damaging only what changed.

param
tag which highlight to change
param
p0 the beginning of the range >= 0
param
p1 the end of the range >= p0
exception
BadLocationException for an invalid range specification

public voiddeinstall(javax.swing.text.JTextComponent c)
Called when the UI is being removed from the interface of a JTextComponent. This is used to unregister any listeners that were attached.

param
c the JTextComponent editor

public javax.swing.text.Highlighter$Highlight[]getHighlights()
Fetches the current list of highlights.

return
the highlight list

public voidinstall(javax.swing.text.JTextComponent c)
Called when the UI is being installed into the interface of a JTextComponent. This can be used to gain access to the model that is being navigated by the implementation of this interface.

param
c the JTextComponent editor

public voidpaint(java.awt.Graphics g)
Renders the highlights.

param
g the graphics context.

public voidremoveAllHighlights()
Removes all highlights this highlighter is responsible for.

public voidremoveHighlight(java.lang.Object tag)
Removes a highlight from the view.

param
tag which highlight to remove