KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > traces > painters > TracePainterLine


1 /*
2  * LinePainter.java, <enter purpose here>.
3  * Copyright (C) 2005 Achim Westermann, Achim.Westermann@gmx.de
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * If you modify or optimize the code in a useful way please let me know.
20  * Achim.Westermann@gmx.de
21  */

22 package info.monitorenter.gui.chart.traces.painters;
23
24
25 import java.awt.Graphics2D JavaDoc;
26
27 /**
28  * <p>
29  * A trace painter that renders a trace by lines.
30  * </p>
31  *
32  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
33  *
34  * @version $Revision: 1.1 $
35  *
36  */

37 public class TracePainterLine extends ATracePainter {
38
39   /**
40    * Paints a line from current to next point.
41    * <p>
42    *
43    * @see info.monitorenter.gui.chart.ITracePainter#paintPoint(int, int, int, int, Graphics2D)
44    */

45   public void paintPoint(final int absoluteX, final int absoluteY, final int nextX,
46       final int nextY, final Graphics2D JavaDoc g) {
47     super.paintPoint(absoluteX, absoluteY, nextX, nextY, g);
48     g.drawLine(absoluteX, absoluteY, nextX, nextY);
49   }
50 }
51
Popular Tags