looks-2.2.0

PlasticTheme().getWindowTitleForeground();
  }
  
  public static ColorUIResource getWindowTitleInactiveBackground()
  {
    return getPlasticTheme().getWindowTitleInactiveBackground();
  }
  
  public static ColorUIResource getWindowTitleInactiveForeground()
  {
    return getPlasticTheme().getWindowTitleInactiveForeground();
  }
  
  public static ColorUIResource getSimpleInternalFrameForeground()
  {
    return getPlasticTheme().getSimpleInternalFrameForeground();
  }
  
  public static ColorUIResource getSimpleInternalFrameBackground()
  {
    return getPlasticTheme().getSimpleInternalFrameBackground();
  }
  
  public static ColorUIResource getTitleTextColor()
  {
    return getPlasticTheme().getTitleTextColor();
  }
  
  public static FontUIResource getTitleTextFont()
  {
    return getPlasticTheme().getTitleTextFont();
  }
  
  private static MetalTheme getCurrentTheme0()
  {
    if (getCurrentThemeMethod != null) {
      try
      {
        return (MetalTheme)getCurrentThemeMethod.invoke(null, null);
      }
      catch (IllegalArgumentException e) {}catch (IllegalAccessException e) {}catch (InvocationTargetException e) {}
    }
    return null;
  }
  
  private static Method getMethodGetCurrentTheme()
  {
    try
    {
      Class clazz = MetalLookAndFeel.class;
      return clazz.getMethod("getCurrentTheme", new Class[0]);
    }
    catch (SecurityException e) {}catch (NoSuchMethodException e) {}
    return null;
  }
  
  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;
  }
}

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

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

final class PlasticMenuBarUI$1
  implements PropertyChangeListener
{
  private final PlasticMenuBarUI this$0;
  
  PlasticMenuBarUI$1(PlasticMenuBarUI paramPlasticMenuBarUI) {}
  
  public void propertyChange(PropertyChangeEvent e)
  {
    String prop = e.getPropertyName();
    if ((prop.equals("jgoodies.headerStyle")) || (prop.equals("Plastic.borderStyle"))) {
      this$0.installSpecialBorder();
    }
  }
}

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

import com.jgoodies.looks.BorderStyle;
import com.jgoodies.looks.HeaderStyle;
import java.awt.Graphics;
import java.awt.Rectangle;
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;
import javax.swing.plaf.basic.BasicMenuBarUI;

public final class PlasticMenuBarUI
  extends BasicMenuBarUI
{
  private PropertyChangeListener listener;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticMenuBarUI();
  }
  
  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("Plastic.borderStyle"))) {
          installSpecialBorder();
        }
      }
    };
  }
  
  public void installSpecialBorder()
  {
    BorderStyle borderStyle = BorderStyle.from(menuBar, "Plastic.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
        {
          HeaderStyle headerStyle = HeaderStyle.from(menuBar);
          String suffix;
          if (headerStyle == HeaderStyle.BOTH)
          {
            suffix = "headerBorder";
          }
          else
          {
            String suffix;
            if ((headerStyle == HeaderStyle.SINGLE) && (is3D())) {
              suffix = "etchedBorder";
            } else {
              return;
            }
          }
        }
      }
    }
    String suffix;
    LookAndFeel.installBorder(menuBar, "MenuBar." + suffix);
  }
  
  public void update(Graphics g, JComponent c)
  {
    if (c.isOpaque())
    {
      g.setColor(c.getBackground());
      g.fillRect(0, 0, c.getWidth(), c.getHeight());
      if (is3D())
      {
        Rectangle bounds = new Rectangle(0, 0, c.getWidth(), c.getHeight());
        
        PlasticUtils.addLight3DEffekt(g, bounds, true);
      }
    }
    paint(g, c);
  }
  
  private boolean is3D()
  {
    if (PlasticUtils.force3D(menuBar)) {
      return true;
    }
    if (PlasticUtils.forceFlat(menuBar)) {
      return false;
    }
    return (PlasticUtils.is3D("MenuBar.")) && (HeaderStyle.from(menuBar) != null) && (BorderStyle.from(menuBar, "Plastic.borderStyle") != BorderStyle.EMPTY);
  }
}

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

