KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > text > LayeredHighlighter


1 /*
2  * @(#)LayeredHighlighter.java 1.7 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.text;
8
9 import java.awt.Graphics JavaDoc;
10 import java.awt.Shape JavaDoc;
11
12 /**
13  *
14  * @author Scott Violet
15  * @author Timothy Prinzing
16  * @version 1.7 12/19/03
17  * @see Highlighter
18  */

19 public abstract class LayeredHighlighter implements Highlighter JavaDoc {
20     /**
21      * When leaf Views (such as LabelView) are rendering they should
22      * call into this method. If a highlight is in the given region it will
23      * be drawn immediately.
24      *
25      * @param g Graphics used to draw
26      * @param p0 starting offset of view
27      * @param p1 ending offset of view
28      * @param viewBounds Bounds of View
29      * @param editor JTextComponent
30      * @param view View instance being rendered
31      */

32     public abstract void paintLayeredHighlights(Graphics JavaDoc g, int p0, int p1,
33                         Shape JavaDoc viewBounds,
34                         JTextComponent JavaDoc editor,
35                         View JavaDoc view);
36
37
38     /**
39      * Layered highlight renderer.
40      */

41     static public abstract class LayerPainter implements Highlighter.HighlightPainter JavaDoc {
42     public abstract Shape JavaDoc paintLayer(Graphics JavaDoc g, int p0, int p1,
43                     Shape JavaDoc viewBounds,JTextComponent JavaDoc editor,
44                     View JavaDoc view);
45     }
46 }
47
Popular Tags