looks-2.2.0

0, x + 7, y + 0);
      g.drawLine(x + 2, y + 1, x + 3, y + 1);
      g.drawLine(x + 8, y + 1, x + 9, y + 1);
      g.drawLine(x + 1, y + 2, x + 1, y + 3);
      g.drawLine(x + 0, y + 4, x + 0, y + 7);
      g.drawLine(x + 1, y + 8, x + 1, y + 9);
      
      g.setColor(UIManager.getColor("RadioButton.highlight"));
      g.drawLine(x + 2, y + 10, x + 3, y + 10);
      g.drawLine(x + 4, y + 11, x + 7, y + 11);
      g.drawLine(x + 8, y + 10, x + 9, y + 10);
      g.drawLine(x + 10, y + 9, x + 10, y + 8);
      g.drawLine(x + 11, y + 7, x + 11, y + 4);
      g.drawLine(x + 10, y + 3, x + 10, y + 2);
      
      g.setColor(UIManager.getColor("RadioButton.darkShadow"));
      g.drawLine(x + 4, y + 1, x + 7, y + 1);
      g.drawLine(x + 2, y + 2, x + 3, y + 2);
      g.drawLine(x + 8, y + 2, x + 9, y + 2);
      g.drawLine(x + 2, y + 3, x + 2, y + 3);
      g.drawLine(x + 1, y + 4, x + 1, y + 7);
      g.drawLine(x + 2, y + 8, x + 2, y + 8);
      
      g.setColor(UIManager.getColor("RadioButton.light"));
      g.drawLine(x + 2, y + 9, x + 3, y + 9);
      g.drawLine(x + 4, y + 10, x + 7, y + 10);
      g.drawLine(x + 8, y + 9, x + 9, y + 9);
      g.drawLine(x + 9, y + 8, x + 9, y + 8);
      g.drawLine(x + 10, y + 7, x + 10, y + 4);
      g.drawLine(x + 9, y + 3, x + 9, y + 3);
      if (model.isSelected())
      {
        g.setColor(UIManager.getColor("RadioButton.checkColor"));
        g.fillRect(x + 4, y + 5, 4, 2);
        g.fillRect(x + 5, y + 4, 2, 4);
      }
    }
    
    public int getIconWidth()
    {
      return 13;
    }
    
    public int getIconHeight()
    {
      return 13;
    }
    
    private RadioButtonIcon() {}
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsIconFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.LookUtils;
import java.lang.reflect.Method;
import javax.swing.UIDefaults;
import javax.swing.UIDefaults.LazyValue;

