Search in sources :

Example 6 with SwingLazyValue

use of sun.swing.SwingLazyValue in project jdk8u_jdk by JetBrains.

the class WindowsLookAndFeel method getLazyValueDefaults.

// When a desktop property change is detected, these classes must be
// reinitialized in the defaults table to ensure the classes reference
// the updated desktop property values (colors mostly)
//
private Object[] getLazyValueDefaults() {
    Object buttonBorder = new XPBorderValue(Part.BP_PUSHBUTTON, new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getButtonBorder"));
    Object textFieldBorder = new XPBorderValue(Part.EP_EDIT, new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getTextFieldBorder"));
    Object textFieldMargin = new XPValue(new InsetsUIResource(2, 2, 2, 2), new InsetsUIResource(1, 1, 1, 1));
    Object spinnerBorder = new XPBorderValue(Part.EP_EDIT, textFieldBorder, new EmptyBorder(2, 2, 2, 2));
    Object spinnerArrowInsets = new XPValue(new InsetsUIResource(1, 1, 1, 1), null);
    Object comboBoxBorder = new XPBorderValue(Part.CP_COMBOBOX, textFieldBorder);
    // For focus rectangle for cells and trees.
    Object focusCellHighlightBorder = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsBorders", "getFocusCellHighlightBorder");
    Object etchedBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getEtchedBorderUIResource");
    Object internalFrameBorder = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsBorders", "getInternalFrameBorder");
    Object loweredBevelBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getLoweredBevelBorderUIResource");
    Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder");
    Object menuBarBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getMenuBarBorder");
    Object popupMenuBorder = new XPBorderValue(Part.MENU, new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder"));
    // *** ProgressBar
    Object progressBarBorder = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsBorders", "getProgressBarBorder");
    Object radioButtonBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getRadioButtonBorder");
    Object scrollPaneBorder = new XPBorderValue(Part.LBP_LISTBOX, textFieldBorder);
    Object tableScrollPaneBorder = new XPBorderValue(Part.LBP_LISTBOX, loweredBevelBorder);
    Object tableHeaderBorder = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsBorders", "getTableHeaderBorder");
    // *** ToolBar
    Object toolBarBorder = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsBorders", "getToolBarBorder");
    // *** ToolTips
    Object toolTipBorder = new SwingLazyValue("javax.swing.plaf.BorderUIResource", "getBlackLineBorderUIResource");
    Object checkBoxIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getCheckBoxIcon");
    Object radioButtonIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getRadioButtonIcon");
    Object radioButtonMenuItemIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getRadioButtonMenuItemIcon");
    Object menuItemCheckIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getMenuItemCheckIcon");
    Object menuItemArrowIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getMenuItemArrowIcon");
    Object menuArrowIcon = new SwingLazyValue("com.sun.java.swing.plaf.windows.WindowsIconFactory", "getMenuArrowIcon");
    Object[] lazyDefaults = { "Button.border", buttonBorder, "CheckBox.border", radioButtonBorder, "ComboBox.border", comboBoxBorder, "DesktopIcon.border", internalFrameBorder, "FormattedTextField.border", textFieldBorder, "FormattedTextField.margin", textFieldMargin, "InternalFrame.border", internalFrameBorder, "List.focusCellHighlightBorder", focusCellHighlightBorder, "Table.focusCellHighlightBorder", focusCellHighlightBorder, "Menu.border", marginBorder, "MenuBar.border", menuBarBorder, "MenuItem.border", marginBorder, "PasswordField.border", textFieldBorder, "PasswordField.margin", textFieldMargin, "PopupMenu.border", popupMenuBorder, "ProgressBar.border", progressBarBorder, "RadioButton.border", radioButtonBorder, "ScrollPane.border", scrollPaneBorder, "Spinner.border", spinnerBorder, "Spinner.arrowButtonInsets", spinnerArrowInsets, "Spinner.arrowButtonSize", new Dimension(17, 9), "Table.scrollPaneBorder", tableScrollPaneBorder, "TableHeader.cellBorder", tableHeaderBorder, "TextArea.margin", textFieldMargin, "TextField.border", textFieldBorder, "TextField.margin", textFieldMargin, "TitledBorder.border", new XPBorderValue(Part.BP_GROUPBOX, etchedBorder), "ToggleButton.border", radioButtonBorder, "ToolBar.border", toolBarBorder, "ToolTip.border", toolTipBorder, "CheckBox.icon", checkBoxIcon, "Menu.arrowIcon", menuArrowIcon, "MenuItem.checkIcon", menuItemCheckIcon, "MenuItem.arrowIcon", menuItemArrowIcon, "RadioButton.icon", radioButtonIcon, "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon, "InternalFrame.layoutTitlePaneAtOrigin", new XPValue(Boolean.TRUE, Boolean.FALSE), "Table.ascendingSortIcon", new XPValue(new SwingLazyValue("sun.swing.icon.SortArrowIcon", null, new Object[] { Boolean.TRUE, "Table.sortIconColor" }), new SwingLazyValue("sun.swing.plaf.windows.ClassicSortArrowIcon", null, new Object[] { Boolean.TRUE })), "Table.descendingSortIcon", new XPValue(new SwingLazyValue("sun.swing.icon.SortArrowIcon", null, new Object[] { Boolean.FALSE, "Table.sortIconColor" }), new SwingLazyValue("sun.swing.plaf.windows.ClassicSortArrowIcon", null, new Object[] { Boolean.FALSE })) };
    return lazyDefaults;
}
Also used : SwingLazyValue(sun.swing.SwingLazyValue)

Aggregations

SwingLazyValue (sun.swing.SwingLazyValue)6 Color (java.awt.Color)2 GetPropertyAction (sun.security.action.GetPropertyAction)2 VistaMenuItemCheckIconFactory (com.sun.java.swing.plaf.windows.WindowsIconFactory.VistaMenuItemCheckIconFactory)1 java.awt (java.awt)1 Dimension (java.awt.Dimension)1 SystemColor (java.awt.SystemColor)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 ReferenceQueue (java.lang.ref.ReferenceQueue)1 WeakReference (java.lang.ref.WeakReference)1 AccessController (java.security.AccessController)1 java.util (java.util)1 javax.swing (javax.swing)1 UIDefaults (javax.swing.UIDefaults)1 LazyValue (javax.swing.UIDefaults.LazyValue)1 javax.swing.plaf (javax.swing.plaf)1 javax.swing.plaf.basic (javax.swing.plaf.basic)1 DefaultEditorKit (javax.swing.text.DefaultEditorKit)1 sun.awt (sun.awt)1