gtklookandfeel.java
来自「Mobile 应用程序使用 Java Micro Edition (Java M」· Java 代码 · 共 1,363 行 · 第 1/5 页
JAVA
1,363 行
"shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl shift LEFT", "selectNextColumnExtendSelection", "ctrl shift KP_LEFT", "selectNextColumnExtendSelection", "ctrl LEFT", "selectNextColumnChangeLead", "ctrl KP_LEFT", "selectNextColumnChangeLead", "ctrl PAGE_UP", "scrollRightChangeSelection", "ctrl PAGE_DOWN", "scrollLeftChangeSelection", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", }), "Table.font", new FontLazyValue(Region.TABLE), "Table.ascendingSortIcon", new GTKStyle.GTKLazyValue( "com.sun.java.swing.plaf.gtk.GTKIconFactory", "getAscendingSortIcon"), "Table.descendingSortIcon", new GTKStyle.GTKLazyValue( "com.sun.java.swing.plaf.gtk.GTKIconFactory", "getDescendingSortIcon"), "TableHeader.font", new FontLazyValue(Region.TABLE_HEADER), "TextArea.caretForeground", caretColor, "TextArea.caretAspectRatio", defaultCaretAspectRatio, "TextArea.caretBlinkRate", caretBlinkRate, "TextArea.margin", zeroInsets, "TextArea.focusInputMap", multilineInputMap, "TextArea.font", new FontLazyValue(Region.TEXT_AREA), "TextField.caretForeground", caretColor, "TextField.caretAspectRatio", defaultCaretAspectRatio, "TextField.caretBlinkRate", caretBlinkRate, "TextField.margin", zeroInsets, "TextField.focusInputMap", fieldInputMap, "TextField.font", new FontLazyValue(Region.TEXT_FIELD), "TextPane.caretForeground", caretColor, "TextPane.caretAspectRatio", defaultCaretAspectRatio, "TextPane.caretBlinkRate", caretBlinkRate, "TextPane.margin", editorMargin, "TextPane.focusInputMap", multilineInputMap, "TextPane.font", new FontLazyValue(Region.TEXT_PANE), "TitledBorder.titleColor", new ColorUIResource(Color.BLACK), "TitledBorder.border", new UIDefaults.ProxyLazyValue( "javax.swing.plaf.BorderUIResource", "getEtchedBorderUIResource"), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontLazyValue(Region.TOGGLE_BUTTON), "ToggleButton.margin", zeroInsets, "ToolBar.separatorSize", new DimensionUIResource(10, 10), "ToolBar.handleIcon", new UIDefaults.ActiveValue() { public Object createValue(UIDefaults table) { return GTKIconFactory.getToolBarHandleIcon(); } }, "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.font", new FontLazyValue(Region.TOOL_BAR), "ToolTip.font", new FontLazyValue(Region.TOOL_TIP), "Tree.padding", new Integer(4), "Tree.drawHorizontalLines", Boolean.FALSE, "Tree.drawVerticalLines", Boolean.FALSE, "Tree.rowHeight", new Integer(-1), "Tree.scrollsOnExpand", Boolean.FALSE, "Tree.expanderSize", new Integer(10), "Tree.repaintWholeRow", Boolean.TRUE, "Tree.closedIcon", null, "Tree.leafIcon", null, "Tree.openIcon", null, "Tree.expandedIcon", new GTKStyle.GTKLazyValue( "com.sun.java.swing.plaf.gtk.GTKIconFactory", "getTreeExpandedIcon"), "Tree.collapsedIcon", new GTKStyle.GTKLazyValue( "com.sun.java.swing.plaf.gtk.GTKIconFactory", "getTreeCollapsedIcon"), "Tree.leftChildIndent", new Integer(2), "Tree.rightChildIndent", new Integer(12), "Tree.scrollsHorizontallyAndVertically", Boolean.FALSE, "Tree.drawsFocusBorder", Boolean.TRUE, "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", "UP", "selectPrevious", "KP_UP", "selectPrevious", "shift UP", "selectPreviousExtendSelection", "shift KP_UP", "selectPreviousExtendSelection", "ctrl shift UP", "selectPreviousExtendSelection", "ctrl shift KP_UP", "selectPreviousExtendSelection", "ctrl UP", "selectPreviousChangeLead", "ctrl KP_UP", "selectPreviousChangeLead", "DOWN", "selectNext", "KP_DOWN", "selectNext", "shift DOWN", "selectNextExtendSelection", "shift KP_DOWN", "selectNextExtendSelection", "ctrl shift DOWN", "selectNextExtendSelection", "ctrl shift KP_DOWN", "selectNextExtendSelection", "ctrl DOWN", "selectNextChangeLead", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "LEFT", "selectParent", "KP_LEFT", "selectParent", "typed +", "expand", "typed -", "collapse", "BACK_SPACE", "moveSelectionToParent", "PAGE_UP", "scrollUpChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "PAGE_DOWN", "scrollDownChangeSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead", "HOME", "selectFirst", "shift HOME", "selectFirstExtendSelection", "ctrl shift HOME", "selectFirstExtendSelection", "ctrl HOME", "selectFirstChangeLead", "END", "selectLast", "shift END", "selectLastExtendSelection", "ctrl shift END", "selectLastExtendSelection", "ctrl END", "selectLastChangeLead", "F2", "startEditing", "ctrl A", "selectAll", "ctrl SLASH", "selectAll", "ctrl BACK_SLASH", "clearSelection", "ctrl LEFT", "scrollLeft", "ctrl KP_LEFT", "scrollLeft", "ctrl RIGHT", "scrollRight", "ctrl KP_RIGHT", "scrollRight", "SPACE", "addToSelection", "ctrl SPACE", "toggleAndAnchor", "shift SPACE", "extendTo", "ctrl shift SPACE", "moveSelectionTo" }), "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" }), "Tree.font", new FontLazyValue(Region.TREE), "Viewport.font", new FontLazyValue(Region.VIEWPORT) }; table.putDefaults(defaults); if (fallbackFont != null) { table.put("TitledBorder.font", fallbackFont); } table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo); // The property "Slider.paintValue" may be passed through AppContext // to avoid loading Swing into plugin (6594219) String key = "Slider.paintValue"; Object tmp = AppContext.getAppContext().get(key); if (tmp == null) { tmp = Boolean.TRUE; } table.put(key, tmp); } protected void initSystemColorDefaults(UIDefaults table) { GTKStyleFactory factory = (GTKStyleFactory)getStyleFactory(); GTKStyle windowStyle = (GTKStyle)factory.getStyle(null, Region.INTERNAL_FRAME); table.put("window", windowStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); table.put("windowText", windowStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.TEXT_FOREGROUND)); GTKStyle entryStyle = (GTKStyle)factory.getStyle(null, Region.TEXT_FIELD); table.put("text", entryStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.TEXT_BACKGROUND)); table.put("textText", entryStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.TEXT_FOREGROUND)); table.put("textHighlight", entryStyle.getGTKColor(SynthConstants.SELECTED, GTKColorType.TEXT_BACKGROUND)); table.put("textHighlightText", entryStyle.getGTKColor(SynthConstants.SELECTED, GTKColorType.TEXT_FOREGROUND)); table.put("textInactiveText", entryStyle.getGTKColor(SynthConstants.DISABLED, GTKColorType.TEXT_FOREGROUND)); Object caretColor = entryStyle.getClassSpecificValue(Region.TEXT_FIELD, "cursor-color"); if (caretColor == null) { caretColor = GTKStyle.BLACK_COLOR; } table.put("caretColor", caretColor); GTKStyle menuStyle = (GTKStyle)factory.getStyle(null, Region.MENU_ITEM); table.put("menu", menuStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); table.put("menuText", menuStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.TEXT_FOREGROUND)); GTKStyle scrollbarStyle = (GTKStyle)factory.getStyle(null, Region.SCROLL_BAR); table.put("scrollbar", scrollbarStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); GTKStyle infoStyle = (GTKStyle)factory.getStyle(null, Region.OPTION_PANE); table.put("info", infoStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); table.put("infoText", infoStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.TEXT_FOREGROUND)); GTKStyle desktopStyle = (GTKStyle)factory.getStyle(null, Region.DESKTOP_PANE); table.put("desktop", desktopStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); // colors specific only for GTK // It is impossible to create a simple GtkWidget without specifying the // type. So for GtkWidget we can use any appropriate concrete type of // wigdet. LABEL in this case. GTKStyle widgetStyle = (GTKStyle)factory.getStyle(null, Region.LABEL); table.put("control", widgetStyle.getGTKColor(SynthConstants.ENABLED, GTKColorType.BACKGROUND)); table.put("controlText", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.TEXT_FOREGROUND)); table.put("controlHighlight", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.BACKGROUND)); table.put("controlLtHighlight", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.LIGHT)); table.put("controlShadow", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.DARK)); table.put("controlDkShadow", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.BLACK)); table.put("light", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.LIGHT)); table.put("mid", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.MID)); table.put("dark", widgetStyle.getGTKColor( SynthConstants.ENABLED, GTKColorType.DARK)); table.put("black", widgetStyle.getGTKColor(
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?