1. /*
  2. * @(#)LayeredHighlighter.java 1.6 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.text;
  8. import java.awt.Graphics;
  9. import java.awt.Shape;
  10. /**
  11. *
  12. * @author Scott Violet
  13. * @author Timothy Prinzing
  14. * @version 1.6 01/23/03
  15. * @see Highlighter
  16. */
  17. public abstract class LayeredHighlighter implements Highlighter {
  18. /**
  19. * When leaf Views (such as LabelView) are rendering they should
  20. * call into this method. If a highlight is in the given region it will
  21. * be drawn immediately.
  22. *
  23. * @param g Graphics used to draw
  24. * @param p0 starting offset of view
  25. * @param p1 ending offset of view
  26. * @param viewBounds Bounds of View
  27. * @param editor JTextComponent
  28. * @param view View instance being rendered
  29. */
  30. public abstract void paintLayeredHighlights(Graphics g, int p0, int p1,
  31. Shape viewBounds,
  32. JTextComponent editor,
  33. View view);
  34. /**
  35. * Layered highlight renderer.
  36. */
  37. static public abstract class LayerPainter implements Highlighter.HighlightPainter {
  38. public abstract Shape paintLayer(Graphics g, int p0, int p1,
  39. Shape viewBounds,JTextComponent editor,
  40. View view);
  41. }
  42. }