116 |
* borderSelectionColor |
* borderSelectionColor |
117 |
*/ |
*/ |
118 |
protected Color borderSelectionColor; |
protected Color borderSelectionColor; |
119 |
|
|
120 |
|
|
121 |
// ------------------------------------------------------------- |
// ------------------------------------------------------------- |
122 |
// Initialization --------------------------------------------- |
// Initialization --------------------------------------------- |
381 |
this.hasFocus = hasFocus; |
this.hasFocus = hasFocus; |
382 |
|
|
383 |
if (leaf) |
if (leaf) |
384 |
setIcon(getLeafIcon()); |
setLeafIcon(getLeafIcon()); |
385 |
else if (expanded) |
else if (expanded) |
386 |
setIcon(getOpenIcon()); |
setOpenIcon(getOpenIcon()); |
387 |
else |
else |
388 |
setIcon(getClosedIcon()); |
setClosedIcon(getClosedIcon()); |
389 |
|
|
390 |
setText(val.toString()); |
setText(val.toString()); |
391 |
setHorizontalAlignment(LEFT); |
setHorizontalAlignment(LEFT); |
392 |
|
setOpaque(true); |
393 |
setVerticalAlignment(TOP); |
setVerticalAlignment(TOP); |
394 |
|
setEnabled(true); |
395 |
|
setFont(getFont()); |
396 |
|
|
397 |
|
if (selected) |
398 |
|
{ |
399 |
|
super.setBackground(getBackgroundSelectionColor()); |
400 |
|
super.setForeground(getTextSelectionColor()); |
401 |
|
} |
402 |
|
else |
403 |
|
{ |
404 |
|
super.setBackground((tree.getParent()).getBackground()); |
405 |
|
super.setForeground(getTextNonSelectionColor()); |
406 |
|
} |
407 |
|
|
408 |
|
|
409 |
return this; |
return this; |
410 |
} |
} |
411 |
|
|
412 |
|
/** |
413 |
|
* getFont |
414 |
|
* |
415 |
|
* @return the current Font |
416 |
|
*/ |
417 |
|
public Font getFont() |
418 |
|
{ |
419 |
|
return super.getFont(); |
420 |
|
} |
421 |
|
|
422 |
/** |
/** |
423 |
* paint |
* paint |