KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * ILabelPainter.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  * <p>
28  * Interface to paint labels for a trace.
29  * </p>
30  * <b>Caution </b>
31  * <p>
32  * There is no guarantee that further manipulation on the given
33  * {@link java.awt.Graphics2D} instance than painting just the label or tick
34  * will not produce layout problems. E.g. changing the color or font is not
35  * recommended as these should be assigned to the {@link info.monitorenter.gui.chart.ITrace2D}/
36  * {@link info.monitorenter.gui.chart.Chart2D}.
37  * </p>
38  *
39  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
40  *
41  * @version $Revision: 1.1 $
42  *
43  */

44 public interface ILabelPainter {
45
46   /**
47    * Paint the given label for the x axis.
48    * <p>
49    *
50    * @param x
51    * the x coordinate of the baseline for the label.
52    *
53    * @param y
54    * the y coordinate of the baseline for the label.
55    *
56    * @param label
57    * the formatted label String.
58    *
59    * @param g
60    * the graphic context to draw on.
61    */

62   public void paintXLabel(final int x, final int y, String JavaDoc label, final Graphics2D JavaDoc g);
63
64   /**
65    * Paint the little marker for a label of the x axis.
66    * <p>
67    *
68    * @param x
69    * the x coordinate of the baseline for the label.
70    *
71    * @param y
72    * the y coordinate of the baseline for the label.
73    *
74    * @param isMajorTick
75    * if true, this is a major tick.
76    *
77    * @param g
78    * the graphic context to draw on.
79    */

80   public void paintXTick(final int x, final int y, boolean isMajorTick, final Graphics2D JavaDoc g);
81
82   /**
83    * Paint the given label for the y axis.
84    * <p>
85    *
86    * @param x
87    * the x coordinate of the baseline for the label.
88    *
89    * @param y
90    * the y coordinate of the baseline for the label.
91    *
92    * @param label
93    * the formatted label String.
94    *
95    * @param g
96    * the graphic context to draw on.
97    */

98   public void paintYLabel(final int x, final int y, String JavaDoc label, final Graphics2D JavaDoc g);
99
100   /**
101    * Paint the little marker for a label of the y axis.
102    * <p>
103    *
104    * @param x
105    * the x coordinate of the baseline for the label.
106    *
107    * @param y
108    * the y coordinate of the baseline for the label.
109    *
110    * @param isMajorTick
111    * if true, this is a major tick.
112    *
113    * @param g
114    * the graphic context to draw on.
115    */

116   public void paintYTick(final int x, final int y, boolean isMajorTick, final Graphics2D JavaDoc g);
117
118 }
119
Popular Tags