347 |
// Document changed. |
// Document changed. |
348 |
modelChanged(); |
modelChanged(); |
349 |
} |
} |
|
else if (event.getPropertyName().equals("enabled") |
|
|
|| event.getPropertyName().equals("editable")) |
|
|
{ |
|
|
updateComponentColors(); |
|
|
} |
|
350 |
} |
} |
351 |
} |
} |
352 |
|
|
426 |
DocumentHandler documentHandler = new DocumentHandler(); |
DocumentHandler documentHandler = new DocumentHandler(); |
427 |
|
|
428 |
/** |
/** |
|
* The standard foreground color. This is the color which is used to paint |
|
|
* text in enabled text components. |
|
|
*/ |
|
|
Color foreground; |
|
|
|
|
|
/** |
|
429 |
* The standard background color. This is the color which is used to paint |
* The standard background color. This is the color which is used to paint |
430 |
* text in enabled text components. |
* text in enabled text components. |
431 |
*/ |
*/ |
432 |
Color background; |
Color background; |
433 |
|
|
434 |
/** |
/** |
|
* The inactive foreground color. This is the color which is used to paint |
|
|
* text in disabled text components. |
|
|
*/ |
|
|
Color inactiveForeground; |
|
|
|
|
|
/** |
|
435 |
* The inactive background color. This is the color which is used to paint |
* The inactive background color. This is the color which is used to paint |
436 |
* text in disabled text components. |
* text in disabled text components. |
437 |
*/ |
*/ |
527 |
caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); |
caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); |
528 |
|
|
529 |
// Fetch the colors for enabled/disabled text components. |
// Fetch the colors for enabled/disabled text components. |
|
foreground = defaults.getColor(prefix + ".foreground"); |
|
530 |
background = defaults.getColor(prefix + ".background"); |
background = defaults.getColor(prefix + ".background"); |
|
inactiveForeground = defaults.getColor(prefix + ".inactiveForeground"); |
|
531 |
inactiveBackground = defaults.getColor(prefix + ".inactiveBackground"); |
inactiveBackground = defaults.getColor(prefix + ".inactiveBackground"); |
532 |
|
textComponent.setForeground(defaults.getColor(prefix + ".foreground")); |
533 |
|
textComponent.setDisabledTextColor |
534 |
|
(defaults.getColor(prefix + ".inactiveForeground")); |
535 |
updateComponentColors(); |
updateComponentColors(); |
536 |
} |
} |
537 |
|
|
816 |
*/ |
*/ |
817 |
protected void paintBackground(Graphics g) |
protected void paintBackground(Graphics g) |
818 |
{ |
{ |
819 |
|
if (textComponent.isEditable()) |
820 |
|
textComponent.setBackground(background); |
821 |
|
else |
822 |
|
textComponent.setBackground(inactiveBackground); |
823 |
|
|
824 |
g.setColor(textComponent.getBackground()); |
g.setColor(textComponent.getBackground()); |
825 |
g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); |
g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); |
826 |
} |
} |
1074 |
*/ |
*/ |
1075 |
void updateComponentColors() |
void updateComponentColors() |
1076 |
{ |
{ |
|
if (textComponent.isEditable()) |
|
|
textComponent.setBackground(background); |
|
|
else |
|
|
textComponent.setBackground(inactiveBackground); |
|
|
|
|
|
if (textComponent.isEnabled()) |
|
|
textComponent.setForeground(foreground); |
|
|
else |
|
|
textComponent.setForeground(inactiveForeground); |
|
1077 |
} |
} |
1078 |
} |
} |