import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.common.ExtBasicMenuUI;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.plaf.ComponentUI;

public final class PlasticMenuUI
  extends ExtBasicMenuUI
{
  private boolean oldOpaque;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticMenuUI();
  }
  
  protected void installDefaults()
  {
    super.installDefaults();
    oldOpaque = menuItem.isOpaque();
  }
  
  protected void uninstallDefaults()
  {
    super.uninstallDefaults();
    if ((!LookUtils.IS_OS_WINDOWS_VISTA) && (!LookUtils.IS_JAVA_6_OR_LATER)) {
      menuItem.setOpaque(oldOpaque);
    }
  }
  
  protected void paintMenuItem(Graphics g, JComponent c, Icon aCheckIcon, Icon anArrowIcon, Color background, Color foreground, int textIconGap)
  {
    JMenuItem b = (JMenuItem)c;
    if (((JMenu)menuItem).isTopLevelMenu())
    {
      b.setOpaque(false);
      if (b.getModel().isSelected())
      {
        int menuWidth = menuItem.getWidth();
        int menuHeight = menuItem.getHeight();
        Color oldColor = g.getColor();
        g.setColor(background);
        g.fillRect(0, 0, menuWidth, menuHeight);
        g.setColor(oldColor);
      }
    }
    super.paintMenuItem(g, c, aCheckIcon, anArrowIcon, background, foreground, textIconGap);
  }
}

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

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 PlasticOptionPaneUI
  extends BasicOptionPaneUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticOptionPaneUI();
  }
  
  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.plastic.PlasticOptionPaneUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.plastic;

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

public final class PlasticPasswordFieldUI
  extends BasicPasswordFieldUI
{
  public static ComponentUI createUI(JComponent c)
  {
    return new PlasticPasswordFieldUI();
  }
  
  public View create(Element elem)
  {
    return LookUtils.IS_JAVA_1_4_OR_5 ? new ExtPasswordView(elem) : super.create(elem);
  }
  
  protected Caret createCaret()
  {
    return PlasticLookAndFeel.isSelectTextOnKeyboardFocusGained() ? new PlasticFieldCaret() : super.createCaret();
  }
}

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

class PlasticPopupMenuUI$1 {}

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

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

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

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

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;
import javax.swing.plaf.basic.BasicPopupMenuUI;

public final class PlasticPopupMenuUI
  extends BasicPopupMenuUI
{
  private PropertyChangeListener borderListener;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticPopupMenuUI();
  }
  
  public void installDefaults()
  {
    super.installDefaults();
    installBorder();
    if ((popupMenu.getLayout() == null) || ((popupMenu.getLayout() instanceof UIResource))) {
      popupMenu.setLayout(new PopupMenuLayout(popupMenu, 1));
    }
  }
  
  protected 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(PlasticPopupMenuUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent e)
    {
      PlasticPopupMenuUI.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.plastic.PlasticPopupMenuUI
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.jgoodies.looks.plastic;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JScrollBar;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.metal.MetalScrollBarUI;

public final class PlasticScrollBarUI
  extends MetalScrollBarUI
{
  private static final String PROPERTY_PREFIX = "ScrollBar.";
  public static final String MAX_BUMPS_WIDTH_KEY = "ScrollBar.maxBumpsWidth";
  private Color shadowColor;
  private Color highlightColor;
  private Color darkShadowColor;
  private Color thumbColor;
  private Color thumbShadow;
  private Color thumbHighlightColor;
  private PlasticBumps bumps;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticScrollBarUI();
  }
  
  protected void installDefaults()
  {
    super.installDefaults();
    bumps = new PlasticBumps(10, 10, thumbHighlightColor, thumbShadow, thumbColor);
  }
  
  protected JButton createDecreaseButton(int orientation)
  {
    decreaseButton = new PlasticArrowButton(orientation, scrollBarWidth, isFreeStanding);
    return decreaseButton;
  }
  
  protected JButton createIncreaseButton(int orientation)
  {
    increaseButton = new PlasticArrowButton(orientation, scrollBarWidth, isFreeStanding);
    return increaseButton;
  }
  
  protected void configureScrollBarColors()
  {
    super.configureScrollBarColors();
    shadowColor = UIManager.getColor("ScrollBar.shadow");
    highlightColor = UIManager.getColor("ScrollBar.highlight");
    darkShadowColor = UIManager.getColor("ScrollBar.darkShadow");
    thumbColor = UIManager.getColor("ScrollBar.thumb");
    thumbShadow = UIManager.getColor("ScrollBar.thumbShadow");
    thumbHighlightColor = UIManager.getColor("ScrollBar.thumbHighlight");
  }
  
  protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
  {
    g.translate(x, y);
    
    boolean leftToRight = PlasticUtils.isLeftToRight(c);
    if (scrollbar.getOrientation() == 1)
    {
      if (!isFreeStanding) {
        if (!leftToRight)
        {
          width += 1;
          g.translate(-1, 0);
        }
        else
        {
          width += 2;
        }
      }
      if (c.isEnabled())
      {
        g.setColor(darkShadowColor);
        g.drawLine(0, 0, 0, height - 1);
        g.drawLine(width - 2, 0, width - 2, height - 1);
        g.drawLine(1, height - 1, width - 1, height - 1);
        g.drawLine(1, 0, width - 2, 0);
        
        g.setColor(shadowColor);
        
        g.drawLine(1, 1, 1, height - 2);
        g.drawLine(1, 1, width - 3, 1);
        if (scrollbar.getValue() != scrollbar.getMaximum())
        {
          int y = thumbRect.y + thumbRect.height - y;
          g.drawLine(1, y, width - 1, y);
        }
        g.setColor(highlightColor);
        g.drawLine(width - 1, 0, width - 1, height - 1);
      }
      else
      {
        PlasticUtils.drawDisabledBorder(g, 0, 0, width, height);
      }
      if (!isFreeStanding) {
        if (!leftToRight)
        {
          width -= 1;
          g.translate(1, 0);
        }
        else
        {
          width -= 2;
        }
      }
    }
    else
    {
      if (!isFreeStanding) {
        height += 2;
      }
      if (c.isEnabled())
      {
        g.setColor(darkShadowColor);
        g.drawLine(0, 0, width - 1, 0);
        g.drawLine(0, 1, 0, height - 2);
        g.drawLine(0, height - 2, width - 1, height - 2);
        
        g.drawLine(width - 1, 1, width - 1, height - 1);
        
        g.setColor(shadowColor);
        
        g.drawLine(1, 1, width - 2, 1);
        g.drawLine(1, 1, 1, height - 3);
        g.drawLine(0, height - 1, width - 1, height - 1);
        if (scrollbar.getValue() != scrollbar.getMaximum())
        {
          int x = thumbRect.x + thumbRect.width - x;
          g.drawLine(x, 1, x, height - 1);
        }
      }
      else
      {
        PlasticUtils.drawDisabledBorder(g, 0, 0, width, height);
      }
      if (!isFreeStanding) {
        height -= 2;
      }
    }
    g.translate(-x, -y);
  }
  
  protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
  {
    if (!c.isEnabled()) {
      return;
    }
    boolean leftToRight = PlasticUtils.isLeftToRight(c);
    
    g.translate(x, y);
    if (scrollbar.getOrientation() == 1)
    {
      if (!isFreeStanding) {
        if (!leftToRight)
        {
          width += 1;
          g.translate(-1, 0);
        }
        else
        {
          width += 2;
        }
      }
      g.setColor(thumbColor);
      g.fillRect(0, 0, width - 2, height - 1);
      
      g.setColor(thumbShadow);
      g.drawRect(0, 0, width - 2, height - 1);
      
      g.setColor(thumbHighlightColor);
      g.drawLine(1, 1, width - 3, 1);
      g.drawLine(1, 1, 1, height - 2);
      
      paintBumps(g, c, 3, 4, width - 6, height - 7);
      if (!isFreeStanding) {
        if (!leftToRight)
        {
          width -= 1;
          g.translate(1, 0);
        }
        else
        {
          width -= 2;
        }
      }
    }
    else
    {
      if (!isFreeStanding) {
        height += 2;
      }
      g.setColor(thumbColor);
      g.fillRect(0, 0, width - 1, height - 2);
      
      g.setColor(thumbShadow);
      g.drawRect(0, 0, width - 1, height - 2);
      
      g.setColor(thumbHighlightColor);
      g.drawLine(1, 1, width - 2, 1);
      g.drawLine(1, 1, 1, height - 3);
      
      paintBumps(g, c, 4, 3, width - 7, height - 6);
      if (!isFreeStanding) {
        height -= 2;
      }
    }
    g.translate(-x, -y);
    if (PlasticUtils.is3D("ScrollBar.")) {
      paintThumb3D(g, thumbBounds);
    }
  }
  
  private void paintBumps(Graphics g, JComponent c, int x, int y, int width, int height)
  {
    if (!useNarrowBumps())
    {
      bumps.setBumpArea(width, height);
      bumps.paintIcon(c, g, x, y);
    }
    else
    {
      int maxWidth = UIManager.getInt("ScrollBar.maxBumpsWidth");
      int myWidth = Math.min(maxWidth, width);
      int myHeight = Math.min(maxWidth, height);
      int myX = x + (width - myWidth) / 2;
      int myY = y + (height - myHeight) / 2;
      bumps.setBumpArea(myWidth, myHeight);
      bumps.paintIcon(c, g, myX, myY);
    }
  }
  
  private void paintThumb3D(Graphics g, Rectangle thumbBounds)
  {
    boolean isHorizontal = scrollbar.getOrientation() == 0;
    int width = width - (isHorizontal ? 3 : 1);
    int height = height - (isHorizontal ? 1 : 3);
    Rectangle r = new Rectangle(x + 2, y + 2, width, height);
    PlasticUtils.addLight3DEffekt(g, r, isHorizontal);
  }
  
  private boolean useNarrowBumps()
  {
    Object value = UIManager.get("ScrollBar.maxBumpsWidth");
    return (value != null) && ((value instanceof Integer));
  }
}

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

class PlasticScrollPaneUI$1 {}

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

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

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

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

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;
import javax.swing.plaf.metal.MetalScrollPaneUI;

public final class PlasticScrollPaneUI
  extends MetalScrollPaneUI
{
  private PropertyChangeListener borderStyleChangeHandler;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticScrollPaneUI();
  }
  
  protected void installDefaults(JScrollPane scrollPane)
  {
    super.installDefaults(scrollPane);
    installEtchedBorder(scrollPane);
  }
  
  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);
  }
  
  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");
  }
  
  private class BorderStyleChangeHandler
    implements PropertyChangeListener
  {
    BorderStyleChangeHandler(PlasticScrollPaneUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent evt)
    {
      JScrollPane scrollPane = (JScrollPane)evt.getSource();
      installEtchedBorder(scrollPane);
    }
    
    private BorderStyleChangeHandler() {}
  }
}

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

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.metal.MetalSeparatorUI;

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

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

class PlasticSpinnerUI$1 {}

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

import com.jgoodies.looks.common.ExtBasicArrowButtonHandler;
import javax.swing.UIManager;

final class PlasticSpinnerUI$SpinnerArrowButton
  extends PlasticArrowButton
{
  PlasticSpinnerUI$SpinnerArrowButton(int x0, ExtBasicArrowButtonHandler x1, PlasticSpinnerUI.1 x2)
  {
    this(x0, x1);
  }
  
  private PlasticSpinnerUI$SpinnerArrowButton(int direction, ExtBasicArrowButtonHandler handler)
  {
    super(direction, UIManager.getInt("ScrollBar.width"), true);
    addActionListener(handler);
    addMouseListener(handler);
  }
  
  protected int calculateArrowHeight(int height, int width)
  {
    int arrowHeight = Math.min((height - 4) / 3, (width - 4) / 3);
    return Math.max(arrowHeight, 3);
  }
  
  protected int calculateArrowOffset()
  {
    return 1;
  }
  
  protected boolean isPaintingNorthBottom()
  {
    return true;
  }
}

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

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.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;
import javax.swing.plaf.basic.BasicSpinnerUI;

public class PlasticSpinnerUI
  extends BasicSpinnerUI
{
  public static ComponentUI createUI(JComponent b)
  {
    return new PlasticSpinnerUI();
  }
  
  private static final ExtBasicArrowButtonHandler nextButtonHandler = new ExtBasicArrowButtonHandler("increment", true);
  private static final ExtBasicArrowButtonHandler previousButtonHandler = new ExtBasicArrowButtonHandler("decrement", false);
  
  protected Component createPreviousButton()
  {
    return new SpinnerArrowButton(5, previousButtonHandler, null);
  }
  
  protected Component createNextButton()
  {
    return new SpinnerArrowButton(1, nextButtonHandler, null);
  }
  
  protected LayoutManager createLayout()
  {
    return new ExtBasicSpinnerLayout();
  }
  
  protected JComponent createEditor()
  {
    JComponent editor = spinner.getEditor();
    configureEditorBorder(editor);
    return editor;
  }
  
  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));
    }
  }
  
  private static final class SpinnerArrowButton
    extends PlasticArrowButton
  {
    SpinnerArrowButton(int x0, ExtBasicArrowButtonHandler x1, PlasticSpinnerUI.1 x2)
    {
      this(x0, x1);
    }
    
    private SpinnerArrowButton(int direction, ExtBasicArrowButtonHandler handler)
    {
      super(UIManager.getInt("ScrollBar.width"), true);
      addActionListener(handler);
      addMouseListener(handler);
    }
    
    protected int calculateArrowHeight(int height, int width)
    {
      int arrowHeight = Math.min((height - 4) / 3, (width - 4) / 3);
      return Math.max(arrowHeight, 3);
    }
    
    protected int calculateArrowOffset()
    {
      return 1;
    }
    
    protected boolean isPaintingNorthBottom()
    {
      return true;
    }
  }
}

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

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;

final class PlasticSplitPaneDivider
  extends BasicSplitPaneDivider
{
  PlasticSplitPaneDivider(BasicSplitPaneUI ui)
  {
    super(ui);
  }
  
  protected JButton createLeftOneTouchButton()
  {
    JButton btn = super.createLeftOneTouchButton();
    btn.setOpaque(false);
    return btn;
  }
  
  protected JButton createRightOneTouchButton()
  {
    JButton btn = super.createRightOneTouchButton();
    btn.setOpaque(false);
    return btn;
  }
  
  public void paint(Graphics g)
  {
    if (splitPane.isOpaque())
    {
      Color bgColor = getBackground();
      if (bgColor != null)
      {
        g.setColor(bgColor);
        g.fillRect(0, 0, getWidth(), getHeight());
      }
    }
    super.paint(g);
  }
}

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

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;

public final class PlasticSplitPaneUI
  extends BasicSplitPaneUI
{
  public static ComponentUI createUI(JComponent x)
  {
    return new PlasticSplitPaneUI();
  }
  
  public BasicSplitPaneDivider createDefaultDivider()
  {
    return new PlasticSplitPaneDivider(this);
  }
}

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

class PlasticTabbedPaneUI$1 {}

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

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;

abstract class PlasticTabbedPaneUI$AbstractRenderer
{
  PlasticTabbedPaneUI$AbstractRenderer(JTabbedPane x0, PlasticTabbedPaneUI.1 x1)
  {
    this(x0);
  }
  
  protected static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
  protected static final Insets NORTH_INSETS = new Insets(1, 0, 0, 0);
  protected static final Insets WEST_INSETS = new Insets(0, 1, 0, 0);
  protected static final Insets SOUTH_INSETS = new Insets(0, 0, 1, 0);
  protected static final Insets EAST_INSETS = new Insets(0, 0, 0, 1);
  protected final JTabbedPane tabPane;
  protected final int tabPlacement;
  protected Color shadowColor;
  protected Color darkShadow;
  protected Color selectColor;
  protected Color selectLight;
  protected Color selectHighlight;
  protected Color lightHighlight;
  protected Color focus;
  
  private PlasticTabbedPaneUI$AbstractRenderer(JTabbedPane tabPane)
  {
    initColors();
    this.tabPane = tabPane;
    tabPlacement = tabPane.getTabPlacement();
  }
  
  private static AbstractRenderer createRenderer(JTabbedPane tabPane)
  {
    switch (tabPane.getTabPlacement())
    {
    case 1: 
      return new PlasticTabbedPaneUI.TopRenderer(tabPane, null);
    case 3: 
      return new PlasticTabbedPaneUI.BottomRenderer(tabPane, null);
    case 2: 
      return new PlasticTabbedPaneUI.LeftRenderer(tabPane, null);
    case 4: 
      return new PlasticTabbedPaneUI.RightRenderer(tabPane, null);
    }
    return new PlasticTabbedPaneUI.TopRenderer(tabPane, null);
  }
  
  private static AbstractRenderer createEmbeddedRenderer(JTabbedPane tabPane)
  {
    switch (tabPane.getTabPlacement())
    {
    case 1: 
      return new PlasticTabbedPaneUI.TopEmbeddedRenderer(tabPane, null);
    case 3: 
      return new PlasticTabbedPaneUI.BottomEmbeddedRenderer(tabPane, null);
    case 2: 
      return new PlasticTabbedPaneUI.LeftEmbeddedRenderer(tabPane, null);
    case 4: 
      return new PlasticTabbedPaneUI.RightEmbeddedRenderer(tabPane, null);
    }
    return new PlasticTabbedPaneUI.TopEmbeddedRenderer(tabPane, null);
  }
  
  private void initColors()
  {
    shadowColor = UIManager.getColor("TabbedPane.shadow");
    darkShadow = UIManager.getColor("TabbedPane.darkShadow");
    selectColor = UIManager.getColor("TabbedPane.selected");
    focus = UIManager.getColor("TabbedPane.focus");
    selectHighlight = UIManager.getColor("TabbedPane.selectHighlight");
    lightHighlight = UIManager.getColor("TabbedPane.highlight");
    selectLight = new Color((2 * selectColor.getRed() + selectHighlight.getRed()) / 3, (2 * selectColor.getGreen() + selectHighlight.getGreen()) / 3, (2 * selectColor.getBlue() + selectHighlight.getBlue()) / 3);
  }
  
  protected boolean isFirstDisplayedTab(int tabIndex, int position, int paneBorder)
  {
    return tabIndex == 0;
  }
  
  protected Insets getTabAreaInsets(Insets defaultInsets)
  {
    return defaultInsets;
  }
  
  protected Insets getContentBorderInsets(Insets defaultInsets)
  {
    return defaultInsets;
  }
  
  protected int getTabLabelShiftX(int tabIndex, boolean isSelected)
  {
    return 0;
  }
  
