metallookandfeel.java
来自「java jdk 1.4的源码」· Java 代码 · 共 1,404 行 · 第 1/5 页
JAVA
1,404 行
Object textFieldBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders", "getTextFieldBorder"); Object textBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders", "getTextBorder"); Object dialogBorder = new MetalLazyValue( "javax.swing.plaf.metal.MetalBorders$DialogBorder"); Object questionDialogBorder = new MetalLazyValue( "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder"); Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/, "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/ }); Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "UP", DefaultEditorKit.upAction, "KP_UP", DefaultEditorKit.upAction, "DOWN", DefaultEditorKit.downAction, "KP_DOWN", DefaultEditorKit.downAction, "PAGE_UP", DefaultEditorKit.pageUpAction, "PAGE_DOWN", DefaultEditorKit.pageDownAction, "shift PAGE_UP", "selection-page-up", "shift PAGE_DOWN", "selection-page-down", "ctrl shift PAGE_UP", "selection-page-left", "ctrl shift PAGE_DOWN", "selection-page-right", "shift UP", DefaultEditorKit.selectionUpAction, "shift KP_UP", DefaultEditorKit.selectionUpAction, "shift DOWN", DefaultEditorKit.selectionDownAction, "shift KP_DOWN", DefaultEditorKit.selectionDownAction, "ENTER", DefaultEditorKit.insertBreakAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "TAB", DefaultEditorKit.insertTabAction, "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/, "ctrl HOME", DefaultEditorKit.beginAction, "ctrl END", DefaultEditorKit.endAction, "ctrl shift HOME", DefaultEditorKit.selectionBeginAction, "ctrl shift END", DefaultEditorKit.selectionEndAction, "ctrl T", "next-link-action", "ctrl shift T", "previous-link-action", "ctrl SPACE", "activate-link-action", "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/ }); Object scrollPaneBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$ScrollPaneBorder"); Object buttonBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders", "getButtonBorder"); Object toggleButtonBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders", "getToggleButtonBorder"); Object titledBorderBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {table.getColor("controlShadow")}); Object desktopIconBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.metal.MetalBorders", "getDesktopIconBorder"); Object menuBarBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.metal.MetalBorders$MenuBarBorder"); Object popupMenuBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.metal.MetalBorders$PopupMenuBorder"); Object menuItemBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.metal.MetalBorders$MenuItemBorder"); Object menuItemAcceleratorDelimiter = new String("-"); Object toolBarBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalBorders$ToolBarBorder"); Object progressBarBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {getControlDarkShadow(), new Integer(1)}); Object toolTipBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {getPrimaryControlDarkShadow()}); Object toolTipBorderInactive = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {getControlDarkShadow()}); Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {getFocusColor()}); Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 6); Object tabbedPaneTabInsets = new InsetsUIResource(0, 9, 1, 9); Object sliderFocusInsets = new InsetsUIResource( 0, 0, 0, 0 ); final Object[] internalFrameIconArgs = new Object[1]; internalFrameIconArgs[0] = new Integer(16); Object[] defaultCueList = new Object[] { "OptionPane.errorSound", "OptionPane.informationSound", "OptionPane.questionSound", "OptionPane.warningSound" }; MetalTheme theme = getCurrentTheme(); Object menuTextValue = new FontActiveValue(theme, MetalTheme.MENU_TEXT_FONT); Object controlTextValue = new FontActiveValue(theme, MetalTheme.CONTROL_TEXT_FONT); Object userTextValue = new FontActiveValue(theme, MetalTheme.USER_TEXT_FONT); Object windowTitleValue = new FontActiveValue(theme, MetalTheme.WINDOW_TITLE_FONT); Object subTextValue = new FontActiveValue(theme, MetalTheme.SUB_TEXT_FONT); Object systemTextValue = new FontActiveValue(theme, MetalTheme.SYSTEM_TEXT_FONT); // // DEFAULTS TABLE // Object[] defaults = { // *** Auditory Feedback "AuditoryCues.defaultCueList", defaultCueList, // this key defines which of the various cues to render // This is disabled until sound bugs can be resolved. "AuditoryCues.playList", null, // defaultCueList, // Text (Note: many are inherited) "TextField.border", textFieldBorder, "TextField.font", userTextValue, "PasswordField.border", textBorder, // passwordField.font should actually map to // win.ansiFixed.font.height on windows. "PasswordField.font", userTextValue, // TextArea.font should actually map to win.ansiFixed.font.height // on windows. "TextArea.font", userTextValue, "TextPane.background", table.get("window"), "TextPane.font", userTextValue, "EditorPane.background", table.get("window"), "EditorPane.font", userTextValue, "TextField.focusInputMap", fieldInputMap, "PasswordField.focusInputMap", fieldInputMap, "TextArea.focusInputMap", multilineInputMap, "TextPane.focusInputMap", multilineInputMap, "EditorPane.focusInputMap", multilineInputMap, // FormattedTextFields "FormattedTextField.border", textFieldBorder, "FormattedTextField.font", userTextValue, "FormattedTextField.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", DefaultEditorKit.copyAction, "ctrl V", DefaultEditorKit.pasteAction, "ctrl X", DefaultEditorKit.cutAction, "COPY", DefaultEditorKit.copyAction, "PASTE", DefaultEditorKit.pasteAction, "CUT", DefaultEditorKit.cutAction, "shift LEFT", DefaultEditorKit.selectionBackwardAction, "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, "shift RIGHT", DefaultEditorKit.selectionForwardAction, "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, "ctrl LEFT", DefaultEditorKit.previousWordAction, "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, "ctrl RIGHT", DefaultEditorKit.nextWordAction, "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "typed \010", DefaultEditorKit.deletePrevCharAction, "DELETE", DefaultEditorKit.deleteNextCharAction, "RIGHT", DefaultEditorKit.forwardAction, "LEFT", DefaultEditorKit.backwardAction, "KP_RIGHT", DefaultEditorKit.forwardAction, "KP_LEFT", DefaultEditorKit.backwardAction, "ENTER", JTextField.notifyAction, "ctrl BACK_SLASH", "unselect", "control shift O", "toggle-componentOrientation", "ESCAPE", "reset-field-edit", "UP", "increment", "KP_UP", "increment", "DOWN", "decrement", "KP_DOWN", "decrement", }), // Buttons "Button.disabledText", getInactiveControlTextColor(), "Button.select", getControlShadow(), "Button.border", buttonBorder, "Button.font", controlTextValue, "Button.focus", getFocusColor(), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.disabledText", getInactiveControlTextColor(), "Checkbox.select", getControlShadow(), "CheckBox.font", controlTextValue, "CheckBox.focus", getFocusColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getCheckBoxIcon"),
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?