looks-2.2.0

)
  {
    super(paramPlasticComboBoxUI);
  }
  
  PlasticComboBoxUI$PlasticComboBoxLayoutManager(PlasticComboBoxUI x0, PlasticComboBoxUI.1 x1)
  {
    this(x0);
  }
  
  public void layoutContainer(Container parent)
  {
    JComboBox cb = (JComboBox)parent;
    if (!cb.isEditable())
    {
      super.layoutContainer(parent);
      return;
    }
    int width = cb.getWidth();
    int height = cb.getHeight();
    
    Insets insets = PlasticComboBoxUI.access$300(this$0);
    int buttonWidth = PlasticComboBoxUI.getEditableButtonWidth();
    int buttonHeight = height - (top + bottom);
    if (PlasticComboBoxUI.access$400(this$0) != null) {
      if (cb.getComponentOrientation().isLeftToRight()) {
        PlasticComboBoxUI.access$500(this$0).setBounds(width - (right + buttonWidth), top, buttonWidth, buttonHeight);
      } else {
        PlasticComboBoxUI.access$600(this$0).setBounds(left, top, buttonWidth, buttonHeight);
      }
    }
    if (PlasticComboBoxUI.access$700(this$0) != null) {
      PlasticComboBoxUI.access$800(this$0).setBounds(this$0.rectangleForCurrentValue());
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticComboBoxUI.PlasticComboBoxLayoutManager
 * 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.Dimension;
import java.awt.Rectangle;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicComboPopup;

final class PlasticComboBoxUI$PlasticComboPopup
  extends BasicComboPopup
{
  PlasticComboBoxUI$PlasticComboPopup(JComboBox x0, PlasticComboBoxUI.1 x1)
  {
    this(x0);
  }
  
  private PlasticComboBoxUI$PlasticComboPopup(JComboBox combo)
  {
    super(combo);
  }
  
  protected void configureList()
  {
    super.configureList();
    list.setForeground(UIManager.getColor("MenuItem.foreground"));
    list.setBackground(UIManager.getColor("MenuItem.background"));
  }
  
  protected void configureScroller()
  {
    super.configureScroller();
    scroller.getVerticalScrollBar().putClientProperty("JScrollBar.isFreeStanding", Boolean.FALSE);
  }
  
  protected Rectangle computePopupBounds(int px, int py, int pw, int ph)
  {
    Rectangle defaultBounds = super.computePopupBounds(px, py, pw, ph);
    Object popupPrototypeDisplayValue = comboBox.getClientProperty("ComboBox.popupPrototypeDisplayValue");
    if (popupPrototypeDisplayValue == null) {
      return defaultBounds;
    }
    ListCellRenderer renderer = list.getCellRenderer();
    Component c = renderer.getListCellRendererComponent(list, popupPrototypeDisplayValue, -1, true, true);
    
    pw = getPreferredSizewidth;
    boolean hasVerticalScrollBar = comboBox.getItemCount() > comboBox.getMaximumRowCount();
    if (hasVerticalScrollBar)
    {
      JScrollBar verticalBar = scroller.getVerticalScrollBar();
      pw += getPreferredSizewidth;
    }
    Rectangle prototypeBasedBounds = super.computePopupBounds(px, py, pw, ph);
    return width > width ? prototypeBasedBounds : defaultBounds;
  }
}

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

import java.awt.Color;
import java.beans.PropertyChangeEvent;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.plaf.basic.BasicComboBoxUI.PropertyChangeHandler;

final class PlasticComboBoxUI$PlasticPropertyChangeListener
  extends BasicComboBoxUI.PropertyChangeHandler
{
  private final PlasticComboBoxUI this$0;
  
  private PlasticComboBoxUI$PlasticPropertyChangeListener(PlasticComboBoxUI paramPlasticComboBoxUI)
  {
    super(paramPlasticComboBoxUI);
  }
  
  PlasticComboBoxUI$PlasticPropertyChangeListener(PlasticComboBoxUI x0, PlasticComboBoxUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent e)
  {
    super.propertyChange(e);
    String propertyName = e.getPropertyName();
    if (propertyName.equals("editable"))
    {
      PlasticComboBoxButton button = (PlasticComboBoxButton)PlasticComboBoxUI.access$1000(this$0);
      
      button.setIconOnly(PlasticComboBoxUI.access$1100(this$0).isEditable());
      PlasticComboBoxUI.access$1200(this$0).repaint();
    }
    else if (propertyName.equals("background"))
    {
      Color color = (Color)e.getNewValue();
      PlasticComboBoxUI.access$1300(this$0).setBackground(color);
      PlasticComboBoxUI.access$1400(this$0).setBackground(color);
    }
    else if (propertyName.equals("foreground"))
    {
      Color color = (Color)e.getNewValue();
      PlasticComboBoxUI.access$1500(this$0).setForeground(color);
      PlasticComboBoxUI.access$1600(this$0).setForeground(color);
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticComboBoxUI.PlasticPropertyChangeListener
 * 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.JComboBox;
import javax.swing.plaf.UIResource;

final class PlasticComboBoxUI$TableCellEditorPropertyChangeHandler
  implements PropertyChangeListener
{
  private final PlasticComboBoxUI this$0;
  
  PlasticComboBoxUI$TableCellEditorPropertyChangeHandler(PlasticComboBoxUI x0, PlasticComboBoxUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent evt)
  {
    PlasticComboBoxUI.access$1702(this$0, PlasticComboBoxUI.access$1800(this$0));
    if ((PlasticComboBoxUI.access$1900(this$0).getRenderer() == null) || ((PlasticComboBoxUI.access$2000(this$0).getRenderer() instanceof UIResource))) {
      PlasticComboBoxUI.access$2100(this$0).setRenderer(this$0.createRenderer());
    }
    if ((PlasticComboBoxUI.access$2200(this$0).getEditor() == null) || ((PlasticComboBoxUI.access$2300(this$0).getEditor() instanceof UIResource))) {
      PlasticComboBoxUI.access$2400(this$0).setEditor(this$0.createEditor());
    }
  }
  
  private PlasticComboBoxUI$TableCellEditorPropertyChangeHandler(PlasticComboBoxUI paramPlasticComboBoxUI) {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticComboBoxUI.TableCellEditorPropertyChangeHandler
 * 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.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.ComboBoxEditor;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.TextUI;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicComboBoxRenderer;
import javax.swing.plaf.basic.BasicComboBoxRenderer.UIResource;
import javax.swing.plaf.basic.BasicComboBoxUI.PropertyChangeHandler;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import javax.swing.plaf.metal.MetalComboBoxUI;
import javax.swing.plaf.metal.MetalComboBoxUI.MetalComboBoxLayoutManager;
import javax.swing.plaf.metal.MetalTextFieldUI;

public class PlasticComboBoxUI
  extends MetalComboBoxUI
{
  static final String CELL_EDITOR_KEY = "JComboBox.isTableCellEditor";
  private static final JTextField PHANTOM = new JTextField("Phantom");
  private static Class phantomLafClass;
  private boolean tableCellEditor;
  private PropertyChangeListener propertyChangeListener;
  
  public static ComponentUI createUI(JComponent b)
  {
    ensurePhantomHasPlasticUI();
    return new PlasticComboBoxUI();
  }
  
  private static void ensurePhantomHasPlasticUI()
  {
    TextUI ui = PHANTOM.getUI();
    Class lafClass = UIManager.getLookAndFeel().getClass();
    if ((phantomLafClass != lafClass) || (!(ui instanceof MetalTextFieldUI)))
    {
      phantomLafClass = lafClass;
      PHANTOM.updateUI();
    }
  }
  
  public void installUI(JComponent c)
  {
    super.installUI(c);
    tableCellEditor = isTableCellEditor();
  }
  
  protected void installListeners()
  {
    super.installListeners();
    propertyChangeListener = new TableCellEditorPropertyChangeHandler(null);
    comboBox.addPropertyChangeListener("JComboBox.isTableCellEditor", propertyChangeListener);
  }
  
  protected void uninstallListeners()
  {
    super.uninstallListeners();
    comboBox.removePropertyChangeListener("JComboBox.isTableCellEditor", propertyChangeListener);
    propertyChangeListener = null;
  }
  
  protected JButton createArrowButton()
  {
    return new PlasticComboBoxButton(comboBox, PlasticIconFactory.getComboBoxButtonIcon(), comboBox.isEditable(), currentValuePane, listBox);
  }
  
  protected ComboBoxEditor createEditor()
  {
    return new PlasticComboBoxEditor.UIResource(tableCellEditor);
  }
  
  protected LayoutManager createLayoutManager()
  {
    return new PlasticComboBoxLayoutManager(null);
  }
  
  protected ComboPopup createPopup()
  {
    return new PlasticComboPopup(comboBox, null);
  }
  
  protected ListCellRenderer createRenderer()
  {
    if (tableCellEditor) {
      return super.createRenderer();
    }
    BasicComboBoxRenderer renderer = new BasicComboBoxRenderer.UIResource();
    renderer.setBorder(UIManager.getBorder("ComboBox.rendererBorder"));
    return renderer;
  }
  
  public Dimension getMinimumSize(JComponent c)
  {
    if (!isMinimumSizeDirty) {
      return new Dimension(cachedMinimumSize);
    }
    Dimension size = getDisplaySize();
    Insets insets = getInsets();
    height += top + bottom;
    if (comboBox.isEditable())
    {
      Insets editorBorderInsets = UIManager.getInsets("ComboBox.editorBorderInsets");
      width += left + right;
      
      width += 1;
    }
    else if (arrowButton != null)
    {
      Insets arrowButtonInsets = arrowButton.getInsets();
      width += left;
    }
    int buttonWidth = getEditableButtonWidth();
    width += left + right + buttonWidth;
    
    ListCellRenderer renderer = comboBox.getRenderer();
    if ((renderer instanceof JComponent))
    {
      JComponent component = (JComponent)renderer;
      Insets rendererInsets = component.getInsets();
      Insets editorInsets = UIManager.getInsets("ComboBox.editorInsets");
      int offsetLeft = Math.max(0, left - left);
      int offsetRight = Math.max(0, right - right);
      
      width += offsetLeft + offsetRight;
    }
    Dimension textFieldSize = PHANTOM.getMinimumSize();
    height = Math.max(height, height);
    
    cachedMinimumSize.setSize(width, height);
    isMinimumSizeDirty = false;
    
    return new Dimension(size);
  }
  
  public Dimension getPreferredSize(JComponent c)
  {
    return getMinimumSize(c);
  }
  
  protected Rectangle rectangleForCurrentValue()
  {
    int width = comboBox.getWidth();
    int height = comboBox.getHeight();
    Insets insets = getInsets();
    int buttonWidth = getEditableButtonWidth();
    if (arrowButton != null) {
      buttonWidth = arrowButton.getWidth();
    }
    if (comboBox.getComponentOrientation().isLeftToRight()) {
      return new Rectangle(left, top, width - (left + right + buttonWidth), height - (top + bottom));
    }
    return new Rectangle(left + buttonWidth, top, width - (left + right + buttonWidth), height - (top + bottom));
  }
  
  public void update(Graphics g, JComponent c)
  {
    if (c.isOpaque())
    {
      g.setColor(c.getBackground());
      g.fillRect(0, 0, c.getWidth(), c.getHeight());
      if (isToolBarComboBox(c)) {
        c.setOpaque(false);
      }
    }
    paint(g, c);
  }
  
  protected boolean isToolBarComboBox(JComponent c)
  {
    Container parent = c.getParent();
    return (parent != null) && (((parent instanceof JToolBar)) || ((parent.getParent() instanceof JToolBar)));
  }
  
  static int getEditableButtonWidth()
  {
    return UIManager.getInt("ScrollBar.width") - 1;
  }
  
  private boolean isTableCellEditor()
  {
    return Boolean.TRUE.equals(comboBox.getClientProperty("JComboBox.isTableCellEditor"));
  }
  
  private final class PlasticComboBoxLayoutManager
    extends MetalComboBoxUI.MetalComboBoxLayoutManager
  {
    private PlasticComboBoxLayoutManager()
    {
      super();
    }
    
    PlasticComboBoxLayoutManager(PlasticComboBoxUI.1 x1)
    {
      this();
    }
    
    public void layoutContainer(Container parent)
    {
      JComboBox cb = (JComboBox)parent;
      if (!cb.isEditable())
      {
        super.layoutContainer(parent);
        return;
      }
      int width = cb.getWidth();
      int height = cb.getHeight();
      
      Insets insets = getInsets();
      int buttonWidth = PlasticComboBoxUI.getEditableButtonWidth();
      int buttonHeight = height - (top + bottom);
      if (arrowButton != null) {
        if (cb.getComponentOrientation().isLeftToRight()) {
          arrowButton.setBounds(width - (right + buttonWidth), top, buttonWidth, buttonHeight);
        } else {
          arrowButton.setBounds(left, top, buttonWidth, buttonHeight);
        }
      }
      if (editor != null) {
        editor.setBounds(rectangleForCurrentValue());
      }
    }
  }
  
  public PropertyChangeListener createPropertyChangeListener()
  {
    return new PlasticPropertyChangeListener(null);
  }
  
  private final class PlasticPropertyChangeListener
    extends BasicComboBoxUI.PropertyChangeHandler
  {
    private PlasticPropertyChangeListener()
    {
      super();
    }
    
    PlasticPropertyChangeListener(PlasticComboBoxUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent e)
    {
      super.propertyChange(e);
      String propertyName = e.getPropertyName();
      if (propertyName.equals("editable"))
      {
        PlasticComboBoxButton button = (PlasticComboBoxButton)arrowButton;
        
        button.setIconOnly(comboBox.isEditable());
        comboBox.repaint();
      }
      else if (propertyName.equals("background"))
      {
        Color color = (Color)e.getNewValue();
        arrowButton.setBackground(color);
        listBox.setBackground(color);
      }
      else if (propertyName.equals("foreground"))
      {
        Color color = (Color)e.getNewValue();
        arrowButton.setForeground(color);
        listBox.setForeground(color);
      }
    }
  }
  
  private static final class PlasticComboPopup
    extends BasicComboPopup
  {
    PlasticComboPopup(JComboBox x0, PlasticComboBoxUI.1 x1)
    {
      this(x0);
    }
    
    private PlasticComboPopup(JComboBox combo)
    {
      super();
    }
    
    protected void configureList()
    {
      super.configureList();
      list.setForeground(UIManager.getColor("MenuItem.foreground"));
      list.setBackground(UIManager.getColor("MenuItem.background"));
    }
    
    protected void configureScroller()
    {
      super.configureScroller();
      scroller.getVerticalScrollBar().putClientProperty("JScrollBar.isFreeStanding", Boolean.FALSE);
    }
    
    protected Rectangle computePopupBounds(int px, int py, int pw, int ph)
    {
      Rectangle defaultBounds = super.computePopupBounds(px, py, pw, ph);
      Object popupPrototypeDisplayValue = comboBox.getClientProperty("ComboBox.popupPrototypeDisplayValue");
      if (popupPrototypeDisplayValue == null) {
        return defaultBounds;
      }
      ListCellRenderer renderer = list.getCellRenderer();
      Component c = renderer.getListCellRendererComponent(list, popupPrototypeDisplayValue, -1, true, true);
      
      pw = getPreferredSizewidth;
      boolean hasVerticalScrollBar = comboBox.getItemCount() > comboBox.getMaximumRowCount();
      if (hasVerticalScrollBar)
      {
        JScrollBar verticalBar = scroller.getVerticalScrollBar();
        pw += getPreferredSizewidth;
      }
      Rectangle prototypeBasedBounds = super.computePopupBounds(px, py, pw, ph);
      return width > width ? prototypeBasedBounds : defaultBounds;
    }
  }
  
  private final class TableCellEditorPropertyChangeHandler
    implements PropertyChangeListener
  {
    TableCellEditorPropertyChangeHandler(PlasticComboBoxUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent evt)
    {
      tableCellEditor = PlasticComboBoxUI.this.isTableCellEditor();
      if ((comboBox.getRenderer() == null) || ((comboBox.getRenderer() instanceof UIResource))) {
        comboBox.setRenderer(createRenderer());
      }
      if ((comboBox.getEditor() == null) || ((comboBox.getEditor() instanceof UIResource))) {
        comboBox.setEditor(createEditor());
      }
    }
    
    private TableCellEditorPropertyChangeHandler() {}
  }
}

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

final class PlasticFieldCaret$1
  implements Runnable
{
  private final PlasticFieldCaret this$0;
  
  PlasticFieldCaret$1(PlasticFieldCaret paramPlasticFieldCaret) {}
  
  public void run()
  {
    PlasticFieldCaret.access$000(this$0);
  }
}

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

import com.jgoodies.looks.Options;
import java.awt.EventQueue;
import java.awt.event.FocusEvent;
import java.awt.event.MouseEvent;
import javax.swing.JFormattedTextField;
import javax.swing.SwingUtilities;
import javax.swing.plaf.UIResource;
import javax.swing.text.DefaultCaret;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;

final class PlasticFieldCaret
  extends DefaultCaret
  implements UIResource
{
  private boolean isKeyboardFocusEvent = true;
  
  public void focusGained(FocusEvent e)
  {
    JTextComponent c = getComponent();
    if (c.isEnabled())
    {
      setVisible(true);
      setSelectionVisible(true);
    }
    if (!c.isEditable()) {
      return;
    }
    if ((c.isEnabled()) && (isKeyboardFocusEvent) && (Options.isSelectOnFocusGainActive(c))) {
      if ((c instanceof JFormattedTextField)) {
        EventQueue.invokeLater(new Runnable()
        {
          public void run()
          {
            PlasticFieldCaret.this.selectAll();
          }
        });
      } else {
        selectAll();
      }
    }
  }
  
  private void selectAll()
  {
    JTextComponent c = getComponent();
    boolean backward = Boolean.TRUE.equals(c.getClientProperty("JGoodies.invertSelection"));
    if (backward)
    {
      setDot(c.getDocument().getLength());
      moveDot(0);
    }
    else
    {
      setDot(0);
      moveDot(c.getDocument().getLength());
    }
  }
  
  public void focusLost(FocusEvent e)
  {
    super.focusLost(e);
    if (!e.isTemporary())
    {
      isKeyboardFocusEvent = true;
      if (Boolean.TRUE.equals(getComponent().getClientProperty("JGoodies.setCaretToStartOnFocusLost"))) {
        setDot(0);
      }
    }
  }
  
  public void mousePressed(MouseEvent e)
  {
    if ((SwingUtilities.isLeftMouseButton(e)) || (e.isPopupTrigger())) {
      isKeyboardFocusEvent = false;
    }
    super.mousePressed(e);
  }
  
  public void mouseReleased(MouseEvent e)
  {
    super.mouseReleased(e);
    if (e.isPopupTrigger())
    {
      isKeyboardFocusEvent = false;
      if ((getComponent() != null) && (getComponent().isEnabled()) && (getComponent().isRequestFocusEnabled())) {
        getComponent().requestFocus();
      }
    }
  }
}

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

class PlasticFileChooserUI$1 {}

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

import java.io.File;
import javax.swing.Icon;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.filechooser.FileSystemView;
import javax.swing.plaf.basic.BasicFileChooserUI.BasicFileView;

final class PlasticFileChooserUI$SystemIconFileView
  extends BasicFileChooserUI.BasicFileView
{
  private final PlasticFileChooserUI this$0;
  
  private PlasticFileChooserUI$SystemIconFileView(PlasticFileChooserUI paramPlasticFileChooserUI)
  {
    super(paramPlasticFileChooserUI);
  }
  
  PlasticFileChooserUI$SystemIconFileView(PlasticFileChooserUI x0, PlasticFileChooserUI.1 x1)
  {
    this(x0);
  }
  
  public Icon getIcon(File f)
  {
    Icon icon = getCachedIcon(f);
    if (icon != null) {
      return icon;
    }
    if ((f != null) && (UIManager.getBoolean("FileChooser.useSystemIcons"))) {
      icon = this$0.getFileChooser().getFileSystemView().getSystemIcon(f);
    }
    if (icon == null) {
      return super.getIcon(f);
    }
    cacheIcon(f, icon);
    return icon;
  }
}

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

import java.io.File;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.filechooser.FileSystemView;
import javax.swing.filechooser.FileView;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicFileChooserUI.BasicFileView;
import javax.swing.plaf.metal.MetalFileChooserUI;

public final class PlasticFileChooserUI
  extends MetalFileChooserUI
{
  private final BasicFileChooserUI.BasicFileView fileView = new SystemIconFileView(null);
  
  public static ComponentUI createUI(JComponent c)
  {
    return new PlasticFileChooserUI((JFileChooser)c);
  }
  
  public PlasticFileChooserUI(JFileChooser fileChooser)
  {
    super(fileChooser);
  }
  
  public void clearIconCache()
  {
    fileView.clearIconCache();
  }
  
  public FileView getFileView(JFileChooser fc)
  {
    return fileView;
  }
  
  private final class SystemIconFileView
    extends BasicFileChooserUI.BasicFileView
  {
    private SystemIconFileView()
    {
      super();
    }
    
    SystemIconFileView(PlasticFileChooserUI.1 x1)
    {
      this();
    }
    
    public Icon getIcon(File f)
    {
      Icon icon = getCachedIcon(f);
      if (icon != null) {
        return icon;
      }
      if ((f != null) && (UIManager.getBoolean("FileChooser.useSystemIcons"))) {
        icon = getFileChooser().getFileSystemView().getSystemIcon(f);
      }
      if (icon == null) {
        return super.getIcon(f);
      }
      cacheIcon(f, icon);
      return icon;
    }
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticFileChooserUI
 * 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.BasicFormattedTextFieldUI;
import javax.swing.text.Caret;

public final class PlasticFormattedTextFieldUI
  extends BasicFormattedTextFieldUI
{
  public static ComponentUI createUI(JComponent c)
  {
    return new PlasticFormattedTextFieldUI();
  }
  
  protected Caret createCaret()
  {
    return new PlasticFieldCaret();
  }
}

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

class PlasticIconFactory$1 {}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.1
 * 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.io.Serializable;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

class PlasticIconFactory$CheckBoxIcon
  implements Icon, UIResource, Serializable
{
  private static final int SIZE = 13;
  
  PlasticIconFactory$CheckBoxIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public int getIconWidth()
  {
    return 13;
  }
  
  public int getIconHeight()
  {
    return 13;
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JCheckBox cb = (JCheckBox)c;
    ButtonModel model = cb.getModel();
    if (model.isEnabled())
    {
      if (cb.isBorderPaintedFlat())
      {
        g.setColor(PlasticLookAndFeel.getControlDarkShadow());
        g.drawRect(x, y, 11, 11);
        
        g.setColor(PlasticLookAndFeel.getControlHighlight());
        g.fillRect(x + 1, y + 1, 10, 10);
      }
      else if ((model.isPressed()) && (model.isArmed()))
      {
        g.setColor(MetalLookAndFeel.getControlShadow());
        g.fillRect(x, y, 12, 12);
        PlasticUtils.drawPressed3DBorder(g, x, y, 13, 13);
      }
      else
      {
        PlasticUtils.drawFlush3DBorder(g, x, y, 13, 13);
      }
      g.setColor(MetalLookAndFeel.getControlInfo());
    }
    else
    {
      g.setColor(MetalLookAndFeel.getControlShadow());
      g.drawRect(x, y, 11, 11);
    }
    if (model.isSelected()) {
      PlasticIconFactory.access$000(g, x, y);
    }
  }
  
  private PlasticIconFactory$CheckBoxIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.CheckBoxIcon
 * 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.io.Serializable;
import javax.swing.Icon;
import javax.swing.JMenuItem;
import javax.swing.plaf.UIResource;

class PlasticIconFactory$CheckBoxMenuItemIcon
  implements Icon, UIResource, Serializable
{
  private static final int SIZE = 13;
  
  PlasticIconFactory$CheckBoxMenuItemIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public int getIconWidth()
  {
    return 13;
  }
  
  public int getIconHeight()
  {
    return 13;
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JMenuItem b = (JMenuItem)c;
    if (b.isSelected()) {
      PlasticIconFactory.access$000(g, x, y + 1);
    }
  }
  
  private PlasticIconFactory$CheckBoxMenuItemIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.CheckBoxMenuItemIcon
 * 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;

class PlasticIconFactory$CollapsedTreeIcon
  extends PlasticIconFactory.ExpandedTreeIcon
{
  private PlasticIconFactory$CollapsedTreeIcon()
  {
    super(null);
  }
  
  PlasticIconFactory$CollapsedTreeIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    super.paintIcon(c, g, x, y);
    g.drawLine(x + 4, y + 2, x + 4, y + 6);
  }
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.CollapsedTreeIcon
 * 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.io.Serializable;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.plaf.metal.MetalLookAndFeel;

class PlasticIconFactory$ComboBoxButtonIcon
  implements Icon, Serializable
{
  PlasticIconFactory$ComboBoxButtonIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JComponent component = (JComponent)c;
    int iconWidth = getIconWidth();
    
    g.translate(x, y);
    
    g.setColor(component.isEnabled() ? MetalLookAndFeel.getControlInfo() : MetalLookAndFeel.getControlShadow());
    
    g.drawLine(0, 0, iconWidth - 1, 0);
    g.drawLine(1, 1, 1 + (iconWidth - 3), 1);
    g.drawLine(2, 2, 2 + (iconWidth - 5), 2);
    g.drawLine(3, 3, 3 + (iconWidth - 7), 3);
    
    g.translate(-x, -y);
  }
  
  public int getIconWidth()
  {
    return 8;
  }
  
  public int getIconHeight()
  {
    return 4;
  }
  
  private PlasticIconFactory$ComboBoxButtonIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.ComboBoxButtonIcon
 * 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.Component;
import java.awt.Graphics;
import java.io.Serializable;
import javax.swing.Icon;

class PlasticIconFactory$ExpandedTreeIcon
  implements Icon, Serializable
{
  protected static final int SIZE = 9;
  protected static final int HALF_SIZE = 4;
  
  PlasticIconFactory$ExpandedTreeIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    g.setColor(Color.WHITE);
    g.fillRect(x, y, 8, 8);
    g.setColor(Color.GRAY);
    g.drawRect(x, y, 8, 8);
    g.setColor(Color.BLACK);
    g.drawLine(x + 2, y + 4, x + 6, y + 4);
  }
  
  public int getIconWidth()
  {
    return 9;
  }
  
  public int getIconHeight()
  {
    return 9;
  }
  
  private PlasticIconFactory$ExpandedTreeIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.ExpandedTreeIcon
 * 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.io.Serializable;
import javax.swing.Icon;
import javax.swing.JMenuItem;
import javax.swing.plaf.UIResource;

class PlasticIconFactory$MenuArrowIcon
  implements Icon, UIResource, Serializable
{
  private static final int WIDTH = 4;
  private static final int HEIGHT = 8;
  
  PlasticIconFactory$MenuArrowIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JMenuItem b = (JMenuItem)c;
    
    g.translate(x, y);
    if (PlasticUtils.isLeftToRight(b))
    {
      g.drawLine(0, 0, 0, 7);
      g.drawLine(1, 1, 1, 6);
      g.drawLine(2, 2, 2, 5);
      g.drawLine(3, 3, 3, 4);
    }
    else
    {
      g.drawLine(4, 0, 4, 7);
      g.drawLine(3, 1, 3, 6);
      g.drawLine(2, 2, 2, 5);
      g.drawLine(1, 3, 1, 4);
    }
    g.translate(-x, -y);
  }
  
  public int getIconWidth()
  {
    return 4;
  }
  
  public int getIconHeight()
  {
    return 8;
  }
  
  private PlasticIconFactory$MenuArrowIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.MenuArrowIcon
 * 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.io.Serializable;
import javax.swing.Icon;
import javax.swing.JMenuItem;
import javax.swing.plaf.UIResource;

class PlasticIconFactory$RadioButtonMenuItemIcon
  implements Icon, UIResource, Serializable
{
  private static final int SIZE = 13;
  
  PlasticIconFactory$RadioButtonMenuItemIcon(PlasticIconFactory.1 x0)
  {
    this();
  }
  
  public int getIconWidth()
  {
    return 13;
  }
  
  public int getIconHeight()
  {
    return 13;
  }
  
  public void paintIcon(Component c, Graphics g, int x, int y)
  {
    JMenuItem b = (JMenuItem)c;
    if (b.isSelected()) {
      drawDot(g, x, y);
    }
  }
  
  private void drawDot(Graphics g, int x, int y)
  {
    g.translate(x, y);
    g.drawLine(5, 4, 8, 4);
    g.fillRect(4, 5, 6, 4);
    g.drawLine(5, 9, 8, 9);
    g.translate(-x, -y);
  }
  
  private PlasticIconFactory$RadioButtonMenuItemIcon() {}
}

/* Location:
 * Qualified Name:     com.jgoodies.looks.plastic.PlasticIconFactory.RadioButtonMenuItemIcon
 * 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.Component;
import java.awt.Graphics;
import java.io.Serializable;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

final class PlasticIconFactory
{
  private static Icon checkBoxIcon;
  private static Icon checkBoxMenuItemIcon;
  private static Icon radioButtonMenuItemIcon;
  private static Icon menuArrowIcon;
  private static Icon expandedTreeIcon;
  private static Icon collapsedTreeIcon;
  private static Icon comboBoxButtonIcon;
  
  private static void drawCheck(Graphics g, int x, int y)
  {
    g.translate(x, y);
    g.drawLine(3, 5, 3, 5);
    g.fillRect(3, 6, 2, 2);
    g.drawLine(4, 8, 9, 3);
    g.drawLine(5, 8, 9, 4);
    g.drawLine(5, 9, 9, 5);
    g.translate(-x, -y);
  }
  
  private static class CheckBoxIcon
    implements Icon, UIResource, Serializable
  {
    private static final int SIZE = 13;
    
    CheckBoxIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public int getIconWidth()
    {
      return 13;
    }
    
    public int getIconHeight()
    {
      return 13;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JCheckBox cb = (JCheckBox)c;
      ButtonModel model = cb.getModel();
      if (model.isEnabled())
      {
        if (cb.isBorderPaintedFlat())
        {
          g.setColor(PlasticLookAndFeel.getControlDarkShadow());
          g.drawRect(x, y, 11, 11);
          
          g.setColor(PlasticLookAndFeel.getControlHighlight());
          g.fillRect(x + 1, y + 1, 10, 10);
        }
        else if ((model.isPressed()) && (model.isArmed()))
        {
          g.setColor(MetalLookAndFeel.getControlShadow());
          g.fillRect(x, y, 12, 12);
          PlasticUtils.drawPressed3DBorder(g, x, y, 13, 13);
        }
        else
        {
          PlasticUtils.drawFlush3DBorder(g, x, y, 13, 13);
        }
        g.setColor(MetalLookAndFeel.getControlInfo());
      }
      else
      {
        g.setColor(MetalLookAndFeel.getControlShadow());
        g.drawRect(x, y, 11, 11);
      }
      if (model.isSelected()) {
        PlasticIconFactory.drawCheck(g, x, y);
      }
    }
    
    private CheckBoxIcon() {}
  }
  
  private static class CheckBoxMenuItemIcon
    implements Icon, UIResource, Serializable
  {
    private static final int SIZE = 13;
    
    CheckBoxMenuItemIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public int getIconWidth()
    {
      return 13;
    }
    
    public int getIconHeight()
    {
      return 13;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JMenuItem b = (JMenuItem)c;
      if (b.isSelected()) {
        PlasticIconFactory.drawCheck(g, x, y + 1);
      }
    }
    
    private CheckBoxMenuItemIcon() {}
  }
  
  private static class RadioButtonMenuItemIcon
    implements Icon, UIResource, Serializable
  {
    private static final int SIZE = 13;
    
    RadioButtonMenuItemIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public int getIconWidth()
    {
      return 13;
    }
    
    public int getIconHeight()
    {
      return 13;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JMenuItem b = (JMenuItem)c;
      if (b.isSelected()) {
        drawDot(g, x, y);
      }
    }
    
    private void drawDot(Graphics g, int x, int y)
    {
      g.translate(x, y);
      g.drawLine(5, 4, 8, 4);
      g.fillRect(4, 5, 6, 4);
      g.drawLine(5, 9, 8, 9);
      g.translate(-x, -y);
    }
    
    private RadioButtonMenuItemIcon() {}
  }
  
  private static class MenuArrowIcon
    implements Icon, UIResource, Serializable
  {
    private static final int WIDTH = 4;
    private static final int HEIGHT = 8;
    
    MenuArrowIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JMenuItem b = (JMenuItem)c;
      
      g.translate(x, y);
      if (PlasticUtils.isLeftToRight(b))
      {
        g.drawLine(0, 0, 0, 7);
        g.drawLine(1, 1, 1, 6);
        g.drawLine(2, 2, 2, 5);
        g.drawLine(3, 3, 3, 4);
      }
      else
      {
        g.drawLine(4, 0, 4, 7);
        g.drawLine(3, 1, 3, 6);
        g.drawLine(2, 2, 2, 5);
        g.drawLine(1, 3, 1, 4);
      }
      g.translate(-x, -y);
    }
    
    public int getIconWidth()
    {
      return 4;
    }
    
    public int getIconHeight()
    {
      return 8;
    }
    
    private MenuArrowIcon() {}
  }
  
  private static class ExpandedTreeIcon
    implements Icon, Serializable
  {
    protected static final int SIZE = 9;
    protected static final int HALF_SIZE = 4;
    
    ExpandedTreeIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      g.setColor(Color.WHITE);
      g.fillRect(x, y, 8, 8);
      g.setColor(Color.GRAY);
      g.drawRect(x, y, 8, 8);
      g.setColor(Color.BLACK);
      g.drawLine(x + 2, y + 4, x + 6, y + 4);
    }
    
    public int getIconWidth()
    {
      return 9;
    }
    
    public int getIconHeight()
    {
      return 9;
    }
    
    private ExpandedTreeIcon() {}
  }
  
  private static class CollapsedTreeIcon
    extends PlasticIconFactory.ExpandedTreeIcon
  {
    private CollapsedTreeIcon()
    {
      super();
    }
    
    CollapsedTreeIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      super.paintIcon(c, g, x, y);
      g.drawLine(x + 4, y + 2, x + 4, y + 6);
    }
  }
  
  private static class ComboBoxButtonIcon
    implements Icon, Serializable
  {
    ComboBoxButtonIcon(PlasticIconFactory.1 x0)
    {
      this();
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
      JComponent component = (JComponent)c;
      int iconWidth = getIconWidth();
      
      g.translate(x, y);
      
      g.setColor(component.isEnabled() ? MetalLookAndFeel.getControlInfo() : MetalLookAndFeel.getControlShadow());
      
      g.drawLine(0, 0, iconWidth - 1, 0);
      g.drawLine(1, 1, 1 + (iconWidth - 3), 1);
      g.drawLine(2, 2, 2 + (iconWidth - 5), 2);
      g.drawLine(3, 3, 3 + (iconWidth - 7), 3);
      
      g.translate(-x, -y);
    }
    
    public int getIconWidth()
    {
      return 8;
    }
    
    public int getIconHeight()
    {
      return 4;
    }
    
    private ComboBoxButtonIcon() {}
  }
  
  static Icon getCheckBoxIcon()
  {
    if (checkBoxIcon == null) {
      checkBoxIcon = new CheckBoxIcon(null);
    }
    return checkBoxIcon;
  }
  
  static Icon getCheckBoxMenuItemIcon()
  {
    if (checkBoxMenuItemIcon == null) {
      checkBoxMenuItemIcon = new CheckBoxMenuItemIcon(null);
    }
    return checkBoxMenuItemIcon;
  }
  
  static Icon getRadioButtonMenuItemIcon()
  {
    if (radioButtonMenuItemIcon == null) {
      radioButtonMenuItemIcon = new RadioButtonMenuItemIcon(null);
    }
    return radioButtonMenuItemIcon;
  }
  
  static Icon getMenuArrowIcon()
  {
    if (menuArrowIcon == null) {
      menuArrowIcon = new MenuArrowIcon(null);
    }
    return menuArrowIcon;
  }
  
  static Icon getExpandedTreeIcon()
  {
    if (expandedTreeIcon == null) {
      expandedTreeIcon = new ExpandedTreeIcon(null);
    }
    return expandedTreeIcon;
  }
  
  static Icon getCollapsedTreeIcon()
  {
    if (collapsedTreeIcon == null) {
      collapsedTreeIcon = new CollapsedTreeIcon(null);
    }
    return collapsedTreeIc
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