2005-04-25 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicScrollBarUI.java (initDefaults): Initialize thumb*Color fields correctly. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/GapContent.java: Added API comments. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalBorders.java: Added inner class ScrollPaneBorder. * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added default for "ScrollPane.border" to use the new ScrollPaneBorder. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/AbstractDocument.java: Added FIXME comments. This class still has to be implemented thread-safe. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/tree/DefaultTreeSelectionModel.java (DefaultTreeSelectionModel): Initialize listenerList here. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalTextFieldUI.java (createUI): Return one instance per Component instead of a shared instance. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/Document.java: Added API documentation comments. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/AbstractDocument.java (getDocumentProperties): Implemented. (setDocumentProperties): Implemented. (getProperty): Implemented. (putProperty): Implemented. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/BoxLayout (preferredLayoutSize): Fixed computation so that it correctly adds the top and bottom insets of the container. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/basic/BasicMenuItemUI.java (paintText): Make use of the 'selectionForeground' UI default for text painting. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/basic/BasicLookAndFeel.java (initSystemColorDefaults): Modified colors to match the BasicLookAndFeel in the reference implementation. (initComponentDefaults): Likewise. From-SVN: r98733
This commit is contained in:
parent
9f62c3e3ed
commit
8efae6bbfa
13 changed files with 652 additions and 191 deletions
|
@ -1,3 +1,70 @@
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/plaf/basic/BasicScrollBarUI.java
|
||||||
|
(initDefaults): Initialize thumb*Color fields correctly.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/text/GapContent.java:
|
||||||
|
Added API comments.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/plaf/metal/MetalBorders.java:
|
||||||
|
Added inner class ScrollPaneBorder.
|
||||||
|
* javax/swing/plaf/metal/MetalLookAndFeel.java
|
||||||
|
(initComponentDefaults): Added default for "ScrollPane.border"
|
||||||
|
to use the new ScrollPaneBorder.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/text/AbstractDocument.java:
|
||||||
|
Added FIXME comments. This class still has to be
|
||||||
|
implemented thread-safe.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/tree/DefaultTreeSelectionModel.java
|
||||||
|
(DefaultTreeSelectionModel): Initialize listenerList here.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/plaf/metal/MetalTextFieldUI.java
|
||||||
|
(createUI): Return one instance per Component instead of a
|
||||||
|
shared instance.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/text/Document.java:
|
||||||
|
Added API documentation comments.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/text/AbstractDocument.java
|
||||||
|
(getDocumentProperties): Implemented.
|
||||||
|
(setDocumentProperties): Implemented.
|
||||||
|
(getProperty): Implemented.
|
||||||
|
(putProperty): Implemented.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/BoxLayout
|
||||||
|
(preferredLayoutSize): Fixed computation so that it correctly
|
||||||
|
adds the top and bottom insets of the container.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/plaf/basic/BasicMenuItemUI.java
|
||||||
|
(paintText): Make use of the 'selectionForeground' UI default
|
||||||
|
for text painting.
|
||||||
|
|
||||||
|
2005-04-25 Roman Kennke <roman@kennke.org>
|
||||||
|
|
||||||
|
* javax/swing/plaf/basic/BasicLookAndFeel.java
|
||||||
|
(initSystemColorDefaults): Modified colors to match the
|
||||||
|
BasicLookAndFeel in the reference implementation.
|
||||||
|
(initComponentDefaults): Likewise.
|
||||||
|
|
||||||
2005-04-25 Tom Tromey <tromey@redhat.com>
|
2005-04-25 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* include/jni.h (_Jv_va_list): Removed.
|
* include/jni.h (_Jv_va_list): Removed.
|
||||||
|
|
|
@ -148,13 +148,14 @@ public class BoxLayout implements LayoutManager2, Serializable
|
||||||
throw new AWTError("invalid parent");
|
throw new AWTError("invalid parent");
|
||||||
|
|
||||||
Insets insets = parent.getInsets();
|
Insets insets = parent.getInsets();
|
||||||
int x = insets.left + insets.right;
|
int x = 0;
|
||||||
int y = insets.bottom + insets.top;
|
int y = 0;
|
||||||
|
|
||||||
Component[] children = parent.getComponents();
|
Component[] children = parent.getComponents();
|
||||||
|
|
||||||
if (isHorizontalIn(parent))
|
if (isHorizontalIn(parent))
|
||||||
{
|
{
|
||||||
|
x = insets.left + insets.right;
|
||||||
// sum up preferred widths of components, find maximum of preferred
|
// sum up preferred widths of components, find maximum of preferred
|
||||||
// heights
|
// heights
|
||||||
for (int index = 0; index < children.length; index++)
|
for (int index = 0; index < children.length; index++)
|
||||||
|
@ -164,9 +165,11 @@ public class BoxLayout implements LayoutManager2, Serializable
|
||||||
x += sz.width;
|
x += sz.width;
|
||||||
y = Math.max(y, sz.height);
|
y = Math.max(y, sz.height);
|
||||||
}
|
}
|
||||||
|
y += insets.bottom + insets.top;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
y = insets.top + insets.bottom;
|
||||||
// sum up preferred heights of components, find maximum of
|
// sum up preferred heights of components, find maximum of
|
||||||
// preferred widths
|
// preferred widths
|
||||||
for (int index = 0; index < children.length; index++)
|
for (int index = 0; index < children.length; index++)
|
||||||
|
@ -176,6 +179,7 @@ public class BoxLayout implements LayoutManager2, Serializable
|
||||||
y += sz.height;
|
y += sz.height;
|
||||||
x = Math.max(x, sz.width);
|
x = Math.max(x, sz.width);
|
||||||
}
|
}
|
||||||
|
x += insets.left + insets.right;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Dimension(x, y);
|
return new Dimension(x, y);
|
||||||
|
|
|
@ -159,34 +159,39 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
*/
|
*/
|
||||||
protected void initSystemColorDefaults(UIDefaults defaults)
|
protected void initSystemColorDefaults(UIDefaults defaults)
|
||||||
{
|
{
|
||||||
|
Color highLight = new Color(249, 247, 246);
|
||||||
|
Color light = new Color(239, 235, 231);
|
||||||
|
Color shadow = new Color(139, 136, 134);
|
||||||
|
Color darkShadow = new Color(16, 16, 16);
|
||||||
|
|
||||||
Object[] uiDefaults;
|
Object[] uiDefaults;
|
||||||
uiDefaults = new Object[] {
|
uiDefaults = new Object[] {
|
||||||
"activeCaption", new ColorUIResource(0, 0, 128),
|
"activeCaption", new ColorUIResource(0, 0, 128),
|
||||||
"activeCaptionBorder", new ColorUIResource(Color.lightGray),
|
"activeCaptionBorder", new ColorUIResource(Color.lightGray),
|
||||||
"activeCaptionText", new ColorUIResource(Color.white),
|
"activeCaptionText", new ColorUIResource(Color.white),
|
||||||
"control", new ColorUIResource(Color.lightGray),
|
"control", new ColorUIResource(light),
|
||||||
"controlDkShadow", new ColorUIResource(Color.black),
|
"controlDkShadow", new ColorUIResource(shadow),
|
||||||
"controlHighlight", new ColorUIResource(Color.lightGray),
|
"controlHighlight", new ColorUIResource(highLight),
|
||||||
"controlLtHighlight", new ColorUIResource(Color.white),
|
"controlLtHighlight", new ColorUIResource(highLight),
|
||||||
"controlShadow", new ColorUIResource(Color.gray),
|
"controlShadow", new ColorUIResource(shadow),
|
||||||
"controlText", new ColorUIResource(Color.black),
|
"controlText", new ColorUIResource(darkShadow),
|
||||||
"desktop", new ColorUIResource(0, 92, 92),
|
"desktop", new ColorUIResource(0, 92, 92),
|
||||||
"inactiveCaption", new ColorUIResource(Color.gray),
|
"inactiveCaption", new ColorUIResource(Color.gray),
|
||||||
"inactiveCaptionBorder", new ColorUIResource(Color.lightGray),
|
"inactiveCaptionBorder", new ColorUIResource(Color.lightGray),
|
||||||
"inactiveCaptionText", new ColorUIResource(Color.lightGray),
|
"inactiveCaptionText", new ColorUIResource(Color.lightGray),
|
||||||
"info", new ColorUIResource(Color.white),
|
"info", new ColorUIResource(light),
|
||||||
"infoText", new ColorUIResource(Color.black),
|
"infoText", new ColorUIResource(darkShadow),
|
||||||
"menu", new ColorUIResource(Color.lightGray),
|
"menu", new ColorUIResource(light),
|
||||||
"menuText", new ColorUIResource(Color.black),
|
"menuText", new ColorUIResource(darkShadow),
|
||||||
"scrollbar", new ColorUIResource(224, 224, 224),
|
"scrollbar", new ColorUIResource(light),
|
||||||
"text", new ColorUIResource(Color.lightGray),
|
"text", new ColorUIResource(Color.white),
|
||||||
"textHighlight", new ColorUIResource(0, 0, 128),
|
"textHighlight", new ColorUIResource(Color.black),
|
||||||
"textHighlightText", new ColorUIResource(Color.white),
|
"textHighlightText", new ColorUIResource(Color.white),
|
||||||
"textInactiveText", new ColorUIResource(Color.gray),
|
"textInactiveText", new ColorUIResource(Color.gray),
|
||||||
"textText", new ColorUIResource(Color.black),
|
"textText", new ColorUIResource(Color.black),
|
||||||
"window", new ColorUIResource(Color.white),
|
"window", new ColorUIResource(light),
|
||||||
"windowBorder", new ColorUIResource(Color.black),
|
"windowBorder", new ColorUIResource(Color.black),
|
||||||
"windowText", new ColorUIResource(Color.black)
|
"windowText", new ColorUIResource(darkShadow)
|
||||||
};
|
};
|
||||||
defaults.putDefaults(uiDefaults);
|
defaults.putDefaults(uiDefaults);
|
||||||
}
|
}
|
||||||
|
@ -232,18 +237,16 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
{
|
{
|
||||||
Object[] uiDefaults;
|
Object[] uiDefaults;
|
||||||
|
|
||||||
// The default Look and Feel happens to use these three purple shades
|
Color highLight = new Color(249, 247, 246);
|
||||||
// extensively.
|
Color light = new Color(239, 235, 231);
|
||||||
Color lightPurple = new Color(0xCC, 0xCC, 0xFF);
|
Color shadow = new Color(139, 136, 134);
|
||||||
Color midPurple = new Color(0x99, 0x99, 0xCC);
|
Color darkShadow = new Color(16, 16, 16);
|
||||||
Color darkPurple = new Color(0x66, 0x66, 0x99);
|
|
||||||
|
|
||||||
uiDefaults = new Object[] {
|
uiDefaults = new Object[] {
|
||||||
|
|
||||||
"AbstractUndoableEdit.undoText", "Undo",
|
"AbstractUndoableEdit.undoText", "Undo",
|
||||||
"AbstractUndoableEdit.redoText", "Redo",
|
"AbstractUndoableEdit.redoText", "Redo",
|
||||||
|
"Button.background", new ColorUIResource(light),
|
||||||
"Button.background", new ColorUIResource(Color.lightGray),
|
|
||||||
"Button.border",
|
"Button.border",
|
||||||
new UIDefaults.LazyValue()
|
new UIDefaults.LazyValue()
|
||||||
{
|
{
|
||||||
|
@ -252,55 +255,52 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
return BasicBorders.getButtonBorder();
|
return BasicBorders.getButtonBorder();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Button.darkShadow", new ColorUIResource(Color.darkGray),
|
"Button.darkShadow", new ColorUIResource(shadow),
|
||||||
"Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"SPACE", "pressed",
|
"SPACE", "pressed",
|
||||||
"released SPACE", "released"
|
"released SPACE", "released"
|
||||||
}),
|
}),
|
||||||
"Button.focus", midPurple,
|
|
||||||
"Button.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Button.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Button.foreground", new ColorUIResource(Color.black),
|
"Button.foreground", new ColorUIResource(darkShadow),
|
||||||
"Button.highlight", new ColorUIResource(Color.white),
|
"Button.highlight", new ColorUIResource(highLight),
|
||||||
"Button.light", new ColorUIResource(Color.lightGray.brighter()),
|
"Button.light", new ColorUIResource(highLight),
|
||||||
"Button.margin", new InsetsUIResource(2, 2, 2, 2),
|
"Button.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"Button.shadow", new ColorUIResource(Color.gray),
|
"Button.shadow", new ColorUIResource(shadow),
|
||||||
"Button.textIconGap", new Integer(4),
|
"Button.textIconGap", new Integer(4),
|
||||||
"Button.textShiftOffset", new Integer(0),
|
"Button.textShiftOffset", new Integer(0),
|
||||||
"CheckBox.background", new ColorUIResource(Color.lightGray),
|
"CheckBox.background", new ColorUIResource(light),
|
||||||
"CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null,
|
"CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null,
|
||||||
null),
|
null),
|
||||||
"CheckBox.darkShadow", new ColorUIResource(Color.darkGray),
|
|
||||||
"CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"SPACE", "pressed",
|
"SPACE", "pressed",
|
||||||
"released SPACE", "released"
|
"released SPACE", "released"
|
||||||
}),
|
}),
|
||||||
"CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"CheckBox.foreground", new ColorUIResource(Color.black),
|
"CheckBox.foreground", new ColorUIResource(darkShadow),
|
||||||
"CheckBox.highlight", new ColorUIResource(Color.white),
|
|
||||||
"CheckBox.icon", BasicIconFactory.getCheckBoxIcon(),
|
"CheckBox.icon", BasicIconFactory.getCheckBoxIcon(),
|
||||||
"CheckBox.light", new ColorUIResource(Color.lightGray.brighter()),
|
|
||||||
"CheckBox.margin",new InsetsUIResource(2, 2, 2, 2),
|
"CheckBox.margin",new InsetsUIResource(2, 2, 2, 2),
|
||||||
"CheckBox.shadow", new ColorUIResource(Color.gray),
|
|
||||||
"CheckBox.textIconGap", new Integer(4),
|
"CheckBox.textIconGap", new Integer(4),
|
||||||
"CheckBox.textShiftOffset", new Integer(0),
|
"CheckBox.textShiftOffset", new Integer(0),
|
||||||
"CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog",
|
"CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog",
|
||||||
Font.PLAIN, 12),
|
Font.PLAIN, 12),
|
||||||
"CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(Color.black),
|
"CheckBoxMenuItem.acceleratorForeground",
|
||||||
"CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white),
|
new ColorUIResource(darkShadow),
|
||||||
|
"CheckBoxMenuItem.acceleratorSelectionForeground",
|
||||||
|
new ColorUIResource(Color.white),
|
||||||
"CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
"CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
||||||
"CheckBoxMenuItem.background", new ColorUIResource(Color.lightGray),
|
"CheckBoxMenuItem.background", new ColorUIResource(light),
|
||||||
"CheckBoxMenuItem.border", new BasicBorders.MarginBorder(),
|
"CheckBoxMenuItem.border", new BasicBorders.MarginBorder(),
|
||||||
"CheckBoxMenuItem.borderPainted", Boolean.FALSE,
|
"CheckBoxMenuItem.borderPainted", Boolean.FALSE,
|
||||||
"CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(),
|
"CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(),
|
||||||
"CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"CheckBoxMenuItem.foreground", new ColorUIResource(Color.black),
|
"CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow),
|
||||||
"CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
"CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"CheckBoxMenuItem.selectionBackground", new ColorUIResource(lightPurple),
|
"CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.black),
|
"CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"ColorChooser.background", new ColorUIResource(Color.lightGray),
|
"ColorChooser.background", new ColorUIResource(light),
|
||||||
"ColorChooser.cancelText", "Cancel",
|
"ColorChooser.cancelText", "Cancel",
|
||||||
"ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"ColorChooser.foreground", new ColorUIResource(Color.black),
|
"ColorChooser.foreground", new ColorUIResource(darkShadow),
|
||||||
"ColorChooser.hsbBlueText", "B",
|
"ColorChooser.hsbBlueText", "B",
|
||||||
"ColorChooser.hsbBrightnessText", "B",
|
"ColorChooser.hsbBrightnessText", "B",
|
||||||
"ColorChooser.hsbGreenText", "G",
|
"ColorChooser.hsbGreenText", "G",
|
||||||
|
@ -319,7 +319,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"ColorChooser.rgbRedMnemonic", new Integer(82),
|
"ColorChooser.rgbRedMnemonic", new Integer(82),
|
||||||
"ColorChooser.rgbRedText", "Red",
|
"ColorChooser.rgbRedText", "Red",
|
||||||
"ColorChooser.sampleText", "Sample Text Sample Text",
|
"ColorChooser.sampleText", "Sample Text Sample Text",
|
||||||
"ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(Color.lightGray),
|
"ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light),
|
||||||
"ColorChooser.swatchesNameText", "Swatches",
|
"ColorChooser.swatchesNameText", "Swatches",
|
||||||
"ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10),
|
"ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10),
|
||||||
"ColorChooser.swatchesRecentText", "Recent:",
|
"ColorChooser.swatchesRecentText", "Recent:",
|
||||||
|
@ -331,13 +331,17 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"HOME", "homePassThrough",
|
"HOME", "homePassThrough",
|
||||||
"END", "endPassThrough"
|
"END", "endPassThrough"
|
||||||
}),
|
}),
|
||||||
"ComboBox.background", new ColorUIResource(Color.white),
|
"ComboBox.background", new ColorUIResource(light),
|
||||||
"ComboBox.disabledBackground", new ColorUIResource(Color.lightGray),
|
"ComboBox.buttonBackground", new ColorUIResource(light),
|
||||||
|
"ComboBox.buttonDarkShadow", new ColorUIResource(shadow),
|
||||||
|
"ComboBox.buttonHighlight", new ColorUIResource(highLight),
|
||||||
|
"ComboBox.buttonShadow", new ColorUIResource(shadow),
|
||||||
|
"ComboBox.disabledBackground", new ColorUIResource(light),
|
||||||
"ComboBox.disabledForeground", new ColorUIResource(Color.gray),
|
"ComboBox.disabledForeground", new ColorUIResource(Color.gray),
|
||||||
"ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
"ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
||||||
"ComboBox.foreground", new ColorUIResource(Color.black),
|
"ComboBox.foreground", new ColorUIResource(Color.black),
|
||||||
"ComboBox.selectionBackground", new ColorUIResource(lightPurple),
|
"ComboBox.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"ComboBox.selectionForeground", new ColorUIResource(Color.black),
|
"ComboBox.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"KP_LEFT", "left",
|
"KP_LEFT", "left",
|
||||||
"KP_RIGHT", "right",
|
"KP_RIGHT", "right",
|
||||||
|
@ -359,13 +363,13 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"ctrl F10", "maximize",
|
"ctrl F10", "maximize",
|
||||||
"ctrl alt shift F6","selectPreviousFrame"
|
"ctrl alt shift F6","selectPreviousFrame"
|
||||||
}),
|
}),
|
||||||
"Desktop.background", new ColorUIResource(175, 163, 236),
|
"Desktop.background", new ColorUIResource(0, 92, 92),
|
||||||
"DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null,
|
"DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null,
|
||||||
null),
|
null),
|
||||||
"EditorPane.background", new ColorUIResource(Color.white),
|
"EditorPane.background", new ColorUIResource(Color.white),
|
||||||
"EditorPane.border", new BasicBorders.MarginBorder(),
|
"EditorPane.border", new BasicBorders.MarginBorder(),
|
||||||
"EditorPane.caretBlinkRate", new Integer(500),
|
"EditorPane.caretBlinkRate", new Integer(500),
|
||||||
"EditorPane.caretForeground", new ColorUIResource(Color.red),
|
"EditorPane.caretForeground", new ColorUIResource(Color.black),
|
||||||
"EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12),
|
"EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12),
|
||||||
"EditorPane.foreground", new ColorUIResource(Color.black),
|
"EditorPane.foreground", new ColorUIResource(Color.black),
|
||||||
"EditorPane.inactiveForeground", new ColorUIResource(Color.gray),
|
"EditorPane.inactiveForeground", new ColorUIResource(Color.gray),
|
||||||
|
@ -384,7 +388,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
0), "insert-tab")
|
0), "insert-tab")
|
||||||
},
|
},
|
||||||
"EditorPane.margin", new InsetsUIResource(3, 3, 3, 3),
|
"EditorPane.margin", new InsetsUIResource(3, 3, 3, 3),
|
||||||
"EditorPane.selectionBackground", new ColorUIResource(Color.lightGray),
|
"EditorPane.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"EditorPane.selectionForeground", new ColorUIResource(Color.white),
|
"EditorPane.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"FileChooser.acceptAllFileFilterText", "All Files (*.*)",
|
"FileChooser.acceptAllFileFilterText", "All Files (*.*)",
|
||||||
"FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
|
@ -430,18 +434,33 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")),
|
"FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")),
|
||||||
"FocusManagerClassName", "TODO",
|
"FocusManagerClassName", "TODO",
|
||||||
|
"FormattedTextField.background", new ColorUIResource(light),
|
||||||
|
"FormattedTextField.caretForeground", new ColorUIResource(Color.black),
|
||||||
|
"FormattedTextField.foreground", new ColorUIResource(Color.black),
|
||||||
|
"FormattedTextField.inactiveBackground", new ColorUIResource(light),
|
||||||
|
"FormattedTextField.inactiveForeground", new ColorUIResource(Color.gray),
|
||||||
|
"FormattedTextField.selectionBackground",
|
||||||
|
new ColorUIResource(Color.black),
|
||||||
|
"FormattedTextField.selectionForeground",
|
||||||
|
new ColorUIResource(Color.white),
|
||||||
"FormView.resetButtonText", "Reset",
|
"FormView.resetButtonText", "Reset",
|
||||||
"FormView.submitButtonText", "Submit Query",
|
"FormView.submitButtonText", "Submit Query",
|
||||||
"InternalFrame.activeTitleBackground", new ColorUIResource(162, 167, 241),
|
"InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128),
|
||||||
"InternalFrame.activeTitleForeground", new ColorUIResource(Color.black),
|
"InternalFrame.activeTitleForeground", new ColorUIResource(Color.white),
|
||||||
"InternalFrame.border", new BorderUIResource.CompoundBorderUIResource(null,
|
"InternalFrame.border",
|
||||||
null),
|
new BorderUIResource.CompoundBorderUIResource(null, null),
|
||||||
|
"InternalFrame.borderColor", new ColorUIResource(light),
|
||||||
|
"InternalFrame.borderDarkShadow", new ColorUIResource(shadow),
|
||||||
|
"InternalFrame.borderHighlight", new ColorUIResource(highLight),
|
||||||
|
"InternalFrame.borderLight", new ColorUIResource(light),
|
||||||
|
"InternalFrame.borderShadow", new ColorUIResource(shadow),
|
||||||
"InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
"InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")),
|
"InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")),
|
||||||
"InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(),
|
"InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(),
|
||||||
"InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.lightGray),
|
"InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray),
|
||||||
"InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.black),
|
"InternalFrame.inactiveTitleForeground",
|
||||||
|
new ColorUIResource(Color.lightGray),
|
||||||
"InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
"InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
||||||
"InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
"InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(),
|
||||||
"InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
|
@ -450,12 +469,12 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"ctrl SPACE", "showSystemMenu",
|
"ctrl SPACE", "showSystemMenu",
|
||||||
"ESCAPE", "showSystemMenu"
|
"ESCAPE", "showSystemMenu"
|
||||||
},
|
},
|
||||||
"Label.background", new ColorUIResource(Color.lightGray),
|
"Label.background", new ColorUIResource(light),
|
||||||
"Label.disabledForeground", new ColorUIResource(Color.white),
|
"Label.disabledForeground", new ColorUIResource(Color.white),
|
||||||
"Label.disabledShadow", new ColorUIResource(Color.gray),
|
"Label.disabledShadow", new ColorUIResource(shadow),
|
||||||
"Label.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Label.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Label.foreground", new ColorUIResource(Color.black),
|
"Label.foreground", new ColorUIResource(darkShadow),
|
||||||
"List.background", new ColorUIResource(Color.white),
|
"List.background", new ColorUIResource(light),
|
||||||
"List.border", new BasicBorders.MarginBorder(),
|
"List.border", new BasicBorders.MarginBorder(),
|
||||||
"List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"PAGE_UP", "scrollUp",
|
"PAGE_UP", "scrollUp",
|
||||||
|
@ -477,20 +496,20 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"shift PAGE_UP","scrollUpExtendSelection",
|
"shift PAGE_UP","scrollUpExtendSelection",
|
||||||
"KP_DOWN", "selectNextRow"
|
"KP_DOWN", "selectNextRow"
|
||||||
}),
|
}),
|
||||||
"List.foreground", new ColorUIResource(Color.black),
|
"List.foreground", new ColorUIResource(darkShadow),
|
||||||
"List.selectionBackground", new ColorUIResource(0xCC, 0xCC, 0xFF),
|
"List.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"List.selectionForeground", new ColorUIResource(Color.black),
|
"List.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Menu.acceleratorForeground", new ColorUIResource(Color.black),
|
"Menu.acceleratorForeground", new ColorUIResource(darkShadow),
|
||||||
"Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white),
|
"Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white),
|
||||||
"Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(),
|
"Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(),
|
||||||
"Menu.background", new ColorUIResource(Color.lightGray),
|
"Menu.background", new ColorUIResource(light),
|
||||||
"Menu.border", new BasicBorders.MarginBorder(),
|
"Menu.border", new BasicBorders.MarginBorder(),
|
||||||
"Menu.borderPainted", Boolean.FALSE,
|
"Menu.borderPainted", Boolean.FALSE,
|
||||||
"Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
|
"Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
|
||||||
"Menu.consumesTabs", Boolean.TRUE,
|
"Menu.consumesTabs", Boolean.TRUE,
|
||||||
"Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Menu.foreground", new ColorUIResource(Color.black),
|
"Menu.foreground", new ColorUIResource(darkShadow),
|
||||||
"Menu.margin", new InsetsUIResource(2, 2, 2, 2),
|
"Menu.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"Menu.selectedWindowInputMapBindings", new Object[] {
|
"Menu.selectedWindowInputMapBindings", new Object[] {
|
||||||
"ESCAPE", "cancel",
|
"ESCAPE", "cancel",
|
||||||
|
@ -505,115 +524,130 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"ENTER", "return",
|
"ENTER", "return",
|
||||||
"SPACE", "return"
|
"SPACE", "return"
|
||||||
},
|
},
|
||||||
"Menu.selectionBackground", new ColorUIResource(lightPurple),
|
"Menu.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"Menu.selectionForeground", new ColorUIResource(Color.black),
|
"Menu.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"MenuBar.background", new ColorUIResource(Color.lightGray),
|
"MenuBar.background", new ColorUIResource(light),
|
||||||
"MenuBar.border", new BasicBorders.MenuBarBorder(null, null),
|
"MenuBar.border", new BasicBorders.MenuBarBorder(null, null),
|
||||||
"MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"MenuBar.foreground", new ColorUIResource(Color.black),
|
"MenuBar.foreground", new ColorUIResource(darkShadow),
|
||||||
|
"MenuBar.highlight", new ColorUIResource(highLight),
|
||||||
|
"MenuBar.shadow", new ColorUIResource(shadow),
|
||||||
"MenuBar.windowBindings", new Object[] {
|
"MenuBar.windowBindings", new Object[] {
|
||||||
"F10", "takeFocus"
|
"F10", "takeFocus"
|
||||||
},
|
},
|
||||||
"MenuItem.acceleratorDelimiter", "-",
|
"MenuItem.acceleratorDelimiter", "-",
|
||||||
"MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"MenuItem.acceleratorForeground", new ColorUIResource(Color.black),
|
"MenuItem.acceleratorForeground", new ColorUIResource(darkShadow),
|
||||||
"MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white),
|
"MenuItem.acceleratorSelectionForeground",
|
||||||
|
new ColorUIResource(Color.white),
|
||||||
"MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
"MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
||||||
"MenuItem.background", new ColorUIResource(Color.lightGray),
|
"MenuItem.background", new ColorUIResource(light),
|
||||||
"MenuItem.border", new BasicBorders.MarginBorder(),
|
"MenuItem.border", new BasicBorders.MarginBorder(),
|
||||||
"MenuItem.borderPainted", Boolean.FALSE,
|
"MenuItem.borderPainted", Boolean.FALSE,
|
||||||
"MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
|
"MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(),
|
||||||
"MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"MenuItem.foreground", new ColorUIResource(Color.black),
|
"MenuItem.foreground", new ColorUIResource(darkShadow),
|
||||||
"MenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
"MenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"MenuItem.selectionBackground", new ColorUIResource(lightPurple),
|
"MenuItem.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"MenuItem.selectionForeground", new ColorUIResource(Color.black),
|
"MenuItem.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"OptionPane.background", new ColorUIResource(Color.lightGray),
|
"OptionPane.background", new ColorUIResource(light),
|
||||||
"OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
"OptionPane.border",
|
||||||
"OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
||||||
|
"OptionPane.buttonAreaBorder",
|
||||||
|
new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
||||||
"OptionPane.cancelButtonText", "Cancel",
|
"OptionPane.cancelButtonText", "Cancel",
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"OptionPane.errorIcon", new IconUIResource(new ImageIcon("icons/Error.gif")),
|
"OptionPane.errorIcon",
|
||||||
|
new IconUIResource(new ImageIcon("icons/Error.gif")),
|
||||||
"OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"OptionPane.foreground", new ColorUIResource(Color.black),
|
"OptionPane.foreground", new ColorUIResource(darkShadow),
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"OptionPane.informationIcon", new IconUIResource(new ImageIcon("icons/Inform.gif")),
|
"OptionPane.informationIcon",
|
||||||
"OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
new IconUIResource(new ImageIcon("icons/Inform.gif")),
|
||||||
"OptionPane.messageForeground", new ColorUIResource(Color.black),
|
"OptionPane.messageAreaBorder",
|
||||||
|
new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0),
|
||||||
|
"OptionPane.messageForeground", new ColorUIResource(darkShadow),
|
||||||
"OptionPane.minimumSize", new DimensionUIResource(262, 90),
|
"OptionPane.minimumSize", new DimensionUIResource(262, 90),
|
||||||
"OptionPane.noButtonText", "No",
|
"OptionPane.noButtonText", "No",
|
||||||
"OptionPane.okButtonText", "OK",
|
"OptionPane.okButtonText", "OK",
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"OptionPane.questionIcon", new IconUIResource(new ImageIcon("icons/Question.gif")),
|
"OptionPane.questionIcon",
|
||||||
|
new IconUIResource(new ImageIcon("icons/Question.gif")),
|
||||||
// XXX Don't use gif
|
// XXX Don't use gif
|
||||||
"OptionPane.warningIcon", new IconUIResource(new ImageIcon("icons/Warn.gif")),
|
"OptionPane.warningIcon",
|
||||||
|
new IconUIResource(new ImageIcon("icons/Warn.gif")),
|
||||||
"OptionPane.windowBindings", new Object[] {
|
"OptionPane.windowBindings", new Object[] {
|
||||||
"ESCAPE", "close"
|
"ESCAPE", "close"
|
||||||
},
|
},
|
||||||
"OptionPane.yesButtonText", "Yes",
|
"OptionPane.yesButtonText", "Yes",
|
||||||
"Panel.background", new ColorUIResource(Color.lightGray),
|
"Panel.background", new ColorUIResource(light),
|
||||||
"Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Panel.foreground", new ColorUIResource(Color.black),
|
"Panel.foreground", new ColorUIResource(Color.black),
|
||||||
"PasswordField.background", new ColorUIResource(Color.white),
|
"PasswordField.background", new ColorUIResource(light),
|
||||||
"PasswordField.border", new BasicBorders.FieldBorder(null, null,
|
"PasswordField.border", new BasicBorders.FieldBorder(null, null,
|
||||||
null, null),
|
null, null),
|
||||||
"PasswordField.caretBlinkRate", new Integer(500),
|
"PasswordField.caretBlinkRate", new Integer(500),
|
||||||
"PasswordField.caretForeground", new ColorUIResource(Color.black),
|
"PasswordField.caretForeground", new ColorUIResource(Color.black),
|
||||||
"PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12),
|
"PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12),
|
||||||
"PasswordField.foreground", new ColorUIResource(Color.black),
|
"PasswordField.foreground", new ColorUIResource(Color.black),
|
||||||
|
"PasswordField.inactiveBackground", new ColorUIResource(light),
|
||||||
"PasswordField.inactiveForeground", new ColorUIResource(Color.gray),
|
"PasswordField.inactiveForeground", new ColorUIResource(Color.gray),
|
||||||
"PasswordField.keyBindings", new JTextComponent.KeyBinding[] {
|
"PasswordField.keyBindings", new JTextComponent.KeyBinding[] {
|
||||||
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
|
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
|
||||||
0),
|
0),
|
||||||
"notify-field-accept")},
|
"notify-field-accept")},
|
||||||
"PasswordField.margin", new InsetsUIResource(0, 0, 0, 0),
|
"PasswordField.margin", new InsetsUIResource(0, 0, 0, 0),
|
||||||
"PasswordField.selectionBackground", new ColorUIResource(lightPurple),
|
"PasswordField.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"PasswordField.selectionForeground", new ColorUIResource(Color.black),
|
"PasswordField.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"PopupMenu.background", new ColorUIResource(Color.lightGray),
|
"PopupMenu.background", new ColorUIResource(light),
|
||||||
"PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0),
|
"PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0),
|
||||||
"PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"PopupMenu.foreground", new ColorUIResource(Color.black),
|
"PopupMenu.foreground", new ColorUIResource(darkShadow),
|
||||||
"ProgressBar.background", new ColorUIResource(Color.lightGray),
|
"ProgressBar.background", new ColorUIResource(light),
|
||||||
"ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray),
|
"ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray),
|
||||||
"ProgressBar.cellLength", new Integer(1),
|
"ProgressBar.cellLength", new Integer(1),
|
||||||
"ProgressBar.cellSpacing", new Integer(0),
|
"ProgressBar.cellSpacing", new Integer(0),
|
||||||
"ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"ProgressBar.foreground", new ColorUIResource(midPurple),
|
"ProgressBar.foreground", new ColorUIResource(Color.black),
|
||||||
"ProgressBar.selectionBackground", new ColorUIResource(lightPurple),
|
"ProgressBar.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"ProgressBar.selectionForeground", new ColorUIResource(Color.lightGray),
|
"ProgressBar.selectionForeground", new ColorUIResource(light),
|
||||||
"ProgressBar.repaintInterval", new Integer(250),
|
"ProgressBar.repaintInterval", new Integer(250),
|
||||||
"ProgressBar.cycleTime", new Integer(6000),
|
"ProgressBar.cycleTime", new Integer(6000),
|
||||||
"RadioButton.background", new ColorUIResource(Color.lightGray),
|
"RadioButton.background", new ColorUIResource(light),
|
||||||
"RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null,
|
"RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null,
|
||||||
null),
|
null),
|
||||||
"RadioButton.darkShadow", new ColorUIResource(Color.darkGray),
|
"RadioButton.darkShadow", new ColorUIResource(shadow),
|
||||||
"RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"SPACE", "pressed",
|
"SPACE", "pressed",
|
||||||
"released SPACE", "released"
|
"released SPACE", "released"
|
||||||
}),
|
}),
|
||||||
"RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"RadioButton.foreground", new ColorUIResource(Color.black),
|
"RadioButton.foreground", new ColorUIResource(darkShadow),
|
||||||
"RadioButton.highlight", new ColorUIResource(Color.white),
|
"RadioButton.highlight", new ColorUIResource(highLight),
|
||||||
"RadioButton.icon", BasicIconFactory.getRadioButtonIcon(),
|
"RadioButton.icon", BasicIconFactory.getRadioButtonIcon(),
|
||||||
"RadioButton.light", new ColorUIResource(Color.lightGray.brighter()),
|
"RadioButton.light", new ColorUIResource(highLight),
|
||||||
"RadioButton.margin", new InsetsUIResource(2, 2, 2, 2),
|
"RadioButton.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"RadioButton.shadow", new ColorUIResource(Color.gray),
|
"RadioButton.shadow", new ColorUIResource(shadow),
|
||||||
"RadioButton.textIconGap", new Integer(4),
|
"RadioButton.textIconGap", new Integer(4),
|
||||||
"RadioButton.textShiftOffset", new Integer(0),
|
"RadioButton.textShiftOffset", new Integer(0),
|
||||||
"RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog",
|
"RadioButtonMenuItem.acceleratorFont",
|
||||||
Font.PLAIN, 12),
|
new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(Color.black),
|
"RadioButtonMenuItem.acceleratorForeground",
|
||||||
"RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white),
|
new ColorUIResource(darkShadow),
|
||||||
|
"RadioButtonMenuItem.acceleratorSelectionForeground",
|
||||||
|
new ColorUIResource(Color.white),
|
||||||
"RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
"RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(),
|
||||||
"RadioButtonMenuItem.background", new ColorUIResource(Color.lightGray),
|
"RadioButtonMenuItem.background", new ColorUIResource(light),
|
||||||
"RadioButtonMenuItem.border", new BasicBorders.MarginBorder(),
|
"RadioButtonMenuItem.border", new BasicBorders.MarginBorder(),
|
||||||
"RadioButtonMenuItem.borderPainted", Boolean.FALSE,
|
"RadioButtonMenuItem.borderPainted", Boolean.FALSE,
|
||||||
"RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(),
|
"RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(),
|
||||||
"RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"RadioButtonMenuItem.foreground", new ColorUIResource(Color.black),
|
"RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow),
|
||||||
"RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
"RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"RadioButtonMenuItem.selectionBackground", new ColorUIResource(lightPurple),
|
"RadioButtonMenuItem.selectionBackground",
|
||||||
"RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.black),
|
new ColorUIResource(Color.black),
|
||||||
|
"RadioButtonMenuItem.selectionForeground",
|
||||||
|
new ColorUIResource(Color.white),
|
||||||
"RootPane.defaultButtonWindowKeyBindings", new Object[] {
|
"RootPane.defaultButtonWindowKeyBindings", new Object[] {
|
||||||
"ENTER", "press",
|
"ENTER", "press",
|
||||||
"released ENTER", "release",
|
"released ENTER", "release",
|
||||||
|
@ -635,15 +669,15 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"DOWN", "positiveUnitIncrement",
|
"DOWN", "positiveUnitIncrement",
|
||||||
"KP_RIGHT", "negativeUnitIncrement"
|
"KP_RIGHT", "negativeUnitIncrement"
|
||||||
}),
|
}),
|
||||||
"ScrollBar.foreground", new ColorUIResource(Color.lightGray),
|
"ScrollBar.foreground", new ColorUIResource(light),
|
||||||
"ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096),
|
"ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096),
|
||||||
"ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8),
|
"ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8),
|
||||||
"ScrollBar.thumb", new ColorUIResource(Color.lightGray),
|
"ScrollBar.thumb", new ColorUIResource(light),
|
||||||
"ScrollBar.thumbDarkShadow", new ColorUIResource(Color.black),
|
"ScrollBar.thumbDarkShadow", new ColorUIResource(shadow),
|
||||||
"ScrollBar.thumbHighlight", new ColorUIResource(Color.white),
|
"ScrollBar.thumbHighlight", new ColorUIResource(highLight),
|
||||||
"ScrollBar.thumbLightShadow", new ColorUIResource(Color.gray),
|
"ScrollBar.thumbShadow", new ColorUIResource(shadow),
|
||||||
"ScrollBar.track", new ColorUIResource(224, 224, 224),
|
"ScrollBar.track", new ColorUIResource(light),
|
||||||
"ScrollBar.trackHighlight", new ColorUIResource(Color.black),
|
"ScrollBar.trackHighlight", new ColorUIResource(shadow),
|
||||||
"ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"PAGE_UP", "scrollUp",
|
"PAGE_UP", "scrollUp",
|
||||||
"KP_LEFT", "unitScrollLeft",
|
"KP_LEFT", "unitScrollLeft",
|
||||||
|
@ -660,16 +694,16 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"KP_UP", "unitScrollUp",
|
"KP_UP", "unitScrollUp",
|
||||||
"KP_DOWN", "unitScrollDown"
|
"KP_DOWN", "unitScrollDown"
|
||||||
}),
|
}),
|
||||||
"ScrollPane.background", new ColorUIResource(Color.lightGray),
|
"ScrollPane.background", new ColorUIResource(light),
|
||||||
"ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(),
|
"ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(),
|
||||||
"ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"ScrollPane.foreground", new ColorUIResource(Color.black),
|
"ScrollPane.foreground", new ColorUIResource(darkShadow),
|
||||||
"Separator.background", new ColorUIResource(Color.white),
|
"Separator.background", new ColorUIResource(highLight),
|
||||||
"Separator.foreground", new ColorUIResource(Color.gray),
|
"Separator.foreground", new ColorUIResource(shadow),
|
||||||
"Separator.highlight", new ColorUIResource(Color.white),
|
"Separator.highlight", new ColorUIResource(highLight),
|
||||||
"Separator.shadow", new ColorUIResource(Color.gray),
|
"Separator.shadow", new ColorUIResource(shadow),
|
||||||
"Slider.background", new ColorUIResource(Color.lightGray),
|
"Slider.background", new ColorUIResource(light),
|
||||||
"Slider.focus", new ColorUIResource(Color.black),
|
"Slider.focus", new ColorUIResource(shadow),
|
||||||
"Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"PAGE_UP", "positiveBlockIncrement",
|
"PAGE_UP", "positiveBlockIncrement",
|
||||||
"PAGE_DOWN", "negativeBlockIncrement",
|
"PAGE_DOWN", "negativeBlockIncrement",
|
||||||
|
@ -685,12 +719,14 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"KP_RIGHT", "positiveUnitIncrement"
|
"KP_RIGHT", "positiveUnitIncrement"
|
||||||
}),
|
}),
|
||||||
"Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
|
"Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
|
||||||
"Slider.foreground", new ColorUIResource(Color.lightGray),
|
"Slider.foreground", new ColorUIResource(light),
|
||||||
"Slider.highlight", new ColorUIResource(Color.white),
|
"Slider.highlight", new ColorUIResource(highLight),
|
||||||
"Slider.shadow", new ColorUIResource(Color.gray),
|
"Slider.shadow", new ColorUIResource(shadow),
|
||||||
"Slider.thumbHeight", new Integer(20),
|
"Slider.thumbHeight", new Integer(20),
|
||||||
"Slider.thumbWidth", new Integer(10),
|
"Slider.thumbWidth", new Integer(10),
|
||||||
"Slider.tickHeight", new Integer(12),
|
"Slider.tickHeight", new Integer(12),
|
||||||
|
"Spinner.background", new ColorUIResource(light),
|
||||||
|
"Spinner.foreground", new ColorUIResource(light),
|
||||||
"SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"F6", "toggleFocus",
|
"F6", "toggleFocus",
|
||||||
"F8", "startResize",
|
"F8", "startResize",
|
||||||
|
@ -705,21 +741,22 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"DOWN", "positiveIncrement",
|
"DOWN", "positiveIncrement",
|
||||||
"KP_RIGHT", "positiveIncrement"
|
"KP_RIGHT", "positiveIncrement"
|
||||||
}),
|
}),
|
||||||
"SplitPane.background", new ColorUIResource(Color.lightGray),
|
"SplitPane.background", new ColorUIResource(light),
|
||||||
"SplitPane.border", new BasicBorders.SplitPaneBorder(null, null),
|
"SplitPane.border", new BasicBorders.SplitPaneBorder(null, null),
|
||||||
|
"SplitPane.darkShadow", new ColorUIResource(shadow),
|
||||||
"SplitPane.dividerSize", new Integer(10),
|
"SplitPane.dividerSize", new Integer(10),
|
||||||
"SplitPane.highlight", new ColorUIResource(Color.white),
|
"SplitPane.highlight", new ColorUIResource(highLight),
|
||||||
"SplitPane.shadow", new ColorUIResource(Color.gray),
|
"SplitPane.shadow", new ColorUIResource(shadow),
|
||||||
"TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"ctrl PAGE_DOWN","navigatePageDown",
|
"ctrl PAGE_DOWN","navigatePageDown",
|
||||||
"ctrl PAGE_UP", "navigatePageUp",
|
"ctrl PAGE_UP", "navigatePageUp",
|
||||||
"ctrl UP", "requestFocus",
|
"ctrl UP", "requestFocus",
|
||||||
"ctrl KP_UP", "requestFocus"
|
"ctrl KP_UP", "requestFocus"
|
||||||
}),
|
}),
|
||||||
"TabbedPane.background", new ColorUIResource(Color.LIGHT_GRAY),
|
"TabbedPane.background", new ColorUIResource(light),
|
||||||
"TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3),
|
"TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3),
|
||||||
"TabbedPane.darkShadow", new ColorUIResource(Color.darkGray),
|
"TabbedPane.darkShadow", new ColorUIResource(shadow),
|
||||||
"TabbedPane.focus", new ColorUIResource(Color.black),
|
"TabbedPane.focus", new ColorUIResource(darkShadow),
|
||||||
"TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"LEFT", "navigateLeft",
|
"LEFT", "navigateLeft",
|
||||||
"KP_UP", "navigateUp",
|
"KP_UP", "navigateUp",
|
||||||
|
@ -733,11 +770,11 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"DOWN", "navigateDown"
|
"DOWN", "navigateDown"
|
||||||
}),
|
}),
|
||||||
"TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"TabbedPane.foreground", new ColorUIResource(Color.black),
|
"TabbedPane.foreground", new ColorUIResource(darkShadow),
|
||||||
"TabbedPane.highlight", new ColorUIResource(Color.lightGray),
|
"TabbedPane.highlight", new ColorUIResource(highLight),
|
||||||
"TabbedPane.lightHighlight", new ColorUIResource(Color.white),
|
"TabbedPane.light", new ColorUIResource(highLight),
|
||||||
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
|
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
|
||||||
"TabbedPane.shadow", new ColorUIResource(Color.gray),
|
"TabbedPane.shadow", new ColorUIResource(shadow),
|
||||||
"TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2),
|
"TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2),
|
||||||
"TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4),
|
"TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4),
|
||||||
"TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2),
|
"TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2),
|
||||||
|
@ -784,21 +821,22 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"ctrl PAGE_DOWN", "scrollRightChangeSelection",
|
"ctrl PAGE_DOWN", "scrollRightChangeSelection",
|
||||||
"PAGE_UP", "scrollUpChangeSelection"
|
"PAGE_UP", "scrollUpChangeSelection"
|
||||||
}),
|
}),
|
||||||
"Table.background", new ColorUIResource(Color.white),
|
"Table.background", new ColorUIResource(light),
|
||||||
"Table.focusCellBackground", new ColorUIResource(Color.white),
|
"Table.focusCellBackground", new ColorUIResource(light),
|
||||||
"Table.focusCellForeground", new ColorUIResource(Color.black),
|
"Table.focusCellForeground", new ColorUIResource(darkShadow),
|
||||||
"Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(Color.white),
|
"Table.focusCellHighlightBorder",
|
||||||
|
new BorderUIResource.LineBorderUIResource(Color.white),
|
||||||
"Table.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Table.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"Table.foreground", new ColorUIResource(Color.black),
|
"Table.foreground", new ColorUIResource(darkShadow),
|
||||||
"Table.gridColor", new ColorUIResource(Color.gray),
|
"Table.gridColor", new ColorUIResource(Color.gray),
|
||||||
"Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0),
|
"Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0),
|
||||||
"Table.selectionBackground", new ColorUIResource(lightPurple),
|
"Table.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"Table.selectionForeground", new ColorUIResource(Color.black),
|
"Table.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"TableHeader.background", new ColorUIResource(Color.lightGray),
|
"TableHeader.background", new ColorUIResource(light),
|
||||||
"TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0),
|
"TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0),
|
||||||
"TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"TableHeader.foreground", new ColorUIResource(Color.black),
|
"TableHeader.foreground", new ColorUIResource(darkShadow),
|
||||||
"TextArea.background", new ColorUIResource(Color.white),
|
"TextArea.background", new ColorUIResource(light),
|
||||||
"TextArea.border", new BasicBorders.MarginBorder(),
|
"TextArea.border", new BasicBorders.MarginBorder(),
|
||||||
"TextArea.caretBlinkRate", new Integer(500),
|
"TextArea.caretBlinkRate", new Integer(500),
|
||||||
"TextArea.caretForeground", new ColorUIResource(Color.black),
|
"TextArea.caretForeground", new ColorUIResource(Color.black),
|
||||||
|
@ -820,15 +858,20 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
0), "insert-tab")
|
0), "insert-tab")
|
||||||
},
|
},
|
||||||
"TextArea.margin", new InsetsUIResource(0, 0, 0, 0),
|
"TextArea.margin", new InsetsUIResource(0, 0, 0, 0),
|
||||||
"TextArea.selectionBackground", new ColorUIResource(lightPurple),
|
"TextArea.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"TextArea.selectionForeground", new ColorUIResource(Color.black),
|
"TextArea.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"TextField.background", new ColorUIResource(Color.white),
|
"TextField.background", new ColorUIResource(light),
|
||||||
"TextField.border", new BasicBorders.FieldBorder(null, null, null, null),
|
"TextField.border", new BasicBorders.FieldBorder(null, null, null, null),
|
||||||
"TextField.caretBlinkRate", new Integer(500),
|
"TextField.caretBlinkRate", new Integer(500),
|
||||||
"TextField.caretForeground", new ColorUIResource(Color.black),
|
"TextField.caretForeground", new ColorUIResource(Color.black),
|
||||||
|
"TextField.darkShadow", new ColorUIResource(shadow),
|
||||||
"TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
"TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
||||||
"TextField.foreground", new ColorUIResource(Color.black),
|
"TextField.foreground", new ColorUIResource(Color.black),
|
||||||
|
"TextField.highlight", new ColorUIResource(highLight),
|
||||||
|
"TextField.inactiveBackground", new ColorUIResource(light),
|
||||||
"TextField.inactiveForeground", new ColorUIResource(Color.gray),
|
"TextField.inactiveForeground", new ColorUIResource(Color.gray),
|
||||||
|
"TextField.light", new ColorUIResource(highLight),
|
||||||
|
"TextField.highlight", new ColorUIResource(light),
|
||||||
"TextField.keyBindings", new JTextComponent.KeyBinding[] {
|
"TextField.keyBindings", new JTextComponent.KeyBinding[] {
|
||||||
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
|
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
|
||||||
0),
|
0),
|
||||||
|
@ -841,8 +884,8 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"selection-forward"),
|
"selection-forward"),
|
||||||
},
|
},
|
||||||
"TextField.margin", new InsetsUIResource(0, 0, 0, 0),
|
"TextField.margin", new InsetsUIResource(0, 0, 0, 0),
|
||||||
"TextField.selectionBackground", new ColorUIResource(lightPurple),
|
"TextField.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"TextField.selectionForeground", new ColorUIResource(Color.black),
|
"TextField.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"TextPane.background", new ColorUIResource(Color.white),
|
"TextPane.background", new ColorUIResource(Color.white),
|
||||||
"TextPane.border", new BasicBorders.MarginBorder(),
|
"TextPane.border", new BasicBorders.MarginBorder(),
|
||||||
"TextPane.caretBlinkRate", new Integer(500),
|
"TextPane.caretBlinkRate", new Integer(500),
|
||||||
|
@ -865,20 +908,25 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
0), "insert-tab")
|
0), "insert-tab")
|
||||||
},
|
},
|
||||||
"TextPane.margin", new InsetsUIResource(3, 3, 3, 3),
|
"TextPane.margin", new InsetsUIResource(3, 3, 3, 3),
|
||||||
"TextPane.selectionBackground", new ColorUIResource(Color.lightGray),
|
"TextPane.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"TextPane.selectionForeground", new ColorUIResource(Color.white),
|
"TextPane.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(),
|
"TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(),
|
||||||
"TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"TitledBorder.titleColor", new ColorUIResource(Color.black),
|
"TitledBorder.titleColor", new ColorUIResource(darkShadow),
|
||||||
"ToggleButton.background", new ColorUIResource(Color.lightGray),
|
"ToggleButton.background", new ColorUIResource(light),
|
||||||
"ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null),
|
"ToggleButton.border",
|
||||||
|
new BorderUIResource.CompoundBorderUIResource(null, null),
|
||||||
|
"ToggleButton.darkShadow", new ColorUIResource(shadow),
|
||||||
"ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"SPACE", "pressed",
|
"SPACE", "pressed",
|
||||||
"released SPACE", "released"
|
"released SPACE", "released"
|
||||||
}),
|
}),
|
||||||
"ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"ToggleButton.foreground", new ColorUIResource(Color.black),
|
"ToggleButton.foreground", new ColorUIResource(darkShadow),
|
||||||
|
"ToggleButton.highlight", new ColorUIResource(highLight),
|
||||||
|
"ToggleButton.light", new ColorUIResource(light),
|
||||||
"ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
|
"ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
|
||||||
|
"ToggleButton.shadow", new ColorUIResource(shadow),
|
||||||
"ToggleButton.textIconGap", new Integer(4),
|
"ToggleButton.textIconGap", new Integer(4),
|
||||||
"ToggleButton.textShiftOffset", new Integer(0),
|
"ToggleButton.textShiftOffset", new Integer(0),
|
||||||
"ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
|
@ -891,23 +939,27 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"RIGHT", "navigateRight",
|
"RIGHT", "navigateRight",
|
||||||
"KP_RIGHT", "navigateRight"
|
"KP_RIGHT", "navigateRight"
|
||||||
}),
|
}),
|
||||||
"ToolBar.background", new ColorUIResource(Color.lightGray),
|
"ToolBar.background", new ColorUIResource(light),
|
||||||
"ToolBar.border", new BorderUIResource.EtchedBorderUIResource(),
|
"ToolBar.border", new BorderUIResource.EtchedBorderUIResource(),
|
||||||
"ToolBar.dockingBackground", new ColorUIResource(Color.lightGray),
|
"ToolBar.darkShadow", new ColorUIResource(shadow),
|
||||||
"ToolBar.dockingForeground", new ColorUIResource(11, 30, 143),
|
"ToolBar.dockingBackground", new ColorUIResource(light),
|
||||||
"ToolBar.floatingBackground", new ColorUIResource(Color.lightGray),
|
"ToolBar.dockingForeground", new ColorUIResource(Color.red),
|
||||||
"ToolBar.floatingForeground", new ColorUIResource(113, 171, 212),
|
"ToolBar.floatingBackground", new ColorUIResource(light),
|
||||||
|
"ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),
|
||||||
"ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
||||||
"ToolBar.foreground", new ColorUIResource(Color.black),
|
"ToolBar.foreground", new ColorUIResource(darkShadow),
|
||||||
|
"ToolBar.highlight", new ColorUIResource(highLight),
|
||||||
|
"ToolBar.light", new ColorUIResource(highLight),
|
||||||
"ToolBar.separatorSize", new DimensionUIResource(20, 20),
|
"ToolBar.separatorSize", new DimensionUIResource(20, 20),
|
||||||
"ToolTip.background", new ColorUIResource(122, 178, 241),
|
"ToolBar.shadow", new ColorUIResource(shadow),
|
||||||
|
"ToolTip.background", new ColorUIResource(light),
|
||||||
"ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray),
|
"ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray),
|
||||||
"ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
"ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12),
|
||||||
"ToolTip.foreground", new ColorUIResource(Color.black),
|
"ToolTip.foreground", new ColorUIResource(darkShadow),
|
||||||
"Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
"Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
|
||||||
"ESCAPE", "cancel"
|
"ESCAPE", "cancel"
|
||||||
}),
|
}),
|
||||||
"Tree.background", new ColorUIResource(Color.white),
|
"Tree.background", new ColorUIResource(light),
|
||||||
"Tree.changeSelectionWithFocus", Boolean.TRUE,
|
"Tree.changeSelectionWithFocus", Boolean.TRUE,
|
||||||
"Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),
|
"Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),
|
||||||
"Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")),
|
"Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")),
|
||||||
|
@ -967,13 +1019,14 @@ public abstract class BasicLookAndFeel extends LookAndFeel
|
||||||
"Tree.rightChildIndent", new Integer(13),
|
"Tree.rightChildIndent", new Integer(13),
|
||||||
"Tree.rowHeight", new Integer(16),
|
"Tree.rowHeight", new Integer(16),
|
||||||
"Tree.scrollsOnExpand", Boolean.TRUE,
|
"Tree.scrollsOnExpand", Boolean.TRUE,
|
||||||
"Tree.selectionBackground", new ColorUIResource(lightPurple),
|
"Tree.selectionBackground", new ColorUIResource(Color.black),
|
||||||
"Tree.selectionBorderColor", new ColorUIResource(Color.black),
|
"Tree.selectionBorderColor", new ColorUIResource(Color.black),
|
||||||
"Tree.selectionForeground", new ColorUIResource(Color.black),
|
"Tree.selectionForeground", new ColorUIResource(Color.white),
|
||||||
"Tree.textBackground", new ColorUIResource(Color.lightGray),
|
"Tree.textBackground", new ColorUIResource(Color.white),
|
||||||
"Tree.textForeground", new ColorUIResource(Color.black),
|
"Tree.textForeground", new ColorUIResource(Color.black),
|
||||||
"Viewport.background", new ColorUIResource(Color.lightGray),
|
"Viewport.background", new ColorUIResource(light),
|
||||||
"Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12),
|
"Viewport.foreground", new ColorUIResource(Color.black),
|
||||||
|
"Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12)
|
||||||
};
|
};
|
||||||
defaults.putDefaults(uiDefaults);
|
defaults.putDefaults(uiDefaults);
|
||||||
}
|
}
|
||||||
|
|
|
@ -605,7 +605,17 @@ public class BasicMenuItemUI extends MenuItemUI
|
||||||
if (text != null && ! text.equals(""))
|
if (text != null && ! text.equals(""))
|
||||||
{
|
{
|
||||||
if (menuItem.isEnabled())
|
if (menuItem.isEnabled())
|
||||||
|
{
|
||||||
|
/* Menu item is considered to be highlighted when it is selected.
|
||||||
|
It is considered to be selected if menu item is inside some menu
|
||||||
|
and is armed or if it is both armed and pressed */
|
||||||
|
if (menuItem.getModel().isArmed()
|
||||||
|
&& (menuItem.getParent() instanceof MenuElement
|
||||||
|
|| menuItem.getModel().isPressed()))
|
||||||
|
g.setColor(selectionForeground);
|
||||||
|
else
|
||||||
g.setColor(menuItem.getForeground());
|
g.setColor(menuItem.getForeground());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
// FIXME: should fix this to use 'disabledForeground', but its
|
// FIXME: should fix this to use 'disabledForeground', but its
|
||||||
// default value in BasicLookAndFeel is null.
|
// default value in BasicLookAndFeel is null.
|
||||||
|
|
|
@ -818,6 +818,11 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
|
||||||
scrollbar.setBorder(defaults.getBorder("ScrollBar.border"));
|
scrollbar.setBorder(defaults.getBorder("ScrollBar.border"));
|
||||||
scrollbar.setOpaque(true);
|
scrollbar.setOpaque(true);
|
||||||
|
|
||||||
|
thumbColor = defaults.getColor("ScrollBar.thumb");
|
||||||
|
thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
|
||||||
|
thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
|
||||||
|
thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
|
||||||
|
|
||||||
maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize");
|
maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize");
|
||||||
minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize");
|
minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize");
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,82 @@ public class MetalBorders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A border for JScrollPanes.
|
||||||
|
*/
|
||||||
|
public static class ScrollPaneBorder
|
||||||
|
extends AbstractBorder
|
||||||
|
implements UIResource
|
||||||
|
{
|
||||||
|
/** The border insets. */
|
||||||
|
private static Insets insets = new Insets(1, 1, 2, 2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new ScrollPaneBorder.
|
||||||
|
*/
|
||||||
|
public ScrollPaneBorder()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the insets of the border for the Component <code>c</code>.
|
||||||
|
*
|
||||||
|
* @param c the Component for which we return the border insets
|
||||||
|
*/
|
||||||
|
public Insets getBorderInsets(Component c)
|
||||||
|
{
|
||||||
|
return insets;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paints the border.
|
||||||
|
*
|
||||||
|
* @param c the Component for which the border is painted
|
||||||
|
* @param g the Graphics context
|
||||||
|
* @param x the X coordinate of the upper left corner of the border
|
||||||
|
* @param y the Y coordinate of the upper left corner of the border
|
||||||
|
* @param w the width of the border
|
||||||
|
* @param h the height of the border
|
||||||
|
*/
|
||||||
|
public void paintBorder(Component c, Graphics g, int x, int y,
|
||||||
|
int w, int h)
|
||||||
|
{
|
||||||
|
Color darkShadow = MetalLookAndFeel.getControlDarkShadow();
|
||||||
|
Color shadow = MetalLookAndFeel.getControlShadow();
|
||||||
|
Color light = MetalLookAndFeel.getWhite();
|
||||||
|
Color middle = MetalLookAndFeel.getControl();
|
||||||
|
|
||||||
|
// paint top border line
|
||||||
|
g.setColor(darkShadow);
|
||||||
|
g.drawLine(x, y, x + w - 2, y);
|
||||||
|
|
||||||
|
// paint left border line
|
||||||
|
g.drawLine(x, y, x, y + h - 2);
|
||||||
|
|
||||||
|
// paint right inner border line
|
||||||
|
g.drawLine(x + w - 2, y, x + w - 2, y + h + 1);
|
||||||
|
|
||||||
|
// paint bottom inner border line
|
||||||
|
g.drawLine(x + 2, y + h - 2, x + w - 2, y + h - 2);
|
||||||
|
|
||||||
|
// draw right outer border line
|
||||||
|
g.setColor(light);
|
||||||
|
g.drawLine(x + w - 1, y, x + w - 1, y + h - 1);
|
||||||
|
|
||||||
|
// draw bottom outer border line
|
||||||
|
g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
|
||||||
|
|
||||||
|
// paint the lighter points
|
||||||
|
g.setColor(middle);
|
||||||
|
g.drawLine(x + w - 1, y, x + w - 1, y);
|
||||||
|
g.drawLine(x + w - 2, y + 2, x + w - 2, y + 2);
|
||||||
|
g.drawLine(x, y + h - 1, x, y + h - 1);
|
||||||
|
g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This border is used in Toolbar buttons as inner border.
|
* This border is used in Toolbar buttons as inner border.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -474,6 +474,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
|
||||||
"Slider.background", new ColorUIResource(getControl()),
|
"Slider.background", new ColorUIResource(getControl()),
|
||||||
"OptionPane.background", new ColorUIResource(getControl()),
|
"OptionPane.background", new ColorUIResource(getControl()),
|
||||||
"ProgressBar.background", new ColorUIResource(getControl()),
|
"ProgressBar.background", new ColorUIResource(getControl()),
|
||||||
|
"ScrollPane.border", new MetalBorders.ScrollPaneBorder(),
|
||||||
"TabbedPane.background", new ColorUIResource(getControl()),
|
"TabbedPane.background", new ColorUIResource(getControl()),
|
||||||
"Label.background", new ColorUIResource(getControl()),
|
"Label.background", new ColorUIResource(getControl()),
|
||||||
"Label.font", getControlTextFont(),
|
"Label.font", getControlTextFont(),
|
||||||
|
|
|
@ -38,6 +38,8 @@ exception statement from your version. */
|
||||||
|
|
||||||
package javax.swing.plaf.metal;
|
package javax.swing.plaf.metal;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicTextFieldUI;
|
import javax.swing.plaf.basic.BasicTextFieldUI;
|
||||||
|
@ -46,9 +48,8 @@ public class MetalTextFieldUI
|
||||||
extends BasicTextFieldUI
|
extends BasicTextFieldUI
|
||||||
{
|
{
|
||||||
|
|
||||||
// FIXME: maybe replace by a Map of instances when this becomes stateful
|
/** The UI instances for MetalTextFieldUIs */
|
||||||
/** The shared UI instance for MetalTextFieldUIs */
|
private static HashMap instances = null;
|
||||||
private static MetalTextFieldUI instance = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new instance of MetalTextFieldUI.
|
* Constructs a new instance of MetalTextFieldUI.
|
||||||
|
@ -67,8 +68,19 @@ public class MetalTextFieldUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent component)
|
public static ComponentUI createUI(JComponent component)
|
||||||
{
|
{
|
||||||
if (instance == null)
|
if (instances == null)
|
||||||
|
instances = new HashMap();
|
||||||
|
|
||||||
|
Object o = instances.get(component);
|
||||||
|
MetalTextFieldUI instance;
|
||||||
|
if (o == null)
|
||||||
|
{
|
||||||
instance = new MetalTextFieldUI();
|
instance = new MetalTextFieldUI();
|
||||||
|
instances.put(component, instance);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
instance = (MetalTextFieldUI) o;
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import java.io.Serializable;
|
||||||
import java.util.Dictionary;
|
import java.util.Dictionary;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.EventListener;
|
import java.util.EventListener;
|
||||||
|
import java.util.Hashtable;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
|
@ -72,6 +73,9 @@ public abstract class AbstractDocument
|
||||||
AttributeContext context;
|
AttributeContext context;
|
||||||
DocumentFilter documentFilter;
|
DocumentFilter documentFilter;
|
||||||
|
|
||||||
|
/** The documents properties. */
|
||||||
|
Dictionary properties;
|
||||||
|
|
||||||
protected EventListenerList listenerList = new EventListenerList();
|
protected EventListenerList listenerList = new EventListenerList();
|
||||||
|
|
||||||
protected AbstractDocument(Content doc)
|
protected AbstractDocument(Content doc)
|
||||||
|
@ -175,7 +179,11 @@ public abstract class AbstractDocument
|
||||||
|
|
||||||
public Dictionary getDocumentProperties()
|
public Dictionary getDocumentProperties()
|
||||||
{
|
{
|
||||||
return null;
|
// FIXME: make me thread-safe
|
||||||
|
if (properties == null)
|
||||||
|
properties = new Hashtable();
|
||||||
|
|
||||||
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Position getEndPosition()
|
public Position getEndPosition()
|
||||||
|
@ -201,7 +209,12 @@ public abstract class AbstractDocument
|
||||||
|
|
||||||
public Object getProperty(Object key)
|
public Object getProperty(Object key)
|
||||||
{
|
{
|
||||||
return null;
|
// FIXME: make me thread-safe
|
||||||
|
Object value = null;
|
||||||
|
if (properties != null)
|
||||||
|
value = properties.get(key);
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Element[] getRootElements()
|
public Element[] getRootElements()
|
||||||
|
@ -258,6 +271,11 @@ public abstract class AbstractDocument
|
||||||
|
|
||||||
public void putProperty(Object key, Object value)
|
public void putProperty(Object key, Object value)
|
||||||
{
|
{
|
||||||
|
// FIXME: make me thread-safe
|
||||||
|
if (properties == null)
|
||||||
|
properties = new Hashtable();
|
||||||
|
|
||||||
|
properties.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readLock()
|
public void readLock()
|
||||||
|
@ -366,6 +384,8 @@ public abstract class AbstractDocument
|
||||||
|
|
||||||
public void setDocumentProperties(Dictionary x)
|
public void setDocumentProperties(Dictionary x)
|
||||||
{
|
{
|
||||||
|
// FIXME: make me thread-safe
|
||||||
|
properties = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeLock()
|
protected void writeLock()
|
||||||
|
|
|
@ -40,48 +40,182 @@ package javax.swing.text;
|
||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
import javax.swing.event.UndoableEditListener;
|
import javax.swing.event.UndoableEditListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Document is the model that backs up all text components in Swing.
|
||||||
|
* This interface supports different kinds of implementations, from
|
||||||
|
* simple plain text model up to complex styled HTML or RTF models.
|
||||||
|
*/
|
||||||
public interface Document
|
public interface Document
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The key for the property that describes the source of a document.
|
||||||
|
*/
|
||||||
String StreamDescriptionProperty = "stream";
|
String StreamDescriptionProperty = "stream";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The key for the property that is the title of a document.
|
||||||
|
*/
|
||||||
String TitleProperty = "title";
|
String TitleProperty = "title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a {@link DocumentListener} to this document.
|
||||||
|
*
|
||||||
|
* @param listener the DocumentListener to add
|
||||||
|
*/
|
||||||
void addDocumentListener(DocumentListener listener);
|
void addDocumentListener(DocumentListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an {@link UndoableEditListener} to this document.
|
||||||
|
*
|
||||||
|
* @param listener the UndoableEditListener to add
|
||||||
|
*/
|
||||||
void addUndoableEditListener(UndoableEditListener listener);
|
void addUndoableEditListener(UndoableEditListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a mark in the character content at the specified offset.
|
||||||
|
*
|
||||||
|
* @param offs the offset where to place the mark
|
||||||
|
*
|
||||||
|
* @return the created Position object
|
||||||
|
*
|
||||||
|
* @throws BadLocationException of the specified offset is not a valid
|
||||||
|
* position in the documents content
|
||||||
|
*/
|
||||||
Position createPosition(int offs)
|
Position createPosition(int offs)
|
||||||
throws BadLocationException;
|
throws BadLocationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the default root element. Views should be using this element
|
||||||
|
* unless other mechanisms for assigning views to element structure is
|
||||||
|
* provided.
|
||||||
|
*
|
||||||
|
* @return the default root element
|
||||||
|
*/
|
||||||
Element getDefaultRootElement();
|
Element getDefaultRootElement();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position that marks the end of the document.
|
||||||
|
*
|
||||||
|
* @return the position that marks the end of the document
|
||||||
|
*/
|
||||||
Position getEndPosition();
|
Position getEndPosition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the length of the document content.
|
||||||
|
*
|
||||||
|
* @return the length of the document content
|
||||||
|
*/
|
||||||
int getLength();
|
int getLength();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a document property with the specified key.
|
||||||
|
*
|
||||||
|
* @param key the (non-null) key for the property to fetch
|
||||||
|
*
|
||||||
|
* @return the property for <code>key</code> or null if no such property
|
||||||
|
* is stored
|
||||||
|
*/
|
||||||
Object getProperty(Object key);
|
Object getProperty(Object key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the root elements of the document content.
|
||||||
|
*
|
||||||
|
* @return the root elements of the document content
|
||||||
|
*/
|
||||||
Element[] getRootElements();
|
Element[] getRootElements();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position that marks the beginning of the document
|
||||||
|
* content.
|
||||||
|
*
|
||||||
|
* @return the start position
|
||||||
|
*/
|
||||||
Position getStartPosition();
|
Position getStartPosition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the textual content starting at <code>offset</code> with
|
||||||
|
* a length of <code>length</code>.
|
||||||
|
*
|
||||||
|
* @param offset the beginning of the text fragment to fetch
|
||||||
|
* @param length the length of the text fragment to fetch
|
||||||
|
*
|
||||||
|
* @return the text fragment starting at <code>offset</code> with
|
||||||
|
* a length of <code>length</code>
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>offset</code> or <code>length</code>
|
||||||
|
* are no valid locations in the document content
|
||||||
|
*/
|
||||||
String getText(int offset, int length)
|
String getText(int offset, int length)
|
||||||
throws BadLocationException;
|
throws BadLocationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the textual content starting at <code>offset</code> with
|
||||||
|
* a length of <code>length</code> and store it in <code>txt</code>.
|
||||||
|
*
|
||||||
|
* @param offset the beginning of the text fragment to fetch
|
||||||
|
* @param length the length of the text fragment to fetch
|
||||||
|
* @param txt the Segment where to store the text fragment
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>offset</code> or <code>length</code>
|
||||||
|
* are no valid locations in the document content
|
||||||
|
*/
|
||||||
void getText(int offset, int length, Segment txt)
|
void getText(int offset, int length, Segment txt)
|
||||||
throws BadLocationException;
|
throws BadLocationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts a piece of text with an AttributeSet at the specified
|
||||||
|
* <code>offset</code>.
|
||||||
|
*
|
||||||
|
* @param offset the location where to insert the content
|
||||||
|
* @param str the textual content to insert
|
||||||
|
* @param a the Attributes associated with the piece of text
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>offset</code>
|
||||||
|
* is not a valid location in the document content
|
||||||
|
*/
|
||||||
void insertString(int offset, String str, AttributeSet a)
|
void insertString(int offset, String str, AttributeSet a)
|
||||||
throws BadLocationException;
|
throws BadLocationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a document property.
|
||||||
|
*
|
||||||
|
* @param key the key of the property
|
||||||
|
* @param value the value of the property
|
||||||
|
*/
|
||||||
void putProperty(Object key, Object value);
|
void putProperty(Object key, Object value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a piece of content.
|
||||||
|
*
|
||||||
|
* @param offs the location of the fragment to remove
|
||||||
|
* @param len the length of the fragment to remove
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>offs</code> or <code>len</code>
|
||||||
|
* are no valid locations in the document content
|
||||||
|
*/
|
||||||
void remove(int offs, int len)
|
void remove(int offs, int len)
|
||||||
throws BadLocationException;
|
throws BadLocationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a DocumentListener from this Document.
|
||||||
|
*
|
||||||
|
* @param listener the DocumentListener to remove
|
||||||
|
*/
|
||||||
void removeDocumentListener(DocumentListener listener);
|
void removeDocumentListener(DocumentListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes an UndoableEditListener from this Document.
|
||||||
|
*
|
||||||
|
* @param listener the UndoableEditListener to remove
|
||||||
|
*/
|
||||||
void removeUndoableEditListener(UndoableEditListener listener);
|
void removeUndoableEditListener(UndoableEditListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This allows the Document to be rendered safely. It is made sure that
|
||||||
|
* the Runnable can read the document without any changes while reading.
|
||||||
|
* The Runnable is not allowed to change the Document itself.
|
||||||
|
*
|
||||||
|
* @param r the Runnable that renders the Document
|
||||||
|
*/
|
||||||
void render(Runnable r);
|
void render(Runnable r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,16 @@ import java.io.Serializable;
|
||||||
// lets just use a stringbuffer instead.
|
// lets just use a stringbuffer instead.
|
||||||
import javax.swing.undo.UndoableEdit;
|
import javax.swing.undo.UndoableEdit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This implementation of {@link AbstractDocument.Content} uses a gapped
|
||||||
|
* buffer. This takes advantage of the fact that text area content is
|
||||||
|
* mostly inserted sequentially. The buffer is a char array that maintains
|
||||||
|
* a gap at the current insertion point. If characters a inserted at
|
||||||
|
* gap boundaries, the cost is minimal (simple array access). The array only
|
||||||
|
* has to be shifted around when the insertion point moves (then the gap also
|
||||||
|
* moves and one array copy is necessary) or when the gap is filled up and
|
||||||
|
* the buffer has to be enlarged.
|
||||||
|
*/
|
||||||
public class GapContent
|
public class GapContent
|
||||||
implements AbstractDocument.Content, Serializable
|
implements AbstractDocument.Content, Serializable
|
||||||
{
|
{
|
||||||
|
@ -51,16 +61,34 @@ public class GapContent
|
||||||
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new GapContent object.
|
||||||
|
*/
|
||||||
public GapContent()
|
public GapContent()
|
||||||
{
|
{
|
||||||
this(10);
|
this(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new GapContent object with a specified initial size.
|
||||||
|
*
|
||||||
|
* @param size the initial size of the buffer
|
||||||
|
*/
|
||||||
public GapContent(int size)
|
public GapContent(int size)
|
||||||
{
|
{
|
||||||
buf.append("\n");
|
buf.append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a mark at the specified position.
|
||||||
|
*
|
||||||
|
* @param offset the position at which to create the mark
|
||||||
|
*
|
||||||
|
* @return the create Position object for the mark
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if the offset is not a valid position in
|
||||||
|
* the buffer
|
||||||
|
*/
|
||||||
public Position createPosition(final int offset) throws BadLocationException
|
public Position createPosition(final int offset) throws BadLocationException
|
||||||
{
|
{
|
||||||
return new Position()
|
return new Position()
|
||||||
|
@ -74,11 +102,28 @@ public class GapContent
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the length of the content.
|
||||||
|
*
|
||||||
|
* @return the length of the content
|
||||||
|
*/
|
||||||
public int length()
|
public int length()
|
||||||
{
|
{
|
||||||
return buf.length();
|
return buf.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts a string at the specified position.
|
||||||
|
*
|
||||||
|
* @param where the position where the string is inserted
|
||||||
|
* @param str the string that is to be inserted
|
||||||
|
*
|
||||||
|
* @return an UndoableEdit object (currently not supported, so
|
||||||
|
* <code>null</code> is returned)
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>where</code> is not a valid location
|
||||||
|
* in the buffer
|
||||||
|
*/
|
||||||
public UndoableEdit insertString(int where, String str)
|
public UndoableEdit insertString(int where, String str)
|
||||||
throws BadLocationException
|
throws BadLocationException
|
||||||
{
|
{
|
||||||
|
@ -86,6 +131,18 @@ public class GapContent
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a piece of content at th specified position.
|
||||||
|
*
|
||||||
|
* @param where the position where the content is to be removed
|
||||||
|
* @param nitems number of characters to be removed
|
||||||
|
*
|
||||||
|
* @return an UndoableEdit object (currently not supported, so
|
||||||
|
* <code>null</code> is returned)
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>where</code> is not a valid location
|
||||||
|
* in the buffer
|
||||||
|
*/
|
||||||
public UndoableEdit remove(int where, int nitems)
|
public UndoableEdit remove(int where, int nitems)
|
||||||
throws BadLocationException
|
throws BadLocationException
|
||||||
{
|
{
|
||||||
|
@ -93,11 +150,30 @@ public class GapContent
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a piece of content as String.
|
||||||
|
*
|
||||||
|
* @param where the start location of the fragment
|
||||||
|
* @param len the length of the fragment
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>where</code> or
|
||||||
|
* <code>where + len</code> are no valid locations in the buffer
|
||||||
|
*/
|
||||||
public String getString(int where, int len) throws BadLocationException
|
public String getString(int where, int len) throws BadLocationException
|
||||||
{
|
{
|
||||||
return buf.substring(where, where+len);
|
return buf.substring(where, where+len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches a piece of content and stores it in a {@link Segment} object.
|
||||||
|
*
|
||||||
|
* @param where the start location of the fragment
|
||||||
|
* @param len the length of the fragment
|
||||||
|
* @param txt the Segment object to store the fragment in
|
||||||
|
*
|
||||||
|
* @throws BadLocationException if <code>where</code> or
|
||||||
|
* <code>where + len</code> are no valid locations in the buffer
|
||||||
|
*/
|
||||||
public void getChars(int where, int len, Segment txt)
|
public void getChars(int where, int len, Segment txt)
|
||||||
throws BadLocationException
|
throws BadLocationException
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* StyleConstants.java --
|
/* StyleConstants.java --
|
||||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Classpath.
|
This file is part of GNU Classpath.
|
||||||
|
|
||||||
|
@ -84,7 +84,9 @@ public class StyleConstants
|
||||||
|
|
||||||
String keyname;
|
String keyname;
|
||||||
|
|
||||||
private StyleConstants(String k)
|
// Package-private to avoid accessor constructor for use by
|
||||||
|
// subclasses.
|
||||||
|
StyleConstants(String k)
|
||||||
{
|
{
|
||||||
keyname = k;
|
keyname = k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class DefaultTreeSelectionModel
|
||||||
public DefaultTreeSelectionModel()
|
public DefaultTreeSelectionModel()
|
||||||
{
|
{
|
||||||
setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
|
setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
|
||||||
|
listenerList = new EventListenerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -230,9 +231,9 @@ public class DefaultTreeSelectionModel
|
||||||
*
|
*
|
||||||
* @param path the path to set as selection
|
* @param path the path to set as selection
|
||||||
*/
|
*/
|
||||||
public void setSelectionPath(TreePath value0)
|
public void setSelectionPath(TreePath path)
|
||||||
{
|
{
|
||||||
// TODO
|
selection = new TreePath[] { path };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue