looks-2.2.0

);
        }
      }
      Font menuFont = table == null ? controlFont : table.getFont("Menu.font");
      
      Font titleFont = controlFont;
      Font messageFont = table == null ? controlFont : table.getFont("OptionPane.font");
      
      Font smallFont = table == null ? controlFont.deriveFont(controlFont.getSize2D() - 2.0F) : table.getFont("ToolTip.font");
      
      Font windowTitleFont = table == null ? controlFont : table.getFont("InternalFrame.titleFont");
      
      return FontSets.createDefaultFontSet(controlFont, menuFont, titleFont, messageFont, smallFont, windowTitleFont);
    }
    
    private DefaultWindowsPolicy() {}
  }
  
  private static final class FixedPolicy
    implements FontPolicy
  {
    private final FontSet fontSet;
    
    FixedPolicy(FontSet fontSet)
    {
      this.fontSet = fontSet;
    }
    
    public FontSet getFontSet(String lafName, UIDefaults table)
    {
      return fontSet;
    }
  }
  
  private static final class Looks1xWindowsPolicy
    implements FontPolicy
  {
    Looks1xWindowsPolicy(FontPolicies.1 x0)
    {
      this();
    }
    
    public FontSet getFontSet(String lafName, UIDefaults table)
    {
      Font windowsControlFont = Fonts.getLooks1xWindowsControlFont();
      Font controlFont;
      Font controlFont;
      if (windowsControlFont != null)
      {
        controlFont = windowsControlFont;
      }
      else
      {
        Font controlFont;
        if (table != null) {
          controlFont = table.getFont("Button.font");
        } else {
          controlFont = new Font("Dialog", 0, 12);
        }
      }
      return FontSets.createDefaultFontSet(controlFont);
    }
    
    private Looks1xWindowsPolicy() {}
  }
}

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

import javax.swing.UIDefaults;

public abstract interface FontPolicy
{
  public abstract FontSet getFontSet(String paramString, UIDefaults paramUIDefaults);
}

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

import java.awt.Font;
import java.awt.Toolkit;
import java.util.Locale;

public final class Fonts
{
  public static final String TAHOMA_NAME = "Tahoma";
  public static final String SEGOE_UI_NAME = "Segoe UI";
  public static final Font TAHOMA_11PT = new Font("Tahoma", 0, 11);
  public static final Font TAHOMA_13PT = new Font("Tahoma", 0, 13);
  public static final Font TAHOMA_14PT = new Font("Tahoma", 0, 14);
  public static final Font SEGOE_UI_12PT = new Font("Segoe UI", 0, 12);
  public static final Font SEGOE_UI_13PT = new Font("Segoe UI", 0, 13);
  public static final Font SEGOE_UI_15PT = new Font("Segoe UI", 0, 15);
  public static final Font WINDOWS_XP_96DPI_NORMAL = TAHOMA_11PT;
  public static final Font WINDOWS_XP_96DPI_DEFAULT_GUI = TAHOMA_11PT;
  public static final Font WINDOWS_XP_96DPI_LARGE = TAHOMA_13PT;
  public static final Font WINDOWS_XP_120DPI_NORMAL = TAHOMA_14PT;
  public static final Font WINDOWS_XP_120DPI_DEFAULT_GUI = TAHOMA_13PT;
  public static final Font WINDOWS_VISTA_96DPI_NORMAL = SEGOE_UI_12PT;
  public static final Font WINDOWS_VISTA_96DPI_LARGE = SEGOE_UI_15PT;
  static final Font WINDOWS_VISTA_101DPI_NORMAL = SEGOE_UI_13PT;
  public static final Font WINDOWS_VISTA_120DPI_NORMAL = SEGOE_UI_15PT;
  static final String WINDOWS_DEFAULT_GUI_FONT_KEY = "win.defaultGUI.font";
  static final String WINDOWS_ICON_FONT_KEY = "win.icon.font";
  
  static Font getDefaultGUIFontWesternModernWindowsNormal()
  {
    return LookUtils.IS_LOW_RESOLUTION ? WINDOWS_XP_96DPI_DEFAULT_GUI : WINDOWS_XP_120DPI_DEFAULT_GUI;
  }
  
  static Font getDefaultIconFontWesternModernWindowsNormal()
  {
    return LookUtils.IS_LOW_RESOLUTION ? WINDOWS_XP_96DPI_NORMAL : WINDOWS_XP_120DPI_NORMAL;
  }
  
  static Font getDefaultIconFontWesternWindowsVistaNormal()
  {
    return LookUtils.IS_LOW_RESOLUTION ? WINDOWS_VISTA_96DPI_NORMAL : WINDOWS_VISTA_120DPI_NORMAL;
  }
  
  static Font getLooks1xWindowsControlFont()
  {
    if (!LookUtils.IS_OS_WINDOWS) {
      throw new UnsupportedOperationException();
    }
    return getDesktopFont("win.defaultGUI.font");
  }
  
  public static Font getWindowsControlFont()
  {
    if (!LookUtils.IS_OS_WINDOWS) {
      throw new UnsupportedOperationException();
    }
    Font defaultGUIFont = getDefaultGUIFont();
    if ((LookUtils.IS_OS_WINDOWS_95) || (LookUtils.IS_OS_WINDOWS_98) || (LookUtils.IS_OS_WINDOWS_NT) || (LookUtils.IS_OS_WINDOWS_ME)) {
      return defaultGUIFont;
    }
    if ((LookUtils.IS_OS_WINDOWS_VISTA) && (LookUtils.IS_JAVA_1_4_OR_5))
    {
      Font tahoma = getDefaultGUIFontWesternModernWindowsNormal();
      return Boolean.TRUE.equals(canDisplayLocalizedText(tahoma, Locale.getDefault())) ? tahoma : defaultGUIFont;
    }
    Font iconFont = getDesktopFont("win.icon.font");
    return Boolean.TRUE.equals(canDisplayLocalizedText(iconFont, Locale.getDefault())) ? iconFont : defaultGUIFont;
  }
  
  private static Font getDefaultGUIFont()
  {
    Font font = getDesktopFont("win.defaultGUI.font");
    if (font != null) {
      return font;
    }
    return new Font("Dialog", 0, 12);
  }
  
  public static Boolean canDisplayLocalizedText(Font font, Locale locale)
  {
    if (localeHasLocalizedDisplayLanguage(locale)) {
      return Boolean.valueOf(canDisplayLocalizedDisplayLanguage(font, locale));
    }
    String fontName = font.getName();
    String language = locale.getLanguage();
    if ("Tahoma".equals(fontName))
    {
      if ("hi".equals(language)) {
        return Boolean.FALSE;
      }
      if ("ja".equals(language)) {
        return Boolean.FALSE;
      }
      if ("ko".equals(language)) {
        return Boolean.FALSE;
      }
      if ("zh".equals(language)) {
        return Boolean.FALSE;
      }
    }
    if ("Microsoft Sans Serif".equals(fontName))
    {
      if ("ja".equals(language)) {
        return Boolean.FALSE;
      }
      if ("ko".equals(language)) {
        return Boolean.FALSE;
      }
      if ("zh".equals(language)) {
        return Boolean.FALSE;
      }
    }
    return null;
  }
  
  private static boolean canDisplayLocalizedDisplayLanguage(Font font, Locale locale)
  {
    String testString = locale.getDisplayLanguage(locale);
    int index = font.canDisplayUpTo(testString);
    return index == -1;
  }
  
  private static boolean localeHasLocalizedDisplayLanguage(Locale locale)
  {
    if (locale.getLanguage().equals(Locale.ENGLISH.getLanguage())) {
      return true;
    }
    String englishDisplayLanguage = locale.getDisplayLanguage(Locale.ENGLISH);
    String localizedDisplayLanguage = locale.getDisplayLanguage(locale);
    return !englishDisplayLanguage.equals(localizedDisplayLanguage);
  }
  
  private static Font getDesktopFont(String fontName)
  {
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    return (Font)toolkit.getDesktopProperty(fontName);
  }
}

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

import javax.swing.plaf.FontUIResource;

public abstract interface FontSet
{
  public abstract FontUIResource getControlFont();
  
  public abstract FontUIResource getMenuFont();
  
  public abstract FontUIResource getTitleFont();
  
  public abstract FontUIResource getWindowTitleFont();
  
  public abstract FontUIResource getSmallFont();
  
  public abstract FontUIResource getMessageFont();
}

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

class FontSets$1 {}

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

import java.awt.Font;
import javax.swing.plaf.FontUIResource;

final class FontSets$DefaultFontSet
  implements FontSet
{
  private final FontUIResource controlFont;
  private final FontUIResource menuFont;
  private final FontUIResource titleFont;
  private final FontUIResource messageFont;
  private final FontUIResource smallFont;
  private final FontUIResource windowTitleFont;
  
  public FontSets$DefaultFontSet(Font controlFont, Font menuFont, Font titleFont, Font messageFont, Font smallFont, Font windowTitleFont)
  {
    this.controlFont = new FontUIResource(controlFont);
    this.menuFont = (menuFont != null ? new FontUIResource(menuFont) : this.controlFont);
    
    this.titleFont = (titleFont != null ? new FontUIResource(titleFont) : this.controlFont);
    
    this.messageFont = (messageFont != null ? new FontUIResource(messageFont) : this.controlFont);
    
    this.smallFont = new FontUIResource(smallFont != null ? smallFont : controlFont.deriveFont(controlFont.getSize2D() - 2.0F));
    
    this.windowTitleFont = (windowTitleFont != null ? new FontUIResource(windowTitleFont) : this.titleFont);
  }
  
  public FontUIResource getControlFont()
  {
    return controlFont;
  }
  
  public FontUIResource getMenuFont()
  {
    return menuFont;
  }
  
  public FontUIResource getTitleFont()
  {
    return titleFont;
  }
  
  public FontUIResource getWindowTitleFont()
  {
    return windowTitleFont;
  }
  
  public FontUIResource getSmallFont()
  {
    return smallFont;
  }
  
  public FontUIResource getMessageFont()
  {
    return messageFont;
  }
}

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

