1 |
/* DefaultTreeCellRenderer.java |
/* DefaultTreeCellRenderer.java |
2 |
Copyright (C) 2002, 2004 Free Software Foundation, Inc. |
Copyright (C) 2002, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
6 |
|
GNU Classpath is free software; you can redistribute it and/or modify |
7 |
|
it under the terms of the GNU General Public License as published by |
8 |
|
the Free Software Foundation; either version 2, or (at your option) |
9 |
|
any later version. |
10 |
|
|
11 |
|
GNU Classpath is distributed in the hope that it will be useful, but |
12 |
|
WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
|
General Public License for more details. |
15 |
|
|
16 |
|
You should have received a copy of the GNU General Public License |
17 |
|
along with GNU Classpath; see the file COPYING. If not, write to the |
18 |
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
19 |
|
02110-1301 USA. |
20 |
|
|
21 |
|
Linking this library statically or dynamically with other modules is |
22 |
|
making a combined work based on this library. Thus, the terms and |
23 |
|
conditions of the GNU General Public License cover the whole |
24 |
|
combination. |
25 |
|
|
26 |
|
As a special exception, the copyright holders of this library give you |
27 |
|
permission to link this library with independent modules to produce an |
28 |
|
executable, regardless of the license terms of these independent |
29 |
|
modules, and to copy and distribute the resulting executable under |
30 |
|
terms of your choice, provided that you also meet, for each linked |
31 |
|
independent module, the terms and conditions of the license of that |
32 |
|
module. An independent module is a module which is not derived from |
33 |
|
or based on this library. If you modify this library, you may extend |
34 |
|
this exception to your version of the library, but you are not |
35 |
|
obligated to do so. If you do not wish to do so, delete this |
36 |
|
exception statement from your version. */ |
37 |
|
|
|
GNU Classpath is free software; you can redistribute it and/or modify |
|
|
it under the terms of the GNU General Public License as published by |
|
|
the Free Software Foundation; either version 2, or (at your option) |
|
|
any later version. |
|
|
|
|
|
GNU Classpath is distributed in the hope that it will be useful, but |
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
General Public License for more details. |
|
|
|
|
|
You should have received a copy of the GNU General Public License |
|
|
along with GNU Classpath; see the file COPYING. If not, write to the |
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
|
02110-1301 USA. |
|
|
|
|
|
Linking this library statically or dynamically with other modules is |
|
|
making a combined work based on this library. Thus, the terms and |
|
|
conditions of the GNU General Public License cover the whole |
|
|
combination. |
|
|
|
|
|
As a special exception, the copyright holders of this library give you |
|
|
permission to link this library with independent modules to produce an |
|
|
executable, regardless of the license terms of these independent |
|
|
modules, and to copy and distribute the resulting executable under |
|
|
terms of your choice, provided that you also meet, for each linked |
|
|
independent module, the terms and conditions of the license of that |
|
|
module. An independent module is a module which is not derived from |
|
|
or based on this library. If you modify this library, you may extend |
|
|
this exception to your version of the library, but you are not |
|
|
obligated to do so. If you do not wish to do so, delete this |
|
|
exception statement from your version. */ |
|
38 |
|
|
39 |
package javax.swing.tree; |
package javax.swing.tree; |
40 |
|
|
42 |
import java.awt.Component; |
import java.awt.Component; |
43 |
import java.awt.Dimension; |
import java.awt.Dimension; |
44 |
import java.awt.Font; |
import java.awt.Font; |
45 |
|
import java.awt.FontMetrics; |
46 |
import java.awt.Graphics; |
import java.awt.Graphics; |
47 |
|
import java.awt.Insets; |
48 |
import java.awt.Rectangle; |
import java.awt.Rectangle; |
49 |
|
|
50 |
import javax.swing.border.Border; |
import javax.swing.border.Border; |
53 |
import javax.swing.JTree; |
import javax.swing.JTree; |
54 |
import javax.swing.UIDefaults; |
import javax.swing.UIDefaults; |
55 |
import javax.swing.UIManager; |
import javax.swing.UIManager; |
56 |
|
import javax.swing.SwingUtilities; |
57 |
import javax.swing.plaf.UIResource; |
import javax.swing.plaf.UIResource; |
58 |
|
|
59 |
/** |
/** |
62 |
* @author Andrew Selkirk |
* @author Andrew Selkirk |
63 |
*/ |
*/ |
64 |
public class DefaultTreeCellRenderer |
public class DefaultTreeCellRenderer |
65 |
extends JLabel |
extends JLabel |
66 |
implements TreeCellRenderer |
implements TreeCellRenderer |
67 |
{ |
{ |
68 |
// ------------------------------------------------------------- |
// ------------------------------------------------------------- |
69 |
// Variables -------------------------------------------------- |
// Variables -------------------------------------------------- |
70 |
// ------------------------------------------------------------- |
// ------------------------------------------------------------- |
71 |
|
|
72 |
/** |
/** |
73 |
* selected |
* selected |
74 |
*/ |
*/ |
75 |
protected boolean selected; |
protected boolean selected; |
76 |
|
|
77 |
/** |
/** |
78 |
* hasFocus |
* hasFocus |
79 |
*/ |
*/ |
80 |
protected boolean hasFocus; |
protected boolean hasFocus; |
81 |
|
|
82 |
/** |
/** |
83 |
* drawsFocusBorderAroundIcon |
* drawsFocusBorderAroundIcon |
84 |
*/ |
*/ |
85 |
private boolean drawsFocusBorderAroundIcon; |
private boolean drawsFocusBorderAroundIcon; |
86 |
|
|
87 |
/** |
/** |
88 |
* closedIcon |
* closedIcon |
89 |
*/ |
*/ |
90 |
protected transient Icon closedIcon; |
protected transient Icon closedIcon; |
91 |
|
|
92 |
/** |
/** |
93 |
* leafIcon |
* leafIcon |
94 |
*/ |
*/ |
95 |
protected transient Icon leafIcon; |
protected transient Icon leafIcon; |
96 |
|
|
97 |
/** |
/** |
98 |
* openIcon |
* openIcon |
99 |
*/ |
*/ |
100 |
protected transient Icon openIcon; |
protected transient Icon openIcon; |
101 |
|
|
102 |
/** |
/** |
103 |
* textSelectionColor |
* textSelectionColor |
104 |
*/ |
*/ |
105 |
protected Color textSelectionColor; |
protected Color textSelectionColor; |
106 |
|
|
107 |
/** |
/** |
108 |
* textNonSelectionColor |
* textNonSelectionColor |
109 |
*/ |
*/ |
110 |
protected Color textNonSelectionColor; |
protected Color textNonSelectionColor; |
111 |
|
|
112 |
/** |
/** |
113 |
* backgroundSelectionColor |
* backgroundSelectionColor |
114 |
*/ |
*/ |
115 |
protected Color backgroundSelectionColor; |
protected Color backgroundSelectionColor; |
116 |
|
|
117 |
/** |
/** |
118 |
* backgroundNonSelectionColor |
* backgroundNonSelectionColor |
119 |
*/ |
*/ |
120 |
protected Color backgroundNonSelectionColor; |
protected Color backgroundNonSelectionColor; |
121 |
|
|
122 |
/** |
/** |
123 |
* borderSelectionColor |
* borderSelectionColor |
124 |
*/ |
*/ |
125 |
protected Color borderSelectionColor; |
protected Color borderSelectionColor; |
126 |
|
|
127 |
|
// ------------------------------------------------------------- |
128 |
// ------------------------------------------------------------- |
// Initialization --------------------------------------------- |
129 |
// Initialization --------------------------------------------- |
// ------------------------------------------------------------- |
130 |
// ------------------------------------------------------------- |
|
131 |
|
/** |
132 |
/** |
* Constructor DefaultTreeCellRenderer |
133 |
* Constructor DefaultTreeCellRenderer |
*/ |
134 |
*/ |
public DefaultTreeCellRenderer() |
135 |
public DefaultTreeCellRenderer() |
{ |
136 |
{ |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
137 |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
|
138 |
|
setLeafIcon(getDefaultLeafIcon()); |
139 |
setLeafIcon(getDefaultLeafIcon()); |
setOpenIcon(getDefaultOpenIcon()); |
140 |
setOpenIcon(getDefaultOpenIcon()); |
setClosedIcon(getDefaultClosedIcon()); |
141 |
setClosedIcon(getDefaultClosedIcon()); |
|
142 |
|
setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); |
143 |
setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); |
setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); |
144 |
setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); |
setBackgroundNonSelectionColor(defaults.getColor("Tree.nonSelectionBackground")); |
145 |
setBackgroundNonSelectionColor(defaults |
setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); |
146 |
.getColor("Tree.nonSelectionBackground")); |
setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); |
147 |
setBackgroundSelectionColor(defaults |
} |
148 |
.getColor("Tree.selectionBackground")); |
|
149 |
setBorderSelectionColor(defaults |
// ------------------------------------------------------------- |
150 |
.getColor("Tree.selectionBorderColor")); |
// Methods ---------------------------------------------------- |
151 |
} |
// ------------------------------------------------------------- |
152 |
|
|
153 |
// ------------------------------------------------------------- |
/** |
154 |
// Methods ---------------------------------------------------- |
* getDefaultOpenIcon |
155 |
// ------------------------------------------------------------- |
* |
156 |
|
* @returns Icon |
157 |
/** |
*/ |
158 |
* getDefaultOpenIcon |
public Icon getDefaultOpenIcon() |
159 |
* |
{ |
160 |
* @returns Icon |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.openIcon"); |
161 |
*/ |
} |
162 |
public Icon getDefaultOpenIcon() |
|
163 |
{ |
/** |
164 |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.openIcon"); |
* getDefaultClosedIcon |
165 |
} |
* |
166 |
|
* @returns Icon |
167 |
/** |
*/ |
168 |
* getDefaultClosedIcon |
public Icon getDefaultClosedIcon() |
169 |
* |
{ |
170 |
* @returns Icon |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.closedIcon"); |
171 |
*/ |
} |
172 |
public Icon getDefaultClosedIcon() |
|
173 |
{ |
/** |
174 |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.closedIcon"); |
* getDefaultLeafIcon |
175 |
} |
* |
176 |
|
* @returns Icon |
177 |
/** |
*/ |
178 |
* getDefaultLeafIcon |
public Icon getDefaultLeafIcon() |
179 |
* |
{ |
180 |
* @returns Icon |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.leafIcon"); |
181 |
*/ |
} |
182 |
public Icon getDefaultLeafIcon() |
|
183 |
{ |
/** |
184 |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.leafIcon"); |
* setOpenIcon |
185 |
} |
* |
186 |
|
* @param i |
187 |
/** |
* the icon. |
188 |
* setOpenIcon |
*/ |
189 |
* |
public void setOpenIcon(Icon i) |
190 |
* @param i the icon. |
{ |
191 |
*/ |
openIcon = i; |
192 |
public void setOpenIcon(Icon i) |
} |
193 |
{ |
|
194 |
openIcon = i; |
/** |
195 |
} |
* getOpenIcon |
196 |
|
* |
197 |
/** |
* @returns Icon |
198 |
* getOpenIcon |
*/ |
199 |
* |
public Icon getOpenIcon() |
200 |
* @returns Icon |
{ |
201 |
*/ |
return openIcon; |
202 |
public Icon getOpenIcon() |
} |
203 |
{ |
|
204 |
return openIcon; |
/** |
205 |
} |
* setClosedIcon |
206 |
|
* |
207 |
/** |
* @param i |
208 |
* setClosedIcon |
* the icon. |
209 |
* |
*/ |
210 |
* @param i the icon. |
public void setClosedIcon(Icon i) |
211 |
*/ |
{ |
212 |
public void setClosedIcon(Icon i) |
closedIcon = i; |
213 |
{ |
} |
214 |
closedIcon = i; |
|
215 |
} |
/** |
216 |
|
* getClosedIcon |
217 |
/** |
* |
218 |
* getClosedIcon |
* @returns Icon |
219 |
* |
*/ |
220 |
* @returns Icon |
public Icon getClosedIcon() |
221 |
*/ |
{ |
222 |
public Icon getClosedIcon() |
return closedIcon; |
223 |
{ |
} |
224 |
return closedIcon; |
|
225 |
} |
/** |
226 |
|
* setLeafIcon |
227 |
/** |
* |
228 |
* setLeafIcon |
* @param i |
229 |
* |
* the icon. |
230 |
* @param i the icon. |
*/ |
231 |
*/ |
public void setLeafIcon(Icon i) |
232 |
public void setLeafIcon(Icon i) |
{ |
233 |
{ |
leafIcon = i; |
234 |
leafIcon = i; |
} |
235 |
} |
|
236 |
|
/** |
237 |
/** |
* getLeafIcon |
238 |
* getLeafIcon |
* |
239 |
* |
* @returns Icon |
240 |
* @returns Icon |
*/ |
241 |
*/ |
public Icon getLeafIcon() |
242 |
public Icon getLeafIcon() |
{ |
243 |
{ |
return leafIcon; |
244 |
return leafIcon; |
} |
245 |
} |
|
246 |
|
/** |
247 |
/** |
* setTextSelectionColor |
248 |
* setTextSelectionColor |
* |
249 |
* |
* @param c |
250 |
* @param c the color. |
* the color. |
251 |
*/ |
*/ |
252 |
public void setTextSelectionColor(Color c) |
public void setTextSelectionColor(Color c) |
253 |
{ |
{ |
254 |
textSelectionColor = c; |
textSelectionColor = c; |
255 |
} |
} |
256 |
|
|
257 |
/** |
/** |
258 |
* getTextSelectionColor |
* getTextSelectionColor |
259 |
* |
* |
260 |
* @returns Color |
* @returns Color |
261 |
*/ |
*/ |
262 |
public Color getTextSelectionColor() |
public Color getTextSelectionColor() |
263 |
{ |
{ |
264 |
return textSelectionColor; |
return textSelectionColor; |
265 |
} |
} |
266 |
|
|
267 |
/** |
/** |
268 |
* setTextNonSelectionColor |
* setTextNonSelectionColor |
269 |
* |
* |
270 |
* @param c the color. |
* @param c |
271 |
*/ |
* the color. |
272 |
public void setTextNonSelectionColor(Color c) |
*/ |
273 |
{ |
public void setTextNonSelectionColor(Color c) |
274 |
textNonSelectionColor = c; |
{ |
275 |
} |
textNonSelectionColor = c; |
276 |
|
} |
277 |
/** |
|
278 |
* getTextNonSelectionColor |
/** |
279 |
* |
* getTextNonSelectionColor |
280 |
* @returns Color |
* |
281 |
*/ |
* @returns Color |
282 |
public Color getTextNonSelectionColor() |
*/ |
283 |
{ |
public Color getTextNonSelectionColor() |
284 |
return textNonSelectionColor; |
{ |
285 |
} |
return textNonSelectionColor; |
286 |
|
} |
287 |
/** |
|
288 |
* setBackgroundSelectionColor |
/** |
289 |
* |
* setBackgroundSelectionColor |
290 |
* @param c the color. |
* |
291 |
*/ |
* @param c |
292 |
public void setBackgroundSelectionColor(Color c) |
* the color. |
293 |
{ |
*/ |
294 |
backgroundSelectionColor = c; |
public void setBackgroundSelectionColor(Color c) |
295 |
} |
{ |
296 |
|
backgroundSelectionColor = c; |
297 |
/** |
} |
298 |
* getBackgroundSelectionColor |
|
299 |
* |
/** |
300 |
* @returns Color |
* getBackgroundSelectionColor |
301 |
*/ |
* |
302 |
public Color getBackgroundSelectionColor() |
* @returns Color |
303 |
{ |
*/ |
304 |
return backgroundSelectionColor; |
public Color getBackgroundSelectionColor() |
305 |
} |
{ |
306 |
|
return backgroundSelectionColor; |
307 |
/** |
} |
308 |
* setBackgroundNonSelectionColor |
|
309 |
* |
/** |
310 |
* @param c the color. |
* setBackgroundNonSelectionColor |
311 |
*/ |
* |
312 |
public void setBackgroundNonSelectionColor(Color c) |
* @param c |
313 |
{ |
* the color. |
314 |
backgroundNonSelectionColor = c; |
*/ |
315 |
} |
public void setBackgroundNonSelectionColor(Color c) |
316 |
|
{ |
317 |
/** |
backgroundNonSelectionColor = c; |
318 |
* getBackgroundNonSelectionColor |
} |
319 |
* |
|
320 |
* @returns Color |
/** |
321 |
*/ |
* getBackgroundNonSelectionColor |
322 |
public Color getBackgroundNonSelectionColor() |
* |
323 |
{ |
* @returns Color |
324 |
return backgroundNonSelectionColor; |
*/ |
325 |
} |
public Color getBackgroundNonSelectionColor() |
326 |
|
{ |
327 |
/** |
return backgroundNonSelectionColor; |
328 |
* setBorderSelectionColor |
} |
329 |
* |
|
330 |
* @param c the color. |
/** |
331 |
*/ |
* setBorderSelectionColor |
332 |
public void setBorderSelectionColor(Color c) |
* |
333 |
{ |
* @param c |
334 |
borderSelectionColor = c; |
* the color. |
335 |
} |
*/ |
336 |
|
public void setBorderSelectionColor(Color c) |
337 |
/** |
{ |
338 |
* getBorderSelectionColor |
borderSelectionColor = c; |
339 |
* |
} |
340 |
* @returns Color |
|
341 |
*/ |
/** |
342 |
public Color getBorderSelectionColor() |
* getBorderSelectionColor |
343 |
{ |
* |
344 |
return borderSelectionColor; |
* @returns Color |
345 |
} |
*/ |
346 |
|
public Color getBorderSelectionColor() |
347 |
/** |
{ |
348 |
* setFont |
return borderSelectionColor; |
349 |
* |
} |
350 |
* @param f the font. |
|
351 |
*/ |
/** |
352 |
public void setFont(Font f) |
* setFont |
353 |
{ |
* |
354 |
if (f != null && f instanceof UIResource) |
* @param f |
355 |
f = null; |
* the font. |
356 |
super.setFont(f); |
*/ |
357 |
} |
public void setFont(Font f) |
358 |
|
{ |
359 |
/** |
if (f != null && f instanceof UIResource) |
360 |
* setBackground |
f = null; |
361 |
* |
super.setFont(f); |
362 |
* @param c the color. |
} |
363 |
*/ |
|
364 |
public void setBackground(Color c) |
/** |
365 |
{ |
* setBackground |
366 |
if (c != null && c instanceof UIResource) |
* |
367 |
c = null; |
* @param c |
368 |
super.setBackground(c); |
* the color. |
369 |
} |
*/ |
370 |
|
public void setBackground(Color c) |
371 |
/** |
{ |
372 |
* getTreeCellRendererComponent |
if (c != null && c instanceof UIResource) |
373 |
* |
c = null; |
374 |
* @param tree TODO |
super.setBackground(c); |
375 |
* @param val TODO |
} |
376 |
* @param selected TODO |
|
377 |
* @param expanded TODO |
/** |
378 |
* @param leaf TODO |
* getTreeCellRendererComponent |
379 |
* @param row TODO |
* |
380 |
* @param hasFocus TODO |
* @param tree |
381 |
* @returns Component |
* TODO |
382 |
*/ |
* @param val |
383 |
public Component getTreeCellRendererComponent(JTree tree, Object val, |
* TODO |
384 |
boolean selected, boolean expanded, boolean leaf, int row, |
* @param selected |
385 |
boolean hasFocus) |
* TODO |
386 |
{ |
* @param expanded |
387 |
if (leaf) |
* TODO |
388 |
setIcon(getLeafIcon()); |
* @param leaf |
389 |
else if (expanded) |
* TODO |
390 |
setIcon(getOpenIcon()); |
* @param row |
391 |
else |
* TODO |
392 |
setIcon(getClosedIcon()); |
* @param hasFocus |
393 |
|
* TODO |
394 |
setText(val.toString()); |
* @returns Component |
395 |
this.selected = selected; |
*/ |
396 |
this.hasFocus = hasFocus; |
public Component getTreeCellRendererComponent(JTree tree, Object val, |
397 |
setHorizontalAlignment(LEFT); |
boolean selected, |
398 |
setOpaque(false); |
boolean expanded, boolean leaf, |
399 |
setVerticalAlignment(TOP); |
int row, boolean hasFocus) |
400 |
setEnabled(true); |
{ |
401 |
super.setFont(UIManager.getLookAndFeelDefaults().getFont("Tree.font")); |
if (leaf) |
402 |
|
setIcon(getLeafIcon()); |
403 |
if (selected) |
else if (expanded) |
404 |
{ |
setIcon(getOpenIcon()); |
405 |
super.setBackground(getBackgroundSelectionColor()); |
else |
406 |
setForeground(getTextSelectionColor()); |
setIcon(getClosedIcon()); |
407 |
setBorder(UIManager.getLookAndFeelDefaults().getBorder("Tree.selectionBorder")); |
|
408 |
} |
setText(val.toString()); |
409 |
else |
this.selected = selected; |
410 |
{ |
this.hasFocus = hasFocus; |
411 |
super.setBackground(getBackgroundNonSelectionColor()); |
setHorizontalAlignment(LEFT); |
412 |
setForeground(getTextNonSelectionColor()); |
setOpaque(false); |
413 |
setBorder(UIManager.getLookAndFeelDefaults().getBorder("Tree.nonSelectionBorder")); |
setVerticalAlignment(TOP); |
414 |
} |
setEnabled(true); |
415 |
|
super.setFont(UIManager.getLookAndFeelDefaults().getFont("Tree.font")); |
416 |
return this; |
|
417 |
} |
if (selected) |
418 |
|
{ |
419 |
/** |
super.setBackground(getBackgroundSelectionColor()); |
420 |
* getFont |
setForeground(getTextSelectionColor()); |
421 |
* |
|
422 |
* @return the current Font |
if (tree.getLeadSelectionPath() == null || |
423 |
*/ |
(tree.getLeadSelectionPath().getLastPathComponent()).equals(val)) |
424 |
public Font getFont() |
setBorderSelectionColor(UIManager.getLookAndFeelDefaults(). |
425 |
{ |
getColor("Tree.selectionBorderColor")); |
426 |
return super.getFont(); |
else |
427 |
} |
setBorderSelectionColor(null); |
428 |
|
} |
429 |
/** |
else |
430 |
* paint |
{ |
431 |
* |
super.setBackground(getBackgroundNonSelectionColor()); |
432 |
* @param g the graphics device. |
setForeground(getTextNonSelectionColor()); |
433 |
*/ |
setBorderSelectionColor(null); |
434 |
public void paint(Graphics g) |
} |
435 |
{ |
|
436 |
super.paint(g); |
return this; |
437 |
} |
} |
438 |
|
|
439 |
/** |
/** |
440 |
* getPreferredSize |
* getFont |
441 |
* |
* |
442 |
* @returns Dimension |
* @return the current Font |
443 |
*/ |
*/ |
444 |
public Dimension getPreferredSize() |
public Font getFont() |
445 |
{ |
{ |
446 |
return null; // TODO |
return super.getFont(); |
447 |
} // getPreferredSize() |
} |
448 |
|
|
449 |
/** |
/** |
450 |
* validate |
* Paints the value. The background is filled based on selected. |
451 |
*/ |
* |
452 |
public void validate() |
* @param g |
453 |
{ |
* the graphics device. |
454 |
// Overridden for performance reasons. |
*/ |
455 |
} // validate() |
public void paint(Graphics g) |
456 |
|
{ |
457 |
/** |
// paint background |
458 |
* revalidate |
Rectangle vr = new Rectangle(); |
459 |
*/ |
Rectangle ir = new Rectangle(); |
460 |
public void revalidate() |
Rectangle tr = new Rectangle(); |
461 |
{ |
|
462 |
// Overridden for performance reasons. |
Insets insets = new Insets(0, 0, 0, 0); |
463 |
} // revalidate() |
Border border = UIManager.getLookAndFeelDefaults().getBorder( |
464 |
|
"Tree.selectionBorder"); |
465 |
/** |
if (border != null) |
466 |
* repaint |
insets = border.getBorderInsets(this); |
467 |
* |
|
468 |
* @param value0 TODO |
FontMetrics fm = getToolkit().getFontMetrics(getFont()); |
469 |
* @param value1 TODO |
SwingUtilities.layoutCompoundLabel(((JLabel) this), fm, getText(), |
470 |
* @param value2 TODO |
getIcon(), getVerticalAlignment(), |
471 |
* @param value3 TODO |
getHorizontalAlignment(), |
472 |
* @param value4 TODO |
getVerticalTextPosition(), |
473 |
*/ |
getHorizontalTextPosition(), vr, ir, tr, |
474 |
public void repaint(long value0, int value1, int value2, int value3, |
getIconTextGap()); |
475 |
int value4) |
|
476 |
{ |
g.setColor(super.getBackground()); |
477 |
// Overridden for performance reasons. |
g.fillRect(tr.x, tr.y, tr.width, tr.height - insets.top - insets.bottom); |
478 |
} // repaint() |
|
479 |
|
// paint border |
480 |
/** |
Color b = getBorderSelectionColor(); |
481 |
* repaint |
if (b != null) |
482 |
* |
{ |
483 |
* @param value0 TODO |
g.setColor(b); |
484 |
*/ |
g.drawRect(tr.x, tr.y, tr.width, tr.height - insets.top - insets.bottom); |
485 |
public void repaint(Rectangle value0) |
} |
486 |
{ |
super.paint(g); |
487 |
// Overridden for performance reasons. |
} |
488 |
} // repaint() |
|
489 |
|
/** |
490 |
/** |
* returns the preferred size of the cell. |
491 |
* firePropertyChange |
* |
492 |
* |
* @returns Dimension |
493 |
* @param value0 TODO |
*/ |
494 |
* @param value1 TODO |
public Dimension getPreferredSize() |
495 |
* @param value2 TODO |
{ |
496 |
*/ |
Rectangle vr = new Rectangle(); |
497 |
protected void firePropertyChange(String value0, Object value1, |
Rectangle ir = new Rectangle(); |
498 |
Object value2) |
Rectangle tr = new Rectangle(); |
499 |
{ |
|
500 |
// Overridden for performance reasons. |
FontMetrics fm = getToolkit().getFontMetrics(getFont()); |
501 |
} // firePropertyChange() |
SwingUtilities.layoutCompoundLabel(((JLabel) this), fm, getText(), |
502 |
|
getIcon(), getVerticalAlignment(), |
503 |
/** |
getHorizontalAlignment(), |
504 |
* firePropertyChange |
getVerticalTextPosition(), |
505 |
* |
getHorizontalTextPosition(), vr, ir, tr, |
506 |
* @param value0 TODO |
getIconTextGap()); |
507 |
* @param value1 TODO |
Rectangle cr = ir.union(tr); |
508 |
* @param value2 TODO |
return new Dimension(cr.width, cr.height); |
509 |
*/ |
} // getPreferredSize() |
510 |
public void firePropertyChange(String value0, byte value1, byte value2) |
|
511 |
{ |
/** |
512 |
// Overridden for performance reasons. |
* validate |
513 |
} // firePropertyChange() |
*/ |
514 |
|
public void validate() |
515 |
/** |
{ |
516 |
* firePropertyChange |
// Overridden for performance reasons. |
517 |
* |
} // validate() |
518 |
* @param value0 TODO |
|
519 |
* @param value1 TODO |
/** |
520 |
* @param value2 TODO |
* revalidate |
521 |
*/ |
*/ |
522 |
public void firePropertyChange(String value0, char value1, char value2) |
public void revalidate() |
523 |
{ |
{ |
524 |
// Overridden for performance reasons. |
// Overridden for performance reasons. |
525 |
} // firePropertyChange() |
} // revalidate() |
526 |
|
|
527 |
/** |
/** |
528 |
* firePropertyChange |
* repaint |
529 |
* |
* |
530 |
* @param value0 TODO |
* @param value0 |
531 |
* @param value1 TODO |
* TODO |
532 |
* @param value2 TODO |
* @param value1 |
533 |
*/ |
* TODO |
534 |
public void firePropertyChange(String value0, short value1, short value2) |
* @param value2 |
535 |
{ |
* TODO |
536 |
// Overridden for performance reasons. |
* @param value3 |
537 |
} // firePropertyChange() |
* TODO |
538 |
|
* @param value4 |
539 |
/** |
* TODO |
540 |
* firePropertyChange |
*/ |
541 |
* |
public void repaint(long value0, int value1, int value2, int value3, |
542 |
* @param value0 TODO |
int value4) |
543 |
* @param value1 TODO |
{ |
544 |
* @param value2 TODO |
// Overridden for performance reasons. |
545 |
*/ |
} // repaint() |
546 |
public void firePropertyChange(String value0, int value1, int value2) |
|
547 |
{ |
/** |
548 |
// Overridden for performance reasons. |
* repaint |
549 |
} // firePropertyChange() |
* |
550 |
|
* @param value0 |
551 |
/** |
* TODO |
552 |
* firePropertyChange |
*/ |
553 |
* |
public void repaint(Rectangle value0) |
554 |
* @param value0 TODO |
{ |
555 |
* @param value1 TODO |
// Overridden for performance reasons. |
556 |
* @param value2 TODO |
} // repaint() |
557 |
*/ |
|
558 |
public void firePropertyChange(String value0, long value1, long value2) |
/** |
559 |
{ |
* firePropertyChange |
560 |
// Overridden for performance reasons. |
* |
561 |
} // firePropertyChange() |
* @param value0 |
562 |
|
* TODO |
563 |
/** |
* @param value1 |
564 |
* firePropertyChange |
* TODO |
565 |
* |
* @param value2 |
566 |
* @param value0 TODO |
* TODO |
567 |
* @param value1 TODO |
*/ |
568 |
* @param value2 TODO |
protected void firePropertyChange(String value0, Object value1, Object value2) |
569 |
*/ |
{ |
570 |
public void firePropertyChange(String value0, float value1, float value2) |
// Overridden for performance reasons. |
571 |
{ |
} // firePropertyChange() |
572 |
// Overridden for performance reasons. |
|
573 |
} // firePropertyChange() |
/** |
574 |
|
* firePropertyChange |
575 |
/** |
* |
576 |
* firePropertyChange |
* @param value0 |
577 |
* |
* TODO |
578 |
* @param value0 TODO |
* @param value1 |
579 |
* @param value1 TODO |
* TODO |
580 |
* @param value2 TODO |
* @param value2 |
581 |
*/ |
* TODO |
582 |
public void firePropertyChange(String value0, double value1, double value2) |
*/ |
583 |
{ |
public void firePropertyChange(String value0, byte value1, byte value2) |
584 |
// Overridden for performance reasons. |
{ |
585 |
} // firePropertyChange() |
// Overridden for performance reasons. |
586 |
|
} // firePropertyChange() |
587 |
/** |
|
588 |
* firePropertyChange |
/** |
589 |
* |
* firePropertyChange |
590 |
* @param name the property name. |
* |
591 |
* @param v1 the old value. |
* @param value0 |
592 |
* @param v2 the new value. |
* TODO |
593 |
*/ |
* @param value1 |
594 |
public void firePropertyChange(String name, boolean v1, boolean v2) |
* TODO |
595 |
{ |
* @param value2 |
596 |
// Overridden for performance reasons. |
* TODO |
597 |
} // firePropertyChange() |
*/ |
598 |
|
public void firePropertyChange(String value0, char value1, char value2) |
599 |
|
{ |
600 |
|
// Overridden for performance reasons. |
601 |
|
} // firePropertyChange() |
602 |
|
|
603 |
|
/** |
604 |
|
* firePropertyChange |
605 |
|
* |
606 |
|
* @param value0 |
607 |
|
* TODO |
608 |
|
* @param value1 |
609 |
|
* TODO |
610 |
|
* @param value2 |
611 |
|
* TODO |
612 |
|
*/ |
613 |
|
public void firePropertyChange(String value0, short value1, short value2) |
614 |
|
{ |
615 |
|
// Overridden for performance reasons. |
616 |
|
} // firePropertyChange() |
617 |
|
|
618 |
|
/** |
619 |
|
* firePropertyChange |
620 |
|
* |
621 |
|
* @param value0 |
622 |
|
* TODO |
623 |
|
* @param value1 |
624 |
|
* TODO |
625 |
|
* @param value2 |
626 |
|
* TODO |
627 |
|
*/ |
628 |
|
public void firePropertyChange(String value0, int value1, int value2) |
629 |
|
{ |
630 |
|
// Overridden for performance reasons. |
631 |
|
} // firePropertyChange() |
632 |
|
|
633 |
|
/** |
634 |
|
* firePropertyChange |
635 |
|
* |
636 |
|
* @param value0 |
637 |
|
* TODO |
638 |
|
* @param value1 |
639 |
|
* TODO |
640 |
|
* @param value2 |
641 |
|
* TODO |
642 |
|
*/ |
643 |
|
public void firePropertyChange(String value0, long value1, long value2) |
644 |
|
{ |
645 |
|
// Overridden for performance reasons. |
646 |
|
} // firePropertyChange() |
647 |
|
|
648 |
|
/** |
649 |
|
* firePropertyChange |
650 |
|
* |
651 |
|
* @param value0 |
652 |
|
* TODO |
653 |
|
* @param value1 |
654 |
|
* TODO |
655 |
|
* @param value2 |
656 |
|
* TODO |
657 |
|
*/ |
658 |
|
public void firePropertyChange(String value0, float value1, float value2) |
659 |
|
{ |
660 |
|
// Overridden for performance reasons. |
661 |
|
} // firePropertyChange() |
662 |
|
|
663 |
|
/** |
664 |
|
* firePropertyChange |
665 |
|
* |
666 |
|
* @param value0 TODO |
667 |
|
* @param value1 TODO |
668 |
|
* @param value2 TODO |
669 |
|
*/ |
670 |
|
public void firePropertyChange(String value0, double value1, double value2) |
671 |
|
{ |
672 |
|
// Overridden for performance reasons. |
673 |
|
} // firePropertyChange() |
674 |
|
|
675 |
|
/** |
676 |
|
* firePropertyChange |
677 |
|
* |
678 |
|
* @param name the property name. |
679 |
|
* @param v1 the old value. |
680 |
|
* @param v2 the new value. |
681 |
|
*/ |
682 |
|
public void firePropertyChange(String name, boolean v1, boolean v2) |
683 |
|
{ |
684 |
|
// Overridden for performance reasons. |
685 |
|
} // firePropertyChange() |
686 |
|
|
687 |
} // DefaultTreeCellRenderer |
} // DefaultTreeCellRenderer |