PageRenderTime 28ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/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
23package org.gjt.sp.jedit.textarea;
24
25import java.awt.Graphics2D;
26
27/**
28 * Subclasses of this class can perform custom painting and tool tip
29 * handling in the text area and gutter.
30 *
31 * @see TextAreaPainter.addExtension(TextAreaExtension)
32 * @see TextAreaPainter.removeExtension(TextAreaExtension)
33 * @see Gutter.addExtension(TextAreaExtension)
34 * @see Gutter.removeExtension(TextAreaExtension)
35 *
36 * @since jEdit 4.0pre4
37 *
38 * @author Slava Pestov
39 * @version $Id: TextAreaExtension.java 3972 2002-01-17 10:37:55Z spestov $
40 */
41public abstract class TextAreaExtension
42{
43	//{{{ paintValidLine() method
44	/**
45	 * Called by the text area when the extension is to paint a
46	 * screen line which has an associated physical line number in
47	 * the buffer. Note that since one physical line may consist of
48	 * several screen lines due to soft wrap, the start and end
49	 * offsets of the screen line are passed in as well.
50	 *
51	 * @param gfx The graphics context
52	 * @param screenLine The screen line number
53	 * @param physicalLine The physical line number
54	 * @param start The offset where the screen line begins, from
55	 * the start of the buffer
56	 * @param end The offset where the screen line ends, from the
57	 * start of the buffer
58	 * @param y The y co-ordinate of the top of the line's
59	 * bounding box
60	 * @since jEdit 4.0pre4
61	 */
62	public void paintValidLine(Graphics2D gfx, int screenLine,
63		int physicalLine, int start, int end, int y) {} //}}}
64
65	//{{{ paintInvalidLine() method
66	/**
67	 * Called by the text area when the extension is to paint a
68	 * screen line which is not part of the buffer. This can happen
69	 * if the buffer is shorter than the height of the text area,
70	 * for example.
71	 *
72	 * @param gfx The graphics context
73	 * @param screenLine The screen line number
74	 * @param y The y co-ordinate of the top of the line's
75	 * bounding box
76	 * @since jEdit 4.0pre4
77	 */
78	public void paintInvalidLine(Graphics2D gfx, int screenLine,
79		int y) {} //}}}
80
81	//{{{ getToolTipText() method
82	/**
83	 * Called by the text area when the mouse hovers over the
84	 * location specified in the mouse event.
85	 *
86	 * @param x The x co-ordinate
87	 * @param y The y co-ordinate
88	 * @since jEdit 4.0pre4
89	 */
90	public String getToolTipText(int x, int y)
91	{
92		return null;
93	} //}}}
94}