380 |
this.selected = selected; |
this.selected = selected; |
381 |
this.hasFocus = hasFocus; |
this.hasFocus = hasFocus; |
382 |
|
|
|
if (leaf) |
|
|
setLeafIcon(getLeafIcon()); |
|
|
else if (expanded) |
|
|
setOpenIcon(getOpenIcon()); |
|
|
else |
|
|
setClosedIcon(getClosedIcon()); |
|
|
|
|
383 |
setText(val.toString()); |
setText(val.toString()); |
384 |
setHorizontalAlignment(LEFT); |
setHorizontalAlignment(LEFT); |
385 |
setOpaque(true); |
setOpaque(true); |
387 |
setEnabled(true); |
setEnabled(true); |
388 |
setFont(getFont()); |
setFont(getFont()); |
389 |
|
|
390 |
|
if (leaf) |
391 |
|
setIcon(getLeafIcon()); |
392 |
|
else if (expanded) |
393 |
|
setIcon(getOpenIcon()); |
394 |
|
else |
395 |
|
setIcon(getClosedIcon()); |
396 |
|
|
397 |
if (selected) |
if (selected) |
398 |
{ |
{ |
399 |
super.setBackground(getBackgroundSelectionColor()); |
super.setBackground(getBackgroundSelectionColor()); |
400 |
super.setForeground(getTextSelectionColor()); |
setForeground(getTextSelectionColor()); |
401 |
} |
} |
402 |
else |
else |
403 |
{ |
{ |
404 |
super.setBackground((tree.getParent()).getBackground()); |
super.setBackground((tree.getParent()).getBackground()); |
405 |
super.setForeground(getTextNonSelectionColor()); |
setForeground(getTextNonSelectionColor()); |
406 |
} |
} |
|
|
|
407 |
|
|
408 |
return this; |
return this; |
409 |
} |
} |