Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.text
Interface Highlighter

All Known Implementing Classes:
  LayeredHighlighter

public abstract interface Highlighter

An interface for an object that allows one to mark up the background with colored areas.

Inner Class Summary
`static interface` | `Highlighter.Highlight`
`static interface` | `Highlighter.HighlightPainter` Highlight renderer.

Method Summary
`java.lang.Object` | `addHighlight(int p0, int p1, Highlighter.HighlightPainter p)` Adds a highlight to the view.
`void` | `changeHighlight(java.lang.Object tag, int p0, int p1)` Changes the given highlight to span a different portion of the document.
`void` | `deinstall(JTextComponent c)` Called when the UI is being removed from the interface of a JTextComponent.
`Highlighter.Highlight[]` | `getHighlights()` Fetches the current list of highlights.
`void` | `install(JTextComponent c)` Called when the UI is being installed into the interface of a JTextComponent.
`void` | `paint(java.awt.Graphics g)` Renders the highlights.
`void` | `removeAllHighlights()` Removes all highlights this highlighter is responsible for.
`void` | `removeHighlight(java.lang.Object tag)` Removes a highlight from the view.

Method Detail

### install

    public void install(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.
  Parameters:
    `c` - the JTextComponent editor

### deinstall

    public void deinstall(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.
  Parameters:
    `c` - the JTextComponent editor

### paint

    public void paint(java.awt.Graphics g)

  Renders the highlights.
  Parameters:
    `g` - the graphics context.

### addHighlight

    public java.lang.Object addHighlight(int p0,
                                         int p1,
                                         Highlighter.HighlightPainter p)
                                  throws BadLocationException

  Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
  Parameters:
    `p0` - the beginning of the range >= 0
    `p1` - the end of the range >= p0
    `p` - the painter to use for the actual highlighting
  Returns:
    an object that refers to the highlight
  Throws:
    BadLocationException - for an invalid range specification

### removeHighlight

    public void removeHighlight(java.lang.Object tag)

  Removes a highlight from the view.
  Parameters:
    `tag` - which highlight to remove

### removeAllHighlights

    public void removeAllHighlights()

  Removes all highlights this highlighter is responsible for.

### changeHighlight

    public void changeHighlight(java.lang.Object tag,
                                int p0,
                                int p1)
                         throws BadLocationException

  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.
  Parameters:
    `tag` - which highlight to change
    `p0` - the beginning of the range >= 0
    `p1` - the end of the range >= p0
  Throws:
    BadLocationException - for an invalid range specification

### getHighlights

    public Highlighter.Highlight[] getHighlights()

  Fetches the current list of highlights.
  Returns:
    the highlight list

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.