import java.awt.Font;
import javax.swing.plaf.FontUIResource;

final class FontSets$LogicalFontSet
  implements FontSet
{
  private FontUIResource controlFont;
  private FontUIResource titleFont;
  private FontUIResource systemFont;
  private FontUIResource smallFont;
  
  FontSets$LogicalFontSet(FontSets.1 x0)
  {
    this();
  }
  
  public FontUIResource getControlFont()
  {
    if (controlFont == null) {
      controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont", new Font("Dialog", 0, 12)));
    }
    return controlFont;
  }
  
  public FontUIResource getMenuFont()
  {
    return getControlFont();
  }
  
  public FontUIResource getTitleFont()
  {
    if (titleFont == null) {
      titleFont = new FontUIResource(getControlFont().deriveFont(1));
    }
    return titleFont;
  }
  
  public FontUIResource getSmallFont()
  {
    if (smallFont == null) {
      smallFont = new FontUIResource(Font.getFont("swing.plaf.metal.smallFont", new Font("Dialog", 0, 10)));
    }
    return smallFont;
  }
  
  public FontUIResource getMessageFont()
  {
    if (systemFont == null) {
      systemFont = new FontUIResource(Font.getFont("swing.plaf.metal.systemFont", new Font("Dialog", 0, 12)));
    }
    return systemFont;
  }
  
  public FontUIResource getWindowTitleFont()
  {
    return getTitleFont();
  }
  
  private FontSets$LogicalFontSet() {}
}

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

import java.awt.Font;
import javax.swing.plaf.FontUIResource;

public final class FontSets
{
  private static FontSet logicalFontSet;
  
  public static FontSet createDefaultFontSet(Font controlFont)
  {
    return createDefaultFontSet(controlFont, null);
  }
  
  public static FontSet createDefaultFontSet(Font controlFont, Font menuFont)
  {
    return createDefaultFontSet(controlFont, menuFont, null, null, null, null);
  }
  
  public static FontSet createDefaultFontSet(Font controlFont, Font menuFont, Font titleFont)
  {
    return createDefaultFontSet(controlFont, menuFont, titleFont, null, null, null);
  }
  
  public static FontSet createDefaultFontSet(Font controlFont, Font menuFont, Font titleFont, Font messageFont, Font smallFont, Font windowTitleFont)
  {
    return new DefaultFontSet(controlFont, menuFont, titleFont, messageFont, smallFont, windowTitleFont);
  }
  
  public static FontSet getLogicalFontSet()
  {
    if (logicalFontSet == null) {
      logicalFontSet = new LogicalFontSet(null);
    }
    return logicalFontSet;
  }
  
  private static final class DefaultFontSet
    implements FontSet
  {
    private final FontUIResource controlFont;
    private final FontUIResource menuFont;
    private final FontUIResource titleFont;
    private final FontUIResource messageFont;
    private final FontUIResource smallFont;
    private final FontUIResource windowTitleFont;
    
    public DefaultFontSet(Font controlFont, Font menuFont, Font titleFont, Font messageFont, Font smallFont, Font windowTitleFont)
    {
      this.controlFont = new FontUIResource(controlFont);
      this.menuFont = (menuFont != null ? new FontUIResource(menuFont) : this.controlFont);
      
      this.titleFont = (titleFont != null ? new FontUIResource(titleFont) : this.controlFont);
      
      this.messageFont = (messageFont != null ? new FontUIResource(messageFont) : this.controlFont);
      
      this.smallFont = new FontUIResource(smallFont != null ? smallFont : controlFont.deriveFont(controlFont.getSize2D() - 2.0F));
      
      this.windowTitleFont = (windowTitleFont != null ? new FontUIResource(windowTitleFont) : this.titleFont);
    }
    
    public FontUIResource getControlFont()
    {
      return controlFont;
    }
    
    public FontUIResource getMenuFont()
    {
      return menuFont;
    }
    
    public FontUIResource getTitleFont()
    {
      return titleFont;
    }
    
    public FontUIResource getWindowTitleFont()
    {
      return windowTitleFont;
    }
    
    public FontUIResource getSmallFont()
    {
      return smallFont;
    }
    
    public FontUIResource getMessageFont()
    {
      return messageFont;
    }
  }
  
  private static final class LogicalFontSet
    implements FontSet
  {
    private FontUIResource controlFont;
    private FontUIResource titleFont;
    private FontUIResource systemFont;
    private FontUIResource smallFont;
    
    LogicalFontSet(FontSets.1 x0)
    {
      this();
    }
    
    public FontUIResource getControlFont()
    {
      if (controlFont == null) {
        controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont", new Font("Dialog", 0, 12)));
      }
      return controlFont;
    }
    
    public FontUIResource getMenuFont()
    {
      return getControlFont();
    }
    
    public FontUIResource getTitleFont()
    {
      if (titleFont == null) {
        titleFont = new FontUIResource(getControlFont().deriveFont(1));
      }
      return titleFont;
    }
    
    public FontUIResource getSmallFont()
    {
      if (smallFont == null) {
        smallFont = new FontUIResource(Font.getFont("swing.plaf.metal.smallFont", new Font("Dialog", 0, 10)));
      }
      return smallFont;
    }
    
    public FontUIResource getMessageFont()
    {
      if (systemFont == null) {
        systemFont = new FontUIResource(Font.getFont("swing.plaf.metal.systemFont", new Font("Dialog", 0, 12)));
      }
      return systemFont;
    }
    
    public FontUIResource getWindowTitleFont()
    {
      return getTitleFont();
    }
    
    private LogicalFontSet() {}
  }
}

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

import javax.swing.JComponent;
import javax.swing.JMenuBar;
import javax.swing.JToolBar;

public final class HeaderStyle
{
  public static final HeaderStyle SINGLE = new HeaderStyle("Single");
  public static final HeaderStyle BOTH = new HeaderStyle("Both");
  private final String name;
  
  private HeaderStyle(String name)
  {
    this.name = name;
  }
  
  public static HeaderStyle from(JMenuBar menuBar)
  {
    return from0(menuBar);
  }
  
  public static HeaderStyle from(JToolBar toolBar)
  {
    return from0(toolBar);
  }
  
  private static HeaderStyle from0(JComponent c)
  {
    Object value = c.getClientProperty("jgoodies.headerStyle");
    if ((value instanceof HeaderStyle)) {
      return (HeaderStyle)value;
    }
    if ((value instanceof String)) {
      return valueOf((String)value);
    }
    return null;
  }
  
  private static HeaderStyle valueOf(String name)
  {
    if (name.equalsIgnoreCase(SINGLEname)) {
      return SINGLE;
    }
    if (name.equalsIgnoreCase(BOTHname)) {
      return BOTH;
    }
    throw new IllegalArgumentException("Invalid HeaderStyle name " + name);
  }
  
  public String toString()
  {
    return name;
  }
}

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

import com.jgoodies.looks.plastic.PlasticLookAndFeel;
import com.jgoodies.looks.plastic.PlasticTheme;
import java.awt.Color;
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.image.ColorModel;
import java.io.PrintStream;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public final class LookUtils
{
  private static final String JAVA_VERSION = getSystemProperty("java.version");
  private static final String OS_NAME = getSystemProperty("os.name");
  private static final String OS_VERSION = getSystemProperty("os.version");
  public static final boolean IS_JAVA_1_4 = startsWith(JAVA_VERSION, "1.4");
  public static final boolean IS_JAVA_1_4_0 = startsWith(JAVA_VERSION, "1.4.0");
  public static final boolean IS_JAVA_1_4_2_OR_LATER = (!startsWith(JAVA_VERSION, "1.4.0")) && (!startsWith(JAVA_VERSION, "1.4.1"));
  public static final boolean IS_JAVA_5 = startsWith(JAVA_VERSION, "1.5");
  public static final boolean IS_JAVA_5_OR_LATER = !IS_JAVA_1_4;
  public static final boolean IS_JAVA_6 = startsWith(JAVA_VERSION, "1.6");
  public static final boolean IS_JAVA_6_OR_LATER = (!IS_JAVA_1_4) && (!IS_JAVA_5);
  public static final boolean IS_JAVA_1_4_OR_5 = (IS_JAVA_1_4) || (IS_JAVA_5);
  public static final boolean IS_OS_FREEBSD = startsWithIgnoreCase(OS_NAME, "FreeBSD");
  public static final boolean IS_OS_LINUX = startsWithIgnoreCase(OS_NAME, "Linux");
  public static final boolean IS_OS_OS2 = startsWith(OS_NAME, "OS/2");
  public static final boolean IS_OS_MAC = startsWith(OS_NAME, "Mac");
  public static final boolean IS_OS_WINDOWS = startsWith(OS_NAME, "Windows");
  public static final boolean IS_OS_WINDOWS_MODERN = (startsWith(OS_NAME, "Windows")) && (!startsWith(OS_VERSION, "4.0"));
  public static final boolean IS_OS_WINDOWS_95 = (startsWith(OS_NAME, "Windows 9")) && (startsWith(OS_VERSION, "4.0"));
  public static final boolean IS_OS_WINDOWS_98 = (startsWith(OS_NAME, "Windows 9")) && (startsWith(OS_VERSION, "4.1"));
  public static final boolean IS_OS_WINDOWS_NT = startsWith(OS_NAME, "Windows NT");
  public static final boolean IS_OS_WINDOWS_ME = (startsWith(OS_NAME, "Windows")) && (startsWith(OS_VERSION, "4.9"));
  public static final boolean IS_OS_WINDOWS_2000 = (startsWith(OS_NAME, "Windows")) && (startsWith(OS_VERSION, "5.0"));
  public static final boolean IS_OS_WINDOWS_XP = (startsWith(OS_NAME, "Windows")) && (startsWith(OS_VERSION, "5.1"));
  public static final boolean IS_OS_WINDOWS_VISTA = (startsWith(OS_NAME, "Windows")) && (startsWith(OS_VERSION, "6.0"));
  public static final boolean IS_OS_SOLARIS = startsWith(OS_NAME, "Solaris");
  public static final boolean IS_LAF_WINDOWS_XP_ENABLED = isWindowsXPLafEnabled();
  public static final boolean IS_LOW_RESOLUTION = isLowResolution();
  private static boolean loggingEnabled = true;
  
  public static String getSystemProperty(String key)
  {
    try
    {
      return System.getProperty(key);
    }
    catch (SecurityException e)
    {
      log("Can't read the System property " + key + ".");
    }
    return null;
  }
  
  public static String getSystemProperty(String key, String defaultValue)
  {
    try
    {
      return System.getProperty(key, defaultValue);
    }
    catch (SecurityException e)
    {
      log("Can't read the System property " + key + ".");
    }
    return defaultValue;
  }
  
  public static Boolean getBooleanSystemProperty(String key, String logMessage)
  {
    String value = getSystemProperty(key, "");
    Boolean result;
    Boolean result;
    if (value.equalsIgnoreCase("false"))
    {
      result = Boolean.FALSE;
    }
    else
    {
      Boolean result;
      if (value.equalsIgnoreCase("true")) {
        result = Boolean.TRUE;
      } else {
        result = null;
      }
    }
    if (result != null) {
      log(logMessage + " have been " + (result.booleanValue() ? "en" : "dis") + "abled in the system properties.");
    }
    return result;
  }
  
  private static boolean isWindowsXPLafEnabled()
  {
    return ((IS_OS_WINDOWS_XP) || (IS_OS_WINDOWS_VISTA)) && (IS_JAVA_1_4_2_OR_LATER) && (Boolean.TRUE.equals(Toolkit.getDefaultToolkit().getDesktopProperty("win.xpstyle.themeActive"))) && (getSystemProperty("swing.noxp") == null);
  }
  
  public static boolean isTrueColor(Component c)
  {
    return c.getToolkit().getColorModel().getPixelSize() >= 24;
  }
  
  public static boolean getToolkitUsesNativeDropShadows()
  {
    return IS_OS_MAC;
  }
  
  public static Color getSlightlyBrighter(Color color)
  {
    return getSlightlyBrighter(color, 1.1F);
  }
  
  public static Color getSlightlyBrighter(Color color, float factor)
  {
    float[] hsbValues = new float[3];
    Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsbValues);
    
    float hue = hsbValues[0];
    float saturation = hsbValues[1];
    float brightness = hsbValues[2];
    float newBrightness = Math.min(brightness * factor, 1.0F);
    return Color.getHSBColor(hue, saturation, newBrightness);
  }
  
  public static void setLookAndTheme(LookAndFeel laf, Object theme)
    throws UnsupportedLookAndFeelException
  {
    if (((laf instanceof PlasticLookAndFeel)) && (theme != null) && ((theme instanceof PlasticTheme))) {
      PlasticLookAndFeel.setPlasticTheme((PlasticTheme)theme);
    }
    UIManager.setLookAndFeel(laf);
  }
  
  public static Object getDefaultTheme(LookAndFeel laf)
  {
    return (laf instanceof PlasticLookAndFeel) ? PlasticLookAndFeel.createMyDefaultTheme() : null;
  }
  
  public static List getInstalledThemes(LookAndFeel laf)
  {
    return (laf instanceof PlasticLookAndFeel) ? PlasticLookAndFeel.getInstalledThemes() : Collections.EMPTY_LIST;
  }
  
  public static void setLoggingEnabled(boolean enabled)
  {
    loggingEnabled = enabled;
  }
  
  public static void log()
  {
    if (loggingEnabled) {
      System.out.println();
    }
  }
  
  public static void log(String message)
  {
    if (loggingEnabled) {
      System.out.println("JGoodies Looks: " + message);
    }
  }
  
  private static boolean isLowResolution()
  {
    return Toolkit.getDefaultToolkit().getScreenResolution() < 120;
  }
  
  private static boolean startsWith(String str, String prefix)
  {
    return (str != null) && (str.startsWith(prefix));
  }
  
  private static boolean startsWithIgnoreCase(String str, String prefix)
  {
    return (str != null) && (str.toUpperCase(Locale.ENGLISH).startsWith(prefix.toUpperCase(Locale.ENGLISH)));
  }
}

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

import java.awt.Insets;
import javax.swing.plaf.InsetsUIResource;

public final class MicroLayout
{
  private final InsetsUIResource textInsets;
  private final InsetsUIResource wrappedTextInsets;
  private final InsetsUIResource comboBoxEditorInsets;
  private final Insets buttonBorderInsets;
  private final InsetsUIResource buttonMargin;
  private final InsetsUIResource commitButtonMargin;
  private final int comboBorderSize;
  private final int comboPopupBorderSize;
  private final InsetsUIResource checkBoxMargin;
  private final InsetsUIResource menuItemMargin;
  private final InsetsUIResource menuMargin;
  private final InsetsUIResource popupMenuSeparatorMargin;
  
