📄 metallookandfeel.java
字号:
"inactiveCaptionBorder", theme.getControlShadow(), /* Border color for inactive caption (title bar) window borders. */ "window", theme.getWindowBackground(), /* Default color for the interior of windows */ "windowBorder", control, /* ??? */ "windowText", theme.getUserTextColor(), /* ??? */ "menu", theme.getMenuBackground(), /* Background color for menus */ "menuText", theme.getMenuForeground(), /* Text color for menus */ "text", theme.getWindowBackground(), /* Text background color */ "textText", theme.getUserTextColor(), /* Text foreground color */ "textHighlight", theme.getTextHighlightColor(), /* Text background color when selected */ "textHighlightText", theme.getHighlightedTextColor(), /* Text color when selected */ "textInactiveText", theme.getInactiveSystemTextColor(), /* Text color when disabled */ "control", control, /* Default color for controls (buttons, sliders, etc) */ "controlText", theme.getControlTextColor(), /* Default color for text in controls */ "controlHighlight", theme.getControlHighlight(), /* Specular highlight (opposite of the shadow) */ "controlLtHighlight", theme.getControlHighlight(), /* Highlight color for controls */ "controlShadow", theme.getControlShadow(), /* Shadow color for controls */ "controlDkShadow", theme.getControlDarkShadow(), /* Dark shadow color for controls */ "scrollbar", control, /* Scrollbar background (usually the "track") */ "info", theme.getPrimaryControl(), /* ToolTip Background */ "infoText", theme.getPrimaryControlInfo() /* ToolTip Text */ }; table.putDefaults(systemColors); } /** * Initialize the defaults table with the name of the ResourceBundle * used for getting localized defaults. */ private void initResourceBundle(UIDefaults table) { table.addResourceBundle( "com.sun.swing.internal.plaf.metal.resources.metal" ); } protected void initComponentDefaults(UIDefaults table) { super.initComponentDefaults( table ); initResourceBundle(table); Color acceleratorForeground = getAcceleratorForeground(); Color acceleratorSelectedForeground = getAcceleratorSelectedForeground(); Color control = getControl(); Color controlHighlight = getControlHighlight(); Color controlShadow = getControlShadow(); Color controlDarkShadow = getControlDarkShadow(); Color controlTextColor = getControlTextColor(); Color focusColor = getFocusColor(); Color inactiveControlTextColor = getInactiveControlTextColor(); Color menuBackground = getMenuBackground(); Color menuSelectedBackground = getMenuSelectedBackground(); Color menuDisabledForeground = getMenuDisabledForeground(); Color menuSelectedForeground = getMenuSelectedForeground(); Color primaryControl = getPrimaryControl(); Color primaryControlDarkShadow = getPrimaryControlDarkShadow(); Color primaryControlShadow = getPrimaryControlShadow(); Color systemTextColor = getSystemTextColor(); Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0); Integer zero = new Integer(0); Object textFieldBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders", "getTextFieldBorder"); 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, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "ctrl H", 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 passwordInputMap = 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.beginLineAction, "ctrl KP_LEFT", DefaultEditorKit.beginLineAction, "ctrl RIGHT", DefaultEditorKit.endLineAction, "ctrl KP_RIGHT", DefaultEditorKit.endLineAction, "ctrl shift LEFT", DefaultEditorKit.selectionBeginLineAction, "ctrl shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction, "ctrl shift RIGHT", DefaultEditorKit.selectionEndLineAction, "ctrl shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction, "ctrl A", DefaultEditorKit.selectAllAction, "HOME", DefaultEditorKit.beginLineAction, "END", DefaultEditorKit.endLineAction, "shift HOME", DefaultEditorKit.selectionBeginLineAction, "shift END", DefaultEditorKit.selectionEndLineAction, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "ctrl H", 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, "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, "ctrl H", 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 SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ScrollPaneBorder"); Object buttonBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders", "getButtonBorder"); Object toggleButtonBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders", "getToggleButtonBorder"); Object titledBorderBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {controlShadow}); Object desktopIconBorder = new SwingLazyValue( "javax.swing.plaf.metal.MetalBorders", "getDesktopIconBorder"); Object menuBarBorder = new SwingLazyValue( "javax.swing.plaf.metal.MetalBorders$MenuBarBorder"); Object popupMenuBorder = new SwingLazyValue( "javax.swing.plaf.metal.MetalBorders$PopupMenuBorder"); Object menuItemBorder = new SwingLazyValue( "javax.swing.plaf.metal.MetalBorders$MenuItemBorder"); Object menuItemAcceleratorDelimiter = new String("-"); Object toolBarBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders$ToolBarBorder"); Object progressBarBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {controlDarkShadow, new Integer(1)}); Object toolTipBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {primaryControlDarkShadow}); Object toolTipBorderInactive = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {controlDarkShadow}); Object focusCellHighlightBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {focusColor}); Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 6); Object tabbedPaneTabInsets = new InsetsUIResource(0, 9, 1, 9); 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,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -