basiclookandfeel.java
来自「JAVA的一些源码 JAVA2 STANDARD EDITION DEVELO」· Java 代码 · 共 1,545 行 · 第 1/5 页
JAVA
1,545 行
Object dialogPlain12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[] {"Dialog", fontPlain, twelve}); Object serifPlain12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[] {"Serif", fontPlain, twelve}); Object sansSerifPlain12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[] {"SansSerif", fontPlain, twelve}); Object monospacedPlain12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[] {"MonoSpaced", fontPlain, twelve}); Object dialogBold12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[] {"Dialog", fontBold, twelve}); // *** Shared Colors ColorUIResource red = new ColorUIResource(Color.red); ColorUIResource black = new ColorUIResource(Color.black); ColorUIResource white = new ColorUIResource(Color.white); ColorUIResource yellow = new ColorUIResource(Color.yellow); ColorUIResource gray = new ColorUIResource(Color.gray); ColorUIResource lightGray = new ColorUIResource(Color.lightGray); ColorUIResource darkGray = new ColorUIResource(Color.darkGray); ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224); Color control = table.getColor("control"); Color controlDkShadow = table.getColor("controlDkShadow"); Color controlHighlight = table.getColor("controlHighlight"); Color controlLtHighlight = table.getColor("controlLtHighlight"); Color controlShadow = table.getColor("controlShadow"); Color controlText = table.getColor("controlText"); Color menu = table.getColor("menu"); Color menuText = table.getColor("menuText"); Color textHighlight = table.getColor("textHighlight"); Color textHighlightText = table.getColor("textHighlightText"); Color textInactiveText = table.getColor("textInactiveText"); Color textText = table.getColor("textText"); Color window = table.getColor("window"); // *** Shared Insets InsetsUIResource zeroInsets = new InsetsUIResource(0,0,0,0); InsetsUIResource twoInsets = new InsetsUIResource(2, 2, 2, 2); // *** Shared Borders Object marginBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders$MarginBorder"); Object etchedBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource", "getEtchedBorderUIResource"); Object loweredBevelBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource", "getLoweredBevelBorderUIResource"); Object popupMenuBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder"); Object blackLineBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource", "getBlackLineBorderUIResource"); Object focusCellHighlightBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$LineBorderUIResource", null, new Object[] {yellow}); Object tableHeaderBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$BevelBorderUIResource", null, new Object[] { new Integer(BevelBorder.RAISED), controlLtHighlight, control, controlDkShadow, controlShadow }); // *** Button value objects Object buttonBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getButtonBorder"); Object buttonToggleBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getToggleButtonBorder"); Object radioButtonBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getRadioButtonBorder"); // *** FileChooser / FileView value objects Object newFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/NewFolder.gif"); Object upFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/UpFolder.gif"); Object homeFolderIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/HomeFolder.gif"); Object detailsViewIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/DetailsView.gif"); Object listViewIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/ListView.gif"); Object directoryIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Directory.gif"); Object fileIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/File.gif"); Object computerIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/Computer.gif"); Object hardDriveIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/HardDrive.gif"); Object floppyDriveIcon = SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/FloppyDrive.gif"); // *** InternalFrame value objects Object internalFrameBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder"); // *** List value objects Object listCellRendererActiveValue = new UIDefaults.ActiveValue() { public Object createValue(UIDefaults table) { return new DefaultListCellRenderer.UIResource(); } }; // *** Menus value objects Object menuBarBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getMenuBarBorder"); Object menuItemCheckIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getMenuItemCheckIcon"); Object menuItemArrowIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getMenuItemArrowIcon"); Object menuArrowIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getMenuArrowIcon"); Object checkBoxIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getCheckBoxIcon"); Object radioButtonIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getRadioButtonIcon"); Object checkBoxMenuItemIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getCheckBoxMenuItemIcon"); Object radioButtonMenuItemIcon = new SwingLazyValue( "javax.swing.plaf.basic.BasicIconFactory", "getRadioButtonMenuItemIcon"); Object menuItemAcceleratorDelimiter = new String("+"); // *** OptionPane value objects Object optionPaneMinimumSize = new DimensionUIResource(262, 90); Integer zero = new Integer(0); Object zeroBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] {zero, zero, zero, zero}); Integer ten = new Integer(10); Object optionPaneBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] {ten, ten, twelve, ten}); Object optionPaneButtonAreaBorder = new SwingLazyValue( "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] {new Integer(6), zero, zero, zero}); // *** ProgessBar value objects Object progressBarBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getProgressBarBorder"); // ** ScrollBar value objects Object minimumThumbSize = new DimensionUIResource(8,8); Object maximumThumbSize = new DimensionUIResource(4096,4096); // ** Slider value objects Object sliderFocusInsets = twoInsets; Object toolBarSeparatorSize = new DimensionUIResource( 10, 10 ); // *** SplitPane value objects Object splitPaneBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getSplitPaneBorder"); Object splitPaneDividerBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getSplitPaneDividerBorder"); // ** TabbedBane value objects Object tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4); Object tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1); Object tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2); Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3); // *** Text value objects Object textFieldBorder = new SwingLazyValue( "javax.swing.plaf.basic.BasicBorders", "getTextFieldBorder"); Object editorMargin = new InsetsUIResource(3,3,3,3); Object caretBlinkRate = fiveHundred; Integer four = new Integer(4); Object[] allAuditoryCues = new Object[] { "CheckBoxMenuItem.commandSound", "InternalFrame.closeSound", "InternalFrame.maximizeSound", "InternalFrame.minimizeSound", "InternalFrame.restoreDownSound", "InternalFrame.restoreUpSound", "MenuItem.commandSound", "OptionPane.errorSound", "OptionPane.informationSound", "OptionPane.questionSound", "OptionPane.warningSound", "PopupMenu.popupSound", "RadioButtonMenuItem.commandSound"}; Object[] noAuditoryCues = new Object[] {"mute"}; // *** Component Defaults Object[] defaults = { // *** Auditory Feedback "AuditoryCues.cueList", allAuditoryCues, "AuditoryCues.allAuditoryCues", allAuditoryCues, "AuditoryCues.noAuditoryCues", noAuditoryCues, // this key defines which of the various cues to render. // L&Fs that want auditory feedback NEED to override playList. "AuditoryCues.playList", null, // *** Buttons "Button.defaultButtonFollowsFocus", Boolean.TRUE, "Button.font", dialogPlain12, "Button.background", control, "Button.foreground", controlText, "Button.shadow", controlShadow, "Button.darkShadow", controlDkShadow, "Button.light", controlHighlight, "Button.highlight", controlLtHighlight, "Button.border", buttonBorder, "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.textIconGap", four, "Button.textShiftOffset", zero, "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed",
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?