  public MicroLayout(InsetsUIResource textInsets, InsetsUIResource wrappedTextInsets, InsetsUIResource comboBoxEditorInsets, int comboBorderSize, int comboPopupBorderSize, Insets buttonBorderInsets, InsetsUIResource buttonMargin, InsetsUIResource commitButtonMargin, InsetsUIResource checkBoxMargin, InsetsUIResource menuItemMargin, InsetsUIResource menuMargin, InsetsUIResource popupMenuSeparatorMargin)
  {
    this.textInsets = textInsets;
    this.wrappedTextInsets = wrappedTextInsets;
    this.comboBoxEditorInsets = comboBoxEditorInsets;
    this.buttonBorderInsets = buttonBorderInsets;
    this.buttonMargin = buttonMargin;
    this.commitButtonMargin = commitButtonMargin;
    this.comboBorderSize = comboBorderSize;
    this.comboPopupBorderSize = comboPopupBorderSize;
    this.checkBoxMargin = checkBoxMargin;
    this.menuItemMargin = menuItemMargin;
    this.menuMargin = menuMargin;
    this.popupMenuSeparatorMargin = popupMenuSeparatorMargin;
  }
  
  public Insets getButtonBorderInsets()
  {
    return buttonBorderInsets;
  }
  
  public InsetsUIResource getButtonMargin()
  {
    return buttonMargin;
  }
  
  public InsetsUIResource getCommitButtonMargin()
  {
    return commitButtonMargin;
  }
  
  public int getComboBorderSize()
  {
    return comboBorderSize;
  }
  
  public int getComboPopupBorderSize()
  {
    return comboPopupBorderSize;
  }
  
  public InsetsUIResource getComboBoxEditorInsets()
  {
    return comboBoxEditorInsets;
  }
  
  public InsetsUIResource getCheckBoxMargin()
  {
    return checkBoxMargin;
  }
  
  public InsetsUIResource getMenuItemMargin()
  {
    return menuItemMargin;
  }
  
  public InsetsUIResource getMenuMargin()
  {
    return menuMargin;
  }
  
  public InsetsUIResource getPopupMenuSeparatorMargin()
  {
    return popupMenuSeparatorMargin;
  }
  
  public InsetsUIResource getTextInsets()
  {
    return textInsets;
  }
  
  public InsetsUIResource getWrappedTextInsets()
  {
    return wrappedTextInsets;
  }
}

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

class MicroLayoutPolicies$1 {}

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

import javax.swing.UIDefaults;

final class MicroLayoutPolicies$DefaultPlasticPolicy
  implements MicroLayoutPolicy
{
  MicroLayoutPolicies$DefaultPlasticPolicy(MicroLayoutPolicies.1 x0)
  {
    this();
  }
  
  public MicroLayout getMicroLayout(String lafName, UIDefaults table)
  {
    boolean isClassic = !LookUtils.IS_LAF_WINDOWS_XP_ENABLED;
    boolean isVista = LookUtils.IS_OS_WINDOWS_VISTA;
    boolean isLowRes = LookUtils.IS_LOW_RESOLUTION;
    boolean isPlasticXP = lafName.equals("JGoodies Plastic XP");
    if (isPlasticXP)
    {
      if (isVista) {
        return isClassic ? MicroLayouts.createPlasticXPVistaClassicMicroLayout() : MicroLayouts.createPlasticXPVistaMicroLayout();
      }
      return isLowRes ? MicroLayouts.createPlasticXPLowResMicroLayout() : MicroLayouts.createPlasticXPHiResMicroLayout();
    }
    if (isVista) {
      return isClassic ? MicroLayouts.createPlasticVistaClassicMicroLayout() : MicroLayouts.createPlasticVistaMicroLayout();
    }
    return isLowRes ? MicroLayouts.createPlasticLowResMicroLayout() : MicroLayouts.createPlasticHiResMicroLayout();
  }
  
  private MicroLayoutPolicies$DefaultPlasticPolicy() {}
}

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

import javax.swing.UIDefaults;

final class MicroLayoutPolicies$DefaultWindowsPolicy
  implements MicroLayoutPolicy
{
  MicroLayoutPolicies$DefaultWindowsPolicy(MicroLayoutPolicies.1 x0)
  {
    this();
  }
  
  public MicroLayout getMicroLayout(String lafName, UIDefaults table)
  {
    boolean isClassic = !LookUtils.IS_LAF_WINDOWS_XP_ENABLED;
    boolean isVista = LookUtils.IS_OS_WINDOWS_VISTA;
    boolean isLowRes = LookUtils.IS_LOW_RESOLUTION;
    if (isClassic) {
      return isLowRes ? MicroLayouts.createWindowsClassicLowResMicroLayout() : MicroLayouts.createWindowsClassicHiResMicroLayout();
    }
    if (isVista) {
      return isLowRes ? MicroLayouts.createWindowsVistaLowResMicroLayout() : MicroLayouts.createWindowsVistaHiResMicroLayout();
    }
    return isLowRes ? MicroLayouts.createWindowsXPLowResMicroLayout() : MicroLayouts.createWindowsXPHiResMicroLayout();
  }
  
  private MicroLayoutPolicies$DefaultWindowsPolicy() {}
}

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

import javax.swing.UIDefaults;

public final class MicroLayoutPolicies
{
  public static MicroLayoutPolicy getDefaultPlasticPolicy()
  {
    return new DefaultPlasticPolicy(null);
  }
  
  public static MicroLayoutPolicy getDefaultWindowsPolicy()
  {
    return new DefaultWindowsPolicy(null);
  }
  
  private static final class DefaultPlasticPolicy
    implements MicroLayoutPolicy
  {
    DefaultPlasticPolicy(MicroLayoutPolicies.1 x0)
    {
      this();
    }
    
    public MicroLayout getMicroLayout(String lafName, UIDefaults table)
    {
      boolean isClassic = !LookUtils.IS_LAF_WINDOWS_XP_ENABLED;
      boolean isVista = LookUtils.IS_OS_WINDOWS_VISTA;
      boolean isLowRes = LookUtils.IS_LOW_RESOLUTION;
      boolean isPlasticXP = lafName.equals("JGoodies Plastic XP");
      if (isPlasticXP)
      {
        if (isVista) {
          return isClassic ? MicroLayouts.createPlasticXPVistaClassicMicroLayout() : MicroLayouts.createPlasticXPVistaMicroLayout();
        }
        return isLowRes ? MicroLayouts.createPlasticXPLowResMicroLayout() : MicroLayouts.createPlasticXPHiResMicroLayout();
      }
      if (isVista) {
        return isClassic ? MicroLayouts.createPlasticVistaClassicMicroLayout() : MicroLayouts.createPlasticVistaMicroLayout();
      }
      return isLowRes ? MicroLayouts.createPlasticLowResMicroLayout() : MicroLayouts.createPlasticHiResMicroLayout();
    }
    
    private DefaultPlasticPolicy() {}
  }
  
  private static final class DefaultWindowsPolicy
    implements MicroLayoutPolicy
  {
    DefaultWindowsPolicy(MicroLayoutPolicies.1 x0)
    {
      this();
    }
    
    public MicroLayout getMicroLayout(String lafName, UIDefaults table)
    {
      boolean isClassic = !LookUtils.IS_LAF_WINDOWS_XP_ENABLED;
      boolean isVista = LookUtils.IS_OS_WINDOWS_VISTA;
      boolean isLowRes = LookUtils.IS_LOW_RESOLUTION;
      if (isClassic) {
        return isLowRes ? MicroLayouts.createWindowsClassicLowResMicroLayout() : MicroLayouts.createWindowsClassicHiResMicroLayout();
      }
      if (isVista) {
        return isLowRes ? MicroLayouts.createWindowsVistaLowResMicroLayout() : MicroLayouts.createWindowsVistaHiResMicroLayout();
      }
      return isLowRes ? MicroLayouts.createWindowsXPLowResMicroLayout() : MicroLayouts.createWindowsXPHiResMicroLayout();
    }
    
    private DefaultWindowsPolicy() {}
  }
}

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

import javax.swing.UIDefaults;

public abstract interface MicroLayoutPolicy
{
  public abstract MicroLayout getMicroLayout(String paramString, UIDefaults paramUIDefaults);
}

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

import java.awt.Insets;
import javax.swing.plaf.InsetsUIResource;

public final class MicroLayouts
{
  private static final InsetsUIResource PLASTIC_MENU_ITEM_MARGIN = new InsetsUIResource(3, 0, 3, 0);
  private static final InsetsUIResource PLASTIC_MENU_MARGIN = new InsetsUIResource(2, 4, 2, 4);
  private static final InsetsUIResource PLASTIC_CHECK_BOX_MARGIN = new InsetsUIResource(2, 0, 2, 1);
  
