Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
public class: DefaultHighlighter [javadoc | source]
java.lang.Object
   javax.swing.text.LayeredHighlighter
      javax.swing.text.DefaultHighlighter

All Implemented Interfaces:
    Highlighter

Direct Known Subclasses:
    BasicHighlighter

Implements the Highlighter interfaces. Implements a simple highlight painter that renders in a solid color.
Nested Class Summary:
public static class  DefaultHighlighter.DefaultHighlightPainter  Simple highlight painter that fills a highlighted area with a solid color. 
class  DefaultHighlighter.HighlightInfo   
class  DefaultHighlighter.LayeredHighlightInfo  LayeredHighlightPainter is used when a drawsLayeredHighlights is true. It maintains a rectangle of the region to paint. 
class  DefaultHighlighter.SafeDamager  This class invokes mapper.damageRange in EventDispatchThread. The only one instance per Highlighter is cretaed. When a number of ranges should be damaged it collects them into queue and damages them in consecutive order in run call. 
Field Summary
public static final  LayerPainter DefaultPainter    Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights.

As of 1.4 this field is final. 

Constructor:
 public DefaultHighlighter() 
Method from javax.swing.text.DefaultHighlighter Summary:
addHighlight,   changeHighlight,   deinstall,   getDrawsLayeredHighlights,   getHighlights,   install,   paint,   paintLayeredHighlights,   removeAllHighlights,   removeHighlight,   setDrawsLayeredHighlights
Methods from javax.swing.text.LayeredHighlighter:
paintLayeredHighlights
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.DefaultHighlighter Detail:
 public Object addHighlight(int p0,
    int p1,
    HighlightPainter p) throws BadLocationException 
    Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
 public  void changeHighlight(Object tag,
    int p0,
    int p1) throws BadLocationException 
    Changes a highlight.
 public  void deinstall(JTextComponent c) 
    Called when the UI is being removed from the interface of a JTextComponent.
 public boolean getDrawsLayeredHighlights() 
 public Highlight[] getHighlights() 
    Makes a copy of the highlights. Does not actually clone each highlight, but only makes references to them.
 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.
 public  void paint(Graphics g) 
    Renders the highlights.
 public  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. If a highlight is in the given region it will be drawn immediately.
 public  void removeAllHighlights() 
    Removes all highlights.
 public  void removeHighlight(Object tag) 
    Removes a highlight from the view.
 public  void setDrawsLayeredHighlights(boolean newValue) 
    If true, highlights are drawn as the Views draw the text. That is the Views will call into 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.