class WindowsLookAndFeel$SimpleProxyLazyValue
  implements UIDefaults.LazyValue
{
  private final String className;
  private final String methodName;
  
  public WindowsLookAndFeel$SimpleProxyLazyValue(String c, String m)
  {
    className = c;
    methodName = m;
  }
  
  public Object createValue(UIDefaults table)
  {
    Object instance = null;
    try
    {
      ClassLoader classLoader = table != null ? (ClassLoader)table.get("ClassLoader") : Thread.currentThread().getContextClassLoader();
      if (classLoader == null) {
        classLoader = getClass().getClassLoader();
      }
      Class c = Class.forName(className, true, classLoader);
      Method m = c.getMethod(methodName, null);
      instance = m.invoke(c, null);
    }
    catch (Throwable t)
    {
      LookUtils.log("Problem creating " + className + " with method " + methodName + t);
    }
    return instance;
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsLookAndFeel.SimpleProxyLazyValue
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.FontPolicies;
import com.jgoodies.looks.FontPolicy;
import com.jgoodies.looks.FontSet;
import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.MicroLayout;
import com.jgoodies.looks.MicroLayoutPolicies;
import com.jgoodies.looks.MicroLayoutPolicy;
import com.jgoodies.looks.Options;
import com.jgoodies.looks.common.MinimumSizedIcon;
import com.jgoodies.looks.common.RGBGrayFilter;
import com.jgoodies.looks.common.ShadowPopupFactory;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.lang.reflect.Method;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.UIDefaults;
import javax.swing.UIDefaults.LazyValue;
import javax.swing.UIDefaults.ProxyLazyValue;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.DimensionUIResource;
import javax.swing.plaf.IconUIResource;
import javax.swing.plaf.InsetsUIResource;
import javax.swing.plaf.basic.BasicBorders.FieldBorder;
import javax.swing.plaf.basic.BasicBorders.MarginBorder;

public final class WindowsLookAndFeel
  extends com.sun.java.swing.plaf.windows.WindowsLookAndFeel
{
  public static final String BORDER_STYLE_KEY = "jgoodies.windows.borderStyle";
  
  public String getName()
  {
    return "JGoodies Windows";
  }
  
  public String getDescription()
  {
    return "The JGoodies Windows Look and Feel - � 2001-2008 JGoodies Karsten Lentzsch";
  }
  
  public static FontPolicy getFontPolicy()
  {
    FontPolicy policy = (FontPolicy)UIManager.get("Windows.fontPolicy");
    if (policy != null) {
      return policy;
    }
    FontPolicy defaultPolicy = FontPolicies.getDefaultWindowsPolicy();
    return FontPolicies.customSettingsPolicy(defaultPolicy);
  }
  
  public static void setFontPolicy(FontPolicy fontPolicy)
  {
    UIManager.put("Windows.fontPolicy", fontPolicy);
  }
  
  public static MicroLayoutPolicy getMicroLayoutPolicy()
  {
    MicroLayoutPolicy policy = (MicroLayoutPolicy)UIManager.get("Windows.MicroLayoutPolicy");
    
    return policy != null ? policy : MicroLayoutPolicies.getDefaultWindowsPolicy();
  }
  
  public static void setMicroLayoutPolicy(MicroLayout microLayoutPolicy)
  {
    UIManager.put("Windows.MicroLayoutPolicy", microLayoutPolicy);
  }
  
  public void initialize()
  {
    super.initialize();
    ShadowPopupFactory.install();
  }
  
  public void uninitialize()
  {
    super.uninitialize();
    ShadowPopupFactory.uninstall();
  }
  
  public Icon getDisabledIcon(JComponent component, Icon icon)
  {
    Icon disabledIcon = RGBGrayFilter.getDisabledIcon(component, icon);
    return disabledIcon != null ? new IconUIResource(disabledIcon) : null;
  }
  
  protected void initClassDefaults(UIDefaults table)
  {
    super.initClassDefaults(table);
    String windowsPrefix = "com.jgoodies.looks.windows.Windows";
    String commonPrefix = "com.jgoodies.looks.common.ExtBasic";
    
    Object[] uiDefaults = { "ComboBoxUI", "com.jgoodies.looks.windows.WindowsComboBoxUI", "ButtonUI", "com.jgoodies.looks.windows.WindowsButtonUI", "ScrollPaneUI", "com.jgoodies.looks.windows.WindowsScrollPaneUI", "MenuBarUI", "com.jgoodies.looks.windows.WindowsMenuBarUI", "PopupMenuUI", "com.jgoodies.looks.windows.WindowsPopupMenuUI", "OptionPaneUI", "com.jgoodies.looks.windows.WindowsOptionPaneUI", "SplitPaneUI", "com.jgoodies.looks.windows.WindowsSplitPaneUI", "TabbedPaneUI", "com.jgoodies.looks.windows.WindowsTabbedPaneUI", "TextFieldUI", "com.jgoodies.looks.windows.WindowsTextFieldUI", "FormattedTextFieldUI", "com.jgoodies.looks.windows.WindowsFormattedTextFieldUI", "PasswordFieldUI", "com.jgoodies.looks.windows.WindowsPasswordFieldUI", "TextAreaUI", "com.jgoodies.looks.windows.WindowsTextAreaUI", "TreeUI", "com.jgoodies.looks.windows.WindowsTreeUI", "SeparatorUI", "com.jgoodies.looks.windows.WindowsSeparatorUI" };
    if (LookUtils.IS_JAVA_1_4_2_OR_LATER) {
      uiDefaults = append(uiDefaults, "SpinnerUI", "com.jgoodies.looks.windows.WindowsSpinnerUI");
    }
    if ((!LookUtils.IS_JAVA_6_OR_LATER) || (!LookUtils.IS_OS_WINDOWS_VISTA) || (!LookUtils.IS_LAF_WINDOWS_XP_ENABLED))
    {
      uiDefaults = append(uiDefaults, "MenuItemUI", "com.jgoodies.looks.windows.WindowsMenuItemUI");
      
      uiDefaults = append(uiDefaults, "CheckBoxMenuItemUI", "com.jgoodies.looks.common.ExtBasicCheckBoxMenuItemUI");
      
      uiDefaults = append(uiDefaults, "RadioButtonMenuItemUI", "com.jgoodies.looks.common.ExtBasicRadioButtonMenuItemUI");
      
      uiDefaults = append(uiDefaults, "PopupMenuSeparatorUI", "com.jgoodies.looks.common.ExtBasicPopupMenuSeparatorUI");
    }
    if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED)
    {
      if ((!LookUtils.IS_JAVA_6_OR_LATER) || (!LookUtils.IS_OS_WINDOWS_VISTA)) {
        uiDefaults = append(uiDefaults, "MenuUI", "com.jgoodies.looks.windows.WindowsXPMenuUI");
      }
      uiDefaults = append(uiDefaults, "ToolBarUI", "com.jgoodies.looks.windows.WindowsXPToolBarUI");
      
      uiDefaults = append(uiDefaults, "TableHeaderUI", "com.jgoodies.looks.windows.WindowsXPTableHeaderUI");
    }
    else
    {
      uiDefaults = append(uiDefaults, "MenuUI", "com.jgoodies.looks.common.ExtBasicMenuUI");
      
      uiDefaults = append(uiDefaults, "ToolBarUI", "com.jgoodies.looks.windows.WindowsToolBarUI");
      
      uiDefaults = append(uiDefaults, "ScrollBarUI", "com.jgoodies.looks.windows.WindowsScrollBarUI");
      if (!LookUtils.IS_JAVA_1_4_2_OR_LATER) {
        uiDefaults = append(uiDefaults, "ToolBarSeparatorUI", "com.jgoodies.looks.windows.WindowsToolBarSeparatorUI");
      }
    }
    table.putDefaults(uiDefaults);
  }
  
  protected void initComponentDefaults(UIDefaults table)
  {
    super.initComponentDefaults(table);
    
    boolean isXP = LookUtils.IS_LAF_WINDOWS_XP_ENABLED;
    boolean isClassic = !isXP;
    boolean isVista = LookUtils.IS_OS_WINDOWS_VISTA;
    
    initFontDefaults(table);
    if (isClassic) {
      initComponentDefaultsClassic(table);
    }
    if ((isXP) && (LookUtils.IS_JAVA_1_4)) {
      initComponentDefaultsXP14(table);
    }
    MicroLayout microLayout = getMicroLayoutPolicy().getMicroLayout("Windows", table);
    if ((!isVista) || (!LookUtils.IS_JAVA_6_OR_LATER) || (!LookUtils.IS_LAF_WINDOWS_XP_ENABLED)) {
      initMenuItemDefaults(table, microLayout);
    }
    Object marginBorder = new BasicBorders.MarginBorder();
    Object checkBoxMargin = microLayout.getCheckBoxMargin();
    
    Object etchedBorder = new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource", "getEtchedBorderUIResource");
    
    Object buttonBorder = new SimpleProxyLazyValue("com.jgoodies.looks.windows.WindowsLookAndFeel", "getButtonBorder");
    
    Object menuBorder = isXP ? WindowsBorders.getXPMenuBorder() : WindowsBorders.getMenuBorder();
    
    Object menuBarEmptyBorder = marginBorder;
    Object menuBarSeparatorBorder = WindowsBorders.getSeparatorBorder();
    Object menuBarEtchedBorder = WindowsBorders.getEtchedBorder();
    Object menuBarHeaderBorder = WindowsBorders.getMenuBarHeaderBorder();
    
    Object toolBarEmptyBorder = marginBorder;
    Object toolBarSeparatorBorder = WindowsBorders.getSeparatorBorder();
    Object toolBarEtchedBorder = WindowsBorders.getEtchedBorder();
    Object toolBarHeaderBorder = WindowsBorders.getToolBarHeaderBorder();
    
    Object buttonMargin = microLayout.getButtonMargin();
    
    Object toolBarSeparatorSize = LookUtils.IS_JAVA_1_4_2_OR_LATER ? null : new DimensionUIResource(6, getDefaultIconSizeheight);
    
    Object textInsets = microLayout.getTextInsets();
    Object wrappedTextInsets = microLayout.getWrappedTextInsets();
    Insets comboEditorInsets = microLayout.getComboBoxEditorInsets();
    
    int comboBorderSize = microLayout.getComboBorderSize();
    int comboPopupBorderSize = microLayout.getComboPopupBorderSize();
    int comboRendererGap = left + comboBorderSize - comboPopupBorderSize;
    Object comboRendererBorder = new EmptyBorder(1, comboRendererGap, 1, comboRendererGap);
    Object comboTableEditorInsets = new Insets(0, 0, 0, 0);
    
    Object popupMenuSeparatorMargin = microLayout.getPopupMenuSeparatorMargin();
    
    int treeFontSize = table.getFont("Tree.font").getSize();
    Integer rowHeight = new Integer(treeFontSize + 6);
    
    Class superclass = getClass().getSuperclass();
    Color controlColor = table.getColor("control");
    Object disabledTextBackground = table.getColor("TextField.disabledBackground");
    Object inactiveTextBackground = table.getColor("TextField.inactiveBackground");
    
    Object comboBoxDisabledBackground = (isVista) && (isXP) ? table.getColor("ComboBox.background") : disabledTextBackground;
    
    Object menuBarBackground = isXP ? table.get("control") : table.get("menu");
    
    Object menuSelectionBackground = isXP ? table.get("MenuItem.selectionBackground") : table.get("Menu.background");
    
    Object menuSelectionForeground = isXP ? table.get("MenuItem.selectionForeground") : table.get("Menu.foreground");
    
    Character passwordEchoChar = new Character(isXP ? '?' : '*');
    
    Object[] defaults = { "Button.border", buttonBorder, "Button.margin", buttonMargin, "CheckBox.border", marginBorder, "CheckBox.margin", checkBoxMargin, "ComboBox.disabledBackground", comboBoxDisabledBackground, "ComboBox.editorBorder", marginBorder, "ComboBox.editorColumns", new Integer(5), "ComboBox.editorInsets", comboEditorInsets, "ComboBox.tableEditorInsets", comboTableEditorInsets, "ComboBox.rendererBorder", comboRendererBorder, "EditorPane.margin", wrappedTextInsets, "Menu.border", menuBorder, "Menu.borderPainted", Boolean.TRUE, "Menu.background", menuBarBackground, "Menu.selectionForeground", menuSelectionForeground, "Menu.selectionBackground", menuSelectionBackground, "MenuBar.background", menuBarBackground, "MenuBar.border", menuBarSeparatorBorder, "MenuBar.emptyBorder", menuBarEmptyBorder, "MenuBar.separatorBorder", menuBarSeparatorBorder, "MenuBar.etchedBorder", menuBarEtchedBorder, "MenuBar.headerBorder", menuBarHeaderBorder, "FormattedTextField.disabledBackground", disabledTextBackground, "FormattedTextField.inactiveBackground", inactiveTextBackground, "FormattedTextField.margin", textInsets, "PasswordField.margin", textInsets, "PasswordField.echoChar", passwordEchoChar, "PopupMenu.border", WindowsBorders.getPopupMenuBorder(), "PopupMenu.noMarginBorder", WindowsBorders.getNoMarginPopupMenuBorder(), "PopupMenuSeparator.margin", popupMenuSeparatorMargin, "ScrollPane.etchedBorder", etchedBorder, "Spinner.defaultEditorInsets", textInsets, "RadioButton.border", marginBorder, "RadioButton.margin", checkBoxMargin, "Table.gridColor", controlColor, "TextArea.margin", wrappedTextInsets, "TextArea.disabledBackground", disabledTextBackground, "TextArea.inactiveBackground", inactiveTextBackground, "TextField.margin", textInsets, "ToggleButton.margin", buttonMargin, "ToolBar.emptyBorder", toolBarEmptyBorder, "ToolBar.separatorBorder", toolBarSeparatorBorder, "ToolBar.etchedBorder", toolBarEtchedBorder, "ToolBar.headerBorder", toolBarHeaderBorder, "ToolBar.separatorSize", toolBarSeparatorSize, "ToolBar.margin", new InsetsUIResource(0, 10, 0, 0), "Tree.selectionBorderColor", controlColor, "Tree.rowHeight", rowHeight };
    if (LookUtils.IS_JAVA_1_4) {
      defaults = append(defaults, new Object[] { "InternalFrame.icon", makeIcon(superclass, "icons/JavaCup.gif"), "OptionPane.errorIcon", isXP ? makeIcon(getClass(), "icons/xp/Error.png") : makeIcon(superclass, "icons/Error.gif"), "OptionPane.informationIcon", isXP ? makeIcon(getClass(), "icons/xp/Inform.png") : makeIcon(superclass, "icons/Inform.gif"), "OptionPane.warningIcon", isXP ? makeIcon(getClass(), "icons/xp/Warn.png") : makeIcon(superclass, "icons/Warn.gif"), "OptionPane.questionIcon", isXP ? makeIcon(getClass(), "icons/xp/Inform.png") : makeIcon(superclass, "icons/Question.gif") });
    }
    if ((LookUtils.IS_JAVA_1_4) || (LookUtils.IS_JAVA_5)) {
      defaults = append(defaults, new Object[] { "Tree.openIcon", isXP ? makeIcon(getClass(), "icons/xp/TreeOpen.png") : makeIcon(getClass(), "icons/TreeOpen.gif"), "Tree.closedIcon", isXP ? makeIcon(getClass(), "icons/xp/TreeClosed.png") : makeIcon(getClass(), "icons/TreeClosed.gif") });
    }
    if (LookUtils.IS_JAVA_6_OR_LATER) {
      defaults = append(defaults, new Object[] { "Spinner.border", table.get("TextField.border") });
    }
    table.putDefaults(defaults);
  }
  
  private void initComponentDefaultsClassic(UIDefaults table)
  {
    Object checkBoxIcon = new SimpleProxyLazyValue("com.jgoodies.looks.windows.WindowsLookAndFeel", "getCheckBoxIcon");
    
    Object radioButtonIcon = new SimpleProxyLazyValue("com.jgoodies.looks.windows.WindowsLookAndFeel", "getRadioButtonIcon");
    
    Border winInsetBorder = new BasicBorders.FieldBorder(table.getColor("controlShadow"), table.getColor("controlDkShadow"), table.getColor("controlHighlight"), table.getColor("controlLtHighlight"));
    
    Object[] defaults = { "CheckBox.checkColor", table.get("controlText"), "CheckBox.icon", checkBoxIcon, "RadioButton.checkColor", table.get("controlText"), "RadioButton.icon", radioButtonIcon, "Table.scrollPaneBorder", winInsetBorder };
    
    table.putDefaults(defaults);
  }
  
  private void initComponentDefaultsXP14(UIDefaults table)
  {
    Object[] defaults = { "TitledBorder.titleColor", table.getColor("activeCaption") };
    
    table.putDefaults(defaults);
  }
  
  private void initFontDefaults(UIDefaults table)
  {
    FontPolicy fontChoicePolicy = getFontPolicy();
    FontSet fontSet = fontChoicePolicy.getFontSet("Windows", table);
    initFontDefaults(table, fontSet);
  }
  
  private void initMenuItemDefaults(UIDefaults table, MicroLayout microLayout)
  {
    Object menuMargin = microLayout.getMenuMargin();
    Object menuItemMargin = microLayout.getMenuItemMargin();
    Icon menuItemCheckIcon = new MinimumSizedIcon();
    Object[] defaults = { "Menu.margin", menuMargin, "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.checkIcon", menuItemCheckIcon, "MenuItem.margin", menuItemMargin, "CheckBoxMenuItem.margin", menuItemMargin, "RadioButtonMenuItem.margin", menuItemMargin };
    
    table.putDefaults(defaults);
  }
  
  private static void initFontDefaults(UIDefaults table, FontSet fontSet)
  {
    Font controlFont = fontSet.getControlFont();
    Font menuFont = fontSet.getMenuFont();
    Font messageFont = fontSet.getMessageFont();
    Font toolTipFont = fontSet.getSmallFont();
    Font titleFont = fontSet.getTitleFont();
    Font windowFont = fontSet.getWindowTitleFont();
    
    Object[] defaults = { "Button.font", controlFont, "CheckBox.font", controlFont, "ColorChooser.font", controlFont, "ComboBox.font", controlFont, "EditorPane.font", controlFont, "FormattedTextField.font", controlFont, "Label.font", controlFont, "List.font", controlFont, "Panel.font", controlFont, "PasswordField.font", controlFont, "ProgressBar.font", controlFont, "RadioButton.font", controlFont, "ScrollPane.font", controlFont, "Spinner.font", controlFont, "TabbedPane.font", controlFont, "Table.font", controlFont, "TableHeader.font", controlFont, "TextArea.font", controlFont, "TextField.font", controlFont, "TextPane.font", controlFont, "ToolBar.font", controlFont, "ToggleButton.font", controlFont, "Tree.font", controlFont, "Viewport.font", controlFont, "InternalFrame.titleFont", windowFont, "OptionPane.font", messageFont, "OptionPane.messageFont", messageFont, "OptionPane.buttonFont", messageFont, "TitledBorder.font", titleFont, "ToolTip.font", toolTipFont, "CheckBoxMenuItem.font", menuFont, "CheckBoxMenuItem.acceleratorFont", menuFont, "Menu.font", menuFont, "Menu.acceleratorFont", menuFont, "MenuBar.font", menuFont, "MenuItem.font", menuFont, "MenuItem.acceleratorFont", menuFont, "PopupMenu.font", menuFont, "RadioButtonMenuItem.font", menuFont, "RadioButtonMenuItem.acceleratorFont", menuFont };
    
    table.putDefaults(defaults);
  }
  
  public static Border getButtonBorder()
  {
    return WindowsBorders.getButtonBorder();
  }
  
  public static Icon getCheckBoxIcon()
  {
    return WindowsIconFactory.getCheckBoxIcon();
  }
  
  public static Icon getRadioButtonIcon()
  {
    return WindowsIconFactory.getRadioButtonIcon();
  }
  
  private static Object[] append(Object[] source, String key, Object value)
  {
    int length = source.length;
    Object[] destination = new Object[length + 2];
    System.arraycopy(source, 0, destination, 0, length);
    destination[length] = key;
    destination[(length + 1)] = value;
    return destination;
  }
  
  private static Object[] append(Object[] source, Object[] keysAndValues)
  {
    int length = source.length;
    Object[] destination = new Object[length + keysAndValues.length];
    System.arraycopy(source, 0, destination, 0, length);
    for (int i = 0; i < keysAndValues.length; i++) {
      destination[(length + i)] = keysAndValues[i];
    }
    return destination;
  }
  
  private static class SimpleProxyLazyValue
    implements UIDefaults.LazyValue
  {
    private final String className;
    private final String methodName;
    
    public SimpleProxyLazyValue(String c, String m)
    {
      className = c;
      methodName = m;
    }
    
    public Object createValue(UIDefaults table)
    {
      Object instance = null;
      try
      {
        ClassLoader classLoader = table != null ? (ClassLoader)table.get("ClassLoader") : Thread.currentThread().getContextClassLoader();
        if (classLoader == null) {
          classLoader = getClass().getClassLoader();
        }
        Class c = Class.forName(className, true, classLoader);
        Method m = c.getMethod(methodName, null);
        instance = m.invoke(c, null);
      }
      catch (Throwable t)
      {
        LookUtils.log("Problem creating " + className + " with method " + methodName + t);
      }
      return instance;
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsLookAndFeel
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

final class WindowsMenuBarUI$1
  implements PropertyChangeListener
{
  private final WindowsMenuBarUI this$0;
  
  WindowsMenuBarUI$1(WindowsMenuBarUI paramWindowsMenuBarUI) {}
  
  public void propertyChange(PropertyChangeEvent e)
  {
    String prop = e.getPropertyName();
    if ((prop.equals("jgoodies.headerStyle")) || (prop.equals("jgoodies.windows.borderStyle"))) {
      WindowsMenuBarUI.access$000(this$0);
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsMenuBarUI.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.BorderStyle;
import com.jgoodies.looks.HeaderStyle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JMenuBar;
import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI;

public final class WindowsMenuBarUI
  extends com.sun.java.swing.plaf.windows.WindowsMenuBarUI
{
  private PropertyChangeListener listener;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsMenuBarUI();
  }
  
  protected void installDefaults()
  {
    super.installDefaults();
    installSpecialBorder();
  }
  
  protected void installListeners()
  {
    super.installListeners();
    listener = createBorderStyleListener();
    menuBar.addPropertyChangeListener(listener);
  }
  
  protected void uninstallListeners()
  {
    menuBar.removePropertyChangeListener(listener);
    super.uninstallListeners();
  }
  
  private PropertyChangeListener createBorderStyleListener()
  {
    new PropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent e)
      {
        String prop = e.getPropertyName();
        if ((prop.equals("jgoodies.headerStyle")) || (prop.equals("jgoodies.windows.borderStyle"))) {
          WindowsMenuBarUI.this.installSpecialBorder();
        }
      }
    };
  }
  
  private void installSpecialBorder()
  {
    BorderStyle borderStyle = BorderStyle.from(menuBar, "jgoodies.windows.borderStyle");
    String suffix;
    if (borderStyle == BorderStyle.EMPTY)
    {
      suffix = "emptyBorder";
    }
    else
    {
      String suffix;
      if (borderStyle == BorderStyle.ETCHED)
      {
        suffix = "etchedBorder";
      }
      else
      {
        String suffix;
        if (borderStyle == BorderStyle.SEPARATOR)
        {
          suffix = "separatorBorder";
        }
        else
        {
          String suffix;
          if (HeaderStyle.from(menuBar) == HeaderStyle.BOTH) {
            suffix = "headerBorder";
          } else {
            return;
          }
        }
      }
    }
    String suffix;
    LookAndFeel.installBorder(menuBar, "MenuBar." + suffix);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsMenuBarUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.common.MenuItemRenderer;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JMenuItem;
import javax.swing.UIManager;

final class WindowsMenuItemRenderer
  extends MenuItemRenderer
{
  public WindowsMenuItemRenderer(JMenuItem menuItem, boolean iconBorderEnabled, Font acceleratorFont, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground)
  {
    super(menuItem, iconBorderEnabled, acceleratorFont, selectionForeground, disabledForeground, acceleratorForeground, acceleratorSelectionForeground);
  }
  
  protected boolean isMnemonicHidden()
  {
    return WindowsLookAndFeel.isMnemonicHidden();
  }
  
  protected boolean disabledTextHasShadow()
  {
    return (!LookUtils.IS_LAF_WINDOWS_XP_ENABLED) || (UIManager.getColor("MenuItem.disabledForeground") == null);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsMenuItemRenderer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.common.ExtBasicMenuItemUI;
import com.jgoodies.looks.common.MenuItemRenderer;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.plaf.ComponentUI;

public final class WindowsMenuItemUI
  extends ExtBasicMenuItemUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsMenuItemUI();
  }
  
  protected MenuItemRenderer createRenderer(JMenuItem menuItem, boolean iconBorderEnabled, Font acceleratorFont, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground)
  {
    return new WindowsMenuItemRenderer(menuItem, iconBorderEnabled(), acceleratorFont, selectionForeground, disabledForeground, acceleratorForeground, acceleratorSelectionForeground);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsMenuItemUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.common.ExtButtonAreaLayout;
import java.awt.Container;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicOptionPaneUI;

public final class WindowsOptionPaneUI
  extends BasicOptionPaneUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsOptionPaneUI();
  }
  
  protected Container createButtonArea()
  {
    JPanel bottom = new JPanel(new ExtButtonAreaLayout(true, 6));
    bottom.setBorder(UIManager.getBorder("OptionPane.buttonAreaBorder"));
    addButtonComponents(bottom, getButtons(), getInitialValueIndex());
    return bottom;
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsOptionPaneUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.common.ExtPasswordView;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.Caret;
import javax.swing.text.Element;
import javax.swing.text.View;

public final class WindowsPasswordFieldUI
  extends com.sun.java.swing.plaf.windows.WindowsPasswordFieldUI
{
  public static ComponentUI createUI(JComponent c)
  {
    return new WindowsPasswordFieldUI();
  }
  
  public View create(Element elem)
  {
    return LookUtils.IS_JAVA_1_4_OR_5 ? new ExtPasswordView(elem) : super.create(elem);
  }
  
  protected Caret createCaret()
  {
    return new WindowsFieldCaret();
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsPasswordFieldUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

class WindowsPopupMenuUI$1 {}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsPopupMenuUI.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

final class WindowsPopupMenuUI$BorderStyleChangeHandler
  implements PropertyChangeListener
{
  private final WindowsPopupMenuUI this$0;
  
  WindowsPopupMenuUI$BorderStyleChangeHandler(WindowsPopupMenuUI x0, WindowsPopupMenuUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent e)
  {
    WindowsPopupMenuUI.access$100(this$0);
  }
  
  private WindowsPopupMenuUI$BorderStyleChangeHandler(WindowsPopupMenuUI paramWindowsPopupMenuUI) {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsPopupMenuUI.BorderStyleChangeHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.common.PopupMenuLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;

public final class WindowsPopupMenuUI
  extends com.sun.java.swing.plaf.windows.WindowsPopupMenuUI
{
  private PropertyChangeListener borderListener;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsPopupMenuUI();
  }
  
  public void installDefaults()
  {
    super.installDefaults();
    installBorder();
    if ((popupMenu.getLayout() == null) || ((popupMenu.getLayout() instanceof UIResource))) {
      popupMenu.setLayout(new PopupMenuLayout(popupMenu, 1));
    }
  }
  
  public void installListeners()
  {
    super.installListeners();
    borderListener = new BorderStyleChangeHandler(null);
    popupMenu.addPropertyChangeListener("JPopupMenu.noMargin", borderListener);
  }
  
  protected void uninstallListeners()
  {
    popupMenu.removePropertyChangeListener("JPopupMenu.noMargin", borderListener);
    super.uninstallListeners();
  }
  
  private final class BorderStyleChangeHandler
    implements PropertyChangeListener
  {
    BorderStyleChangeHandler(WindowsPopupMenuUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent e)
    {
      WindowsPopupMenuUI.this.installBorder();
    }
    
    private BorderStyleChangeHandler() {}
  }
  
  private void installBorder()
  {
    boolean useNarrowBorder = Boolean.TRUE.equals(popupMenu.getClientProperty("JPopupMenu.noMargin"));
    
    String suffix = useNarrowBorder ? "noMarginBorder" : "border";
    LookAndFeel.installBorder(popupMenu, "PopupMenu." + suffix);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsPopupMenuUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;

public final class WindowsScrollBarUI
  extends com.sun.java.swing.plaf.windows.WindowsScrollBarUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsScrollBarUI();
  }
  
  protected JButton createDecreaseButton(int orientation)
  {
    return new WindowsArrowButton(orientation);
  }
  
  protected JButton createIncreaseButton(int orientation)
  {
    return createDecreaseButton(orientation);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsScrollBarUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

class WindowsScrollPaneUI$1 {}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsScrollPaneUI.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JScrollPane;

class WindowsScrollPaneUI$BorderStyleChangeHandler
  implements PropertyChangeListener
{
  private final WindowsScrollPaneUI this$0;
  
  WindowsScrollPaneUI$BorderStyleChangeHandler(WindowsScrollPaneUI x0, WindowsScrollPaneUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent evt)
  {
    JScrollPane scrollPane = (JScrollPane)evt.getSource();
    this$0.installEtchedBorder(scrollPane);
  }
  
  private WindowsScrollPaneUI$BorderStyleChangeHandler(WindowsScrollPaneUI paramWindowsScrollPaneUI) {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsScrollPaneUI.BorderStyleChangeHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI;

public final class WindowsScrollPaneUI
  extends com.sun.java.swing.plaf.windows.WindowsScrollPaneUI
{
  private PropertyChangeListener borderStyleChangeHandler;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsScrollPaneUI();
  }
  
  protected void installDefaults(JScrollPane scrollPane)
  {
    super.installDefaults(scrollPane);
    installEtchedBorder(scrollPane);
  }
  
  protected void installEtchedBorder(JScrollPane scrollPane)
  {
    Object value = scrollPane.getClientProperty("jgoodies.isEtched");
    boolean hasEtchedBorder = Boolean.TRUE.equals(value);
    LookAndFeel.installBorder(scrollPane, hasEtchedBorder ? "ScrollPane.etchedBorder" : "ScrollPane.border");
  }
  
  public void installListeners(JScrollPane scrollPane)
  {
    super.installListeners(scrollPane);
    borderStyleChangeHandler = new BorderStyleChangeHandler(null);
    scrollPane.addPropertyChangeListener("jgoodies.isEtched", borderStyleChangeHandler);
  }
  
  protected void uninstallListeners(JComponent c)
  {
    ((JScrollPane)c).removePropertyChangeListener("jgoodies.isEtched", borderStyleChangeHandler);
    
    super.uninstallListeners(c);
  }
  
  private class BorderStyleChangeHandler
    implements PropertyChangeListener
  {
    BorderStyleChangeHandler(WindowsScrollPaneUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent evt)
    {
      JScrollPane scrollPane = (JScrollPane)evt.getSource();
      installEtchedBorder(scrollPane);
    }
    
    private BorderStyleChangeHandler() {}
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsScrollPaneUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSeparatorUI;

public final class WindowsSeparatorUI
  extends BasicSeparatorUI
{
  private static ComponentUI separatorUI;
  
  public static ComponentUI createUI(JComponent c)
  {
    if (separatorUI == null) {
      separatorUI = new WindowsSeparatorUI();
    }
    return separatorUI;
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsSeparatorUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.common.ExtBasicArrowButtonHandler;
import com.jgoodies.looks.common.ExtBasicSpinnerLayout;
import java.awt.Component;
import java.awt.Insets;
import java.awt.LayoutManager;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JSpinner.DefaultEditor;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.ComponentUI;

public final class WindowsSpinnerUI
  extends com.sun.java.swing.plaf.windows.WindowsSpinnerUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsSpinnerUI();
  }
  
  private static final ExtBasicArrowButtonHandler NEXT_BUTTON_HANDLER = new ExtBasicArrowButtonHandler("increment", true);
  private static final ExtBasicArrowButtonHandler PREVIOUS_BUTTON_HANDLER = new ExtBasicArrowButtonHandler("decrement", false);
  
  protected Component createPreviousButton()
  {
    if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED) {
      return super.createPreviousButton();
    }
    JButton b = new WindowsArrowButton(5);
    b.addActionListener(PREVIOUS_BUTTON_HANDLER);
    b.addMouseListener(PREVIOUS_BUTTON_HANDLER);
    return b;
  }
  
  protected Component createNextButton()
  {
    if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED) {
      return super.createNextButton();
    }
    JButton b = new WindowsArrowButton(1);
    b.addActionListener(NEXT_BUTTON_HANDLER);
    b.addMouseListener(NEXT_BUTTON_HANDLER);
    return b;
  }
  
  protected JComponent createEditor()
  {
    JComponent editor = spinner.getEditor();
    configureEditorBorder(editor);
    return editor;
  }
  
  protected LayoutManager createLayout()
  {
    return new ExtBasicSpinnerLayout();
  }
  
  protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
  {
    spinner.remove(oldEditor);
    configureEditorBorder(newEditor);
    spinner.add(newEditor, "Editor");
  }
  
  private void configureEditorBorder(JComponent editor)
  {
    if ((editor instanceof JSpinner.DefaultEditor))
    {
      JSpinner.DefaultEditor defaultEditor = (JSpinner.DefaultEditor)editor;
      JTextField editorField = defaultEditor.getTextField();
      Insets insets = UIManager.getInsets("Spinner.defaultEditorInsets");
      editorField.setBorder(new EmptyBorder(insets));
    }
    else if (((editor instanceof JPanel)) && (editor.getBorder() == null) && (editor.getComponentCount() > 0))
    {
      JComponent editorField = (JComponent)editor.getComponent(0);
      Insets insets = UIManager.getInsets("Spinner.defaultEditorInsets");
      editorField.setBorder(new EmptyBorder(insets));
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.windows.WindowsSpinnerUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.windows;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.UIManager;
import javax.swing.border.Border;

final class WindowsSplitPaneDivider$1
  extends JButton
{
  int[][] buffer = { { 0, 0, 0, 2, 2, 0, 0, 0, 0 }, { 0, 0, 2, 1, 1, 1, 0, 0, 0 }, { 0, 2, 1, 1, 1, 1, 1, 0, 0 }, { 2, 1, 1, 1, 1, 1, 1, 1, 0 }, { 0, 3, 3, 3, 3, 3, 3, 3, 3 } };
  private final WindowsSplitPaneDivider this$0;
  
  WindowsSplitPaneDivider$1(WindowsSplitPaneDivider paramWindowsSplitPaneDivider) {}
  
  public void setBorder(Border border) {}
  
  public void paint(Graphics g)
  {
    JSplitPane theSplitPane = this$0.getSplitPaneFromSuper();
    if (theSplitPane != null)
    {
      int theOrientation = this$0.getOrientationFromSuper();
      int blockSize = buffer.length + 1;
      
      Color[] colors = { getBackground(), UIManager.getColor("controlDkShadow"), Color.black, UIManager.getColor("controlLtHighlight") };
      
      g.setColor(getBackground());
      g.fillRect(0, 0, getWidth(), getHeight());
      if (getModel().isPressed()) {
        colors[1] = colors[2];
      }
      if (theOrientation == 0) {
        for (int i = 1; i <= buffer[0].length; i++) {
          for (int j = 1; j < blockSize; j++) {
            if (buffer[(j - 1)][(i - 1)] != 0)
            {
              g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
              g.drawLine(i - 1, j, i - 1, j);
            }
          }
        }
      } else {
        for (int i = 1; i <= buffer[0].length; i++) {
         
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd