📄 basiclookandfeel.java
字号:
"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", }), "PasswordField.font", monospacedPlain12, "PasswordField.background", table.get("window"), "PasswordField.foreground", table.get("textText"), "PasswordField.inactiveForeground", table.get("textInactiveText"), "PasswordField.inactiveBackground", table.get("control"), "PasswordField.selectionBackground", table.get("textHighlight"), "PasswordField.selectionForeground", table.get("textHighlightText"), "PasswordField.caretForeground", table.get("textText"), "PasswordField.caretBlinkRate", caretBlinkRate, "PasswordField.border", textFieldBorder, "PasswordField.margin", zeroInsets, "TextArea.font", monospacedPlain12, "TextArea.background", table.get("window"), "TextArea.foreground", table.get("textText"), "TextArea.inactiveForeground", table.get("textInactiveText"), "TextArea.selectionBackground", table.get("textHighlight"), "TextArea.selectionForeground", table.get("textHighlightText"), "TextArea.caretForeground", table.get("textText"), "TextArea.caretBlinkRate", caretBlinkRate, "TextArea.border", marginBorder, "TextArea.margin", zeroInsets, "TextPane.font", serifPlain12, "TextPane.background", white, "TextPane.foreground", table.get("textText"), "TextPane.selectionBackground", table.get("textHighlight"), "TextPane.selectionForeground", table.get("textHighlightText"), "TextPane.caretForeground", table.get("textText"), "TextPane.caretBlinkRate", caretBlinkRate, "TextPane.inactiveForeground", table.get("textInactiveText"), "TextPane.border", marginBorder, "TextPane.margin", editorMargin, "EditorPane.font", serifPlain12, "EditorPane.background", white, "EditorPane.foreground", table.get("textText"), "EditorPane.selectionBackground", table.get("textHighlight"), "EditorPane.selectionForeground", table.get("textHighlightText"), "EditorPane.caretForeground", table.get("textText"), "EditorPane.caretBlinkRate", caretBlinkRate, "EditorPane.inactiveForeground", table.get("textInactiveText"), "EditorPane.border", marginBorder, "EditorPane.margin", editorMargin, // *** TitledBorder "TitledBorder.font", dialogPlain12, "TitledBorder.titleColor", table.get("controlText"), "TitledBorder.border", etchedBorder, // *** ToolBar "ToolBar.font", dialogPlain12, "ToolBar.background", table.get("control"), "ToolBar.foreground", table.get("controlText"), "ToolBar.shadow", table.getColor("controlShadow"), "ToolBar.darkShadow", table.getColor("controlDkShadow"), "ToolBar.light", table.getColor("controlHighlight"), "ToolBar.highlight", table.getColor("controlLtHighlight"), "ToolBar.dockingBackground", table.get("control"), "ToolBar.dockingForeground", red, "ToolBar.floatingBackground", table.get("control"), "ToolBar.floatingForeground", darkGray, "ToolBar.border", etchedBorder, "ToolBar.separatorSize", toolBarSeparatorSize, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), // *** ToolTips "ToolTip.font", sansSerifPlain12, "ToolTip.background", table.get("info"), "ToolTip.foreground", table.get("infoText"), "ToolTip.border", blackLineBorder, // ToolTips also support backgroundInactive, borderInactive, // and foregroundInactive // *** Tree "Tree.font", dialogPlain12, "Tree.background", table.get("window"), "Tree.foreground", table.get("textText"), "Tree.hash", gray, "Tree.textForeground", table.get("textText"), "Tree.textBackground", table.get("text"), "Tree.selectionForeground", table.get("textHighlightText"), "Tree.selectionBackground", table.get("textHighlight"), "Tree.selectionBorderColor", black, "Tree.editorBorder", blackLineBorder, "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.openIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeOpen.gif"), "Tree.closedIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeClosed.gif"), "Tree.leafIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeLeaf.gif"), "Tree.expandedIcon", null, "Tree.collapsedIcon", null, "Tree.changeSelectionWithFocus", Boolean.TRUE, "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "END", "selectLast", "shift END", "selectLastExtendSelection", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "shift SPACE", "extendSelection", "ctrl HOME", "selectFirstChangeLead", "ctrl END", "selectLastChangeLead", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "ctrl PAGE_DOWN", "scrollDownChangeLead", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "toggleSelectionPreserveAnchor", }), "Tree.focusInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "selectParent", "KP_RIGHT", "selectParent", "LEFT", "selectChild", "KP_LEFT", "selectChild", }), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), // These bindings are only enabled when there is a default // button set on the rootpane. "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, }; table.putDefaults(defaults); } // ********* Auditory Cue support methods and objects ********* // also see the "AuditoryCues" section of the defaults table /** * Returns an <code>ActionMap</code>. * <P> * This <code>ActionMap</code> contains <code>Actions</code> that * embody the ability to render an auditory cue. These auditory * cues map onto user and system activities that may be useful * for an end user to know about (such as a dialog box appearing). * <P> * At the appropriate time in a <code>JComponent</code> UI's lifecycle, * the ComponentUI is responsible for getting the appropriate * <code>Action</code> out of the <code>ActionMap</code> and passing * it on to <code>playSound</code>. * <P> * The <code>Actions</code> in this <code>ActionMap</code> are * created by the <code>createAudioAction</code> method. * * @return an ActionMap containing Actions * responsible for rendering auditory cues * @see #createAudioAction * @see #playSound(Action) * @since 1.4 */ protected ActionMap getAudioActionMap() { ActionMap audioActionMap = (ActionMap)UIManager.get( "AuditoryCues.actionMap"); if (audioActionMap == null) { Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList"); if (acList != null) { audioActionMap = new ActionMapUIResource(); for(int counter = acList.length-1; counter >= 0; counter--) { audioActionMap.put(acList[counter], createAudioAction(acList[counter])); } } UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap); } return audioActionMap; } /** * Returns an <code>Action</code>. * <P> * This Action contains the information and logic to render an * auditory cue. The <code>Object</code> that is passed to this * method contains the information needed to render the auditory * cue. Normally, this <code>Object</code> is a <code>String</code> * that points to an audio file relative to the current package. * This <code>Action</code>'s <code>actionPerformed</code> method * is fired by the <code>playSound</code> method. * * @return an Action which knows how to render the auditory * cue for one particular system or user activity * @see #playSound(Action) * @since 1.4 */ protected Action createAudioAction(Object key) { if (key != null) { String audioKey = (String)key; String audioValue = (String)UIManager.get(key); return new AudioAction(audioKey, audioValue); } else { return null; } } /** * Pass the name String to the super constructor. This is used * later to identify the Action and decide whether to play it or * not. Store the resource String. I is used to get the audio * resource. In this case, the resource is an audio file. * * @since 1.4 */ private class AudioAction extends AbstractAction implements LineListener { // We strive to only play one sound at a time (other platforms // appear to do this). This is done by maintaining the field // clipPlaying. Every time a sound is to be played, // cancelCurrentSound is invoked to cancel any sound that may be // playing. private String audioResource; private byte[] audioBuffer; /** * The String is the name of the Action and * points to the audio resource. * The byte[] is a buffer of the audio bits. */ public AudioAction(String name, String resource) { super(name); audioResourc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -