looks-2.2.0

ton)c;
    ButtonModel model = button.getModel();
    if (!model.isEnabled())
    {
      PlasticXPUtils.drawDisabledButtonBorder(g, x, y, w, h);
      return;
    }
    boolean isPressed = (model.isPressed()) && (model.isArmed());
    boolean isDefault = ((button instanceof JButton)) && (((JButton)button).isDefaultButton());
    
    boolean isFocused = (button.isFocusPainted()) && (button.hasFocus());
    if (isPressed) {
      PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
    } else if (isFocused) {
      PlasticXPUtils.drawFocusedButtonBorder(g, x, y, w, h);
    } else if (isDefault) {
      PlasticXPUtils.drawDefaultButtonBorder(g, x, y, w, h);
    } else {
      PlasticXPUtils.drawPlainButtonBorder(g, x, y, w, h);
    }
  }
  
  public Insets getBorderInsets(Component c)
  {
    return insets;
  }
  
  public Insets getBorderInsets(Component c, Insets newInsets)
  {
    top = insets.top;
    left = insets.left;
    bottom = insets.bottom;
    right = insets.right;
    return newInsets;
  }
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.ButtonModel;
import javax.swing.JComboBox;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPBorders$XPComboBoxArrowButtonBorder
  extends AbstractBorder
  implements UIResource
{
  PlasticXPBorders$XPComboBoxArrowButtonBorder(PlasticXPBorders.1 x0)
  {
    this();
  }
  
  protected static final Insets INSETS = new Insets(1, 1, 1, 1);
  
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
  {
    PlasticComboBoxButton button = (PlasticComboBoxButton)c;
    JComboBox comboBox = button.getComboBox();
    ButtonModel model = button.getModel();
    if (!model.isEnabled())
    {
      PlasticXPUtils.drawDisabledButtonBorder(g, x, y, w, h);
    }
    else
    {
      boolean isPressed = (model.isPressed()) && (model.isArmed());
      boolean isFocused = comboBox.hasFocus();
      if (isPressed) {
        PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
      } else if (isFocused) {
        PlasticXPUtils.drawFocusedButtonBorder(g, x, y, w, h);
      } else {
        PlasticXPUtils.drawPlainButtonBorder(g, x, y, w, h);
      }
    }
    if (comboBox.isEditable())
    {
      g.setColor(model.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
      
      g.fillRect(x, y, 1, 1);
      g.fillRect(x, y + h - 1, 1, 1);
    }
  }
  
  public Insets getBorderInsets(Component c)
  {
    return INSETS;
  }
  
  private PlasticXPBorders$XPComboBoxArrowButtonBorder() {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPBorders$XPComboBoxEditorBorder
  extends AbstractBorder
{
  PlasticXPBorders$XPComboBoxEditorBorder(PlasticXPBorders.1 x0)
  {
    this();
  }
  
  private static final Insets INSETS = new Insets(1, 1, 1, 0);
  
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
  {
    g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
    
    PlasticXPUtils.drawRect(g, x, y, w + 1, h - 1);
  }
  
  public Insets getBorderInsets(Component c)
  {
    return INSETS;
  }
  
  private PlasticXPBorders$XPComboBoxEditorBorder() {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.plaf.metal.MetalBorders.ScrollPaneBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPBorders$XPScrollPaneBorder
  extends MetalBorders.ScrollPaneBorder
{
  PlasticXPBorders$XPScrollPaneBorder(PlasticXPBorders.1 x0)
  {
    this();
  }
  
  private static final Insets INSETS = new Insets(1, 1, 1, 1);
  
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
  {
    g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
    
    PlasticXPUtils.drawRect(g, x, y, w - 1, h - 1);
  }
  
  public Insets getBorderInsets(Component c)
  {
    return INSETS;
  }
  
  public Insets getBorderInsets(Component c, Insets newInsets)
  {
    top = INSETStop;
    left = INSETSleft;
    bottom = INSETSbottom;
    right = INSETSright;
    return newInsets;
  }
  
  private PlasticXPBorders$XPScrollPaneBorder() {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.UIManager;
import javax.swing.plaf.metal.MetalBorders.ScrollPaneBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPBorders$XPSpinnerBorder
  extends MetalBorders.ScrollPaneBorder
{
  PlasticXPBorders$XPSpinnerBorder(PlasticXPBorders.1 x0)
  {
    this();
  }
  
  private static final Insets INSETS = new Insets(1, 1, 1, 1);
  
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
  {
    g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
    
    int arrowButtonWidth = UIManager.getInt("ScrollBar.width") - 1;
    w -= arrowButtonWidth;
    g.fillRect(x, y, w, 1);
    g.fillRect(x, y + 1, 1, h - 1);
    g.fillRect(x + 1, y + h - 1, w - 1, 1);
  }
  
  public Insets getBorderInsets(Component c)
  {
    return INSETS;
  }
  
  public Insets getBorderInsets(Component c, Insets newInsets)
  {
    top = INSETStop;
    left = INSETSleft;
    bottom = INSETSbottom;
    right = INSETSright;
    return newInsets;
  }
  
  private PlasticXPBorders$XPSpinnerBorder() {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.text.JTextComponent;

final class PlasticXPBorders$XPTextFieldBorder
  extends AbstractBorder
{
  PlasticXPBorders$XPTextFieldBorder(PlasticXPBorders.1 x0)
  {
    this();
  }
  
  private static final Insets INSETS = new Insets(1, 1, 1, 1);
  
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
  {
    boolean enabled = (((c instanceof JTextComponent)) && (c.isEnabled()) && (((JTextComponent)c).isEditable())) || (c.isEnabled());
    
    g.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
    
    PlasticXPUtils.drawRect(g, x, y, w - 1, h - 1);
  }
  
  public Insets getBorderInsets(Component c)
  {
    return INSETS;
  }
  
  public Insets getBorderInsets(Component c, Insets newInsets)
  {
    top = INSETStop;
    left = INSETSleft;
    bottom = INSETSbottom;
    right = INSETSright;
    return newInsets;
  }
  
  private PlasticXPBorders$XPTextFieldBorder() {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JToggleButton;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.plaf.BorderUIResource.CompoundBorderUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicBorders.MarginBorder;
import javax.swing.plaf.metal.MetalBorders.ScrollPaneBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.text.JTextComponent;

final class PlasticXPBorders
{
  private static Border comboBoxArrowButtonBorder;
  private static Border comboBoxEditorBorder;
  private static Border scrollPaneBorder;
  private static Border textFieldBorder;
  private static Border spinnerBorder;
  private static Border rolloverButtonBorder;
  
  static Border getButtonBorder(Insets buttonMargin)
  {
    return new BorderUIResource.CompoundBorderUIResource(new XPButtonBorder(buttonMargin), new BasicBorders.MarginBorder());
  }
  
  static Border getComboBoxArrowButtonBorder()
  {
    if (comboBoxArrowButtonBorder == null) {
      comboBoxArrowButtonBorder = new CompoundBorder(new XPComboBoxArrowButtonBorder(null), new BasicBorders.MarginBorder());
    }
    return comboBoxArrowButtonBorder;
  }
  
  static Border getComboBoxEditorBorder()
  {
    if (comboBoxEditorBorder == null) {
      comboBoxEditorBorder = new CompoundBorder(new XPComboBoxEditorBorder(null), new BasicBorders.MarginBorder());
    }
    return comboBoxEditorBorder;
  }
  
  static Border getScrollPaneBorder()
  {
    if (scrollPaneBorder == null) {
      scrollPaneBorder = new XPScrollPaneBorder(null);
    }
    return scrollPaneBorder;
  }
  
  static Border getTextFieldBorder()
  {
    if (textFieldBorder == null) {
      textFieldBorder = new BorderUIResource.CompoundBorderUIResource(new XPTextFieldBorder(null), new BasicBorders.MarginBorder());
    }
    return textFieldBorder;
  }
  
  static Border getToggleButtonBorder(Insets buttonMargin)
  {
    return new BorderUIResource.CompoundBorderUIResource(new XPButtonBorder(buttonMargin), new BasicBorders.MarginBorder());
  }
  
  static Border getSpinnerBorder()
  {
    if (spinnerBorder == null) {
      spinnerBorder = new XPSpinnerBorder(null);
    }
    return spinnerBorder;
  }
  
  static Border getRolloverButtonBorder()
  {
    if (rolloverButtonBorder == null) {
      rolloverButtonBorder = new CompoundBorder(new RolloverButtonBorder(null), new PlasticBorders.RolloverMarginBorder());
    }
    return rolloverButtonBorder;
  }
  
  private static class XPButtonBorder
    extends AbstractBorder
    implements UIResource
  {
    protected final Insets insets;
    
    protected XPButtonBorder(Insets insets)
    {
      this.insets = insets;
    }
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      AbstractButton button = (AbstractButton)c;
      ButtonModel model = button.getModel();
      if (!model.isEnabled())
      {
        PlasticXPUtils.drawDisabledButtonBorder(g, x, y, w, h);
        return;
      }
      boolean isPressed = (model.isPressed()) && (model.isArmed());
      boolean isDefault = ((button instanceof JButton)) && (((JButton)button).isDefaultButton());
      
      boolean isFocused = (button.isFocusPainted()) && (button.hasFocus());
      if (isPressed) {
        PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
      } else if (isFocused) {
        PlasticXPUtils.drawFocusedButtonBorder(g, x, y, w, h);
      } else if (isDefault) {
        PlasticXPUtils.drawDefaultButtonBorder(g, x, y, w, h);
      } else {
        PlasticXPUtils.drawPlainButtonBorder(g, x, y, w, h);
      }
    }
    
    public Insets getBorderInsets(Component c)
    {
      return insets;
    }
    
    public Insets getBorderInsets(Component c, Insets newInsets)
    {
      top = insets.top;
      left = insets.left;
      bottom = insets.bottom;
      right = insets.right;
      return newInsets;
    }
  }
  
  private static final class XPComboBoxArrowButtonBorder
    extends AbstractBorder
    implements UIResource
  {
    XPComboBoxArrowButtonBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    protected static final Insets INSETS = new Insets(1, 1, 1, 1);
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      PlasticComboBoxButton button = (PlasticComboBoxButton)c;
      JComboBox comboBox = button.getComboBox();
      ButtonModel model = button.getModel();
      if (!model.isEnabled())
      {
        PlasticXPUtils.drawDisabledButtonBorder(g, x, y, w, h);
      }
      else
      {
        boolean isPressed = (model.isPressed()) && (model.isArmed());
        boolean isFocused = comboBox.hasFocus();
        if (isPressed) {
          PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
        } else if (isFocused) {
          PlasticXPUtils.drawFocusedButtonBorder(g, x, y, w, h);
        } else {
          PlasticXPUtils.drawPlainButtonBorder(g, x, y, w, h);
        }
      }
      if (comboBox.isEditable())
      {
        g.setColor(model.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
        
        g.fillRect(x, y, 1, 1);
        g.fillRect(x, y + h - 1, 1, 1);
      }
    }
    
    public Insets getBorderInsets(Component c)
    {
      return INSETS;
    }
    
    private XPComboBoxArrowButtonBorder() {}
  }
  
  private static final class XPComboBoxEditorBorder
    extends AbstractBorder
  {
    XPComboBoxEditorBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    private static final Insets INSETS = new Insets(1, 1, 1, 0);
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
      
      PlasticXPUtils.drawRect(g, x, y, w + 1, h - 1);
    }
    
    public Insets getBorderInsets(Component c)
    {
      return INSETS;
    }
    
    private XPComboBoxEditorBorder() {}
  }
  
  private static final class XPTextFieldBorder
    extends AbstractBorder
  {
    XPTextFieldBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    private static final Insets INSETS = new Insets(1, 1, 1, 1);
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      boolean enabled = (((c instanceof JTextComponent)) && (c.isEnabled()) && (((JTextComponent)c).isEditable())) || (c.isEnabled());
      
      g.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
      
      PlasticXPUtils.drawRect(g, x, y, w - 1, h - 1);
    }
    
    public Insets getBorderInsets(Component c)
    {
      return INSETS;
    }
    
    public Insets getBorderInsets(Component c, Insets newInsets)
    {
      top = INSETStop;
      left = INSETSleft;
      bottom = INSETSbottom;
      right = INSETSright;
      return newInsets;
    }
    
    private XPTextFieldBorder() {}
  }
  
  private static final class XPScrollPaneBorder
    extends MetalBorders.ScrollPaneBorder
  {
    XPScrollPaneBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    private static final Insets INSETS = new Insets(1, 1, 1, 1);
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
      
      PlasticXPUtils.drawRect(g, x, y, w - 1, h - 1);
    }
    
    public Insets getBorderInsets(Component c)
    {
      return INSETS;
    }
    
    public Insets getBorderInsets(Component c, Insets newInsets)
    {
      top = INSETStop;
      left = INSETSleft;
      bottom = INSETSbottom;
      right = INSETSright;
      return newInsets;
    }
    
    private XPScrollPaneBorder() {}
  }
  
  private static final class XPSpinnerBorder
    extends MetalBorders.ScrollPaneBorder
  {
    XPSpinnerBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    private static final Insets INSETS = new Insets(1, 1, 1, 1);
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      g.setColor(c.isEnabled() ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlShadow());
      
      int arrowButtonWidth = UIManager.getInt("ScrollBar.width") - 1;
      w -= arrowButtonWidth;
      g.fillRect(x, y, w, 1);
      g.fillRect(x, y + 1, 1, h - 1);
      g.fillRect(x + 1, y + h - 1, w - 1, 1);
    }
    
    public Insets getBorderInsets(Component c)
    {
      return INSETS;
    }
    
    public Insets getBorderInsets(Component c, Insets newInsets)
    {
      top = INSETStop;
      left = INSETSleft;
      bottom = INSETSbottom;
      right = INSETSright;
      return newInsets;
    }
    
    private XPSpinnerBorder() {}
  }
  
  private static final class RolloverButtonBorder
    extends PlasticXPBorders.XPButtonBorder
  {
    RolloverButtonBorder(PlasticXPBorders.1 x0)
    {
      this();
    }
    
    private RolloverButtonBorder()
    {
      super();
    }
    
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
    {
      AbstractButton b = (AbstractButton)c;
      ButtonModel model = b.getModel();
      if (!model.isEnabled()) {
        return;
      }
      if (!(c instanceof JToggleButton))
      {
        if ((model.isRollover()) && ((!model.isPressed()) || (model.isArmed()))) {
          super.paintBorder(c, g, x, y, w, h);
        }
        return;
      }
      if (model.isRollover())
      {
        if ((model.isPressed()) && (model.isArmed())) {
          PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
        } else {
          PlasticXPUtils.drawPlainButtonBorder(g, x, y, w, h);
        }
      }
      else if (model.isSelected()) {
        PlasticXPUtils.drawPressedButtonBorder(g, x, y, w, h);
      }
    }
  }
}

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

import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.metal.MetalCheckBoxUI;

public final class PlasticXPCheckBoxUI
  extends MetalCheckBoxUI
{
  private static final PlasticXPCheckBoxUI INSTANCE = new PlasticXPCheckBoxUI();
  
  public static ComponentUI createUI(JComponent b)
  {
    return INSTANCE;
  }
  
  protected BasicButtonListener createButtonListener(AbstractButton b)
  {
    return new ActiveBasicButtonListener(b);
  }
}

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

class PlasticXPIconFactory$1 {}

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

import com.jgoodies.looks.LookUtils;
import java.awt.Color;
import java.awt.Component;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.RenderingHints.Key;
import java.io.Serializable;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPIconFactory$CheckBoxIcon
  implements Icon, UIResource, Serializable
{
  PlasticXPIconFactory$CheckBoxIcon(PlasticXPIconFactory.1 x0)
  {
    this();
  }
  
  private static final int SIZE = LookUtils.IS_LOW_RESOLUTION ? 13 : 15;
  
  public int getIconWidth()
  {
    return SIZE;
  }
  
  public int getIconHeight()
  {
    return SIZE;
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JCheckBox cb = (JCheckBox)c;
    ButtonModel model = cb.getModel();
    Graphics2D g2 = (Graphics2D)g;
    boolean paintFocus = ((model.isArmed()) && (!model.isPressed())) || ((cb.hasFocus()) && (PlasticXPIconFactory.access$200(cb.getText())));
    
    RenderingHints.Key key = RenderingHints.KEY_ANTIALIASING;
    Object newAAHint = RenderingHints.VALUE_ANTIALIAS_ON;
    Object oldAAHint = g2.getRenderingHint(key);
    if (newAAHint != oldAAHint) {
      g2.setRenderingHint(key, newAAHint);
    } else {
      oldAAHint = null;
    }
    drawBorder(g2, model.isEnabled(), x, y, SIZE - 1, SIZE - 1);
    drawFill(g2, model.isPressed(), x + 1, y + 1, SIZE - 2, SIZE - 2);
    if (paintFocus) {
      drawFocus(g2, x + 1, y + 1, SIZE - 3, SIZE - 3);
    }
    if (model.isSelected()) {
      drawCheck(g2, model.isEnabled(), x + 3, y + 3, SIZE - 7, SIZE - 7);
    }
    if (oldAAHint != null) {
      g2.setRenderingHint(key, oldAAHint);
    }
  }
  
  private void drawBorder(Graphics2D g2, boolean enabled, int x, int y, int width, int height)
  {
    g2.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlDisabled());
    
    g2.drawRect(x, y, width, height);
  }
  
  private void drawCheck(Graphics2D g2, boolean enabled, int x, int y, int width, int height)
  {
    g2.setColor(enabled ? UIManager.getColor("CheckBox.check") : MetalLookAndFeel.getControlDisabled());
    
    int right = x + width;
    int bottom = y + height;
    int startY = y + height / 3;
    int turnX = x + width / 2 - 2;
    g2.drawLine(x, startY, turnX, bottom - 3);
    g2.drawLine(x, startY + 1, turnX, bottom - 2);
    g2.drawLine(x, startY + 2, turnX, bottom - 1);
    g2.drawLine(turnX + 1, bottom - 2, right, y);
    g2.drawLine(turnX + 1, bottom - 1, right, y + 1);
    g2.drawLine(turnX + 1, bottom, right, y + 2);
  }
  
  private void drawFill(Graphics2D g2, boolean pressed, int x, int y, int w, int h)
  {
    Color lowerRight;
    Color upperLeft;
    Color lowerRight;
    if (pressed)
    {
      Color upperLeft = MetalLookAndFeel.getControlShadow();
      lowerRight = PlasticLookAndFeel.getControlHighlight();
    }
    else
    {
      upperLeft = PlasticLookAndFeel.getControl();
      lowerRight = PlasticLookAndFeel.getControlHighlight().brighter();
    }
    g2.setPaint(new GradientPaint(x, y, upperLeft, x + w, y + h, lowerRight));
    g2.fillRect(x, y, w, h);
  }
  
  private void drawFocus(Graphics2D g2, int x, int y, int width, int height)
  {
    g2.setPaint(new GradientPaint(x, y, PlasticLookAndFeel.getFocusColor().brighter(), width, height, PlasticLookAndFeel.getFocusColor()));
    
    g2.drawRect(x, y, width, height);
    g2.drawRect(x + 1, y + 1, width - 2, height - 2);
  }
  
  private PlasticXPIconFactory$CheckBoxIcon() {}
}

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

import com.jgoodies.looks.LookUtils;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.RenderingHints.Key;
import java.awt.Stroke;
import java.io.Serializable;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticXPIconFactory$RadioButtonIcon
  implements Icon, UIResource, Serializable
{
  PlasticXPIconFactory$RadioButtonIcon(PlasticXPIconFactory.1 x0)
  {
    this();
  }
  
  private static final int SIZE = LookUtils.IS_LOW_RESOLUTION ? 13 : 15;
  private static final Stroke FOCUS_STROKE = new BasicStroke(2.0F);
  
  public int getIconWidth()
  {
    return SIZE;
  }
  
  public int getIconHeight()
  {
    return SIZE;
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    Graphics2D g2 = (Graphics2D)g;
    AbstractButton rb = (AbstractButton)c;
    ButtonModel model = rb.getModel();
    boolean paintFocus = ((model.isArmed()) && (!model.isPressed())) || ((rb.hasFocus()) && (PlasticXPIconFactory.access$200(rb.getText())));
    
    RenderingHints.Key key = RenderingHints.KEY_ANTIALIASING;
    Object newAAHint = RenderingHints.VALUE_ANTIALIAS_ON;
    Object oldAAHint = g2.getRenderingHint(key);
    if (newAAHint != oldAAHint) {
      g2.setRenderingHint(key, newAAHint);
    } else {
      oldAAHint = null;
    }
    drawFill(g2, model.isPressed(), x, y, SIZE - 1, SIZE - 1);
    if (paintFocus) {
      drawFocus(g2, x + 1, y + 1, SIZE - 3, SIZE - 3);
    }
    if (model.isSelected()) {
      drawCheck(g2, c, model.isEnabled(), x + 4, y + 4, SIZE - 8, SIZE - 8);
    }
    drawBorder(g2, model.isEnabled(), x, y, SIZE - 1, SIZE - 1);
    if (oldAAHint != null) {
      g2.setRenderingHint(key, oldAAHint);
    }
  }
  
  private void drawBorder(Graphics2D g2, boolean enabled, int x, int y, int w, int h)
  {
    g2.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlDisabled());
    
    g2.drawOval(x, y, w, h);
  }
  
  private void drawCheck(Graphics2D g2, Component c, boolean enabled, int x, int y, int w, int h)
  {
    g2.translate(x, y);
    if (enabled)
    {
      g2.setColor(UIManager.getColor("RadioButton.check"));
      g2.fillOval(0, 0, w, h);
      UIManager.getIcon("RadioButton.checkIcon").paintIcon(c, g2, 0, 0);
    }
    else
    {
      g2.setColor(MetalLookAndFeel.getControlDisabled());
      g2.fillOval(0, 0, w, h);
    }
    g2.translate(-x, -y);
  }
  
  private void drawFill(Graphics2D g2, boolean pressed, int x, int y, int w, int h)
  {
    Color lowerRight;
    Color upperLeft;
    Color lowerRight;
    if (pressed)
    {
      Color upperLeft = MetalLookAndFeel.getControlShadow();
      lowerRight = PlasticLookAndFeel.getControlHighlight();
    }
    else
    {
      upperLeft = PlasticLookAndFeel.getControl();
      lowerRight = PlasticLookAndFeel.getControlHighlight().brighter();
    }
    g2.setPaint(new GradientPaint(x, y, upperLeft, x + w, y + h, lowerRight));
    g2.fillOval(x, y, w, h);
  }
  
  private void drawFocus(Graphics2D g2, int x, int y, int w, int h)
  {
    g2.setPaint(new GradientPaint(x, y, PlasticLookAndFeel.getFocusColor().brighter(), w, h, PlasticLookAndFeel.getFocusColor()));
    
    Stroke stroke = g2.getStroke();
    g2.setStroke(FOCUS_STROKE);
    g2.drawOval(x, y, w, h);
    g2.setStroke(stroke);
  }
  
  private PlasticXPIconFactory$RadioButtonIcon() {}
}

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

import com.jgoodies.looks.LookUtils;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.RenderingHints.Key;
import java.awt.Stroke;
import java.io.Serializable;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

public final class PlasticXPIconFactory
{
  private static CheckBoxIcon checkBoxIcon;
  private static RadioButtonIcon radioButtonIcon;
  
  static Icon getCheckBoxIcon()
  {
    if (checkBoxIcon == null) {
      checkBoxIcon = new CheckBoxIcon(null);
    }
    return checkBoxIcon;
  }
  
  static Icon getRadioButtonIcon()
  {
    if (radioButtonIcon == null) {
      radioButtonIcon = new RadioButtonIcon(null);
    }
    return radioButtonIcon;
  }
  
  private static final class CheckBoxIcon
    implements Icon, UIResource, Serializable
  {
    CheckBoxIcon(PlasticXPIconFactory.1 x0)
    {
      this();
    }
    
    private static final int SIZE = LookUtils.IS_LOW_RESOLUTION ? 13 : 15;
    
    public int getIconWidth()
    {
      return SIZE;
    }
    
    public int getIconHeight()
    {
      return SIZE;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JCheckBox cb = (JCheckBox)c;
      ButtonModel model = cb.getModel();
      Graphics2D g2 = (Graphics2D)g;
      boolean paintFocus = ((model.isArmed()) && (!model.isPressed())) || ((cb.hasFocus()) && (PlasticXPIconFactory.isBlank(cb.getText())));
      
      RenderingHints.Key key = RenderingHints.KEY_ANTIALIASING;
      Object newAAHint = RenderingHints.VALUE_ANTIALIAS_ON;
      Object oldAAHint = g2.getRenderingHint(key);
      if (newAAHint != oldAAHint) {
        g2.setRenderingHint(key, newAAHint);
      } else {
        oldAAHint = null;
      }
      drawBorder(g2, model.isEnabled(), x, y, SIZE - 1, SIZE - 1);
      drawFill(g2, model.isPressed(), x + 1, y + 1, SIZE - 2, SIZE - 2);
      if (paintFocus) {
        drawFocus(g2, x + 1, y + 1, SIZE - 3, SIZE - 3);
      }
      if (model.isSelected()) {
        drawCheck(g2, model.isEnabled(), x + 3, y + 3, SIZE - 7, SIZE - 7);
      }
      if (oldAAHint != null) {
        g2.setRenderingHint(key, oldAAHint);
      }
    }
    
    private void drawBorder(Graphics2D g2, boolean enabled, int x, int y, int width, int height)
    {
      g2.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlDisabled());
      
      g2.drawRect(x, y, width, height);
    }
    
    private void drawCheck(Graphics2D g2, boolean enabled, int x, int y, int width, int height)
    {
      g2.setColor(enabled ? UIManager.getColor("CheckBox.check") : MetalLookAndFeel.getControlDisabled());
      
      int right = x + width;
      int bottom = y + height;
      int startY = y + height / 3;
      int turnX = x + width / 2 - 2;
      g2.drawLine(x, startY, turnX, bottom - 3);
      g2.drawLine(x, startY + 1, turnX, bottom - 2);
      g2.drawLine(x, startY + 2, turnX, bottom - 1);
      g2.drawLine(turnX + 1, bottom - 2, right, y);
      g2.drawLine(turnX + 1, bottom - 1, right, y + 1);
      g2.drawLine(turnX + 1, bottom, right, y + 2);
    }
    
    private void drawFill(Graphics2D g2, boolean pressed, int x, int y, int w, int h)
    {
      Color lowerRight;
      Color upperLeft;
      Color lowerRight;
      if (pressed)
      {
        Color upperLeft = MetalLookAndFeel.getControlShadow();
        lowerRight = PlasticLookAndFeel.getControlHighlight();
      }
      else
      {
        upperLeft = PlasticLookAndFeel.getControl();
        lowerRight = PlasticLookAndFeel.getControlHighlight().brighter();
      }
      g2.setPaint(new GradientPaint(x, y, upperLeft, x + w, y + h, lowerRight));
      g2.fillRect(x, y, w, h);
    }
    
    private void drawFocus(Graphics2D g2, int x, int y, int width, int height)
    {
      g2.setPaint(new GradientPaint(x, y, PlasticLookAndFeel.getFocusColor().brighter(), width, height, PlasticLookAndFeel.getFocusColor()));
      
      g2.drawRect(x, y, width, height);
      g2.drawRect(x + 1, y + 1, width - 2, height - 2);
    }
    
    private CheckBoxIcon() {}
  }
  
  private static final class RadioButtonIcon
    implements Icon, UIResource, Serializable
  {
    RadioButtonIcon(PlasticXPIconFactory.1 x0)
    {
      this();
    }
    
    private static final int SIZE = LookUtils.IS_LOW_RESOLUTION ? 13 : 15;
    private static final Stroke FOCUS_STROKE = new BasicStroke(2.0F);
    
    public int getIconWidth()
    {
      return SIZE;
    }
    
    public int getIconHeight()
    {
      return SIZE;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      Graphics2D g2 = (Graphics2D)g;
      AbstractButton rb = (AbstractButton)c;
      ButtonModel model = rb.getModel();
      boolean paintFocus = ((model.isArmed()) && (!model.isPressed())) || ((rb.hasFocus()) && (PlasticXPIconFactory.isBlank(rb.getText())));
      
      RenderingHints.Key key = RenderingHints.KEY_ANTIALIASING;
      Object newAAHint = RenderingHints.VALUE_ANTIALIAS_ON;
      Object oldAAHint = g2.getRenderingHint(key);
      if (newAAHint != oldAAHint) {
        g2.setRenderingHint(key, newAAHint);
      } else {
        oldAAHint = null;
      }
      drawFill(g2, model.isPressed(), x, y, SIZE - 1, SIZE - 1);
      if (paintFocus) {
        drawFocus(g2, x + 1, y + 1, SIZE - 3, SIZE - 3);
      }
      if (model.isSelected()) {
        drawCheck(g2, c, model.isEnabled(), x + 4, y + 4, SIZE - 8, SIZE - 8);
      }
      drawBorder(g2, model.isEnabled(), x, y, SIZE - 1, SIZE - 1);
      if (oldAAHint != null) {
        g2.setRenderingHint(key, oldAAHint);
      }
    }
    
    private void drawBorder(Graphics2D g2, boolean enabled, int x, int y, int w, int h)
    {
      g2.setColor(enabled ? PlasticLookAndFeel.getControlDarkShadow() : MetalLookAndFeel.getControlDisabled());
      
      g2.drawOval(x, y, w, h);
    }
    
    private void drawCheck(Graphics2D g2, Component c, boolean enabled, int x, int y, int w, int h)
    {
      g2.translate(x, y);
      if (enabled)
      {
        g2.setColor(UIManager.getColor("RadioButton.check"));
        g2.fillOval(0, 0, w, h);
        UIManager.getIcon("RadioButton.checkIcon").paintIcon(c, g2, 0, 0);
      }
      else
      {
        g2.setColor(MetalLookAndFeel.getControlDisabled());
        g2.fillOval(0, 0, w, h);
      }
      g2.translate(-x, -y);
    }
    
    private void drawFill(Graphics2D g2, boolean pressed, int x, int y, int w, int h)
    {
      Color lowerRight;
      Color upperLeft;
      Color lowerRight;
      if (pressed)
      {
        Color upperLeft = MetalLookAndFeel.getControlShadow();
        lowerRight = PlasticLookAndFeel.getControlHighlight();
      }
      else
      {
        upperLeft = PlasticLookAndFeel.getControl();
        lowerRight = PlasticLookAndFeel.getControlHighlight().brighter();
      }
      g2.setPaint(new GradientPaint(x, y, upperLeft, x + w, y + h, lowerRight));
      g2.fillOval(x, y, w, h);
    }
    
    private void drawFocus(Graphics2D g2, int x, int y, int w, int h)
    {
      g2.setPaint(new GradientPaint(x, y, PlasticLookAndFeel.getFocusColor().brighter(), w, h, PlasticLookAndFeel.getFocusColor()));
      
      Stroke stroke = g2.getStroke();
      g2.setStroke(FOCUS_STROKE);
      g2.drawOval(x, y, w, h);
      g2.setStroke(stroke);
    }
    
    private RadioButtonIcon() {}
  }
  
  private static boolean isBlank(String str)
  {
    int length;
    if ((str == null) || ((length = str.length()) == 0)) {
      return true;
    }
    int length;
    for (int i = length - 1; i >= 0; i--) {
      if (!Character.isWhitespace(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticXPIconFactory
 * 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.MicroLayout;
import com.jgoodies.looks.MicroLayoutPolicy;
import java.awt.Insets;
import javax.swing.UIDefaults;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.ColorUIResource;

public class PlasticXPLookAndFeel
  extends Plastic3DLookAndFeel
{
  public String getID()
  {
    return "JGoodies Plastic XP";
  }
  
  public String getName()
  {
    return "JGoodies Plastic XP";
  }
  
  public String getDescription()
  {
    return "The JGoodies Plastic XP Look and Feel - � 2001-2008 JGoodies Karsten Lentzsch";
  }
  
  protected void initClassDefaults(UIDefaults table)
  {
    super.initClassDefaults(table);
    
    String uiClassnamePrefix = "com.jgoodies.looks.plastic.PlasticXP";
    Object[] uiDefaults = { "CheckBoxUI", "com.jgoodies.looks.plastic.PlasticXPCheckBoxUI", "RadioButtonUI", "com.jgoodies.looks.plastic.PlasticXPRadioButtonUI", "SpinnerUI", "com.jgoodies.looks.plastic.PlasticXPSpinnerUI", "ToolBarUI", "com.jgoodies.looks.plastic.PlasticXPToolBarUI" };
    
    table.putDefaults(uiDefaults);
  }
  
  protected void initComponentDefaults(UIDefaults table)
  {
    super.initComponentDefaults(table);
    
    MicroLayout microLayout = getMicroLayoutPolicy().getMicroLayout(getName(), table);
    Insets buttonBorderInsets = microLayout.getButtonBorderInsets();
    
    Object buttonBorder = PlasticXPBorders.getButtonBorder(buttonBorderInsets);
    Object toggleButtonBorder = PlasticXPBorders.getToggleButtonBorder(buttonBorderInsets);
    Object checkBoxIcon = PlasticXPIconFactory.getCheckBoxIcon();
    Object comboBoxButtonBorder = PlasticXPBorders.getComboBoxArrowButtonBorder();
    Border comboBoxEditorBorder = PlasticXPBorders.getComboBoxEditorBorder();
    Object radioButtonIcon = PlasticXPIconFactory.getRadioButtonIcon();
    Object scrollPaneBorder = PlasticXPBorders.getScrollPaneBorder();
    Object textFieldBorder = PlasticXPBorders.getTextFieldBorder();
    Object spinnerBorder = PlasticXPBorders.getSpinnerBorder();
    
    String radioCheckIconName = LookUtils.IS_LOW_RESOLUTION ? "icons/RadioLight5x5.png" : "icons/RadioLight7x7.png";
    
    Insets comboEditorInsets = microLayout.getComboBoxEditorInsets();
    
    Insets comboEditorBorderInsets = comboBoxEditorBorder.getBorderInsets(null);
    int comboBorderSize = left;
    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[] defaults = { "Button.border", buttonBorder, "Button.borderPaintsFocus", Boolean.TRUE, "CheckBox.icon", checkBoxIcon, "CheckBox.check", getToggleButtonCheckColor(), "ComboBox.arrowButtonBorder", comboBoxButtonBorder, "ComboBox.editorBorder", comboBoxEditorBorder, "ComboBox.borderPaintsFocus", Boolean.TRUE, "ComboBox.editorBorderInsets", comboEditorBorderInsets, "ComboBox.tableEditorInsets", comboTableEditorInsets, "ComboBox.rendererBorder", comboRendererBorder, "FormattedTextField.border", textFieldBorder, "PasswordField.border", textFieldBorder, "Spinner.border", spinnerBorder, "ScrollPane.border", scrollPaneBorder, "Table.scrollPaneBorder", scrollPaneBorder, "RadioButton.icon", radioButtonIcon, "RadioButton.check", getToggleButtonCheckColor(), "RadioButton.interiorBackground", getControlHighlight(), "RadioButton.checkIcon", makeIcon(getClass(), radioCheckIconName), "TextField.border", textFieldBorder, "ToggleButton.border", toggleButtonBorder, "ToggleButton.borderPaintsFocus", Boolean.TRUE, "Tree.expandedIcon", makeIcon(getClass(), "icons/TreeExpanded.png"), "Tree.collapsedIcon", makeIcon(getClass(), "icons/TreeCollapsed.png") };
    
    table.putDefaults(defaults);
  }
  
  protected static void installDefaultThemes() {}
  
  private ColorUIResource getToggleButtonCheckColor()
  {
    return getPlasticTheme().getToggleButtonCheckColor();
  }
}

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

import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.metal.MetalRadioButtonUI;

public final class PlasticXPRadioButtonUI
  extends MetalRadioButtonUI
{
  private static
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-2017. Infinite Loop Ltd