bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public View getRootView(JTextComponent t) { return rootView; }
|
public View getRootView(JTextComponent t) { return rootView; }
| 6,248
|
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); // Fetch the colors for enabled/disabled text components. background = defaults.getColor(prefix + ".background"); inactiveBackground = defaults.getColor(prefix + ".inactiveBackground"); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setDisabledTextColor (defaults.getColor(prefix + ".inactiveForeground")); }
|
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); // Fetch the colors for enabled/disabled text components. background = defaults.getColor(prefix + ".background"); inactiveBackground = defaults.getColor(prefix + ".inactiveBackground"); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setDisabledTextColor (defaults.getColor(prefix + ".inactiveForeground")); }
| 6,249
|
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
|
protected void installKeyboardActions() { // load any bindings for the older Keymap interface Keymap km = JTextComponent.getKeymap(getKeymapName()); if (km == null) km = createKeymap(); textComponent.setKeymap(km); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); }
| 6,250
|
public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); }
|
public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); }
| 6,251
|
public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); }
|
public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); }
| 6,252
|
public Rectangle modelToView(JTextComponent t, int pos) throws BadLocationException { return modelToView(t, pos, Position.Bias.Forward); }
|
public Rectangle modelToView(JTextComponent t, int pos) throws BadLocationException { return modelToView(t, pos, Position.Bias.Forward); }
| 6,253
|
public Rectangle modelToView(JTextComponent t, int pos) throws BadLocationException { return modelToView(t, pos, Position.Bias.Forward); }
|
public Rectangle modelToView(JTextComponent t, int pos) throws BadLocationException { return modelToView(t, pos, Position.Bias.Forward); }
| 6,254
|
public final void paint(Graphics g, JComponent c) { paintSafely(g); }
|
public final void paint(Graphics g, JComponent c) { paintSafely(g); }
| 6,255
|
protected void paintBackground(Graphics g) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); g.setColor(textComponent.getBackground()); g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); }
|
protected void paintBackground(Graphics g) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); g.setColor(textComponent.getBackground()); g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); }
| 6,256
|
public int viewToModel(JTextComponent t, Point pt) { return viewToModel(t, pt, null); }
|
public int viewToModel(JTextComponent t, Point pt) { return viewToModel(t, pt, null); }
| 6,257
|
public MetalLookAndFeel() { createDefaultTheme(); }
|
public MetalLookAndFeel() { }
| 6,258
|
protected void createDefaultTheme() { if (theme == null) setCurrentTheme(new OceanTheme()); }
|
protected void createDefaultTheme() { if (theme == null) setCurrentTheme(new OceanTheme()); }
| 6,259
|
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
|
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
| 6,262
|
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
|
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
| 6,263
|
Component findComponentForMouseEventAt(int x, int y) { synchronized (getTreeLock()) { if (!contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) { // Ignore invisible children... if (!component[i].isVisible()) continue; int x2 = x - component[i].x; int y2 = y - component[i].y; // We don't do the contains() check right away because // findComponentAt would redundantly do it first thing. if (component[i] instanceof Container) { Container k = (Container) component[i]; Component r = k.findComponentForMouseEventAt(x2, y2); if (r != null) return r; } else if (component[i].contains(x2, y2)) return component[i]; } //don't return transparent components with no MouseListeners if (this.getMouseListeners().length == 0) return null; return this; } }
|
Component findComponentForMouseEventAt(int x, int y) { synchronized (getTreeLock()) { if (!contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) { // Ignore invisible children... if (!component[i].isVisible()) continue; int x2 = x - component[i].x; int y2 = y - component[i].y; // We don't do the contains() check right away because // findComponentAt would redundantly do it first thing. if (component[i] instanceof Container) { Container k = (Container) component[i]; Component r = k.findComponentForMouseEventAt(x2, y2); if (r != null) return r; } else if (component[i].contains(x2, y2)) return component[i]; } //don't return transparent components with no MouseListeners if (getMouseListeners().length == 0 && getMouseMotionListeners().length == 0) return null; return this; } }
| 6,267
|
public float getAlignmentX() { return super.getAlignmentX(); }
|
public float getAlignmentX() { LayoutManager layout = getLayout(); float alignmentX = 0.0F; if (layout != null && layout instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layout; alignmentX = lm2.getLayoutAlignmentX(this); } else alignmentX = super.getAlignmentX(); return alignmentX; }
| 6,268
|
public float getAlignmentY() { return super.getAlignmentY(); }
|
public float getAlignmentY() { LayoutManager layout = getLayout(); float alignmentY = 0.0F; if (layout != null && layout instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layout; alignmentY = lm2.getLayoutAlignmentY(this); } else alignmentY = super.getAlignmentY(); return alignmentY; }
| 6,269
|
public void paintComponents(Graphics g) { super.paint(g); visitChildren(g, GfxPaintAllVisitor.INSTANCE, true); }
|
public void paintComponents(Graphics g) { paint(g); visitChildren(g, GfxPaintAllVisitor.INSTANCE, true); }
| 6,270
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; }
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; }
| 6,272
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; }
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; }
| 6,273
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; }
|
ComponentacquireComponentForMouseEvent(MouseEventme){intx=me.getX();inty=me.getY();ComponentmouseEventTarget=null;//Findthecandidatewhichshouldreceivethisevent.Componentparent=nativeContainer;Componentcandidate=null;Pointp=me.getPoint();while(candidate==null&&parent!=null){candidate=getDeepestComponentForMouseEventAt(parent,p.x,p.y);if(candidate==null||(candidate.eventMask&me.getID())==0){candidate=null;p=AWTUtilities.convertPoint(parent,p.x,p.y,parent.parent);parent=parent.parent;}}//Iftheonlycandidatewefoundwasthenativecontaineritself,//don'tdispatchanyeventatall.Weonlycareaboutthelightweight//childrenhere.if(candidate==nativeContainer)candidate=null;//Ifourcandidateisnew,informtheoldtargetwe'releaving.if(lastComponentEntered!=null&&lastComponentEntered.isShowing()&&lastComponentEntered!=candidate){//Oldcandidatecouldhavebeenremovedfrom//thenativeContainersowecheckfirst.if(AWTUtilities.isDescendingFrom(lastComponentEntered,nativeContainer)){Pointtp=AWTUtilities.convertPoint(nativeContainer,x,y,lastComponentEntered);MouseEventexited=newMouseEvent(lastComponentEntered,MouseEvent.MOUSE_EXITED,me.getWhen(),me.getModifiersEx(),tp.x,tp.y,me.getClickCount(),me.isPopupTrigger(),me.getButton());lastComponentEntered.dispatchEvent(exited);}lastComponentEntered=null;}//Ifwehaveacandidate,maybeenterit.if(candidate!=null){mouseEventTarget=candidate;if(candidate.isLightweight()&&candidate.isShowing()&&candidate!=nativeContainer&&candidate!=lastComponentEntered) { lastComponentEntered=mouseEventTarget;Pointcp=AWTUtilities.convertPoint(nativeContainer,x,y,lastComponentEntered);MouseEvententered=newMouseEvent(lastComponentEntered,MouseEvent.MOUSE_ENTERED,me.getWhen(),me.getModifiersEx(),cp.x,cp.y,me.getClickCount(),me.isPopupTrigger(),me.getButton());lastComponentEntered.dispatchEvent(entered);}}//Checkwhichbuttonswherepressedexceptthelastbuttonthat//changedstate.intmodifiers=me.getModifiersEx()&(MouseEvent.BUTTON1_DOWN_MASK|MouseEvent.BUTTON2_DOWN_MASK|MouseEvent.BUTTON3_DOWN_MASK);switch(me.getButton()){caseMouseEvent.BUTTON1:modifiers&=~MouseEvent.BUTTON1_DOWN_MASK;break;caseMouseEvent.BUTTON2:modifiers&=~MouseEvent.BUTTON2_DOWN_MASK;break;caseMouseEvent.BUTTON3:modifiers&=~MouseEvent.BUTTON3_DOWN_MASK;break;}if(me.getID()==MouseEvent.MOUSE_RELEASED||me.getID()==MouseEvent.MOUSE_PRESSED&&modifiers>0||me.getID()==MouseEvent.MOUSE_DRAGGED){//Ifanyofthefollowingeventsoccurwhileabuttonishelddown,//theyshouldbedispatchedtothesamecomponenttowhichthe//originalMOUSE_PRESSEDeventwasdispatched://-MOUSE_RELEASED//-MOUSE_PRESSED:anotherbuttonpressedwhilethefirstisheld//down//-MOUSE_DRAGGEDif(AWTUtilities.isDescendingFrom(pressedComponent,nativeContainer))mouseEventTarget=pressedComponent;}elseif(me.getID()==MouseEvent.MOUSE_CLICKED){//Don'tdispatchCLICKEDeventswhosetargetisnotthesameasthe//targetfortheoriginalPRESSEDevent.if(candidate!=pressedComponent)mouseEventTarget=null;elseif(pressCount==0)pressedComponent=null;}returnmouseEventTarget;}
| 6,274
|
Component getDeepestComponentForMouseEventAt ( Component parent, int x, int y) { if (parent == null || (! parent.contains(x, y))) return null; if (! (parent instanceof Container)) return parent; Container c = (Container) parent; return c.findComponentForMouseEventAt(x, y); }
|
Component getDeepestComponentForMouseEventAt ( Component parent, int x, int y) { if (parent == null || (! parent.contains(x, y))) return null; if (! (parent instanceof Container)) return parent; Container c = (Container) parent; return c.findComponentForMouseEventAt(x, y); }
| 6,276
|
public void deliverEvent(Event e) { // XXX Add backward compatibility handling. }
|
public void deliverEvent (Event e) { // XXX Add backward compatibility handling. }
| 6,278
|
public void deliverEvent(Event e) { // XXX Add backward compatibility handling. }
|
postEvent (e); postEvent (e); publicpostEvent (e); voidpostEvent (e); deliverEvent(EventpostEvent (e); e)postEvent (e); postEvent (e); { //postEvent (e); XXXpostEvent (e); AddpostEvent (e); backwardpostEvent (e); compatibilitypostEvent (e); handling. }
| 6,279
|
Component findNextFocusComponent(Component child) { return null; }
|
Component findNextFocusComponent(Component child) { return null; }
| 6,280
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
|
public void list() { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
| 6,281
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
| 6,282
|
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); String key = (String) s.readObject(); while (key != null) { Object listener = s.readObject(); if ("componentL".equals(key)) addComponentListener((ComponentListener) listener); else if ("focusL".equals(key)) addFocusListener((FocusListener) listener); else if ("keyL".equals(key)) addKeyListener((KeyListener) listener); else if ("mouseL".equals(key)) addMouseListener((MouseListener) listener); else if ("mouseMotionL".equals(key)) addMouseMotionListener((MouseMotionListener) listener); else if ("inputMethodL".equals(key)) addInputMethodListener((InputMethodListener) listener); else if ("hierarchyL".equals(key)) addHierarchyListener((HierarchyListener) listener); else if ("hierarchyBoundsL".equals(key)) addHierarchyBoundsListener((HierarchyBoundsListener) listener); else if ("mouseWheelL".equals(key)) addMouseWheelListener((MouseWheelListener) listener); key = (String) s.readObject(); } }
|
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); String key = (String) s.readObject(); while (key != null) { Object listener = s.readObject(); if ("componentL".equals(key)) addComponentListener((ComponentListener) listener); else if ("focusL".equals(key)) addFocusListener((FocusListener) listener); else if ("keyL".equals(key)) addKeyListener((KeyListener) listener); else if ("mouseL".equals(key)) addMouseListener((MouseListener) listener); else if ("mouseMotionL".equals(key)) addMouseMotionListener((MouseMotionListener) listener); else if ("inputMethodL".equals(key)) addInputMethodListener((InputMethodListener) listener); else if ("hierarchyL".equals(key)) addHierarchyListener((HierarchyListener) listener); else if ("hierarchyBoundsL".equals(key)) addHierarchyBoundsListener((HierarchyBoundsListener) listener); else if ("mouseWheelL".equals(key)) addMouseWheelListener((MouseWheelListener) listener); key = (String) s.readObject(); } }
| 6,283
|
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); String key = (String) s.readObject(); while (key != null) { Object listener = s.readObject(); if ("componentL".equals(key)) addComponentListener((ComponentListener) listener); else if ("focusL".equals(key)) addFocusListener((FocusListener) listener); else if ("keyL".equals(key)) addKeyListener((KeyListener) listener); else if ("mouseL".equals(key)) addMouseListener((MouseListener) listener); else if ("mouseMotionL".equals(key)) addMouseMotionListener((MouseMotionListener) listener); else if ("inputMethodL".equals(key)) addInputMethodListener((InputMethodListener) listener); else if ("hierarchyL".equals(key)) addHierarchyListener((HierarchyListener) listener); else if ("hierarchyBoundsL".equals(key)) addHierarchyBoundsListener((HierarchyBoundsListener) listener); else if ("mouseWheelL".equals(key)) addMouseWheelListener((MouseWheelListener) listener); key = (String) s.readObject(); } }
|
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); String key = (String) s.readObject(); while (key != null) { Object listener = s.readObject(); if ("componentL".equals(key)) addComponentListener((ComponentListener) listener); else if ("focusL".equals(key)) addFocusListener((FocusListener) listener); else if ("keyL".equals(key)) addKeyListener((KeyListener) listener); else if ("mouseL".equals(key)) addMouseListener((MouseListener) listener); else if ("mouseMotionL".equals(key)) addMouseMotionListener((MouseMotionListener) listener); else if ("inputMethodL".equals(key)) addInputMethodListener((InputMethodListener) listener); else if ("hierarchyL".equals(key)) addHierarchyListener((HierarchyListener) listener); else if ("hierarchyBoundsL".equals(key)) addHierarchyBoundsListener((HierarchyBoundsListener) listener); else if ("mouseWheelL".equals(key)) addMouseWheelListener((MouseWheelListener) listener); key = (String) s.readObject(); } }
| 6,284
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
| 6,285
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
|
public boolean equals(Object obj){ if (obj == null) return false; if (! (obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
| 6,286
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font) obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
| 6,287
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
|
public boolean equals(Object obj){ if (obj == null) return false; if (!(obj instanceof Font)) return false; Font f = (Font)obj; return (f.getName().equals(this.getName()) && f.getFamily().equals(this.getFamily()) && f.getFontName().equals(this.getFontName()) && f.getTransform().equals(this.getTransform ()) && f.getSize() == this.getSize() && f.getStyle() == this.getStyle());}
| 6,288
|
private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); AWTEventMulticaster.save(s, "componentL", componentListener); AWTEventMulticaster.save(s, "focusL", focusListener); AWTEventMulticaster.save(s, "keyL", keyListener); AWTEventMulticaster.save(s, "mouseL", mouseListener); AWTEventMulticaster.save(s, "mouseMotionL", mouseMotionListener); AWTEventMulticaster.save(s, "inputMethodL", inputMethodListener); AWTEventMulticaster.save(s, "hierarchyL", hierarchyListener); AWTEventMulticaster.save(s, "hierarchyBoundsL", hierarchyBoundsListener); AWTEventMulticaster.save(s, "mouseWheelL", mouseWheelListener); s.writeObject(null); }
|
private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); AWTEventMulticaster.save(s, "componentL", componentListener); AWTEventMulticaster.save(s, "focusL", focusListener); AWTEventMulticaster.save(s, "keyL", keyListener); AWTEventMulticaster.save(s, "mouseL", mouseListener); AWTEventMulticaster.save(s, "mouseMotionL", mouseMotionListener); AWTEventMulticaster.save(s, "inputMethodL", inputMethodListener); AWTEventMulticaster.save(s, "hierarchyL", hierarchyListener); AWTEventMulticaster.save(s, "hierarchyBoundsL", hierarchyBoundsListener); AWTEventMulticaster.save(s, "mouseWheelL", mouseWheelListener); s.writeObject(null); }
| 6,289
|
public void read(InputStream in, Object desc) throws IOException { }
|
public void read(InputStream in, Object desc) throws IOException { }
| 6,290
|
private synchronized void doInitialize() { if (!isInitialized()) { if (!isInitializing()) { state |= VmTypeState.ST_INITIALIZING; /* * Screen.debug("initialize("); Screen.debug(name); */ final VmMethod initMethod = getInitializerMethod(); if (initMethod != null) { try { VmReflection.invokeStatic(initMethod); } catch (InvocationTargetException ex) { final Throwable targetEx = ex.getTargetException(); if (targetEx != null) { ex.getTargetException().printStackTrace(); //Unsafe.die("VmType.doInitialize"); throw new ExceptionInInitializerError(ex .getTargetException()); } else { throw new ExceptionInInitializerError( "targetEx == null"); } } } state |= VmTypeState.ST_INITIALIZED; } } }
|
private synchronized void doInitialize() { if (!isInitialized()) { if (!isInitializing()) { state |= VmTypeState.ST_INITIALIZING; /* * Screen.debug("initialize("); Screen.debug(name); */ final VmMethod initMethod = getInitializerMethod(); if (initMethod != null) { try { VmReflection.invokeStatic(initMethod); } catch (InvocationTargetException ex) { final Throwable targetEx = ex.getTargetException(); if (targetEx != null) { ex.getTargetException().printStackTrace(); //Unsafe.die("VmType.doInitialize"); throw new ExceptionInInitializerError(ex .getTargetException()); } else { throw new ExceptionInInitializerError( "targetEx == null"); } } } state |= VmTypeState.ST_INITIALIZED; } } }
| 6,295
|
public final void initialize() { if (!isInitialized()) { linkAndInitialize(); } }
|
public final void initialize() { if (!isInitialized() && !isInitializing()) { linkAndInitialize(); } }
| 6,296
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
| 6,297
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
| 6,298
|
public LinkageError(String s) { super(s); }
|
public LinkageError(String s) { super(s); }
| 6,299
|
public ExceptionInInitializerError(String s) { super(s); exception = null; }
|
public ExceptionInInitializerError(String s) { super(s); exception = null; }
| 6,300
|
public Object getAny(int index) { return get(index); }
|
public final Object getAny(int index) { return get(index); }
| 6,301
|
public float getLayoutAlignmentX(Container parent) { return(parent.getAlignmentX()); }
|
public float getLayoutAlignmentX(Container parent) { return 0.5F; }
| 6,302
|
public float getLayoutAlignmentY(Container parent) { return(parent.getAlignmentY()); }
|
public float getLayoutAlignmentY(Container parent) { return 0.5F; }
| 6,303
|
public GeneralNames(final byte[] encoded) throws IOException { names = new LinkedList(); DERReader der = new DERReader(encoded); DERValue nameList = der.read(); if (!nameList.isConstructed()) throw new IOException("malformed GeneralNames"); int len = 0; while (len < nameList.getLength()) { DERValue name = der.read(); List namePair = new ArrayList(2); if (name.getTagClass() != DER.APPLICATION) throw new IOException("malformed GeneralName"); namePair.add(new Integer(name.getTag())); DERValue val = null; switch (name.getTag()) { case RFC822_NAME: case DNS_NAME: case X400_ADDRESS: case URI: namePair.add(new String((byte[]) name.getValue())); break; case OTHER_NAME: case EDI_PARTY_NAME: namePair.add(name.getValue()); break; case DIRECTORY_NAME: byte[] b = name.getEncoded(); b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE); namePair.add(new X500DistinguishedName(b).toString()); break; case IP_ADDRESS: namePair.add(InetAddress.getByAddress((byte[]) name.getValue()) .getHostAddress()); break; case REGISTERED_ID: byte[] bb = name.getEncoded(); bb[0] = (byte) DER.OBJECT_IDENTIFIER; namePair.add(new OID(bb).toString()); break; default: throw new IOException("unknown tag " + name.getTag()); } names.add(namePair); len += name.getEncodedLength(); } }
|
public GeneralNames(final byte[] encoded) throws IOException { names = new LinkedList(); DERReader der = new DERReader(encoded); DERValue nameList = der.read(); if (!nameList.isConstructed()) throw new IOException("malformed GeneralNames"); int len = 0; while (len < nameList.getLength()) { DERValue name = der.read(); List namePair = new ArrayList(2); if (name.getTagClass() != DER.APPLICATION) throw new IOException("malformed GeneralName"); namePair.add(new Integer(name.getTag())); DERValue val = null; switch (name.getTag()) { case RFC822_NAME: case DNS_NAME: case X400_ADDRESS: case URI: namePair.add(new String((byte[]) name.getValue())); break; case OTHER_NAME: case EDI_PARTY_NAME: namePair.add(name.getValue()); break; case DIRECTORY_NAME: byte[] b = name.getEncoded(); b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE); namePair.add(new X500DistinguishedName(b).toString()); break; case IP_ADDRESS: namePair.add(InetAddress.getByAddress((byte[]) name.getValue()) .getHostAddress()); break; case REGISTERED_ID: byte[] bb = name.getEncoded(); bb[0] = (byte) DER.OBJECT_IDENTIFIER; namePair.add(new OID(bb).toString()); break; default: throw new IOException("unknown tag " + name.getTag()); } names.add(namePair); len += name.getEncodedLength(); } }
| 6,305
|
public GeneralNames(final byte[] encoded) throws IOException { names = new LinkedList(); DERReader der = new DERReader(encoded); DERValue nameList = der.read(); if (!nameList.isConstructed()) throw new IOException("malformed GeneralNames"); int len = 0; while (len < nameList.getLength()) { DERValue name = der.read(); List namePair = new ArrayList(2); if (name.getTagClass() != DER.APPLICATION) throw new IOException("malformed GeneralName"); namePair.add(new Integer(name.getTag())); DERValue val = null; switch (name.getTag()) { case RFC822_NAME: case DNS_NAME: case X400_ADDRESS: case URI: namePair.add(new String((byte[]) name.getValue())); break; case OTHER_NAME: case EDI_PARTY_NAME: namePair.add(name.getValue()); break; case DIRECTORY_NAME: byte[] b = name.getEncoded(); b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE); namePair.add(new X500DistinguishedName(b).toString()); break; case IP_ADDRESS: namePair.add(InetAddress.getByAddress((byte[]) name.getValue()) .getHostAddress()); break; case REGISTERED_ID: byte[] bb = name.getEncoded(); bb[0] = (byte) DER.OBJECT_IDENTIFIER; namePair.add(new OID(bb).toString()); break; default: throw new IOException("unknown tag " + name.getTag()); } names.add(namePair); len += name.getEncodedLength(); } }
|
public GeneralNames(final byte[] encoded) throws IOException { names = new LinkedList(); DERReader der = new DERReader(encoded); DERValue nameList = der.read(); if (!nameList.isConstructed()) throw new IOException("malformed GeneralNames"); int len = 0; while (len < nameList.getLength()) { DERValue name = der.read(); List namePair = new ArrayList(2); if (name.getTagClass() != DER.APPLICATION) throw new IOException("malformed GeneralName"); namePair.add(new Integer(name.getTag())); DERValue val = null; switch (name.getTag()) { case RFC822_NAME: case DNS_NAME: case X400_ADDRESS: case URI: namePair.add(new String((byte[]) name.getValue())); break; case OTHER_NAME: case EDI_PARTY_NAME: namePair.add(name.getValue()); break; case DIRECTORY_NAME: byte[] b = name.getEncoded(); b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE); DERReader r = new DERReader (b); r.read (); namePair.add(new X500Principal(r.read ().getEncoded ()).toString()); break; case IP_ADDRESS: namePair.add(InetAddress.getByAddress((byte[]) name.getValue()) .getHostAddress()); break; case REGISTERED_ID: byte[] bb = name.getEncoded(); bb[0] = (byte) DER.OBJECT_IDENTIFIER; namePair.add(new OID(bb).toString()); break; default: throw new IOException("unknown tag " + name.getTag()); } names.add(namePair); len += name.getEncodedLength(); } }
| 6,306
|
public X500DistinguishedName(byte[] encoded) throws IOException { this(new ByteArrayInputStream(encoded)); }
|
public X500DistinguishedName(String name) { this(new ByteArrayInputStream(encoded)); }
| 6,307
|
public X500DistinguishedName(byte[] encoded) throws IOException { this(new ByteArrayInputStream(encoded)); }
|
public X500DistinguishedName(byte[] encoded) throws IOException { if (name == null) throw new NullPointerException(); try { parseDN(name, true); } catch (Exception e) { parseDN(name, false); } }
| 6,308
|
private String getFixedLength(byte[] cByte,FileFieldDef f) { sb.setLength(0); switch (f.getFieldType()) { case 'P': case 'S': // rb.append(f.parseData(cByte).trim() + delimiter); sb.append(f.parseData(cByte)); while (sb.length() < f.getFieldLength()) sb.insert(0,' '); break; default: // rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter); sb.append(f.parseData(cByte)); while (sb.length() < f.getFieldLength()) sb.append(' '); break; } return sb.toString(); }
|
privateStringgetFixedLength(byte[]cByte,FileFieldDeff){sb.setLength(0);switch(f.getFieldType()){case'P':case'S'://rb.append(f.parseData(cByte).trim()+delimiter);sb.append(f.parseData(cByte));while(sb.length()<f.getFieldLength())sb.insert(0,'');break;default://rb.append(stringQualifier+f.parseData(cByte).trim()+stringQualifier+delimiter);sb.append(f.parseData(cByte));while(sb.length()<f.getFieldLength())sb.append('');break;}returnsb.toString();}
| 6,311
|
private String getFixedLength(byte[] cByte,FileFieldDef f) { sb.setLength(0); switch (f.getFieldType()) { case 'P': case 'S': // rb.append(f.parseData(cByte).trim() + delimiter); sb.append(f.parseData(cByte)); while (sb.length() < f.getFieldLength()) sb.insert(0,' '); break; default: // rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter); sb.append(f.parseData(cByte)); while (sb.length() < f.getFieldLength()) sb.append(' '); break; } return sb.toString(); }
|
privateStringgetFixedLength(byte[]cByte,FileFieldDeff){sb.setLength(0);switch(f.getFieldType()){case'P':case'S'://rb.append(f.parseData(cByte).trim()+delimiter);sb.append(f.parseData(cByte));while(sb.length()<f.getFieldLength())sb.insert(0,'');break;default://rb.append(stringQualifier+f.parseData(cByte).trim()+stringQualifier+delimiter);sb.append(f.parseData(cByte));while(sb.length()<f.getFieldLength())sb.append('');break;}returnsb.toString();}
| 6,312
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S':// rb.append(f.parseData(cByte).trim() + delimiter); rb.append(getFixedLength(cByte,f)); break; default:// rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);// rb.append(f.parseData(cByte)); rb.append(getFixedLength(cByte,f)); break; } } } rb.append ('\n'); fout.println(rb); }
|
publicvoidparseFields(byte[]cByte,ArrayListffd,StringBufferrb){FileFieldDeff;//writeoutthehtmlrecordinformationforeachfieldthatisselectedfor(intx=0;x<ffd.size();x++){f=(FileFieldDef)ffd.get(x);if(f.isWriteField()){switch(f.getFieldType()){case'P':case'S'://rb.append(f.parseData(cByte).trim()+delimiter);rb.append(getFixedLength(cByte,f));break;default://rb.append(stringQualifier+f.parseData(cByte).trim()+stringQualifier+delimiter);//rb.append(f.parseData(cByte));rb.append(getFixedLength(cByte,f));break;}}}rb.append('\n');fout.println(rb);}
| 6,313
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S':// rb.append(f.parseData(cByte).trim() + delimiter); rb.append(getFixedLength(cByte,f)); break; default:// rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);// rb.append(f.parseData(cByte)); rb.append(getFixedLength(cByte,f)); break; } } } rb.append ('\n'); fout.println(rb); }
|
publicvoidparseFields(byte[]cByte,ArrayListffd,StringBufferrb){FileFieldDeff;//writeoutthehtmlrecordinformationforeachfieldthatisselectedfor(intx=0;x<ffd.size();x++){f=(FileFieldDef)ffd.get(x);if(f.isWriteField()){switch(f.getFieldType()){case'P':case'S'://rb.append(f.parseData(cByte).trim()+delimiter);rb.append(getFixedLength(cByte,f));break;default://rb.append(stringQualifier+f.parseData(cByte).trim()+stringQualifier+delimiter);//rb.append(f.parseData(cByte));rb.append(getFixedLength(cByte,f));break;}}}rb.append('\n');fout.println(rb);}
| 6,314
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S':// rb.append(f.parseData(cByte).trim() + delimiter); rb.append(getFixedLength(cByte,f)); break; default:// rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);// rb.append(f.parseData(cByte)); rb.append(getFixedLength(cByte,f)); break; } } } rb.append ('\n'); fout.println(rb); }
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) {FileFieldDef f;// write out the html record information for each field that is selectedfor (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) {switch (f.getFieldType()) { case 'P': case 'S'://rb.append(f.parseData(cByte).trim() + delimiter);rb.append(getFixedLength(cByte,f));break; default://rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);//rb.append(f.parseData(cByte));rb.append(getFixedLength(cByte,f));break;} }}rb.append ('\n');fout.println(rb); }
| 6,315
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S':// rb.append(f.parseData(cByte).trim() + delimiter); rb.append(getFixedLength(cByte,f)); break; default:// rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);// rb.append(f.parseData(cByte)); rb.append(getFixedLength(cByte,f)); break; } } } rb.append ('\n'); fout.println(rb); }
|
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S':// rb.append(f.parseData(cByte).trim() + delimiter); rb.append(getFixedLength(cByte,f)); break; default:// rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter);// rb.append(f.parseData(cByte)); rb.append(getFixedLength(cByte,f)); break; } } } fout.println(rb); }
| 6,316
|
public void setCustomProperties() {// new DelimitedDialog(new JFrame()); }
|
publicvoidsetCustomProperties(){//newDelimitedDialog(newJFrame());}
| 6,317
|
public void writeHeader(String fileName, String host, ArrayList ffd, char decChar) { try { FileFieldDef f; StringBuffer sb = new StringBuffer(); // loop through each of the fields and write out the field name for // each selected field for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName()); } } fout.write (sb.toString().getBytes()); fout.write ('\n'); } catch (IOException ioe) {// printFTPInfo(" error writing header " + ioe.getMessage()); } }
|
public void writeHeader(String fileName, String host, ArrayList ffd, char decChar) { try { FileFieldDef f; StringBuffer sb = new StringBuffer(); // loop through each of the fields and write out the field name for // each selected field for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName()); } } fout.write (sb.toString().getBytes()); fout.write ('\n'); } catch (IOException ioe) {// printFTPInfo(" error writing header " + ioe.getMessage()); } }
| 6,318
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { JPanel modalInterceptor = new JPanel(); modalInterceptor.setOpaque(false); JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f); lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue()); modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight()); modalInterceptor.addMouseListener(new MouseAdapter(){}); modalInterceptor.addMouseMotionListener(new MouseMotionAdapter(){}); lp.add(modalInterceptor); f.toFront(); EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue(); try { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,319
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,320
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,321
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,322
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,323
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,324
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,325
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
|
private static void startModal(JInternalFrame f) { synchronized (f) { final JInternalFrame tmp = f; tmp.toFront(); f.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { synchronized (tmp) { tmp.removeInternalFrameListener(this); tmp.notifyAll(); } } }); try { while (! f.isClosed()) f.wait(); } catch (InterruptedException ignored) { // Ignore this Exception. } } }
| 6,326
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
| 6,327
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
| 6,328
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
| 6,329
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
|
public synchronized AWTEvent getNextEvent() throws InterruptedException { if (next != null) return next.getNextEvent(); while (next_in == next_out) wait(); AWTEvent res = queue[next_out]; if (++next_out == queue.length) next_out = 0; return res; }
| 6,330
|
public void dispatch();
|
public void dispatch();
| 6,331
|
public final void dispatchEvent(AWTEvent event){ // See comment in Component.dispatchEvent(). dispatchEventImpl(event);}
|
public final void dispatchEvent(AWTEvent event){ Event oldStyleEvent = Component.translateEvent(event); if (oldStyleEvent != null) { postEvent(oldStyleEvent); } // See comment in Component.dispatchEvent(). dispatchEventImpl(event);}
| 6,332
|
public final void dispatchEvent(AWTEvent event){ // See comment in Component.dispatchEvent(). dispatchEventImpl(event);}
|
public final void dispatchEvent(AWTEvent event){ // See comment in Component.dispatchEvent(). dispatchEventImpl(event);}
| 6,333
|
public void removeUpdate(DocumentEvent ev) { Dimension size = textComponent.getSize(); rootView.removeUpdate(ev, new Rectangle(0, 0, size.width, size.height), BasicTextUI.this); int caretPos = textComponent.getCaretPosition(); if (caretPos >= ev.getOffset()) textComponent.setCaretPosition(caretPos - ev.getLength()); }
|
public void removeUpdate(DocumentEvent ev) { Dimension size = textComponent.getSize(); rootView.removeUpdate(ev, new Rectangle(0, 0, size.width, size.height), BasicTextUI.this); int caretPos = textComponent.getCaretPosition(); if (caretPos >= ev.getOffset()) textComponent.setCaretPosition(ev.getOffset()); }
| 6,334
|
static String not_applicable(String Id) { try { throw new MARSHAL("The read/write are not applicable for " + Id); } catch (Exception e) { throw new MARSHAL(); } }
|
static String not_applicable(String Id) { try { throw new MARSHAL("The read/write are not applicable for " + Id); } catch (Exception e) { throw new MARSHAL(); } }
| 6,336
|
public Info(String name, Syntax[] syntaxes) { this.name = name; this.syntaxes = syntaxes; }
|
public Info(String name, Syntax[] syntaxes) { this.name = name; this.syntaxes = syntaxes; }
| 6,337
|
public String complete(CommandLine partial) throws CompletionException { //System.out.println("completing \"" + partial + "\""); for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].complete(partial.getRemainder()); } catch (CompletionException ex) { // this syntax is not fitting // following debug output is for testing the "intelligent" delegation mechanism // System.err.println("Syntax \"" + syntaxes[i].getDescription() + "\" threw " // + ex.toString()); } } System.out.println(); usage(); throw new CompletionException("Invalid command syntax"); }
|
public String complete(CommandLine partial) throws CompletionException { //System.out.println("completing \"" + partial + "\""); for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].complete(partial.getRemainder()); } catch (CompletionException ex) { // this syntax is not fitting // following debug output is for testing the "intelligent" delegation mechanism // System.err.println("Syntax \"" + syntaxes[i].getDescription() + "\" threw " // + ex.toString()); } } System.out.println(); usage(); throw new CompletionException("Invalid command syntax"); }
| 6,338
|
public String getName() { return name; }
|
public String getName() { return name; }
| 6,339
|
public Syntax[] getSyntaxes() { return syntaxes; }
|
public Syntax[] getSyntaxes() { return syntaxes; }
| 6,340
|
public void help() { Help.getHelp().help(this); }
|
public void help() { Help.getHelp().help(this); }
| 6,341
|
public ParsedArguments parse(String[] args) throws SyntaxError { for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].parse(args); } catch (SyntaxError ex) { // debug output to debug syntax finding mechanism //System.err.println(ex.toString()); //ex.printStackTrace(System.out); } } // no fitting Syntax found? trow an error throw new SyntaxError("No matching syntax found"); }
|
public ParsedArguments parse(String[] args) throws SyntaxError { for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].parse(args); } catch (SyntaxError ex) { // debug output to debug syntax finding mechanism //System.err.println(ex.toString()); //ex.printStackTrace(System.out); } } // no fitting Syntax found? trow an error throw new SyntaxError("No matching syntax found"); }
| 6,342
|
public ParsedArguments parse(String[] args) throws SyntaxError { for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].parse(args); } catch (SyntaxError ex) { // debug output to debug syntax finding mechanism //System.err.println(ex.toString()); //ex.printStackTrace(System.out); } } // no fitting Syntax found? trow an error throw new SyntaxError("No matching syntax found"); }
|
public ParsedArguments parse(String[] args) throws SyntaxError { for (int i = 0; i < syntaxes.length; i++) { try { return syntaxes[i].parse(args); } catch (SyntaxError ex) { // debug output to debug syntax finding mechanism //System.err.println(ex.toString()); //ex.printStackTrace(System.out); } } // no fitting Syntax found? trow an error throw new SyntaxError("No matching syntax found"); }
| 6,343
|
public void usage() { Help.getHelp().usage(this); }
|
public void usage() { Help.getHelp().usage(this); }
| 6,344
|
public static Help getHelp() throws HelpException { try { return (Help) InitialNaming.lookup(NAME); } catch (NamingException ex) { throw new HelpException("Help application not found"); } }
|
public static Help getHelp() throws HelpException { try { return (Help) InitialNaming.lookup(NAME); } catch (NamingException ex) { throw new HelpException("Help application not found"); } }
| 6,345
|
public static Info getInfo(Class clazz) throws HelpException { try { Field helpInfo = clazz.getField(INFO_FIELD_NAME); return (Help.Info) helpInfo.get(null); // static access } catch (NoSuchFieldException ex) { throw new HelpException("Command information not found"); } catch (IllegalAccessException ex) { throw new HelpException("Command information not accessible"); } }
|
public static Info getInfo(Class clazz) throws HelpException { try { Field helpInfo = clazz.getField(INFO_FIELD_NAME); return (Help.Info) helpInfo.get(null); // static access } catch (NoSuchFieldException ex) { throw new HelpException("Command information not found"); } catch (IllegalAccessException ex) { throw new HelpException("Command information not accessible"); } }
| 6,346
|
public void keyPressed(KeyEvent e) { int kc = e.getKeyCode(); if (kc == KeyEvent.VK_N) { newGame(); return; } if (kc == KeyEvent.VK_P) { flipPause(); return; } if (!up || pause) return; switch (e.getKeyCode()) { case KeyEvent.VK_UP: rot(1); break; case KeyEvent.VK_LEFT: trans(-1); break; case KeyEvent.VK_DOWN: rot(3); break; case KeyEvent.VK_RIGHT: trans(1); break; case KeyEvent.VK_SPACE: fall(); break; case KeyEvent.VK_N: newGame(); break; case KeyEvent.VK_P: flipPause(); break; default: return; } repaint(); }
|
public void keyPressed(KeyEvent e) { int kc = e.getKeyCode(); if (kc == KeyEvent.VK_N) { newGame(); return; } if (kc == KeyEvent.VK_P) { flipPause(); return; } if (!up || pause) return; switch (e.getKeyCode()) { case KeyEvent.VK_UP: rot(1); break; case KeyEvent.VK_LEFT: trans(-1); break; case KeyEvent.VK_DOWN: rot(3); break; case KeyEvent.VK_RIGHT: trans(1); break; case KeyEvent.VK_SPACE: fall(); break; case KeyEvent.VK_N: newGame(); break; case KeyEvent.VK_P: flipPause(); break; default: return; } repaint(); }
| 6,347
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,348
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,349
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,350
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,351
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,352
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
|
public void newGame() { if (thread != null) { up = false; if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = false; score = 0; si = si_rnd.nextInt(7); next_si = si_rnd.nextInt(7); bi = bi_rnd.nextInt(4); next_bi = bi_rnd.nextInt(4); x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0])); y = 0; thread = new Thread(new Runnable() { public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } } }); thread.start(); }
| 6,353
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
| 6,354
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
| 6,355
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
| 6,356
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
|
public void run() { try { up = true; long before, after, sleep; stop: while (up) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!up) break stop; } } if (hasRoom(bi, x, y + 1)) { y++; repaint(); } else { newBlock(); if (!hasRoom(bi, x, y)) { up = false; end = true; repaint(); } } after = System.currentTimeMillis(); sleep = delay - (after - before); sleep = sleep < 0 ? delay : sleep; try { Thread.sleep(sleep); } catch (InterruptedException ignore) { } } } catch (Throwable ex) { ex.printStackTrace(); } }
| 6,357
|
public void paint(Graphics g) { if (img == null) { img = createImage(DIM.width, DIM.height); } Graphics g2 = img.getGraphics(); g2.setColor(COLORS[0]); g2.fillRect(0, 0, DIM.width, DIM.height); for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { int ci = WORLD[i][j]; if (ci > 0) paintBox(g2, i, j, COLORS[ci]); } } { Color c = COLORS[COLORS.length - 1]; for (int i = 0; i < WIDTH_C + 2; i++) { paintBox(g2, i, HEIGHT_C + 6, c); } for (int j = 0; j < 4; j++) { paintBox(g2, 0, HEIGHT_C + 2 + j, c); paintBox(g2, 5, HEIGHT_C + 2 + j, c); // paintBox(g2, 6, HEIGHT_C + 2 +j, c ); paintBox(g2, WIDTH_C + 1, HEIGHT_C + 2 + j, c); } } if (up) { int[][] b = BLOCKS[si][bi]; for (int i = 0; i < b.length; i++) { paintBox(g2, x + b[i][0], y + b[i][1], COLORS[si + 1]); } { g2.setColor(Color.WHITE); g2.drawString("SCORE:", CELL + 2, (HEIGHT_C + 4) * CELL - 4); g2.drawString(String.valueOf(score), 2 * CELL, (HEIGHT_C + 5) * CELL - 4); b = BLOCKS[next_si][next_bi]; for (int i = 0; i < b.length; i++) { paintBox(g2, 7 + b[i][0], HEIGHT_C + 2 + b[i][1], COLORS[next_si + 1]); } } } else if (end) { g2.setColor(Color.BLACK); g2.fillRect(2 * CELL, 9 * CELL, 8 * CELL, 4 * CELL); g2.setColor(Color.WHITE); g2.drawRect(2 * CELL, 9 * CELL, 8 * CELL, 4 * CELL); g2.drawString("GAME OVER! SCORE: " + score, (WIDTH_C - 6) * CELL / 2 + 2, (HEIGHT_C + 2) * CELL / 2); } g2.dispose(); g.drawImage(img, 0, 0, this); }
|
public void paint(Graphics g) { if (img == null) { img = createImage(DIM.width, DIM.height); } Graphics g2 = img.getGraphics(); g2.setColor(COLORS[0]); g2.fillRect(0, 0, DIM.width, DIM.height); for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { int ci = WORLD[i][j]; if (ci > 0) paintBox(g2, i, j, COLORS[ci]); } } { Color c = COLORS[COLORS.length - 1]; for (int i = 0; i < WIDTH_C + 2; i++) { paintBox(g2, i, HEIGHT_C + 6, c); } for (int j = 0; j < 4; j++) { paintBox(g2, 0, HEIGHT_C + 2 + j, c); paintBox(g2, 5, HEIGHT_C + 2 + j, c); // paintBox(g2, 6, HEIGHT_C + 2 +j, c ); paintBox(g2, WIDTH_C + 1, HEIGHT_C + 2 + j, c); } } if (up) { int[][] b = BLOCKS[si][bi]; for (int i = 0; i < b.length; i++) { paintBox(g2, x + b[i][0], y + b[i][1], COLORS[si + 1]); } { g2.setColor(Color.WHITE); g2.drawString("SCORE:", CELL + 2, (HEIGHT_C + 4) * CELL - 4); g2.drawString(String.valueOf(score), 2 * CELL, (HEIGHT_C + 5) * CELL - 4); b = BLOCKS[next_si][next_bi]; for (int i = 0; i < b.length; i++) { paintBox(g2, 7 + b[i][0], HEIGHT_C + 2 + b[i][1], COLORS[next_si + 1]); } } } else if (end) { g2.setColor(Color.BLACK); g2.fillRect(2 * CELL, 9 * CELL, 8 * CELL, 4 * CELL); g2.setColor(Color.WHITE); g2.drawRect(2 * CELL, 9 * CELL, 8 * CELL, 4 * CELL); g2.drawString("GAME OVER! SCORE: " + score, (WIDTH_C - 6) * CELL / 2 + 2, (HEIGHT_C + 2) * CELL / 2); } g2.dispose(); g.drawImage(img, 0, 0, this); }
| 6,358
|
public SwingChoicePeer(SwingToolkit toolkit, Choice choice) { super(toolkit, choice, new JComboBox()); this.choice = choice; final JComboBox combo = (JComboBox)jComponent; combo.setModel(new DefaultComboBoxModel()); SwingToolkit.add(choice, combo); SwingToolkit.copyAwtProperties(choice, combo); final int cnt = choice.getItemCount(); for (int i = 0; i < cnt; i++) { addItem(choice.getItem(i), i); } }
|
public SwingChoicePeer(SwingToolkit toolkit, Choice choice) { super(toolkit, choice, new JComboBox()); this.choice = choice; final JComboBox combo = (JComboBox)jComponent; combo.setModel(new DefaultComboBoxModel()); SwingToolkit.add(choice, combo); SwingToolkit.copyAwtProperties(choice, combo); final int cnt = choice.getItemCount(); for (int i = 0; i < cnt; i++) { addItem(choice.getItem(i), i); } }
| 6,359
|
public void add(String item, int index) { model().insertElementAt(item, index); }
|
public void add(String item, int index) { model().insertElementAt(item, index); }
| 6,360
|
private DefaultComboBoxModel model() { return ((DefaultComboBoxModel)((JComboBox)jComponent).getModel()); }
|
private DefaultComboBoxModel model() { return ((DefaultComboBoxModel)((JComboBox)jComponent).getModel()); }
| 6,361
|
public void remove(int index) { model().removeElementAt(index); }
|
public void remove(int index) { model().removeElementAt(index); }
| 6,362
|
public void removeAll() { model().removeAllElements(); }
|
public void removeAll() { model().removeAllElements(); }
| 6,363
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.