  protected int getTabLabelShiftY(int tabIndex, boolean isSelected)
  {
    return 0;
  }
  
  protected int getTabRunOverlay(int tabRunOverlay)
  {
    return tabRunOverlay;
  }
  
  protected boolean shouldPadTabRun(int run, boolean aPriori)
  {
    return aPriori;
  }
  
  protected int getTabRunIndent(int run)
  {
    return 0;
  }
  
  protected Insets getSelectedTabPadInsets()
  {
    return EMPTY_INSETS;
  }
  
  protected void paintContentBorderTopEdge(Graphics g, int x, int y, int w, int h, boolean drawBroken, Rectangle selRect, boolean isContentBorderPainted)
  {
    if (isContentBorderPainted)
    {
      g.setColor(selectHighlight);
      g.fillRect(x, y, w - 1, 1);
    }
  }
  
  protected void paintContentBorderBottomEdge(Graphics g, int x, int y, int w, int h, boolean drawBroken, Rectangle selRect, boolean isContentBorderPainted)
  {
    if (isContentBorderPainted)
    {
      g.setColor(darkShadow);
      g.fillRect(x, y + h - 1, w - 1, 1);
    }
  }
  
  protected void paintContentBorderLeftEdge(Graphics g, int x, int y, int w, int h, boolean drawBroken, Rectangle selRect, boolean isContentBorderPainted)
  {
    if (isContentBorderPainted)
    {
      g.setColor(selectHighlight);
      g.fillRect(x, y, 1, h - 1);
    }
  }
  
  protected void paintContentBorderRightEdge(Graphics g, int x, int y, int w, int h, boolean drawBroken, Rectangle selRect, boolean isContentBorderPainted)
  {
    if (isContentBorderPainted)
    {
      g.setColor(darkShadow);
      g.fillRect(x + w - 1, y, 1, h);
    }
  }
  
  protected int getTabsOverlay()
  {
    return 0;
  }
  
  protected abstract Insets getTabInsets(int paramInt, Insets paramInsets);
  
  protected abstract void paintFocusIndicator(Graphics paramGraphics, Rectangle[] paramArrayOfRectangle, int paramInt, Rectangle paramRectangle1, Rectangle paramRectangle2, boolean paramBoolean);
  
  protected abstract void paintTabBackground(Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean);
  
  protected abstract void paintTabBorder(Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean);
}

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

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.UIManager;
import javax.swing.plaf.UIResource;

