KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > ITracePainter


1 /*
2  * ITracePainter.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;
23
24 import java.awt.Graphics2D JavaDoc;
25
26 /**
27  * An interface that works at trace level and defines how it's points are
28  * rendered.
29  * <p>
30  *
31  * A contract for implementation is that
32  * {@link java.lang.Object#equals(java.lang.Object)} has to be implemented to
33  * return true if two instances are of the same class and
34  * {@link java.lang.Comparable#compareTo(java.lang.Object)} is implemented
35  * according to that. This is OK as trace painters are mostly to characterize by
36  * their different implementation of rendering a trace.
37  * <p>
38  *
39  * <h3>Caution</h3>
40  * There is no guarantee that further manipulation on the given
41  * {@link java.awt.Graphics2D} instance than painting just the label or tick
42  * will not produce layout problems. E.g. changing the color or font is not
43  * recommended as these should be assigned to the {@link info.monitorenter.gui.chart.ITrace2D}/
44  * {@link info.monitorenter.gui.chart.Chart2D}.
45  * <p>
46  *
47  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
48  *
49  * @version $Revision: 1.2 $
50  *
51  */

52 public interface ITracePainter extends Comparable JavaDoc {
53
54   /**
55    * Invoked to inform the painter that a discontinue in the trace to # paint
56    * has occured.
57    * <p>
58    * This only has to be implemented by painters that collect several points of
59    * {@link #paintPoint(int, int, int, int, Graphics2D)} to draw them as
60    * polygons (e.g.: {@link java.awt.Graphics#drawPolyline(int[], int[], int)}).
61    * <p>
62    *
63    */

64   public void discontinue();
65   
66   /**
67    * Invoked to inform implementations that a paint iteration ends for the
68    * corresponding {@link info.monitorenter.gui.chart.ITrace2D}.
69    * <p>
70    *
71    */

72   public void endPaintIteration();
73
74   /**
75    * Paint the point given by absolute coordinates on the given graphic context.
76    * <p>
77    *
78    * The next coordinates are also provided to allow to check how much distance
79    * is available for the graphic representation of the current point.
80    * <p>
81    *
82    * @param absoluteX
83    * the ready to use x value for the point to paint.
84    *
85    * @param absoluteY
86    * the ready to use y value for the point to paint.
87    *
88    * @param nextX
89    * the ready to use next x value for the point to paint.
90    *
91    * @param nextY
92    * the ready to use next < value for the point to paint.
93    *
94    * @param g
95    * the graphic context to paint on.
96    */

97   public void paintPoint(final int absoluteX, final int absoluteY, final int nextX,
98       final int nextY, final Graphics2D JavaDoc g);
99
100   /**
101    * Invoked to inform implementations that a paint iteration starts for the
102    * corresponding {@link info.monitorenter.gui.chart.ITrace2D}.
103    * <p>
104    *
105    */

106   public void startPaintIteration();
107
108 }
109
Popular Tags