/jEdit/tags/jedit-4-0-pre5/org/gjt/sp/jedit/textarea/TextAreaExtension.java

# · Java · 94 lines · 13 code · 5 blank · 76 comment · 0 complexity · 0d68d31ceb20b6688a5e92a13bd40997 MD5 · raw file

  1. /*
  2. * TextAreaExtension.java - Custom painter and tool tip handler
  3. * :tabSize=8:indentSize=8:noTabs=false:
  4. * :folding=explicit:collapseFolds=1:
  5. *
  6. * Copyright (C) 2002 Slava Pestov
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. package org.gjt.sp.jedit.textarea;
  23. import java.awt.Graphics2D;
  24. /**
  25. * Subclasses of this class can perform custom painting and tool tip
  26. * handling in the text area and gutter.
  27. *
  28. * @see TextAreaPainter.addExtension(TextAreaExtension)
  29. * @see TextAreaPainter.removeExtension(TextAreaExtension)
  30. * @see Gutter.addExtension(TextAreaExtension)
  31. * @see Gutter.removeExtension(TextAreaExtension)
  32. *
  33. * @since jEdit 4.0pre4
  34. *
  35. * @author Slava Pestov
  36. * @version $Id: TextAreaExtension.java 3972 2002-01-17 10:37:55Z spestov $
  37. */
  38. public abstract class TextAreaExtension
  39. {
  40. //{{{ paintValidLine() method
  41. /**
  42. * Called by the text area when the extension is to paint a
  43. * screen line which has an associated physical line number in
  44. * the buffer. Note that since one physical line may consist of
  45. * several screen lines due to soft wrap, the start and end
  46. * offsets of the screen line are passed in as well.
  47. *
  48. * @param gfx The graphics context
  49. * @param screenLine The screen line number
  50. * @param physicalLine The physical line number
  51. * @param start The offset where the screen line begins, from
  52. * the start of the buffer
  53. * @param end The offset where the screen line ends, from the
  54. * start of the buffer
  55. * @param y The y co-ordinate of the top of the line's
  56. * bounding box
  57. * @since jEdit 4.0pre4
  58. */
  59. public void paintValidLine(Graphics2D gfx, int screenLine,
  60. int physicalLine, int start, int end, int y) {} //}}}
  61. //{{{ paintInvalidLine() method
  62. /**
  63. * Called by the text area when the extension is to paint a
  64. * screen line which is not part of the buffer. This can happen
  65. * if the buffer is shorter than the height of the text area,
  66. * for example.
  67. *
  68. * @param gfx The graphics context
  69. * @param screenLine The screen line number
  70. * @param y The y co-ordinate of the top of the line's
  71. * bounding box
  72. * @since jEdit 4.0pre4
  73. */
  74. public void paintInvalidLine(Graphics2D gfx, int screenLine,
  75. int y) {} //}}}
  76. //{{{ getToolTipText() method
  77. /**
  78. * Called by the text area when the mouse hovers over the
  79. * location specified in the mouse event.
  80. *
  81. * @param x The x co-ordinate
  82. * @param y The y co-ordinate
  83. * @since jEdit 4.0pre4
  84. */
  85. public String getToolTipText(int x, int y)
  86. {
  87. return null;
  88. } //}}}
  89. }