Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.sun.java.swing.text.DefaultHighlighter

java.lang.Object
  |
  +--com.sun.java.swing.text.DefaultHighlighter

public class DefaultHighlighter
extends java.lang.Object
implements Highlighter
Implements the Highlighter interfaces. Implements a simple highlight painter that renders in a solid color.

See Also:
Highlighter

Inner Class Summary
static  DefaultHighlighter.DefaultHighlightPainter
          Simple highlight painter that fills a highlighted area with a solid color.
 
Constructor Summary
DefaultHighlighter()
          Creates a new DefaultHighlighther object.
 
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 a highlight.
void deinstall(JTextComponent c)
          Called when the UI is being removed from the interface of a JTextComponent.
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(java.awt.Graphics g)
          Renders the highlights.
void removeAllHighlights()
          Removes all highlights.
void removeHighlight(java.lang.Object tag)
          Removes a highlight from the view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

DefaultHighlighter

public DefaultHighlighter()
Creates a new DefaultHighlighther object.
Method Detail

paint

public void paint(java.awt.Graphics g)
Renders the highlights.
Specified by:
paint in interface Highlighter
Parameters:
g - the graphics context

install

public void install(JTextComponent c)
Called when the UI is being installed into the interface of a JTextComponent. Installs the editor, and removes any existing highlights.
Specified by:
install in interface Highlighter
Parameters:
c - the editor component
See Also:
install

deinstall

public void deinstall(JTextComponent c)
Called when the UI is being removed from the interface of a JTextComponent.
Specified by:
deinstall in interface Highlighter
Parameters:
c - the component
See Also:
deinstall

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.
Specified by:
addHighlight in interface Highlighter
Parameters:
p0 - the start offset of the range to highlight >= 0
p1 - the end offset of the range to highlight >= p0
p - the painter to use to actually render the highlight
Throws:
BadLocationException - if the specified location is invalid

removeHighlight

public void removeHighlight(java.lang.Object tag)
Removes a highlight from the view.
Specified by:
removeHighlight in interface Highlighter
Parameters:
tag - the reference to the highlight

removeAllHighlights

public void removeAllHighlights()
Removes all highlights.
Specified by:
removeAllHighlights in interface Highlighter

changeHighlight

public void changeHighlight(java.lang.Object tag,
                            int p0,
                            int p1)
                    throws BadLocationException
Changes a highlight.
Specified by:
changeHighlight in interface Highlighter
Parameters:
tag - the highlight tag
p0 - the beginning of the range >= 0
p1 - the end of the range >= p0
Throws:
BadLocationException - if the specified location is invalid

getHighlights

public Highlighter.Highlight[] getHighlights()
Makes a copy of the highlights. Does not actually clone each highlight, but only makes references to them.
Specified by:
getHighlights in interface Highlighter
Returns:
the copy
See Also:
getHighlights

Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug or feature
Submit comments/suggestions about javadoc
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.