  public static MicroLayout createPlasticLowResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 1, 2, 1), new InsetsUIResource(2, 2, 2, 1), new InsetsUIResource(1, 1, 2, 1), -1, 1, new Insets(2, 3, 3, 3), getButtonMargin(1, 1), getButtonMargin(1, 1), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticHiResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 1, 2, 1), new InsetsUIResource(2, 2, 2, 1), new InsetsUIResource(1, 1, 2, 1), -1, 1, new Insets(1, 3, 1, 3), getButtonMargin(2, 3), getButtonMargin(2, 3), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticVistaMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 1, 1, 1), new InsetsUIResource(1, 2, 1, 1), new InsetsUIResource(1, 1, 1, 1), -1, 1, new Insets(2, 3, 3, 3), getButtonMargin(0, 1), getButtonMargin(0, 1), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticVistaClassicMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 1, 2, 1), new InsetsUIResource(2, 2, 2, 1), new InsetsUIResource(1, 1, 2, 1), -1, 1, new Insets(3, 3, 3, 3), getButtonMargin(0, 1), getButtonMargin(0, 1), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticXPLowResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), -1, 1, new Insets(3, 2, 3, 2), getButtonMargin(0, 1), getButtonMargin(0, 1), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticXPHiResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), -1, 1, new Insets(2, 2, 2, 2), getButtonMargin(1, 2), getButtonMargin(1, 2), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticXPVistaMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), -1, 1, new Insets(2, 2, 3, 2), getButtonMargin(0, 0), getButtonMargin(0, 0), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  public static MicroLayout createPlasticXPVistaClassicMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), -1, 1, new Insets(3, 2, 4, 2), getButtonMargin(0, 0), getButtonMargin(0, 0), PLASTIC_CHECK_BOX_MARGIN, PLASTIC_MENU_ITEM_MARGIN, PLASTIC_MENU_MARGIN, null);
  }
  
  private static final InsetsUIResource WINDOWS_CHECK_BOX_MARGIN = new InsetsUIResource(2, 0, 2, 0);
  
  public static MicroLayout createWindowsClassicLowResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), 2, 1, new Insets(3, 2, 4, 2), getButtonMargin(1, 1), getButtonMargin(1, 1), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(3, 0, 3, 0), new InsetsUIResource(2, 3, 2, 3), new InsetsUIResource(2, 0, 3, 0));
  }
  
  public static MicroLayout createWindowsClassicHiResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), 2, 1, new Insets(3, 2, 4, 2), getButtonMargin(1, 1), getButtonMargin(1, 1), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(2, 0, 2, 0), new InsetsUIResource(2, 4, 2, 4), new InsetsUIResource(3, 0, 4, 0));
  }
  
  public static MicroLayout createWindowsXPLowResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), 1, 1, new Insets(3, 2, 4, 2), getButtonMargin(2, 3), getButtonMargin(2, 3), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(3, 0, 3, 0), new InsetsUIResource(2, 3, 2, 4), new InsetsUIResource(2, 3, 3, 3));
  }
  
  public static MicroLayout createWindowsXPHiResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), new InsetsUIResource(2, 2, 3, 2), 1, 1, new Insets(3, 2, 4, 2), getButtonMargin(2, 3), getButtonMargin(2, 3), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(2, 0, 2, 0), new InsetsUIResource(2, 5, 2, 6), new InsetsUIResource(3, 3, 4, 3));
  }
  
  public static MicroLayout createWindowsVistaLowResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), 1, 1, new Insets(3, 2, 4, 2), getButtonMargin(1, 2), getButtonMargin(1, 2), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(3, 0, 3, 0), new InsetsUIResource(2, 3, 2, 4), new InsetsUIResource(2, 3, 3, 3));
  }
  
  public static MicroLayout createWindowsVistaHiResMicroLayout()
  {
    return new MicroLayout(new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), new InsetsUIResource(1, 2, 2, 2), 1, 1, new Insets(3, 2, 4, 2), getButtonMargin(1, 2), getButtonMargin(1, 2), WINDOWS_CHECK_BOX_MARGIN, new InsetsUIResource(2, 0, 2, 0), new InsetsUIResource(2, 5, 2, 6), new InsetsUIResource(3, 3, 4, 3));
  }
  
  private static InsetsUIResource getButtonMargin(int top, int bottom)
  {
    int pad = Options.getUseNarrowButtons() ? 4 : 14;
    return new InsetsUIResource(top, pad, bottom, pad);
  }
}

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

import com.jgoodies.looks.common.ShadowPopup;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.text.JTextComponent;

public final class Options
{
  public static final String PLASTIC_NAME = "com.jgoodies.looks.plastic.PlasticLookAndFeel";
  public static final String PLASTIC3D_NAME = "com.jgoodies.looks.plastic.Plastic3DLookAndFeel";
  public static final String PLASTICXP_NAME = "com.jgoodies.looks.plastic.PlasticXPLookAndFeel";
  public static final String JGOODIES_WINDOWS_NAME = "com.jgoodies.looks.windows.WindowsLookAndFeel";
  public static final String DEFAULT_LOOK_NAME = "com.jgoodies.looks.plastic.PlasticXPLookAndFeel";
  private static final Map LAF_REPLACEMENTS = new HashMap();
  public static final String PLASTIC_FONT_POLICY_KEY = "Plastic.fontPolicy";
  public static final String PLASTIC_CONTROL_FONT_KEY = "Plastic.controlFont";
  public static final String PLASTIC_MENU_FONT_KEY = "Plastic.menuFont";
  public static final String WINDOWS_FONT_POLICY_KEY = "Windows.fontPolicy";
  public static final String WINDOWS_CONTROL_FONT_KEY = "Windows.controlFont";
  public static final String WINDOWS_MENU_FONT_KEY = "Windows.menuFont";
  public static final String USE_SYSTEM_FONTS_KEY = "swing.useSystemFontSettings";
  public static final String USE_SYSTEM_FONTS_APP_KEY = "Application.useSystemFontSettings";
  public static final String PLASTIC_MICRO_LAYOUT_POLICY_KEY = "Plastic.MicroLayoutPolicy";
  public static final String WINDOWS_MICRO_LAYOUT_POLICY_KEY = "Windows.MicroLayoutPolicy";
  public static final String DEFAULT_ICON_SIZE_KEY = "jgoodies.defaultIconSize";
  public static final String USE_NARROW_BUTTONS_KEY = "jgoodies.useNarrowBut
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