KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chart2d > TextListArea


1 /**
2  * Chart2D, a java library for drawing two dimensional charts.
3  * Copyright (C) 2001 Jason J. Simas
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  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * The author of this library may be contacted at:
19  * E-mail: jjsimas@users.sourceforge.net
20  * Street Address: J J Simas, 887 Tico Road, Ojai, CA 93023-3555 USA
21  */

22
23
24 package net.sourceforge.chart2d;
25
26
27 import java.awt.*;
28
29
30 /**
31  * An abstract class for shared methods between HorizontalTextListArea and
32  * VerticalTextListArea.
33  */

34 abstract class TextListArea extends FontArea {
35
36
37   /**
38    * Allows this text list area to determine its minimum size and reset its own
39    * size. This is useful when you want the component to be able to figure out
40    * its minimum size, but not always to set itself to that miniumum size.
41    * @param allow If true, then the component can reset its own minimum size.
42    * This is only relevant when auto minimum sizing is enabled.
43    */

44   abstract void setAllowSelfSize (boolean allow);
45
46
47   /**
48    * Specifies the text for the labels. This value cannot be null; however,
49    * a zero or greater length array is fine.
50    * @param labels An array of the strings to be used for the labels.
51    */

52   abstract void setLabels (String JavaDoc[] labels);
53
54
55   /**
56    * Specifies the model size (width and height) of the bullets. A ratio based
57    * on maximum size / model size will be applied to this to find the actual
58    * bullet size -- when auto sizing the model maximum size is disabled.
59    * Otherwise, the actual size will be this size.
60    * @param model The model size of a bullet.
61    */

62   abstract void setBulletsSizeModel (Dimension model);
63
64
65   /**
66    * The horizontal alignment of the bullets respective to the labels. The
67    * bullets can either be place in line with each label, or in in line with
68    * the middle of the space between each label. That is, bullets can be
69    * centered in the middle of the label, or placed between each label.
70    * @param alignment The alignment for the bullets.
71    * Possible values are CENTERED and BETWEEN.
72    */

73   abstract void setBulletsAlignment (int alignment);
74
75
76   /**
77    * Specifies the horizontal relation of the bullets to the labels.
78    * The bullets
79    * can either be placed along the left of the labels or along the right.
80    * @param relation The horizontal relation of the bullets.
81    * Possible values are LEFT and RIGHT.
82    */

83   abstract void setBulletsRelation (int relation);
84
85
86   /**
87    * Specifies the colors of the bullets. Each bullet can have a different
88    * color so an array must be passed. The number of colors must be equal to
89    * the number of bullets. If the bullets alignment is between the labels and
90    * the lables do exist, then there should be one bullet less than the number
91    * of labels. If the bullets alignment is centered and the labels do exist,
92    * then there should be the same number of bullets as labels. Otherwise,
93    * choose any number of bullets. Number of bullets is set by setting the
94    * bullet colors. The number of bullets always equals the number of colors.
95    * @param colors An array filled with a color for each bullet. The first
96    * bullet from left to right gets the lowest order color in the array.
97    */

98   abstract void setBulletColors (Color[] colors);
99
100
101   /**
102    * Specifies whether the bullets should have a small black outline.
103    * Outline is 1 pixel on all sides, at all times, and is black.
104    * Outlien is included in size of bullet.
105    * @param outline If true, then the outline will exist.
106    */

107   abstract void setBulletsOutline (boolean outline);
108
109
110   /**
111    * Specifies the color of the bullets outline.
112    * @param color The outline color.
113    */

114   abstract void setBulletsOutlineColor (Color color);
115
116
117   /**
118    * Specifies whether the <b>minimum</b> amount of space between each label,
119    * the gap, shall be enforced. If the gap does not exist, then it will
120    * not be included in calculations.
121    * @param existence The existence of the gap. If true, then it exists.
122    */

123   abstract void setBetweenLabelsGapExistence (boolean existence);
124
125
126   /**
127    * Specifies the model <b>minimum</b> thickness of the gap between the labels.
128    * @param model The model minimum thickness of the gap.
129    * Note: The gap may end up being more depending on sizing properties.
130    */

131   abstract void setBetweenLabelsGapThicknessModel (int model);
132
133
134   /**
135    * Specifies the existence of a minimum gap between each bullets. If the gap
136    * doesn't exist, then it will not be included in calculations.
137    * @param existence The existence of the minimum gap. If true, then the gap
138    * does exist.
139    */

140   abstract void setBetweenBulletsGapExistence (boolean existence);
141
142
143   /**
144    * Specifies the model <b>minimum</b> thickness of the gap between each
145    * bullet.
146    * @param model The model minimum thickness of the gap.
147    * Note: The gap may end up being more depending on sizing properties.
148    */

149   abstract void setBetweenBulletsGapThicknessModel (int model);
150
151
152   /**
153    * Specifies the existence of a minimum gap between the labels and the
154    * bullets. If the gap doesn't exist, then it will not be included in
155    * calculations.
156    * @param boolean The existence of the minimum gap. If true, then the gap
157    * does exist.
158    */

159   abstract void setBetweenBulletsAndLabelsGapExistence (boolean existence);
160
161
162   /**
163    * Specifies the model <b>minimum</b> thickness of the gap between the labels
164    * and the bullets.
165    * @param model The model minimum thickness of the gap.
166    * Note: The gap may end up being more depending on sizing properties.
167    */

168   abstract void setBetweenBulletsAndLabelsGapThicknessModel (int model);
169
170
171   /**
172    * Returns the label strings of this text list.
173    * @return The label strings.
174    */

175   abstract String JavaDoc[] getLabelStrings();
176
177
178   /**
179    * Returns the labels. This is useful if other components
180    * need to be aligned exactly with the label's location or should be the
181    * exact same size.
182    * @param g2D The graphics context used for calculations.
183    * @return The array of TextArea's which are the labels.
184    */

185   abstract TextArea[] getLabels (Graphics2D g2D);
186
187
188   /**
189    * Returns the model thickness of the minimum gap between bullets.
190    * @return int The model thickness.
191    */

192   abstract int getBetweenBulletsGapThicknessModel();
193
194   /**
195    * Returns the model thickness of the minimum gap between labels.
196    * @return The model thickness.
197    */

198   abstract int getBetweenLabelsGapThicknessModel();
199
200
201   /**
202    * Returns the model <b>minimum</b> thickness of the gap between the labels
203    * and the bullets.
204    * @return The model minimum thickness of the gap.
205    */

206   abstract int getBetweenBulletsAndLabelsGapThicknessModel();
207
208
209   /**
210    * Returns the bounds for each bullet. This is useful if other components
211    * need to be aligned exactly with the bullet's location or should be the
212    * exact same size.
213    * @param g2D The graphics context used for calculations.
214    * @return The array of rectangles which bound each bullet.
215    */

216   abstract Rectangle[] getBullets (Graphics2D g2D);
217
218
219   /**
220    * Returns the model size of the bullets.
221    * @return The size.
222    */

223   abstract Dimension getBulletsSizeModel();
224
225
226   /**
227    * The horizontal alignment of the bullets respective to the labels. The
228    * bullets can either be place in line with each label, or in in line with
229    * the middle of the space between each label. That is, bullets can be
230    * centered in the middle of the label, or placed between each label.
231    * @return The alignment for the bullets.
232    * Possible values are CENTERED and BETWEEN.
233    */

234   abstract int getBulletsAlignment();
235
236
237   /**
238    * Specifies whether the bullets should have a small outline.
239    * Outline is 1 pixel on all sides, at all times, and is black.
240    * Outline is included in size of bullet.
241    * @return outline If true, then the outline will exist.
242    */

243   abstract boolean getBulletsOutline();
244
245
246   /**
247    * Specifies the color of the bullets outline.
248    * @return color The outline color.
249    */

250   abstract Color getBulletsOutlineColor();
251 }
Popular Tags