final class PlasticTabbedPaneUI$ArrowButton
  extends JButton
  implements UIResource
{
  private final int buttonWidth;
  private final int direction;
  private boolean mouseIsOver;
  
  PlasticTabbedPaneUI$ArrowButton(int direction, int buttonWidth)
  {
    this.direction = direction;
    this.buttonWidth = buttonWidth;
    setRequestFocusEnabled(false);
  }
  
  protected void processMouseEvent(MouseEvent e)
  {
    super.processMouseEvent(e);
    switch (e.getID())
    {
    case 504: 
      mouseIsOver = true;
      revalidate();
      repaint();
      break;
    case 505: 
      mouseIsOver = false;
      revalidate();
      repaint();
    }
  }
  
  protected void paintBorder(Graphics g)
  {
    if ((mouseIsOver) && (isEnabled())) {
      super.paintBorder(g);
    }
  }
  
  protected void paintComponent(Graphics g)
  {
    if (mouseIsOver)
    {
      super.paintComponent(g);
    }
    else
    {
      g.setColor(getBackground());
      g.fillRect(0, 0, getWidth(), getHeight());
    }
    paintArrow(g);
  }
  
  private void paintArrow(Graphics g)
  {
    Color oldColor = g.getColor();
    
    boolean isEnabled = isEnabled();
    g.setColor(isEnabled ? PlasticLookAndFeel.getControlInfo() : PlasticLookAndFeel.getControlDisabled());
    int arrowWidth;
    int arrowHeight;
    switch (direction)
    {
    case 1: 
    case 5: 
      arrowWidth = 9;
      arrowHeight = 5;
      break;
    case 2: 
    case 3: 
    case 4: 
    case 6: 
    case 7: 
    default: 
      arrowWidth = 5;
      arrowHeight = 9;
    }
    int x = (getWidth() - arrowWidth) / 2;
    int y = (getHeight() - arrowHeight) / 2;
    g.translate(x, y);
    
    boolean paintShadow = (!mouseIsOver) || (!isEnabled);
    Color shadow = isEnabled ? PlasticLookAndFeel.getControlShadow() : UIManager.getColor("ScrollBar.highlight");
    switch (direction)
    {
    case 1: 
      g.fillRect(0, 4, 9, 1);
      g.fillRect(1, 3, 7, 1);
      g.fillRect(2, 2, 5, 1);
      g.fillRect(3, 1, 3, 1);
      g.fillRect(4, 0, 1, 1);
      if (paintShadow)
      {
        g.setColor(shadow);
        g.fillRect(1, 5, 9, 1);
      }
      break;
    case 5: 
      g.fillRect(0, 0, 9, 1);
      g.fillRect(1, 1, 7, 1);
      g.fillRect(2, 2, 5, 1);
      g.fillRect(3, 3, 3, 1);
      g.fillRect(4, 4, 1, 1);
      if (paintShadow)
      {
        g.setColor(shadow);
        g.drawLine(5, 4, 8, 1);
        g.drawLine(5, 5, 9, 1);
      }
      break;
    case 7: 
      g.fillRect(0, 4, 1, 1);
      g.fillRect(1, 3, 1, 3);
      g.fillRect(2, 2, 1, 5);
      g.fillRect(3, 1, 1, 7);
      g.fillRect(4, 0, 1, 9);
      if (paintShadow)
      {
        g.setColor(shadow);
        g.fillRect(5, 1, 1, 9);
      }
      break;
    case 3: 
      g.fillRect(0, 0, 1, 9);
      g.fillRect(1, 1, 1, 7);
      g.fillRect(2, 2, 1, 5);
      g.fillRect(3, 3, 1, 3);
      g.fillRect(4, 4, 1, 1);
      if (paintShadow)
      {
        g.setColor(shadow);
        g.drawLine(1, 8, 4, 5);
        g.drawLine(1, 9, 5, 5);
      }
      break;
    }
    g.translate(-x, -y);
    g.setColor(oldColor);
  }
  
  public Dimension getPreferredSize()
  {
    return new Dimension(buttonWidth, buttonWidth);
  }
  
  public Dimension getMinimumSize()
  {
    return getPreferredSize();
  }
  
  public Dimension getMaximumSize()
  {
    return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
  }
}

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

import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import javax.swing.JTabbedPane;

final class PlasticTabbedPaneUI$BottomEmbeddedRenderer
  extends PlasticTabbedPaneUI.AbstractRenderer
{
  PlasticTabbedPaneUI$BottomEmbeddedRenderer(JTabbedPane x0, PlasticTabbedPaneUI.1 x1)
  {
    this(x0);
  }
  
  private PlasticTabbedPaneUI$BottomEmbeddedRenderer(JTabbedPane tabPane)
  {
    super(tabPane, null);
  }
  
  protected Insets getTabAreaInsets(Insets insets)
  {
    return EMPTY_INSETS;
  }
  
  protected Insets getContentBorderInsets(Insets defaultInsets)
  {
    return SOUTH_INSETS;
  }
  
  protected Insets getSelectedTabPadInsets()
  {
    return EMPTY_INSETS;
  }
  
  protected Insets getTabInsets(int tabIndex, Insets tabInsets)
  {
    return new Insets(top, left, bottom, right);
  }
  
  protected void paintTabBackground(Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected)
  {
    g.setColor(selectColor);
   
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