bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", new ColorUIResource(getControl()), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", new ColorUIResource(getControlDarkShadow()), "Button.disabledText", new ColorUIResource(getControlDisabled()), "Button.focus", new ColorUIResource(getFocusColor()), "Button.font", getControlTextFont(), "Button.foreground", new ColorUIResource(getSystemTextColor()), "Button.highlight", new ColorUIResource(getControlHighlight()), "Button.light", new ColorUIResource(getControlHighlight()), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", new ColorUIResource(getPrimaryControlShadow()), "Button.shadow", new ColorUIResource(getPrimaryControlShadow()), "CheckBox.background", new ColorUIResource(getControl()), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBoxMenuItem.background", new ColorUIResource(getControl()), "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "ToolBar.background", new ColorUIResource(getControl()), "Panel.background", new ColorUIResource(getControl()), "Slider.background", new ColorUIResource(getControl()), "OptionPane.background", new ColorUIResource(getControl()), "ProgressBar.background", new ColorUIResource(getControl()), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "TabbedPane.background", new ColorUIResource(getControl()), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", new ColorUIResource(getControl()), "Label.font", getControlTextFont(), "Label.disabledForeground", new ColorUIResource(getInactiveControlTextColor()), "Label.foreground", new ColorUIResource(getControlTextColor()), "Menu.background", new ColorUIResource(getControl()), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.font", getControlTextFont(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", new ColorUIResource(getControl()), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuItem.background", new ColorUIResource(getControl()), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.font", getControlTextFont(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "Panel.background", new ColorUIResource(getControl()), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", new ColorUIResource(getControl()), "ScrollBar.shadow", new ColorUIResource(getControlShadow()), "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), "ScrollBar.thumbDarkShadow", new ColorUIResource(getPrimaryControlDarkShadow()), "ScrollBar.thumbHighlight", new ColorUIResource(getPrimaryControl()), "SplitPane.darkShadow", new ColorUIResource(getControlDarkShadow()), "SplitPane.highlight", new ColorUIResource(getControlHighlight()), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "ToggleButton.background", new ColorUIResource(getControl()), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), "ToggleButton.disabledText", new ColorUIResource(getControlDisabled()), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", new ColorUIResource(getSystemTextColor()), "ToggleButton.highlight", new ColorUIResource(getControlHighlight()), "ToggleButton.light", new ColorUIResource(getControlHighlight()), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", new ColorUIResource(getPrimaryControlShadow()), "ToggleButton.shadow", new ColorUIResource(getPrimaryControlShadow()), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.background", new ColorUIResource(Color.white), "Tree.foreground", new ColorUIResource(new Color(204, 204, 255)), "Tree.hash", new ColorUIResource(new Color(204, 204, 255)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.nonSelectionBackground", new ColorUIResource(Color.white), "Tree.selectionBorderColor", new ColorUIResource(new Color(102, 102, 153)), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.nonSelectionBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.black), "PopupMenu.border", new MetalBorders.PopupMenuBorder() }; defaults.putDefaults(myDefaults); }
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", new ColorUIResource(getControl()), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", new ColorUIResource(getControlDarkShadow()), "Button.disabledText", new ColorUIResource(getControlDisabled()), "Button.focus", new ColorUIResource(getFocusColor()), "Button.font", getControlTextFont(), "Button.foreground", new ColorUIResource(getSystemTextColor()), "Button.highlight", new ColorUIResource(getControlHighlight()), "Button.light", new ColorUIResource(getControlHighlight()), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", new ColorUIResource(getPrimaryControlShadow()), "Button.shadow", new ColorUIResource(getPrimaryControlShadow()), "CheckBox.background", new ColorUIResource(getControl()), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBoxMenuItem.background", new ColorUIResource(getControl()), "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "ToolBar.background", new ColorUIResource(getControl()), "Panel.background", new ColorUIResource(getControl()), "Slider.background", new ColorUIResource(getControl()), "OptionPane.background", new ColorUIResource(getControl()), "ProgressBar.background", new ColorUIResource(getControl()), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "TabbedPane.background", new ColorUIResource(getControl()), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", new ColorUIResource(getControl()), "Label.font", getControlTextFont(), "Label.disabledForeground", new ColorUIResource(getInactiveControlTextColor()), "Label.foreground", new ColorUIResource(getControlTextColor()), "Menu.background", new ColorUIResource(getControl()), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.font", getControlTextFont(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", new ColorUIResource(getControl()), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuItem.background", new ColorUIResource(getControl()), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.font", getControlTextFont(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "Panel.background", new ColorUIResource(getControl()), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", new ColorUIResource(getControl()), "ScrollBar.shadow", new ColorUIResource(getControlShadow()), "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), "ScrollBar.thumbDarkShadow", new ColorUIResource(getPrimaryControlDarkShadow()), "ScrollBar.thumbHighlight", new ColorUIResource(getPrimaryControl()), "SplitPane.darkShadow", new ColorUIResource(getControlDarkShadow()), "SplitPane.highlight", new ColorUIResource(getControlHighlight()), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "ToggleButton.background", new ColorUIResource(getControl()), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), "ToggleButton.disabledText", new ColorUIResource(getControlDisabled()), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", new ColorUIResource(getSystemTextColor()), "ToggleButton.highlight", new ColorUIResource(getControlHighlight()), "ToggleButton.light", new ColorUIResource(getControlHighlight()), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", new ColorUIResource(getPrimaryControlShadow()), "ToggleButton.shadow", new ColorUIResource(getPrimaryControlShadow()), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.background", new ColorUIResource(Color.white), "Tree.foreground", new ColorUIResource(new Color(204, 204, 255)), "Tree.hash", new ColorUIResource(new Color(204, 204, 255)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.nonSelectionBackground", new ColorUIResource(Color.white), "Tree.selectionBorderColor", new ColorUIResource(new Color(102, 102, 153)), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.nonSelectionBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.black), "PopupMenu.border", new MetalBorders.PopupMenuBorder() }; defaults.putDefaults(myDefaults); }
7,287
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
7,288
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isObject); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
7,289
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
7,290
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_Object((org.omg.CORBA.Object) an_interface); }
public void write_abstract_interface(java.lang.Object an_interface) { boolean isValue = an_interface instanceof ValueBase || (!(an_interface instanceof org.omg.CORBA.Object)); write_boolean(isValue); if (isValue) write_value((ValueBase) an_interface); else write_value((Serializable) an_interface); }
7,291
public Object clone() { HMac result = new HMac((IMessageDigest) underlyingHash.clone()); result.ipadHash = this.ipadHash; result.opadHash = this.opadHash; result.ipad = (byte[])this.ipad.clone(); return result; }
public Object clone() throws CloneNotSupportedException { HMac result = new HMac((IMessageDigest) underlyingHash.clone()); result.ipadHash = this.ipadHash; result.opadHash = this.opadHash; result.ipad = (byte[])this.ipad.clone(); return result; }
7,292
public Object clone() { HMac result = new HMac((IMessageDigest) underlyingHash.clone()); result.ipadHash = this.ipadHash; result.opadHash = this.opadHash; result.ipad = (byte[])this.ipad.clone(); return result; }
public Object clone() { HMac result = new HMac((IMessageDigest) underlyingHash.clone()); result.ipadHash = this.ipadHash; result.opadHash = this.opadHash; result.ipad = (byte[])this.ipad.clone(); return result; }
7,293
public SwingButtonPeer(SwingToolkit toolkit, Button button) { super(toolkit, button, new JButton()); this.button = button; final JButton jButton = (JButton)jComponent; SwingToolkit.add(button, jButton); SwingToolkit.copyAwtProperties(button, jButton); jButton.setText(button.getLabel()); jButton.addActionListener(new ActionListenerDelegate(button)); jButton.addMouseListener(new MouseListenerDelegate(button)); jButton.addMouseMotionListener(new MouseMotionListenerDelegate(button)); }
public SwingButtonPeer(SwingToolkit toolkit, Button button) { super(toolkit, button, new JButton()); this.button = button; final JButton jButton = (JButton)jComponent; SwingToolkit.add(button, jButton); SwingToolkit.copyAwtProperties(button, jButton); jButton.setText(button.getLabel()); jButton.addActionListener(new ActionListenerDelegate(button)); jButton.addMouseListener(new MouseListenerDelegate(button)); jButton.addMouseMotionListener(new MouseMotionListenerDelegate(button)); }
7,296
public static Object get(Object key) { Object val = null; if (userUIDefaults != null) val = userUIDefaults.get(key); if (val == null) val = getLookAndFeelDefaults().get(key); return val; }
public static Object get(Object key) { Object val = null; if (userUIDefaults != null) val = userUIDefaults.get(key); if (val == null) val = getLookAndFeelDefaults().get(key); return val; }
7,297
public static UIDefaults getLookAndFeelDefaults() { return currentUIDefaults; }
public static UIDefaults getLookAndFeelDefaults() { return lookAndFeelDefaults; }
7,299
public static ComponentUI getUI(JComponent target) { ComponentUI ui = null; if (userUIDefaults != null && userUIDefaults.get(target.getUIClassID()) != null) ui = userUIDefaults.getUI(target); if (ui == null) ui = currentUIDefaults.getUI(target); return ui; }
public static ComponentUI getUI(JComponent target) { ComponentUI ui = null; if (userUIDefaults != null && userUIDefaults.get(target.getUIClassID()) != null) ui = userUIDefaults.getUI(target); if (ui == null) ui = currentUIDefaults.getUI(target); return ui; }
7,300
public static Object put(Object key, Object value) { Object old = get(key); if (userUIDefaults == null) userUIDefaults = new UIDefaults(); userUIDefaults.put(key, value); return old; }
public static Object put(Object key, Object value) { Object old = get(key); if (userUIDefaults == null) userUIDefaults = new UIDefaults(); userUIDefaults.put(key, value); return old; }
7,301
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException { if (newLookAndFeel != null && ! newLookAndFeel.isSupportedLookAndFeel()) throw new UnsupportedLookAndFeelException(newLookAndFeel.getName()); LookAndFeel oldLookAndFeel = currentLookAndFeel; if (oldLookAndFeel != null) oldLookAndFeel.uninitialize(); // Set the current default look and feel using a LookAndFeel object. currentLookAndFeel = newLookAndFeel; if (newLookAndFeel != null) { newLookAndFeel.initialize(); currentUIDefaults = newLookAndFeel.getDefaults(); } else { currentUIDefaults = null; } listeners.firePropertyChange("lookAndFeel", oldLookAndFeel, newLookAndFeel); //revalidate(); //repaint(); }
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException { if (newLookAndFeel != null && ! newLookAndFeel.isSupportedLookAndFeel()) throw new UnsupportedLookAndFeelException(newLookAndFeel.getName() + " not supported on this platform"); LookAndFeel oldLookAndFeel = currentLookAndFeel; if (oldLookAndFeel != null) oldLookAndFeel.uninitialize(); // Set the current default look and feel using a LookAndFeel object. currentLookAndFeel = newLookAndFeel; if (newLookAndFeel != null) { newLookAndFeel.initialize(); currentUIDefaults = newLookAndFeel.getDefaults(); } else { currentUIDefaults = null; } listeners.firePropertyChange("lookAndFeel", oldLookAndFeel, newLookAndFeel); //revalidate(); //repaint(); }
7,302
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException { if (newLookAndFeel != null && ! newLookAndFeel.isSupportedLookAndFeel()) throw new UnsupportedLookAndFeelException(newLookAndFeel.getName()); LookAndFeel oldLookAndFeel = currentLookAndFeel; if (oldLookAndFeel != null) oldLookAndFeel.uninitialize(); // Set the current default look and feel using a LookAndFeel object. currentLookAndFeel = newLookAndFeel; if (newLookAndFeel != null) { newLookAndFeel.initialize(); currentUIDefaults = newLookAndFeel.getDefaults(); } else { currentUIDefaults = null; } listeners.firePropertyChange("lookAndFeel", oldLookAndFeel, newLookAndFeel); //revalidate(); //repaint(); }
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException { if (newLookAndFeel != null && ! newLookAndFeel.isSupportedLookAndFeel()) throw new UnsupportedLookAndFeelException(newLookAndFeel.getName()); LookAndFeel oldLookAndFeel = currentLookAndFeel; if (oldLookAndFeel != null) oldLookAndFeel.uninitialize(); // Set the current default look and feel using a LookAndFeel object. currentLookAndFeel = newLookAndFeel; if (newLookAndFeel != null) { newLookAndFeel.initialize(); lookAndFeelDefaults = newLookAndFeel.getDefaults(); if (currentUIDefaults == null) currentUIDefaults = new MultiplexUIDefaults(lookAndFeelDefaults); else currentUIDefaults.fallback = lookAndFeelDefaults; } else { currentUIDefaults = null; } listeners.firePropertyChange("lookAndFeel", oldLookAndFeel, newLookAndFeel); //revalidate(); //repaint(); }
7,303
public boolean probe(AbstractPointerDriver d) { try { // reset the mouse if (!d.initPointer()) { log.debug("Reset mouse failed"); return false; } int id = d.getPointerId(); if (id != 0) { // does not seem to be a mouse, more likely a tablet of touch screen log.debug("PointerId == " + id); return false; } //int protocolBytes = 3; // standard: 3 byte protocol // try to make this a 3 button + wheel boolean result = d.setRate(200); result &= d.setRate(100); result &= d.setRate(80); // a "normal" mouse doesn't recognize this sequence as special // but a mouse with a wheel will change its mouse ID id = d.getPointerId(); // select protocol for (Iterator i = protocolsHandlers.iterator(); i.hasNext();) { final MouseProtocolHandler p = (MouseProtocolHandler) i.next(); if (p.supportsId(id)) { this.protocol = p; break; } } if (protocol == null) { log.error("No mouse driver found for PointerID " + id); return false; } this.data = new byte[protocol.getPacketSize()]; return result; } catch (DriverException ex) { log.error("Error probing for mouse", ex); return false; } catch (DeviceException ex) { log.error("Error probing for mouse", ex); return false; } }
public boolean probe(AbstractPointerDriver d) { try { // reset the mouse if (!d.initPointer()) { log.debug("Reset mouse failed"); return false; } int id = d.getPointerId(); if (id != 0) { // does not seem to be a mouse, more likely a tablet of touch screen log.debug("PointerId 0x" + NumberUtils.hex(id, 2)); return false; } //int protocolBytes = 3; // standard: 3 byte protocol // try to make this a 3 button + wheel boolean result = d.setRate(200); result &= d.setRate(100); result &= d.setRate(80); // a "normal" mouse doesn't recognize this sequence as special // but a mouse with a wheel will change its mouse ID id = d.getPointerId(); // select protocol for (Iterator i = protocolsHandlers.iterator(); i.hasNext();) { final MouseProtocolHandler p = (MouseProtocolHandler) i.next(); if (p.supportsId(id)) { this.protocol = p; break; } } if (protocol == null) { log.error("No mouse driver found for PointerID " + id); return false; } this.data = new byte[protocol.getPacketSize()]; return result; } catch (DriverException ex) { log.error("Error probing for mouse", ex); return false; } catch (DeviceException ex) { log.error("Error probing for mouse", ex); return false; } }
7,304
public static Policy[] extract(Any any) { try { PolicyListHolder holds = (PolicyListHolder) any.extract_Streamable(); return holds.value; } catch (ClassCastException ex) { throw new BAD_OPERATION("Policy[] expected"); } }
public static Policy[] extract(Any any) { try { PolicyListHolder holds = (PolicyListHolder) any.extract_Streamable(); return holds.value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("Policy[] expected"); bad.minor = Minor.Any; throw bad; } }
7,306
public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // WVL - LDC : 16/07/2003 : TR.000345 // The inStream return -1 when end-of-stream is reached. This // happens e.g. when the connection is closed from the AS/400. // So we stop in this case! // ==> an empty byte array is returned from this method. if (i == -1) // nothing read! { done = true; vt.disconnect(); continue; } // We use the values instead of the static values IAC and EOR // because they are defined as bytes. // // The > if(i != 255 || j != 255) < is a hack for the double FF FF's // that are being returned. I do not know why this is like this and // can not find any documentation for it. It is also being returned // on my Client Access tcp dump as well so they are handling it. // // my5250 // 0000: 00 50 DA 44 C8 45 42 00 00 00 00 24 08 00 45 00 .P.D.EB....$..E. // 0010: 04 2A BC F9 00 00 40 06 D0 27 C1 A8 33 04 C1 A8 .*....@..'..3... // 0020: 33 58 00 17 04 18 6F A2 83 CB 00 1E D1 BA 50 18 3X....o.......P. // 0030: 20 00 8A 9A 00 00 03 FF FF 12 A0 00 00 04 00 00 ............... // --------------------------- || || ------------------------------------- // 0040: 03 04 40 04 11 00 20 01 07 00 00 00 18 00 00 10 ..@... ......... if(j == 255 && i == 255) { j = -1; continue; } else { baosin.write(i); // check for end of record EOR and IAC - FFEF if(j == 255 && i == 239) done = true; // This is to check for the TELNET TIMING MARK OPTION // rfc860 explains this in more detail. When we receive it // we will negotiate with the server by sending a WONT'T TIMING-MARK // This will let the server know that we processed the information // and are just waiting for the user to enter some data so keep the // socket alive. This is more or less a AYT (ARE YOU THERE) or not. if(i == 253 && j == 255) { done = true; negotiate = true; } j = i; } } // after the initial negotiation we might get other options such as // timing marks ?????????????? do we ???????????? look at telnet spec // yes we do. rfc860 explains about timing marks. if (negotiate) { // get the negotiation option baosin.write(bin.read()); vt.negotiate(baosin.toByteArray()); } if (dumpBytes) { dump(baosin.toByteArray()); } return baosin.toByteArray(); }
public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // WVL - LDC : 16/07/2003 : TR.000345 // The inStream return -1 when end-of-stream is reached. This // happens e.g. when the connection is closed from the AS/400. // So we stop in this case! // ==> an empty byte array is returned from this method. if (i == -1) // nothing read! { done = true; vt.disconnect(); continue; } // We use the values instead of the static values IAC and EOR // because they are defined as bytes. // // The > if(i != 255 || j != 255) < is a hack for the double FF FF's // that are being returned. I do not know why this is like this and // can not find any documentation for it. It is also being returned // on my Client Access tcp dump as well so they are handling it. // // my5250 // 0000: 00 50 DA 44 C8 45 42 00 00 00 00 24 08 00 45 00 .P.D.EB....$..E. // 0010: 04 2A BC F9 00 00 40 06 D0 27 C1 A8 33 04 C1 A8 .*....@..'..3... // 0020: 33 58 00 17 04 18 6F A2 83 CB 00 1E D1 BA 50 18 3X....o.......P. // 0030: 20 00 8A 9A 00 00 03 FF FF 12 A0 00 00 04 00 00 ............... // --------------------------- || || ------------------------------------- // 0040: 03 04 40 04 11 00 20 01 07 00 00 00 18 00 00 10 ..@... ......... if(j == 255 && i == 255) { j = -1; continue; } else { baosin.write(i); // check for end of record EOR and IAC - FFEF if(j == 255 && i == 239) done = true; // This is to check for the TELNET TIMING MARK OPTION // rfc860 explains this in more detail. When we receive it // we will negotiate with the server by sending a WONT'T TIMING-MARK // This will let the server know that we processed the information // and are just waiting for the user to enter some data so keep the // socket alive. This is more or less a AYT (ARE YOU THERE) or not. if(i == 253 && j == 255) { done = true; negotiate = true; } j = i; } } // after the initial negotiation we might get other options such as // timing marks ?????????????? do we ???????????? look at telnet spec // yes we do. rfc860 explains about timing marks. if (negotiate) { // get the negotiation option baosin.write(bin.read()); vt.negotiate(rBytes); return null; } if (dumpBytes) { dump(baosin.toByteArray()); } return baosin.toByteArray(); }
7,307
public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // WVL - LDC : 16/07/2003 : TR.000345 // The inStream return -1 when end-of-stream is reached. This // happens e.g. when the connection is closed from the AS/400. // So we stop in this case! // ==> an empty byte array is returned from this method. if (i == -1) // nothing read! { done = true; vt.disconnect(); continue; } // We use the values instead of the static values IAC and EOR // because they are defined as bytes. // // The > if(i != 255 || j != 255) < is a hack for the double FF FF's // that are being returned. I do not know why this is like this and // can not find any documentation for it. It is also being returned // on my Client Access tcp dump as well so they are handling it. // // my5250 // 0000: 00 50 DA 44 C8 45 42 00 00 00 00 24 08 00 45 00 .P.D.EB....$..E. // 0010: 04 2A BC F9 00 00 40 06 D0 27 C1 A8 33 04 C1 A8 .*....@..'..3... // 0020: 33 58 00 17 04 18 6F A2 83 CB 00 1E D1 BA 50 18 3X....o.......P. // 0030: 20 00 8A 9A 00 00 03 FF FF 12 A0 00 00 04 00 00 ............... // --------------------------- || || ------------------------------------- // 0040: 03 04 40 04 11 00 20 01 07 00 00 00 18 00 00 10 ..@... ......... if(j == 255 && i == 255) { j = -1; continue; } else { baosin.write(i); // check for end of record EOR and IAC - FFEF if(j == 255 && i == 239) done = true; // This is to check for the TELNET TIMING MARK OPTION // rfc860 explains this in more detail. When we receive it // we will negotiate with the server by sending a WONT'T TIMING-MARK // This will let the server know that we processed the information // and are just waiting for the user to enter some data so keep the // socket alive. This is more or less a AYT (ARE YOU THERE) or not. if(i == 253 && j == 255) { done = true; negotiate = true; } j = i; } } // after the initial negotiation we might get other options such as // timing marks ?????????????? do we ???????????? look at telnet spec // yes we do. rfc860 explains about timing marks. if (negotiate) { // get the negotiation option baosin.write(bin.read()); vt.negotiate(baosin.toByteArray()); } if (dumpBytes) { dump(baosin.toByteArray()); } return baosin.toByteArray(); }
public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // WVL - LDC : 16/07/2003 : TR.000345 // The inStream return -1 when end-of-stream is reached. This // happens e.g. when the connection is closed from the AS/400. // So we stop in this case! // ==> an empty byte array is returned from this method. if (i == -1) // nothing read! { done = true; vt.disconnect(); continue; } // We use the values instead of the static values IAC and EOR // because they are defined as bytes. // // The > if(i != 255 || j != 255) < is a hack for the double FF FF's // that are being returned. I do not know why this is like this and // can not find any documentation for it. It is also being returned // on my Client Access tcp dump as well so they are handling it. // // my5250 // 0000: 00 50 DA 44 C8 45 42 00 00 00 00 24 08 00 45 00 .P.D.EB....$..E. // 0010: 04 2A BC F9 00 00 40 06 D0 27 C1 A8 33 04 C1 A8 .*....@..'..3... // 0020: 33 58 00 17 04 18 6F A2 83 CB 00 1E D1 BA 50 18 3X....o.......P. // 0030: 20 00 8A 9A 00 00 03 FF FF 12 A0 00 00 04 00 00 ............... // --------------------------- || || ------------------------------------- // 0040: 03 04 40 04 11 00 20 01 07 00 00 00 18 00 00 10 ..@... ......... if(j == 255 && i == 255) { j = -1; continue; } else { baosin.write(i); // check for end of record EOR and IAC - FFEF if(j == 255 && i == 239) done = true; // This is to check for the TELNET TIMING MARK OPTION // rfc860 explains this in more detail. When we receive it // we will negotiate with the server by sending a WONT'T TIMING-MARK // This will let the server know that we processed the information // and are just waiting for the user to enter some data so keep the // socket alive. This is more or less a AYT (ARE YOU THERE) or not. if(i == 253 && j == 255) { done = true; negotiate = true; } j = i; } } // after the initial negotiation we might get other options such as // timing marks ?????????????? do we ???????????? look at telnet spec // yes we do. rfc860 explains about timing marks. if (negotiate) { // get the negotiation option baosin.write(bin.read()); vt.negotiate(baosin.toByteArray()); } if (dumpBytes) { dump(baosin.toByteArray()); } return baosin.toByteArray(); }
7,308
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { log.warn(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); log.warn(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) { log.warn(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { log.warn(ex.getMessage()); if (me.isInterrupted()) done = true; } } }
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { log.warn(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); log.warn(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) { log.warn(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { log.warn(ex.getMessage()); if (me.isInterrupted()) done = true; } } }
7,309
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { log.warn(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); log.warn(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) { log.warn(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { log.warn(ex.getMessage()); if (me.isInterrupted()) done = true; } } }
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { log.warn(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); log.warn(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) { log.warn(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { log.warn(ex.getMessage()); if (me.isInterrupted()) done = true; } } }
7,310
public OutputStream _invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; // We suppose that the next_n should be the most popular. if (method.equals("next_n")) { // The next_n has been invoked. int amount = in.read_ulong(); BindingListHolder a_list = new BindingListHolder(); boolean result = next_n(amount, a_list); out = rh.createReply(); out.write_boolean(result); BindingListHelper.write(out, a_list.value); } else if (method.equals("next_one")) { // The next_one has been invoked. BindingHolder a_binding = new BindingHolder(); boolean result = next_one(a_binding); out = rh.createReply(); out.write_boolean(result); BindingHelper.write(out, a_binding.value); } else if (method.equals("destroy")) { // The destroy has been invoked. destroy(); out = rh.createReply(); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return out; }
public OutputStream _invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; // We suppose that the next_n should be the most popular. if (method.equals("next_n")) { // The next_n has been invoked. int amount = in.read_ulong(); BindingListHolder a_list = new BindingListHolder(); boolean result = next_n(amount, a_list); out = rh.createReply(); out.write_boolean(result); BindingListHelper.write(out, a_list.value); } else if (method.equals("next_one")) { // The next_one has been invoked. BindingHolder a_binding = new BindingHolder(); boolean result = next_one(a_binding); out = rh.createReply(); out.write_boolean(result); BindingHelper.write(out, a_binding.value); } else if (method.equals("destroy")) { // The destroy has been invoked. destroy(); out = rh.createReply(); } else throw new BAD_OPERATION(method, Minor.Method, CompletionStatus.COMPLETED_MAYBE); return out; }
7,314
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=\"" + attrib+"\""); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=\"" + attrib + "\""); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=\"" + attrib + "\""); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=\"" + attrib + "\""); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=\"" + attrib+"\""); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=\"" + attrib + "\""); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=\"" + attrib + "\""); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=\"" + attrib + "\""); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
7,315
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=\"" + attrib+"\""); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=\"" + attrib + "\""); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=\"" + attrib + "\""); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=\"" + attrib + "\""); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + Specification.getInstance().getPrettyXDFOutputIndentation(); if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=\"" + attrib+"\""); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=\"" + attrib + "\""); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=\"" + attrib + "\""); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=\"" + attrib + "\""); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
7,316
public int getItemCount() { // returns the number of items on // the menu, including separators. return getComponents().length; }
public int getItemCount() { // returns the number of items on // the menu, including separators. return getMenuComponentCount(); }
7,317
public String getUIClassID() { return uiClassID; }
public String getUIClassID() { return "MenuUI"; }
7,318
public boolean isTopLevelMenu() { if (getParent() instanceof JMenuBar) return true; else return false; }
public boolean isTopLevelMenu() { if (getParent() instanceof JMenuBar) return true; else return false; }
7,319
protected String paramString() { return "JMenu"; }
protected String paramString() { return super.paramString(); }
7,320
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) menuBar.repaint(); if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY)) menuBar.repaint(); }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("borderPainted")) menuBar.repaint(); if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY)) menuBar.repaint(); }
7,321
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) menuBar.repaint(); if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY)) menuBar.repaint(); }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) menuBar.repaint(); if (e.getPropertyName().equals("margin")) menuBar.repaint(); }
7,322
public void writePUSH(int jvmType, X86Register.GPR reg) { final Item item = ifac.createReg(ec, jvmType, reg); if (Vm.VerifyAssertions) Vm._assert(pool.request(reg, item), "request"); push(item); }
public void writePUSH(int jvmType, X86Register.GPR reg) { final Item item = ifac.createReg(ec, jvmType, reg); if (Vm.VerifyAssertions) Vm._assert(ok, "request"); push(item); }
7,323
public void writePUSH64(int jvmType, X86Register.GPR lsbReg, X86Register.GPR msbReg) { final Item item = ifac.createReg(ec, jvmType, lsbReg, msbReg); if (Vm.VerifyAssertions) { Vm._assert(pool.request(lsbReg, item), "request-lsb"); Vm._assert(pool.request(msbReg, item), "request-msb"); } push(item); }
public void writePUSH64(int jvmType, X86Register.GPR lsbReg, X86Register.GPR msbReg) { final Item item = ifac.createReg(ec, jvmType, lsbReg, msbReg); if (Vm.VerifyAssertions) { Vm._assert(pool.request(lsbReg, item), "request-lsb"); Vm._assert(pool.request(msbReg, item), "request-msb"); } push(item); }
7,324
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel) c; Insets insets = lab.getInsets(); FontMetrics fm = lab.getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height, ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel) c; Insets insets = lab.getInsets(); FontMetrics fm = lab.getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height, ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
7,325
protected void installKeyboardActions(JLabel l) throws NotImplementedException { //FIXME: implement. }
protected void installKeyboardActions(JLabel l) { //FIXME: implement. }
7,326
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; FontMetrics fm = g.getFontMetrics(); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); Object htmlRenderer = b.getClientProperty(BasicHTML.propertyKey); if (htmlRenderer == null) { if (text != null && !text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } } else { ((View) htmlRenderer).paint(g, tr); } }
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; FontMetrics fm = g.getFontMetrics(); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); Object htmlRenderer = b.getClientProperty(BasicHTML.propertyKey); if (htmlRenderer == null) { if (text != null && !text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } } else { ((View) htmlRenderer).paint(g, tr); } }
7,328
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; FontMetrics fm = g.getFontMetrics(); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); Object htmlRenderer = b.getClientProperty(BasicHTML.propertyKey); if (htmlRenderer == null) { if (text != null && !text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } } else { ((View) htmlRenderer).paint(g, tr); } }
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; FontMetrics fm = g.getFontMetrics(); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); Object htmlRenderer = b.getClientProperty(BasicHTML.propertyKey); if (htmlRenderer == null) { if (text != null && !text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } } else { ((View) htmlRenderer).paint(g, tr); } }
7,329
protected void uninstallKeyboardActions(JLabel l) throws NotImplementedException { //FIXME: implement. }
protected void uninstallKeyboardActions(JLabel l) { //FIXME: implement. }
7,331
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,333
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,334
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,335
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else if (evt.getModifiers() == 0) { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if (evt.getModifiers() == 0) if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else if (evt.getModifiers() == 0) { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if (evt.getModifiers() == 0) if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if (evt.getModifiers() == 0) if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == 0) if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == 0) if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == 0) if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == 0) if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else if (evt.getModifiers() == 0) { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else if (evt.getModifiers() == 0) colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else if (evt.getModifiers() == 0) { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else if (evt.getModifiers() == 0) { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else if (evt.getModifiers() == 0) { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else if (evt.getModifiers() == 0) { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if (evt.getModifiers() == 0) if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == 0) if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,336
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.getModifiers() == (InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK)) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.getModifiers() == (InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK)) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,337
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == InputEvent.CTRL_MASK) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.getModifiers() == InputEvent.CTRL_MASK) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,338
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,339
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,341
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,343
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,344
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,345
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
7,346
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
public void keyPressed(KeyEvent evt) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { table.clearSelection(); rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } } else if ((evt.getKeyCode() == KeyEvent.VK_LEFT) || (evt.getKeyCode() == KeyEvent.VK_KP_LEFT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } } else if ((evt.getKeyCode() == KeyEvent.VK_RIGHT) || (evt.getKeyCode() == KeyEvent.VK_KP_RIGHT)) { if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } } else if (evt.getKeyCode() == KeyEvent.VK_END) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } } else if (evt.getKeyCode() == KeyEvent.VK_HOME) { if (evt.isControlDown() && evt.isShiftDown()) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (evt.isControlDown()) { table.clearSelection(); rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { // FIXME: Implement "start editing" } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { // FIXME: Implement select next column // NOTE: TAB doesn't get recognized by this KeyHandler // something must be intercepting it and using it to change // focus } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // If there is just one cell selected, select the next row, and wrap // when you get to the edges of the table. if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } // Otherwise select the next row and wrap when you get to the edges // of the selection. So you only move the lead indices around // amongst the already selected cells. // If the row lead index is at the end of the selection, wrap it around int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; if (rowLead == rowMaxSelected) { rowModel.addSelectionInterval(rowMinSelected, rowMinSelected); // And select the next column (from within the selection) if (colLead == colMaxSelected) colModel.addSelectionInterval(colMinSelected, colMinSelected); else { int[] colsSelected; if (table.getColumnSelectionAllowed()) colsSelected = table.getSelectedColumns(); else { colsSelected = new int[table.getModel().getColumnCount()]; for (int i = 0; i < table.getModel().getColumnCount(); i++) colsSelected[i] = i; } int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } // If the row lead index isn't at the end, just advance it // and you don't have to update the column index else { int[] rowsSelected; if (table.getRowSelectionAllowed()) rowsSelected = table.getSelectedRows(); else { rowsSelected = new int[table.getModel().getRowCount()]; for (int i = 0; i < table.getModel().getRowCount(); i++) rowsSelected[i] = i; } int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } table.repaint(); } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { // FIXME: implement "cancel" } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && (evt.getModifiers() == InputEvent.CTRL_MASK)) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); // the next two lines are to restore the lead selection indices to // their previous values, because select-all operations shouldn't // change them rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && (evt.getModifiers() == InputEvent.CTRL_MASK)) { table.clearSelection(); } }
7,347
public static void createChildren(DefaultMutableTreeNode parent, Object children) { if (children instanceof Hashtable) { Hashtable tab = (Hashtable) children; Enumeration e = tab.keys(); while (e.hasMoreElements()) { Object key = e.nextElement(); Object val = tab.get(key); parent.add(new DynamicUtilTreeNode(key, val)); } } else if (children instanceof Vector) { Iterator i = ((Vector)children).iterator(); while (i.hasNext()) { Object n = i.next(); parent.add(new DynamicUtilTreeNode(n,n)); } } else if (children.getClass().isArray()) { Object[] arr = (Object[]) children; for (int i = 0; i < arr.length; ++i) parent.add(new DynamicUtilTreeNode(arr[i], arr[i])); } }
public static void createChildren(DefaultMutableTreeNode parent, Object children) { if (children instanceof Hashtable) { Hashtable tab = (Hashtable) children; Enumeration e = tab.keys(); while (e.hasMoreElements()) { Object key = e.nextElement(); Object val = tab.get(key); parent.add(new DynamicUtilTreeNode(key, val)); } } else if (children instanceof Vector) { Iterator i = ((Vector)children).iterator(); while (i.hasNext()) { Object n = i.next(); parent.add(new DynamicUtilTreeNode(n,n)); } } else if (children.getClass().isArray()) { Object[] arr = (Object[]) children; for (int i = 0; i < arr.length; ++i) parent.add(new DynamicUtilTreeNode(arr[i], arr[i])); } }
7,349
public boolean isRowSelected(int row) { return selectionModel.isRowSelected(row); }
public boolean isRowSelected(int row) { return selectionModel.isPathSelected(getPathForRow(row)); }
7,352
protected void setExpandedState(TreePath path, boolean state) { if (path == null) return; TreePath parent = path.getParentPath(); try { while (parent != null) checkExpandParents(parent); } catch (ExpandVetoException e) { // Expansion vetoed. return; } doExpandParents(path, state); }
protected void setExpandedState(TreePath path, boolean state) { if (path == null) return; TreePath parent = path.getParentPath(); try { if (parent != null) checkExpandParents(parent); } catch (ExpandVetoException e) { // Expansion vetoed. return; } doExpandParents(path, state); }
7,353
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x);// char ac = vt.getASCIIChar(x); char ac = vt.ebcdic2uni(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; // if me is null then we are running as an applet and we need to create // a frame to pass JFrame parent = null; if (me == null) parent = new JFrame(); else parent = me.getParentView((Session)this); result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x);// char ac = vt.getASCIIChar(x); char ac = vt.ebcdic2uni(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; // if me is null then we are running as an applet and we need to create // a frame to pass JFrame parent = null; if (me == null) parent = new JFrame(); else parent = me.getParentView((Session)this); result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; if (((String)hm.getSelectedValue()).length() > 7) k += ((String)hm.getSelectedValue()).charAt(9); else k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
7,355
protected int getDefaultPort() { return 80; }
protected int getDefaultPort() { return HTTPConnection.HTTP_PORT; }
7,357
protected URLConnection openConnection (URL url) throws IOException { return new Connection (url); }
public URLConnection openConnection(URL url) throws IOException { return new Connection (url); }
7,358
protected URLConnection openConnection (URL url) throws IOException { return new Connection (url); }
protected URLConnection openConnection (URL url) throws IOException { return new HTTPURLConnection(url); }
7,359
public void addSessionView(String tabText,Session sessionView) { final Session session = sessionView; if (hideTabBar && sessionPane.getTabCount() == 0 && !embedded) { this.getContentPane().add(session, BorderLayout.CENTER); session.addSessionListener(this); session.resizeMe(); repaint(); if (packFrame) pack(); else validate(); embedded = true; session.grabFocus(); setTitle(); } else { if (hideTabBar && sessionPane.getTabCount() == 0 ) { Session ses = null; for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { ses = (Session)(this.getContentPane().getComponent(x)); this.getContentPane().remove(x); break; } } //ses = (Session)(this.getContentPane().getComponent(0)); sessionPane.addTab(tabText,focused,ses); final Session finalSession = ses; SwingUtilities.invokeLater(new Runnable() { public void run() { finalSession.resizeMe(); finalSession.repaint(); } }); if (ses.getAllocDeviceName() != null) sessionPane.setTitleAt(0,ses.getAllocDeviceName()); else sessionPane.setTitleAt(0,ses.getSessionName()); ses.addSessionListener(this); ses.addSessionJumpListener(this); this.getContentPane().add(sessionPane, BorderLayout.CENTER); SwingUtilities.invokeLater(new Runnable() { public void run() { repaint(); finalSession.grabFocus(); } }); } sessionPane.addTab(tabText,focused,session); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.black); sessionPane.setIconAt(sessionPane.getSelectedIndex(),unfocused); sessionPane.setSelectedIndex(sessionPane.getTabCount()-1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); session.addSessionListener(this); session.addSessionJumpListener(this); SwingUtilities.invokeLater(new Runnable() { public void run() { session.resizeMe(); session.repaint(); session.grabFocus(); } }); } }
public void addSessionView(String tabText,Session sessionView) { final Session session = sessionView; if (hideTabBar && sessionPane.getTabCount() == 0 && !embedded) { this.getContentPane().add(session, BorderLayout.CENTER); session.addSessionListener(this); session.resizeMe(); repaint(); if (packFrame) pack(); else validate(); embedded = true; session.grabFocus(); setSessionTitle(); } else { if (hideTabBar && sessionPane.getTabCount() == 0 ) { Session ses = null; for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { ses = (Session)(this.getContentPane().getComponent(x)); this.getContentPane().remove(x); break; } } //ses = (Session)(this.getContentPane().getComponent(0)); sessionPane.addTab(tabText,focused,ses); final Session finalSession = ses; SwingUtilities.invokeLater(new Runnable() { public void run() { finalSession.resizeMe(); finalSession.repaint(); } }); if (ses.getAllocDeviceName() != null) sessionPane.setTitleAt(0,ses.getAllocDeviceName()); else sessionPane.setTitleAt(0,ses.getSessionName()); ses.addSessionListener(this); ses.addSessionJumpListener(this); this.getContentPane().add(sessionPane, BorderLayout.CENTER); SwingUtilities.invokeLater(new Runnable() { public void run() { repaint(); finalSession.grabFocus(); } }); } sessionPane.addTab(tabText,focused,session); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.black); sessionPane.setIconAt(sessionPane.getSelectedIndex(),unfocused); sessionPane.setSelectedIndex(sessionPane.getTabCount()-1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); session.addSessionListener(this); session.addSessionJumpListener(this); SwingUtilities.invokeLater(new Runnable() { public void run() { session.resizeMe(); session.repaint(); session.grabFocus(); } }); } }
7,360
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); // update the frame sequences frameSeq = sequence++; sessionPane.setBorder(BorderFactory.createEtchedBorder()); sessionPane.setBounds(new Rectangle(78, 57, 5, 5)); sessionPane.setOpaque(true); sessionPane.setRequestFocusEnabled(false); sessionPane.setDoubleBuffered(false); sessionPane.addChangeListener(this); Properties props = GlobalConfigure.getInstance(). getProperties(GlobalConfigure.SESSIONS); if (props.getProperty("emul.hideTabBar","no").equals("yes")) hideTabBar = true; if (!hideTabBar) { this.getContentPane().add(sessionPane, BorderLayout.CENTER); } setTitle(); if (packFrame) pack(); else validate(); }
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); // update the frame sequences frameSeq = sequence++; sessionPane.setBorder(BorderFactory.createEtchedBorder()); sessionPane.setBounds(new Rectangle(78, 57, 5, 5)); sessionPane.setOpaque(true); sessionPane.setRequestFocusEnabled(false); sessionPane.setDoubleBuffered(false); sessionPane.addChangeListener(this); Properties props = GlobalConfigure.getInstance(). getProperties(GlobalConfigure.SESSIONS); if (props.getProperty("emul.hideTabBar","no").equals("yes")) hideTabBar = true; if (!hideTabBar) { this.getContentPane().add(sessionPane, BorderLayout.CENTER); } if (count == 0) setSessionTitle(); if (packFrame) pack(); else validate(); }
7,361
private void nextSession() { final int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); SwingUtilities.invokeLater(new Runnable() { public void run() { int index1 = index; if (index1 < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setTitle(); } }); }
private void nextSession() { final int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); SwingUtilities.invokeLater(new Runnable() { public void run() { int index1 = index; if (index1 < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setSessionTitle(); } }); }
7,362
public void run() { int index1 = index; if (index1 < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setTitle(); }
public void run() { int index1 = index; if (index1 < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setSessionTitle(); }
7,363
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = sessionPane.indexOfComponent(ses); if (index >= 0) { Runnable tc = new Runnable () { public void run() { sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } setTitle(); } break; } }
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = sessionPane.indexOfComponent(ses); if (index >= 0) { Runnable tc = new Runnable () { public void run() { sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } setSessionTitle(); } break; } }
7,364
private void prevSession() { final int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); SwingUtilities.invokeLater(new Runnable() { public void run() { int index1 = index; if (index1 == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setTitle(); } }); }
private void prevSession() { final int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); SwingUtilities.invokeLater(new Runnable() { public void run() { int index1 = index; if (index1 == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setSessionTitle(); } }); }
7,365
public void run() { int index1 = index; if (index1 == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setTitle(); }
public void run() { int index1 = index; if (index1 == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index1); sessionPane.setForegroundAt(index1,Color.blue); sessionPane.setIconAt(index1,focused); } ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus(); setSessionTitle(); }
7,366
public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); p.setForegroundAt(selectedIndex,Color.black); p.setIconAt(selectedIndex,unfocused); Session sg = (Session)p.getComponentAt(selectedIndex); sg.setVisible(false); sg = (Session)p.getSelectedComponent(); if (sg == null) return; sg.setVisible(true); sg.grabFocus(); selectedIndex = p.getSelectedIndex(); p.setForegroundAt(selectedIndex,Color.blue); p.setIconAt(selectedIndex,focused); setTitle(); }
public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); p.setForegroundAt(selectedIndex,Color.black); p.setIconAt(selectedIndex,unfocused); Session sg = (Session)p.getComponentAt(selectedIndex); sg.setVisible(false); sg = (Session)p.getSelectedComponent(); if (sg == null) return; sg.setVisible(true); sg.grabFocus(); selectedIndex = p.getSelectedIndex(); p.setForegroundAt(selectedIndex,Color.blue); p.setIconAt(selectedIndex,focused); setSessionTitle(); }
7,367
public void setInverted(boolean inverted) { if (isInverted != inverted) { boolean oldInverted = isInverted; isInverted = inverted; firePropertyChange(INVERTED_CHANGED_PROPERTY, oldInverted, isInverted); } }
public void setInverted(boolean inverted) { if (isInverted != inverted) { boolean oldInverted = isInverted; isInverted = inverted; firePropertyChange("inverted", oldInverted, isInverted); } }
7,368
public void setLabelTable(Dictionary table) { if (table != labelTable) { Dictionary oldTable = labelTable; labelTable = table; firePropertyChange(LABEL_TABLE_CHANGED_PROPERTY, oldTable, labelTable); } }
public void setLabelTable(Dictionary table) { if (table != labelTable) { Dictionary oldTable = labelTable; labelTable = table; firePropertyChange("labelTable", oldTable, labelTable); } }
7,369
public void setMajorTickSpacing(int spacing) { if (majorTickSpacing != spacing) { int oldSpacing = majorTickSpacing; majorTickSpacing = spacing; firePropertyChange(MAJOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing, majorTickSpacing); } }
public void setMajorTickSpacing(int spacing) { if (majorTickSpacing != spacing) { int oldSpacing = majorTickSpacing; majorTickSpacing = spacing; firePropertyChange("majorTickSpacing", oldSpacing, majorTickSpacing); } }
7,370
public void setMinorTickSpacing(int spacing) { if (minorTickSpacing != spacing) { int oldSpacing = minorTickSpacing; minorTickSpacing = spacing; firePropertyChange(MINOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing, minorTickSpacing); } }
public void setMinorTickSpacing(int spacing) { if (minorTickSpacing != spacing) { int oldSpacing = minorTickSpacing; minorTickSpacing = spacing; firePropertyChange("minorTickSpacing", oldSpacing, minorTickSpacing); } }
7,371
public void setModel(BoundedRangeModel model) { // I didn't do the null pointer check on purpose. // If you try it with Sun's, it'll go ahead and set it to null // and bork the next time it tries to access the model. if (model != sliderModel) { BoundedRangeModel oldModel = sliderModel; sliderModel = model; oldModel.removeChangeListener(changeListener); sliderModel.addChangeListener(changeListener); firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, sliderModel); } }
public void setModel(BoundedRangeModel model) { // I didn't do the null pointer check on purpose. // If you try it with Sun's, it'll go ahead and set it to null // and bork the next time it tries to access the model. if (model != sliderModel) { BoundedRangeModel oldModel = sliderModel; sliderModel = model; oldModel.removeChangeListener(changeListener); sliderModel.addChangeListener(changeListener); firePropertyChange("model", oldModel, sliderModel); } }
7,372
public void setOrientation(int orientation) { if (orientation != VERTICAL && orientation != HORIZONTAL) throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, this.orientation); } }
public void setOrientation(int orientation) { if (orientation != VERTICAL && orientation != HORIZONTAL) throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange("orientation", oldOrientation, this.orientation); } }
7,373
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { boolean oldPaintLabels = paintLabels; paintLabels = paint; firePropertyChange(PAINT_LABELS_CHANGED_PROPERTY, oldPaintLabels, paintLabels); } }
public void setPaintLabels(boolean paint) { if (paint != paintLabels) { boolean oldPaintLabels = paintLabels; paintLabels = paint; firePropertyChange(PAINT_LABELS_CHANGED_PROPERTY, oldPaintLabels, paintLabels); } }
7,374
public void setPaintTicks(boolean paint) { if (paint != paintTicks) { boolean oldPaintTicks = paintTicks; paintTicks = paint; firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks, paintTicks); } }
public void setPaintTicks(boolean paint) { if (paint != paintTicks) { boolean oldPaintTicks = paintTicks; paintTicks = paint; firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks, paintTicks); } }
7,375
public void addItem(MenuItem item) { item.addNotify(); jComponent.add(((SwingMenuItemPeer)item.getPeer()).jComponent); }
public void addItem(MenuItem item) { item.addNotify(); jComponent.add(((SwingBaseMenuItemPeer)item.getPeer()).jComponent); }
7,376
public SpringLayout.Constraints getConstraints(Component c) { Constraints constraints = (Constraints) constraintsMap.get(c); if (constraints == null) { Container parent = c.getParent(); constraints = new Constraints(); if (parent != null) { constraints.setX (Spring.constant(parent.getInsets().left)); constraints.setY (Spring.constant(parent.getInsets().top)); } else { constraints.setX (Spring.constant(0)); constraints.setY (Spring.constant(0)); } constraints.setWidth (Spring.constant(c.getMinimumSize().width, c.getPreferredSize().width, c.getMaximumSize().width)); constraints.setHeight (Spring.constant(c.getMinimumSize().height, c.getPreferredSize().height, c.getMaximumSize().height)); constraintsMap.put(c, constraints); } return constraints; }
public SpringLayout.Constraints getConstraints(Component c) { Constraints constraints = (Constraints) constraintsMap.get(c); if (constraints == null) { Container parent = c.getParent(); constraints = new Constraints(); if (parent != null) { constraints.setX (Spring.constant(parent.getInsets().left)); constraints.setY (Spring.constant(parent.getInsets().top)); } else { constraints.setX (Spring.constant(0)); constraints.setY (Spring.constant(0)); } constraints.setWidth (Spring.constant(c.getMinimumSize().width, c.getPreferredSize().width, c.getMaximumSize().width)); constraints.setHeight (Spring.constant(c.getMinimumSize().height, c.getPreferredSize().height, c.getMaximumSize().height)); constraintsMap.put(c, constraints); } return constraints; }
7,377
public SpringLayout.Constraints getConstraints(Component c) { Constraints constraints = (Constraints) constraintsMap.get(c); if (constraints == null) { Container parent = c.getParent(); constraints = new Constraints(); if (parent != null) { constraints.setX (Spring.constant(parent.getInsets().left)); constraints.setY (Spring.constant(parent.getInsets().top)); } else { constraints.setX (Spring.constant(0)); constraints.setY (Spring.constant(0)); } constraints.setWidth (Spring.constant(c.getMinimumSize().width, c.getPreferredSize().width, c.getMaximumSize().width)); constraints.setHeight (Spring.constant(c.getMinimumSize().height, c.getPreferredSize().height, c.getMaximumSize().height)); constraintsMap.put(c, constraints); } return constraints; }
public SpringLayout.Constraints getConstraints(Component c) { Constraints constraints = (Constraints) constraintsMap.get(c); if (constraints == null) { Container parent = c.getParent(); constraints = new Constraints(); if (parent != null) { constraints.setX (Spring.constant(parent.getInsets().left)); constraints.setY (Spring.constant(parent.getInsets().top)); else { constraints.setX (Spring.constant(0)); constraints.setY (Spring.constant(0)); constraints.setWidth (Spring.constant(c.getMinimumSize().width, c.getPreferredSize().width, c.getMaximumSize().width)); constraints.setHeight (Spring.constant(c.getMinimumSize().height, c.getPreferredSize().height, c.getMaximumSize().height)); constraintsMap.put(c, constraints); return constraints;
7,378
protected void initialize(ImageIcon iimage) { image = iimage.getImage(); // if no image, return if (image == null) { throw new IllegalArgumentException("Image specified is invalid."); }// System.out.println(" here in splash ");// MediaTracker tracker = new MediaTracker(this);// tracker.addImage(image,0);//// try {// tracker.waitForAll();// }// catch(Exception e) {// System.out.println(e.getMessage());// } // create dialog window f = new Frame(); dialog = new Window(f); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); dialog.setSize(s); dialog.add(this); dialog.validate(); dialog.pack(); // position splash screen Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - s.width)/2; if (x < 0) { x = 0; } int y = (screen.height - s.height)/2; if (y < 0) { y = 0; } dialog.setLocation(x, y);// try {// Thread.sleep(1000);// }// catch (InterruptedException i) {// System.out.println(" here " + i.getMessage() );//// } }
protected void initialize(ImageIcon iimage) { image = iimage.getImage(); // if no image, return if (image == null) { throw new IllegalArgumentException("Image specified is invalid."); }// System.out.println(" here in splash ");// MediaTracker tracker = new MediaTracker(this);// tracker.addImage(image,0);//// try {// tracker.waitForAll();// }// catch(Exception e) {// System.out.println(e.getMessage());// } // create dialog window f = new Frame(); dialog = new Window(f); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); dialog.setSize(s); dialog.add(this); dialog.validate(); dialog.pack(); // position splash screen Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - s.width)/2; if (x < 0) { x = 0; } int y = (screen.height - s.height)/2; if (y < 0) { y = 0; } dialog.setLocation(x, y);// try {// Thread.sleep(1000);// }// catch (InterruptedException i) {// System.out.println(" here " + i.getMessage() );//// } }
7,380
protected void initialize(ImageIcon iimage) { image = iimage.getImage(); // if no image, return if (image == null) { throw new IllegalArgumentException("Image specified is invalid."); }// System.out.println(" here in splash ");// MediaTracker tracker = new MediaTracker(this);// tracker.addImage(image,0);//// try {// tracker.waitForAll();// }// catch(Exception e) {// System.out.println(e.getMessage());// } // create dialog window f = new Frame(); dialog = new Window(f); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); dialog.setSize(s); dialog.add(this); dialog.validate(); dialog.pack(); // position splash screen Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - s.width)/2; if (x < 0) { x = 0; } int y = (screen.height - s.height)/2; if (y < 0) { y = 0; } dialog.setLocation(x, y);// try {// Thread.sleep(1000);// }// catch (InterruptedException i) {// System.out.println(" here " + i.getMessage() );//// } }
protected void initialize(ImageIcon iimage) { image = iimage.getImage(); // if no image, return if (image == null) { throw new IllegalArgumentException("Image specified is invalid."); }// System.out.println(" here in splash ");// MediaTracker tracker = new MediaTracker(this);// tracker.addImage(image,0);//// try {// tracker.waitForAll();// }// catch(Exception e) {// System.out.println(e.getMessage());// } // create dialog window f = new Frame(); dialog = new Window(f); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); dialog.setSize(s); dialog.add(this); dialog.validate(); dialog.pack(); // position splash screen Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - s.width)/2; if (x < 0) { x = 0; } int y = (screen.height - s.height)/2; if (y < 0) { y = 0; } dialog.setLocation(x, y);// try {// Thread.sleep(1000);// }// catch (InterruptedException i) {// System.out.println(" here " + i.getMessage() );//// } }
7,381
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
public synchronized void paint(Graphics g) { int inset = 5; int height = 14; Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
7,383
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
7,384
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.setColor(new Color(204,204,255)); offScreenBufferGraphics.draw3DRect(0,0,size.width - 1,size.height - 1,true); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
7,385
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
7,386
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
public synchronized void paint(Graphics g) { Dimension size = getSize();// System.out.println(" here in paint "); if(offScreenBuffer == null) { offScreenBuffer = createImage(size.width,size.height); offScreenBufferGraphics = offScreenBuffer.getGraphics(); } offScreenBufferGraphics.setColor(Color.black); offScreenBufferGraphics.drawRect(0,0,size.width - 1,size.height - 1); offScreenBufferGraphics.drawImage(image,1,1,this); offScreenBufferGraphics.draw3DRect(4,image.getHeight(this) - 16, image.getWidth(this) - 8,15,true); offScreenBufferGraphics.setColor(new Color(206,206,229)); offScreenBufferGraphics.fillRect(5,image.getHeight(this) - 15, ((image.getWidth(this) - 10) / steps) * progress,14); g.drawImage(offScreenBuffer,0,0,this);// System.out.println(" here after paint "); }
7,387
public SwingTextFieldPeer(TextField textField) { SwingToolkit.add(textField, this); SwingToolkit.copyAwtProperties(textField, this); setText(textField.getText()); setColumns(textField.getColumns()); setEditable(textField.isEditable()); }
public SwingTextFieldPeer(TextField textField) { SwingToolkit.add(textField, this); SwingToolkit.copyAwtProperties(textField, this); setText(textField.getText()); setColumns(textField.getColumns()); setEditable(textField.isEditable()); }
7,388
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(new Color(204, 204, 204)), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
7,389
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getMenuItemCheckIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
7,390
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(new Color(16, 16, 16)), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(new Color(16, 16, 16)), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(new Color(16, 16, 16)), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(new Color(16, 16, 16)), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(new Color(16, 16, 16)), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(new Color(16, 16, 16)), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(new Color(16, 16, 16)), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(new Color(16, 16, 16)), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(new Color(16, 16, 16)), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(new Color(16, 16, 16)), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(new Color(16, 16, 16)), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(new Color(16, 16, 16)), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(new Color(16, 16, 16)), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(new Color(16, 16, 16)), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(new Color(16, 16, 16)), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(new Color(16, 16, 16)), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(new Color(16, 16, 16)), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(new Color(16, 16, 16)), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(new Color(16, 16, 16)), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(new Color(16, 16, 16)), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(new Color(16, 16, 16)), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(new Color(16, 16, 16)), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(new Color(16, 16, 16)), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(new Color(16, 16, 16)), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(new Color(16, 16, 16)), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(new Color(16, 16, 16)), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(new Color(16, 16, 16)), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
7,391
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; 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); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(Color.BLACK), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(Color.BLACK), "Button.highlight", new ColorUIResource(Color.WHITE), "Button.light", new ColorUIResource(Color.LIGHT_GRAY), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(Color.GRAY), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); } }, "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getMenuItemCheckIcon(); } }, "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "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.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "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.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), "InternalFrame.borderHighlight", new ColorUIResource(Color.WHITE), "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY), "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // FIXME: Set a nice icon for InternalFrames here. "InternalFrame.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); } }, "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "List.focusCellHighlightBorder", new BorderUIResource. LineBorderUIResource(new ColorUIResource(Color.yellow)), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); } }, "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(11), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(new Color(128, 128, 128)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), // FIXME "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
7,392
public Object createValue(UIDefaults def) { return BasicIconFactory.getCheckBoxIcon(); }
public Object createValue(UIDefaults def) { return BasicIconFactory.getMenuItemCheckIcon(); }
7,393
public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; }
public Object createValue(UIDefaults table) { Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Color.WHITE, shadowOuter, shadowInner); Border border = new BorderUIResource.CompoundBorderUIResource(outer, inner); return border; }
7,394
public Object createValue(UIDefaults def) { return new IconUIResource(BasicIconFactory.createEmptyFrameIcon()); }
public Object createValue(UIDefaults def) { return BasicIconFactory.getMenuItemCheckIcon(); }
7,395
public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); }
public Object createValue(UIDefaults def) { return BasicIconFactory.getRadioButtonIcon(); }
7,396
public FSEntry addDirectory(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; Ext2Entry newEntry; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); newEntry = new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_DIR, fs, this.entry); //add "." Ext2Directory newDir = new Ext2Directory(newINode, fs, newEntry); Ext2DirectoryRecord drThis = new Ext2DirectoryRecord( fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, "." ); newDir.addDirectoryRecord( drThis ); newINode.setLinksCount( 2 ); //add ".." long parentINodeNr = ((Ext2Directory)entry.getDirectory()).getINode().getINodeNr(); Ext2DirectoryRecord drParent=new Ext2DirectoryRecord( fs, parentINodeNr, Ext2Constants.EXT2_FT_DIR, ".." ); newDir.addDirectoryRecord( drParent ); //increase the reference count for the parent directory INode parentINode = fs.getINode((int)parentINodeNr); //to be able to synchronize to the inode object requires that an inode cache is used and //it contains only one copy of any inode synchronized(parentINode) { parentINode.setLinksCount( parentINode.getLinksCount()+1 ); } //update the number of used directories in the block group int group = (int)( (newINode.getINodeNr()-1) / fs.getSuperblock().getINodesPerGroup()) ; fs.modifyUsedDirsCount(group, 1); //update both affected directory inodes iNode.update(); newINode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return newEntry; }
public synchronized FSEntry addDirectory(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; Ext2Entry newEntry; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); newEntry = new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_DIR, fs, this.entry); //add "." Ext2Directory newDir = new Ext2Directory(newINode, fs, newEntry); Ext2DirectoryRecord drThis = new Ext2DirectoryRecord( fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, "." ); newDir.addDirectoryRecord( drThis ); newINode.setLinksCount( 2 ); //add ".." long parentINodeNr = ((Ext2Directory)entry.getDirectory()).getINode().getINodeNr(); Ext2DirectoryRecord drParent=new Ext2DirectoryRecord( fs, parentINodeNr, Ext2Constants.EXT2_FT_DIR, ".." ); newDir.addDirectoryRecord( drParent ); //increase the reference count for the parent directory INode parentINode = fs.getINode((int)parentINodeNr); //to be able to synchronize to the inode object requires that an inode cache is used and //it contains only one copy of any inode synchronized(parentINode) { parentINode.setLinksCount( parentINode.getLinksCount()+1 ); } //update the number of used directories in the block group int group = (int)( (newINode.getINodeNr()-1) / fs.getSuperblock().getINodesPerGroup()) ; fs.modifyUsedDirsCount(group, 1); //update both affected directory inodes iNode.update(); newINode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return newEntry; }
7,397
public FSEntry addDirectory(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; Ext2Entry newEntry; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); newEntry = new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_DIR, fs, this.entry); //add "." Ext2Directory newDir = new Ext2Directory(newINode, fs, newEntry); Ext2DirectoryRecord drThis = new Ext2DirectoryRecord( fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, "." ); newDir.addDirectoryRecord( drThis ); newINode.setLinksCount( 2 ); //add ".." long parentINodeNr = ((Ext2Directory)entry.getDirectory()).getINode().getINodeNr(); Ext2DirectoryRecord drParent=new Ext2DirectoryRecord( fs, parentINodeNr, Ext2Constants.EXT2_FT_DIR, ".." ); newDir.addDirectoryRecord( drParent ); //increase the reference count for the parent directory INode parentINode = fs.getINode((int)parentINodeNr); //to be able to synchronize to the inode object requires that an inode cache is used and //it contains only one copy of any inode synchronized(parentINode) { parentINode.setLinksCount( parentINode.getLinksCount()+1 ); } //update the number of used directories in the block group int group = (int)( (newINode.getINodeNr()-1) / fs.getSuperblock().getINodesPerGroup()) ; fs.modifyUsedDirsCount(group, 1); //update both affected directory inodes iNode.update(); newINode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return newEntry; }
public FSEntry addDirectory(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; Ext2Entry newEntry; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFDIR, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); newEntry = new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_DIR, fs, this.entry); //add "." Ext2Directory newDir = new Ext2Directory(newINode, fs, newEntry); Ext2DirectoryRecord drThis = new Ext2DirectoryRecord( fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_DIR, "." ); newDir.addDirectoryRecord( drThis ); newINode.setLinksCount( 2 ); //add ".." long parentINodeNr = ((Ext2Directory)entry.getDirectory()).getINode().getINodeNr(); Ext2DirectoryRecord drParent=new Ext2DirectoryRecord( fs, parentINodeNr, Ext2Constants.EXT2_FT_DIR, ".." ); newDir.addDirectoryRecord( drParent ); //increase the reference count for the parent directory INode parentINode = fs.getINode((int)parentINodeNr); //to be able to synchronize to the inode object requires that an inode cache is used and //it contains only one copy of any inode synchronized(parentINode) { parentINode.setLinksCount( parentINode.getLinksCount()+1 ); } //update the number of used directories in the block group int group = (int)( (newINode.getINodeNr()-1) / fs.getSuperblock().getINodesPerGroup()) ; fs.modifyUsedDirsCount(group, 1); //update both affected directory inodes iNode.update(); newINode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return newEntry; }
7,398
private void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ Ext2File dir = new Ext2File(iNode); //read itself as a file //find the last directory record (if any) Ext2FSEntryIterator iterator = (Ext2FSEntryIterator)iterator(); Ext2DirectoryRecord rec=null; while(iterator.hasNext()) { rec = iterator.nextDirectoryRecord(); } if(rec!=null) { long lastPos = rec.getFileOffset(); long lastLen = rec.getRecLen(); //truncate the last record to its minimal size (cut the padding from the end) rec.truncateRecord(); //directoryRecords may not extend over block boundaries: // see if the new record fits in the same block after truncating the last record long remainingLength = fs.getBlockSize() - (lastPos%fs.getBlockSize()) - rec.getRecLen(); log.debug("LAST-1 record: begins at: "+lastPos+", length: "+lastLen); log.debug("LAST-1 truncated length: "+rec.getRecLen()); log.debug("Remaining length: "+remainingLength); if(remainingLength >= dr.getRecLen()) { //write back the last record truncated dir.write( lastPos, rec.getData(), rec.getOffset(), rec.getRecLen() ); //pad the end of the new record with zeroes dr.expandRecord(lastPos+rec.getRecLen(), lastPos+rec.getRecLen()+remainingLength); //append the new record at the end of the list dir.write( lastPos+rec.getRecLen(), dr.getData(), dr.getOffset(), dr.getRecLen() ); log.debug("addDirectoryRecord(): LAST record: begins at: "+ (rec.getFileOffset()+rec.getRecLen())+", length: "+dr.getRecLen()); } else { //the new record must go to the next block //(the previously last record (rec) stays padded to the end of the block, so we can // append after that) dr.expandRecord(lastPos+lastLen, lastPos+lastLen+fs.getBlockSize()); dir.write( lastPos+lastLen, dr.getData(), dr.getOffset(), dr.getRecLen() ); log.debug("addDirectoryRecord(): LAST record: begins at: "+(lastPos+lastLen)+", length: "+dr.getRecLen()); } } else { //rec==null, ie. this is the first record in the directory dr.expandRecord(0, fs.getBlockSize()); dir.write(0, dr.getData(), dr.getOffset(), dr.getRecLen()); log.debug("addDirectoryRecord(): LAST record: begins at: 0, length: "+dr.getRecLen()); } iNode.setMtime(System.currentTimeMillis()/1000); }
private synchronized void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ Ext2File dir = new Ext2File(iNode); //read itself as a file //find the last directory record (if any) Ext2FSEntryIterator iterator = (Ext2FSEntryIterator)iterator(); Ext2DirectoryRecord rec=null; while(iterator.hasNext()) { rec = iterator.nextDirectoryRecord(); } if(rec!=null) { long lastPos = rec.getFileOffset(); long lastLen = rec.getRecLen(); //truncate the last record to its minimal size (cut the padding from the end) rec.truncateRecord(); //directoryRecords may not extend over block boundaries: // see if the new record fits in the same block after truncating the last record long remainingLength = fs.getBlockSize() - (lastPos%fs.getBlockSize()) - rec.getRecLen(); log.debug("LAST-1 record: begins at: "+lastPos+", length: "+lastLen); log.debug("LAST-1 truncated length: "+rec.getRecLen()); log.debug("Remaining length: "+remainingLength); if(remainingLength >= dr.getRecLen()) { //write back the last record truncated dir.write( lastPos, rec.getData(), rec.getOffset(), rec.getRecLen() ); //pad the end of the new record with zeroes dr.expandRecord(lastPos+rec.getRecLen(), lastPos+rec.getRecLen()+remainingLength); //append the new record at the end of the list dir.write( lastPos+rec.getRecLen(), dr.getData(), dr.getOffset(), dr.getRecLen() ); log.debug("addDirectoryRecord(): LAST record: begins at: "+ (rec.getFileOffset()+rec.getRecLen())+", length: "+dr.getRecLen()); } else { //the new record must go to the next block //(the previously last record (rec) stays padded to the end of the block, so we can // append after that) dr.expandRecord(lastPos+lastLen, lastPos+lastLen+fs.getBlockSize()); dir.write( lastPos+lastLen, dr.getData(), dr.getOffset(), dr.getRecLen() ); log.debug("addDirectoryRecord(): LAST record: begins at: "+(lastPos+lastLen)+", length: "+dr.getRecLen()); } } else { //rec==null, ie. this is the first record in the directory dr.expandRecord(0, fs.getBlockSize()); dir.write(0, dr.getData(), dr.getOffset(), dr.getRecLen()); log.debug("addDirectoryRecord(): LAST record: begins at: 0, length: "+dr.getRecLen()); } iNode.setMtime(System.currentTimeMillis()/1000); }
7,399
public FSEntry addFile(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFREG, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_REG_FILE, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); // update the directory inode iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_REG_FILE, fs, this.entry); }
public synchronized FSEntry addFile(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRecord dr; try{ int rights = 0xFFFF & (Ext2Constants.EXT2_S_IRWXU | Ext2Constants.EXT2_S_IRWXG | Ext2Constants.EXT2_S_IRWXO); newINode = fs.createINode((int)iNode.getGroup(), Ext2Constants.EXT2_S_IFREG, rights, 0, 0); dr = new Ext2DirectoryRecord(fs, newINode.getINodeNr(), Ext2Constants.EXT2_FT_REG_FILE, name); addDirectoryRecord(dr); //TODO: add synchronization newINode.setLinksCount( newINode.getLinksCount()+1 ); // update the directory inode iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); } return new Ext2Entry(newINode, name, Ext2Constants.EXT2_FT_REG_FILE, fs, this.entry); }
7,400
public FSEntry getEntry(String name) throws IOException{ //parse the directory and search for the file FSEntryIterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = iterator.next(); if(entry.getName().equals(name)) return entry; } return null; }
public synchronized FSEntry getEntry(String name) throws IOException{ //parse the directory and search for the file FSEntryIterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = iterator.next(); if(entry.getName().equals(name)) return entry; } return null; }
7,401
protected Rectangle modelToView(int position, Shape a, Position.Bias bias) throws BadLocationException { return ((PlainView) view).modelToView(position, a, bias).getBounds(); }
public Shape modelToView(int position, Shape a, Position.Bias bias) throws BadLocationException { return ((PlainView) view).modelToView(position, a, bias).getBounds(); }
7,402
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); textComponent = null; uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); }
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); }
7,404
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: work out whether/how the icon changes with different component // states (and also different metal themes) Color savedColor = g.getColor(); g.setColor(Color.black); for (int i = 0; i < 5; i++) g.drawLine(x + i, y + i, x + 9 - i, y + i); g.setColor(savedColor); }
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: work out whether/how the icon changes with different component // states (and also different metal themes) Color savedColor = g.getColor(); if (c.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); for (int i = 0; i < 5; i++) g.drawLine(x + i, y + i, x + 9 - i, y + i); g.setColor(savedColor); }
7,406
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() while (in.hasRemaining ()) { char c = in.get (); if (c > Byte.MAX_VALUE) { in.position (in.position () - 1); return CoderResult.unmappableForLength (1); } if (!out.hasRemaining ()) { in.position (in.position () - 1); return CoderResult.OVERFLOW; } out.put ((byte) c); } return CoderResult.UNDERFLOW; }
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() while (in.hasRemaining ()) { char c = in.get (); if (c > 0x7f) { in.position (in.position () - 1); return CoderResult.unmappableForLength (1); } if (!out.hasRemaining ()) { in.position (in.position () - 1); return CoderResult.OVERFLOW; } out.put ((byte) c); } return CoderResult.UNDERFLOW; }
7,407