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