looks-2.2.0

 for (int j = 1; j < blockSize; j++) {
            if (buffer[(j - 1)][(i - 1)] != 0)
            {
              g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
              
              g.drawLine(j - 1, i, j - 1, i);
            }
          }
        }
      }
    }
  }
}

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

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

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

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

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import javax.swing.JButton;
import javax.swing.JSplitPane;

public final class WindowsSplitPaneDivider$ExtWindowsDividerLayout
  implements LayoutManager
{
  private final WindowsSplitPaneDivider this$0;
  
  public WindowsSplitPaneDivider$ExtWindowsDividerLayout(WindowsSplitPaneDivider paramWindowsSplitPaneDivider) {}
  
  public void layoutContainer(Container c)
  {
    JButton theLeftButton = this$0.getLeftButtonFromSuper();
    JButton theRightButton = this$0.getRightButtonFromSuper();
    JSplitPane theSplitPane = this$0.getSplitPaneFromSuper();
    int theOrientation = this$0.getOrientationFromSuper();
    int oneTouchSize = this$0.getOneTouchSize();
    int oneTouchOffset = this$0.getOneTouchOffset();
    int blockSize = 5;
    if ((theLeftButton != null) && (theRightButton != null) && (c == this$0)) {
      if (theSplitPane.isOneTouchExpandable())
      {
        if (theOrientation == 0)
        {
          theLeftButton.setBounds(oneTouchOffset, 0, blockSize * 2, blockSize);
          
          theRightButton.setBounds(oneTouchOffset + oneTouchSize * 2, 0, blockSize * 2, blockSize);
        }
        else
        {
          theLeftButton.setBounds(0, oneTouchOffset, blockSize, blockSize * 2);
          
          theRightButton.setBounds(0, oneTouchOffset + oneTouchSize * 2, blockSize, blockSize * 2);
        }
      }
      else
      {
        theLeftButton.setBounds(-5, -5, 1, 1);
        theRightButton.setBounds(-5, -5, 1, 1);
      }
    }
  }
  
  public Dimension minimumLayoutSize(Container c)
  {
    return new Dimension(0, 0);
  }
  
  public Dimension preferredLayoutSize(Container c)
  {
    return new Dimension(0, 0);
  }
  
  public void removeLayoutComponent(Component c) {}
  
  public void addLayoutComponent(String string, Component c) {}
}

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

import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.LayoutManager;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;

final class WindowsSplitPaneDivider
  extends BasicSplitPaneDivider
{
  private static final int EXT_ONE_TOUCH_SIZE = 5;
  private static final int EXT_ONE_TOUCH_OFFSET = 2;
  private static final int EXT_BLOCKSIZE = 6;
  
  public final class ExtWindowsDividerLayout
    implements LayoutManager
  {
    public ExtWindowsDividerLayout() {}
    
    public void layoutContainer(Container c)
    {
      JButton theLeftButton = getLeftButtonFromSuper();
      JButton theRightButton = getRightButtonFromSuper();
      JSplitPane theSplitPane = getSplitPaneFromSuper();
      int theOrientation = getOrientationFromSuper();
      int oneTouchSize = getOneTouchSize();
      int oneTouchOffset = getOneTouchOffset();
      int blockSize = 5;
      if ((theLeftButton != null) && (theRightButton != null) && (c == WindowsSplitPaneDivider.this)) {
        if (theSplitPane.isOneTouchExpandable())
        {
          if (theOrientation == 0)
          {
            theLeftButton.setBounds(oneTouchOffset, 0, blockSize * 2, blockSize);
            
            theRightButton.setBounds(oneTouchOffset + oneTouchSize * 2, 0, blockSize * 2, blockSize);
          }
          else
          {
            theLeftButton.setBounds(0, oneTouchOffset, blockSize, blockSize * 2);
            
            theRightButton.setBounds(0, oneTouchOffset + oneTouchSize * 2, blockSize, blockSize * 2);
          }
        }
        else
        {
          theLeftButton.setBounds(-5, -5, 1, 1);
          theRightButton.setBounds(-5, -5, 1, 1);
        }
      }
    }
    
    public Dimension minimumLayoutSize(Container c)
    {
      return new Dimension(0, 0);
    }
    
    public Dimension preferredLayoutSize(Container c)
    {
      return new Dimension(0, 0);
    }
    
    public void removeLayoutComponent(Component c) {}
    
    public void addLayoutComponent(String string, Component c) {}
  }
  
  public WindowsSplitPaneDivider(BasicSplitPaneUI ui)
  {
    super(ui);
    setLayout(new ExtWindowsDividerLayout());
  }
  
  protected JButton createLeftOneTouchButton()
  {
    JButton b = new JButton()
    {
      int[][] buffer = { { 0, 0, 0, 2, 2, 0, 0, 0, 0 }, { 0, 0, 2, 1, 1, 1, 0, 0, 0 }, { 0, 2, 1, 1, 1, 1, 1, 0, 0 }, { 2, 1, 1, 1, 1, 1, 1, 1, 0 }, { 0, 3, 3, 3, 3, 3, 3, 3, 3 } };
      
      public void setBorder(Border border) {}
      
      public void paint(Graphics g)
      {
        JSplitPane theSplitPane = getSplitPaneFromSuper();
        if (theSplitPane != null)
        {
          int theOrientation = getOrientationFromSuper();
          int blockSize = buffer.length + 1;
          
          Color[] colors = { getBackground(), UIManager.getColor("controlDkShadow"), Color.black, UIManager.getColor("controlLtHighlight") };
          
          g.setColor(getBackground());
          g.fillRect(0, 0, getWidth(), getHeight());
          if (getModel().isPressed()) {
            colors[1] = colors[2];
          }
          if (theOrientation == 0) {
            for (int i = 1; i <= buffer[0].length; i++) {
              for (int j = 1; j < blockSize; j++) {
                if (buffer[(j - 1)][(i - 1)] != 0)
                {
                  g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
                  g.drawLine(i - 1, j, i - 1, j);
                }
              }
            }
          } else {
            for (int i = 1; i <= buffer[0].length; i++) {
              for (int j = 1; j < blockSize; j++) {
                if (buffer[(j - 1)][(i - 1)] != 0)
                {
                  g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
                  
                  g.drawLine(j - 1, i, j - 1, i);
                }
              }
            }
          }
        }
      }
    };
    b.setFocusPainted(false);
    b.setBorderPainted(false);
    b.setFocusable(false);
    b.setOpaque(false);
    return b;
  }
  
  protected JButton createRightOneTouchButton()
  {
    JButton b = new JButton()
    {
      int[][] buffer = { { 2, 2, 2, 2, 2, 2, 2, 2 }, { 0, 1, 1, 1, 1, 1, 1, 3 }, { 0, 0, 1, 1, 1, 1, 3, 0 }, { 0, 0, 0, 1, 1, 3, 0, 0 }, { 0, 0, 0, 0, 3, 0, 0, 0 } };
      
      public void setBorder(Border border) {}
      
      public void paint(Graphics g)
      {
        JSplitPane theSplitPane = getSplitPaneFromSuper();
        if (theSplitPane != null)
        {
          int theOrientation = getOrientationFromSuper();
          int blockSize = buffer.length + 1;
          
          Color[] colors = { getBackground(), UIManager.getColor("controlDkShadow"), Color.black, UIManager.getColor("controlLtHighlight") };
          
          g.setColor(getBackground());
          g.fillRect(0, 0, getWidth(), getHeight());
          if (getModel().isPressed()) {
            colors[1] = colors[2];
          }
          if (theOrientation == 0) {
            for (int i = 1; i <= buffer[0].length; i++) {
              for (int j = 1; j < blockSize; j++) {
                if (buffer[(j - 1)][(i - 1)] != 0)
                {
                  g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
                  g.drawLine(i, j, i, j);
                }
              }
            }
          } else {
            for (int i = 1; i <= buffer[0].length; i++) {
              for (int j = 1; j < blockSize; j++) {
                if (buffer[(j - 1)][(i - 1)] != 0)
                {
                  g.setColor(colors[buffer[(j - 1)][(i - 1)]]);
                  
                  g.drawLine(j - 1, i, j - 1, i);
                }
              }
            }
          }
        }
      }
    };
    b.setFocusPainted(false);
    b.setBorderPainted(false);
    b.setFocusable(false);
    b.setOpaque(false);
    return b;
  }
  
  int getBlockSize()
  {
    return 6;
  }
  
  int getOneTouchOffset()
  {
    return 2;
  }
  
  int getOneTouchSize()
  {
    return 5;
  }
  
  int getOrientationFromSuper()
  {
    return orientation;
  }
  
  JButton getLeftButtonFromSuper()
  {
    return leftButton;
  }
  
  JButton getRightButtonFromSuper()
  {
    return rightButton;
  }
  
  JSplitPane getSplitPaneFromSuper()
  {
    return splitPane;
  }
  
  public void paint(Graphics g)
  {
    if (splitPane.isOpaque())
    {
      Color bgColor = splitPane.hasFocus() ? UIManager.getColor("SplitPane.shadow") : getBackground();
      if (bgColor != null)
      {
        g.setColor(bgColor);
        g.fillRect(0, 0, getWidth(), getHeight());
      }
    }
    super.paint(g);
  }
}

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

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

public final class WindowsSplitPaneUI
  extends com.sun.java.swing.plaf.windows.WindowsSplitPaneUI
{
  public static ComponentUI createUI(JComponent x)
  {
    return new WindowsSplitPaneUI();
  }
  
  public BasicSplitPaneDivider createDefaultDivider()
  {
    return new WindowsSplitPaneDivider(this);
  }
}

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

class WindowsTabbedPaneUI$1 {}

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

import java.beans.PropertyChangeEvent;
import javax.swing.plaf.basic.BasicTabbedPaneUI.PropertyChangeHandler;

final class WindowsTabbedPaneUI$MyPropertyChangeHandler
  extends BasicTabbedPaneUI.PropertyChangeHandler
{
  private final WindowsTabbedPaneUI this$0;
  
  private WindowsTabbedPaneUI$MyPropertyChangeHandler(WindowsTabbedPaneUI paramWindowsTabbedPaneUI)
  {
    super(paramWindowsTabbedPaneUI);
  }
  
  WindowsTabbedPaneUI$MyPropertyChangeHandler(WindowsTabbedPaneUI x0, WindowsTabbedPaneUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent e)
  {
    super.propertyChange(e);
    
    String pName = e.getPropertyName();
    if (null == pName) {
      return;
    }
    if (pName.equals("jgoodies.embeddedTabs"))
    {
      WindowsTabbedPaneUI.access$100(this$0, (Boolean)e.getNewValue());
      return;
    }
    if (pName.equals("jgoodies.noContentBorder"))
    {
      WindowsTabbedPaneUI.access$200(this$0, (Boolean)e.getNewValue());
      return;
    }
  }
}

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

import com.jgoodies.looks.LookUtils;
import com.jgoodies.looks.Options;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import javax.swing.plaf.basic.BasicTabbedPaneUI.PropertyChangeHandler;
import javax.swing.text.View;

public final class WindowsTabbedPaneUI
  extends com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI
{
  private static final boolean IS_XP_LAF_5_OR_LATER = (LookUtils.IS_JAVA_5_OR_LATER) && (LookUtils.IS_LAF_WINDOWS_XP_ENABLED);
  private static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
  private static final int INSET = IS_XP_LAF_5_OR_LATER ? -1 : 1;
  private static final Insets NO_CONTENT_BORDER_NORTH_INSETS = new Insets(INSET, 0, 0, 0);
  private static final Insets NO_CONTENT_BORDER_WEST_INSETS = new Insets(0, INSET, 0, 0);
  private static final Insets NO_CONTENT_BORDER_SOUTH_INSETS = new Insets(0, 0, INSET, 0);
  private static final Insets NO_CONTENT_BORDER_EAST_INSETS = new Insets(0, 0, 0, INSET);
  private static final Insets CONTENT_BORDER_NORTH_INSETS = new Insets(0, 2, 4, 4);
  private static final Insets CONTENT_BORDER_WEST_INSETS = new Insets(2, 0, 4, 4);
  private static final Insets CONTENT_BORDER_SOUTH_INSETS = new Insets(4, 2, 0, 4);
  private static final Insets CONTENT_BORDER_EAST_INSETS = new Insets(2, 4, 4, 0);
  private static boolean isTabIconsEnabled = Options.isTabIconsEnabled();
  private Boolean noContentBorder;
  private Boolean embeddedTabs;
  
  public static ComponentUI createUI(JComponent x)
  {
    return new WindowsTabbedPaneUI();
  }
  
  public void installUI(JComponent c)
  {
    super.installUI(c);
    embeddedTabs = ((Boolean)c.getClientProperty("jgoodies.embeddedTabs"));
    noContentBorder = ((Boolean)c.getClientProperty("jgoodies.noContentBorder"));
  }
  
  private boolean hasNoContentBorder()
  {
    return (hasEmbeddedTabs()) || (Boolean.TRUE.equals(noContentBorder));
  }
  
  private boolean hasEmbeddedTabs()
  {
    return embeddedTabs == null ? false : embeddedTabs.booleanValue();
  }
  
  protected PropertyChangeListener createPropertyChangeListener()
  {
    return new MyPropertyChangeHandler(null);
  }
  
  private void doLayout()
  {
    tabPane.revalidate();
    tabPane.repaint();
  }
  
  private void embeddedTabsPropertyChanged(Boolean newValue)
  {
    embeddedTabs = newValue;
    doLayout();
  }
  
  private void noContentBorderPropertyChanged(Boolean newValue)
  {
    noContentBorder = newValue;
    doLayout();
  }
  
  protected Icon getIconForTab(int tabIndex)
  {
    String title = tabPane.getTitleAt(tabIndex);
    boolean hasTitle = (title != null) && (title.length() > 0);
    return (!isTabIconsEnabled) && (hasTitle) ? null : super.getIconForTab(tabIndex);
  }
  
  protected Insets getContentBorderInsets(int tabPlacement)
  {
    if (!hasNoContentBorder())
    {
      if (IS_XP_LAF_5_OR_LATER)
      {
        switch (tabPlacement)
        {
        case 4: 
          return CONTENT_BORDER_EAST_INSETS;
        case 2: 
          return CONTENT_BORDER_WEST_INSETS;
        case 1: 
          return CONTENT_BORDER_NORTH_INSETS;
        }
        return CONTENT_BORDER_SOUTH_INSETS;
      }
      return contentBorderInsets;
    }
    if (hasEmbeddedTabs()) {
      return EMPTY_INSETS;
    }
    switch (tabPlacement)
    {
    case 4: 
      return NO_CONTENT_BORDER_EAST_INSETS;
    case 2: 
      return NO_CONTENT_BORDER_WEST_INSETS;
    case 1: 
      return NO_CONTENT_BORDER_NORTH_INSETS;
    }
    return NO_CONTENT_BORDER_SOUTH_INSETS;
  }
  
  protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
  {
    switch (tabPlacement)
    {
    case 4: 
      return isSelected ? 2 : 0;
    case 2: 
      return isSelected ? -2 : 0;
    }
    return 0;
  }
  
  protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
  {
    return 0;
  }
  
  protected Insets getSelectedTabPadInsets(int tabPlacement)
  {
    if (hasEmbeddedTabs()) {
      return EMPTY_INSETS;
    }
    if (hasNoContentBorder())
    {
      int inset = IS_XP_LAF_5_OR_LATER ? 1 : 0;
      switch (tabPlacement)
      {
      case 2: 
        return new Insets(1, 2, 1, inset);
      case 4: 
        return new Insets(1, inset, 1, 2);
      case 1: 
        return new Insets(2, 2, inset, 2);
      case 3: 
        return new Insets(inset, 2, 2, 2);
      }
      return EMPTY_INSETS;
    }
    Insets superInsets = super.getSelectedTabPadInsets(tabPlacement);
    int equalized = left + right / 2;
    left = (right = equalized);
    return superInsets;
  }
  
  protected Insets getTabAreaInsets(int tabPlacement)
  {
    return hasEmbeddedTabs() ? EMPTY_INSETS : super.getTabAreaInsets(tabPlacement);
  }
  
  protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
  {
    if ((hasNoContentBorder()) && (tabPlacement != 1)) {
      return;
    }
    Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
    if ((tabPlacement != 1) || (selectedIndex < 0) || (y + height + 1 < y) || (x < x) || (x > x + w))
    {
      super.paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h);
    }
    else
    {
      g.setColor(lightHighlight);
      g.fillRect(x, y, x + 1 - x, 1);
      g.fillRect(x + width, y, x + w - 2 - x - width, 1);
    }
  }
  
  protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
  {
    if (!hasNoContentBorder())
    {
      Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
      if ((tabPlacement != 3) || (selectedIndex < 0) || (y - 1 > h + y) || (x < x) || (x > x + w))
      {
        super.paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h);
      }
      else
      {
        g.setColor(lightHighlight);
        g.fillRect(x, y + h - 1, 1, 1);
        g.setColor(shadow);
        g.fillRect(x + 1, y + h - 2, x - 1 - x, 1);
        g.fillRect(x + width, y + h - 2, x + w - 2 - x - width, 1);
        g.setColor(darkShadow);
        g.fillRect(x, y + h - 1, x - x, 1);
        g.fillRect(x + width - 1, y + h - 1, x + w - x - width, 1);
      }
    }
    else if (tabPlacement == 3)
    {
      g.setColor(shadow);
      g.fillRect(x, y + h, w, 1);
    }
  }
  
  protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
  {
    if (!hasNoContentBorder())
    {
      Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
      if ((tabPlacement != 2) || (selectedIndex < 0) || (x + width + 1 < x) || (y < y) || (y > y + h))
      {
        super.paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h);
      }
      else
      {
        g.setColor(lightHighlight);
        g.fillRect(x, y, 1, y + 1 - y);
        g.fillRect(x, y + height, 1, y + h - 1 - y - height);
      }
    }
    else if (tabPlacement == 2)
    {
      g.setColor(shadow);
      g.fillRect(x, y, 1, h);
    }
  }
  
  protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
  {
    if (!hasNoContentBorder())
    {
      Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
      if ((tabPlacement != 4) || (selectedIndex < 0) || (x - 1 > x + w) || (y < y) || (y > y + h))
      {
        super.paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h);
      }
      else
      {
        g.setColor(lightHighlight);
        g.fillRect(x + w - 1, y, 1, 1);
        g.setColor(shadow);
        g.fillRect(x + w - 2, y + 1, 1, y - 1 - y);
        g.fillRect(x + w - 2, y + height, 1, y + h - 1 - y - height);
        
        g.setColor(darkShadow);
        g.fillRect(x + w - 1, y, 1, y - y);
        g.fillRect(x + w - 1, y + height - 1, 1, y + h - y - height);
      }
    }
    else if (tabPlacement == 4)
    {
      g.setColor(shadow);
      g.fillRect(x + w, y, 1, h);
    }
  }
  
  protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
  {
    if (!hasEmbeddedTabs())
    {
      super.paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
      return;
    }
    g.translate(x - 1, y - 1);
    int w1;
    int w2;
    int w3;
    int h1;
    int h2;
    int h3;
    switch (tabPlacement)
    {
    case 1: 
      w1 = 1;
      w2 = w - 2;
      w3 = 1;
      h1 = 1;
      h2 = h - 1;
      h3 = 0;
      break;
    case 3: 
      w1 = 1;
      w2 = w - 2;
      w3 = 1;
      h1 = 0;
      h2 = h - 1;
      h3 = 1;
      break;
    case 2: 
      w1 = 1;
      w2 = w - 1;
      w3 = 0;
      h1 = 1;
      h2 = h - 3;
      h3 = 1;
      break;
    case 4: 
    default: 
      w1 = 0;
      w2 = w - 1;
      w3 = 1;
      h1 = 1;
      h2 = h - 3;
      h3 = 1;
    }
    if (isSelected)
    {
      g.setColor(lightHighlight);
      g.drawRect(w1, h1, w1 + w2 + w3, h1 + h2 + h3);
      g.setColor(shadow);
      g.fillRect(1 + w1, 0, w2, h1);
      g.fillRect(0, 1 + h1, w1, h2);
      g.fillRect(2 * w1 + w2 + 2 * w3, 1 + h1, w3, h2);
      g.fillRect(1 + w1, 2 * h1 + h2 + 2 * h3, w2, h3);
      g.fillRect(1, 1, w1, h1);
      g.fillRect(2 * w1 + w2 + w3, 1, w3, h1);
      g.fillRect(1, 2 * h1 + h2 + h3, w1, h3);
      g.fillRect(2 * w1 + w2 + w3, 2 * h1 + h2 + h3, w3, h3);
    }
    else
    {
      g.setColor(shadow);
      g.fillRect(w1 + w2 + 2 * w3, h3 * h2 / 2, w3, h2 * 2 / 3);
      g.fillRect(w3 * w2 / 2, h1 + h2 + 2 * h3, w2 / 2 + 2, h3);
    }
    g.translate(-x + 1, -y + 1);
  }
  
  protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rectangles, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
  {
    if (!hasEmbeddedTabs())
    {
      super.paintFocusIndicator(g, tabPlacement, rectangles, tabIndex, iconRect, textRect, isSelected);
      return;
    }
    if ((tabPane.hasFocus()) && (isSelected))
    {
      g.setColor(focus);
      BasicGraphicsUtils.drawDashedRect(g, x - 2, y, width + 3, height);
    }
  }
  
  protected boolean shouldRotateTabRuns(int tabPlacement)
  {
    return !hasEmbeddedTabs();
  }
  
  protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected)
  {
    x = (y = x = y = 0);
    
    View v = getTextViewForTab(tabIndex);
    if (v != null) {
      tabPane.putClientProperty("html", v);
    }
    int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
    int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
    if (((tabPlacement == 4) || (tabPlacement == 2)) && (icon != null) && (title != null) && (!title.equals("")))
    {
      SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon, 0, 2, 0, 11, tabRect, iconRect, textRect, textIconGap);
      
      xNudge += 4;
    }
    else
    {
      SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon, 0, 0, 0, 11, tabRect, iconRect, textRect, textIconGap);
    }
    tabPane.putClientProperty("html", null);
    
    x += xNudge;
    y += yNudge;
    x += xNudge;
    y += yNudge;
  }
  
  private final class MyPropertyChangeHandler
    extends BasicTabbedPaneUI.PropertyChangeHandler
  {
    private MyPropertyChangeHandler()
    {
      super();
    }
    
    MyPropertyChangeHandler(WindowsTabbedPaneUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent e)
    {
      super.propertyChange(e);
      
      String pName = e.getPropertyName();
      if (null == pName) {
        return;
      }
      if (pName.equals("jgoodies.embeddedTabs"))
      {
        WindowsTabbedPaneUI.this.embeddedTabsPropertyChanged((Boolean)e.getNewValue());
        return;
      }
      if (pName.equals("jgoodies.noContentBorder"))
      {
        WindowsTabbedPaneUI.this.noContentBorderPropertyChanged((Boolean)e.getNewValue());
        return;
      }
    }
  }
}

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

import java.awt.Color;
import java.beans.PropertyChangeEvent;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.JTextComponent;

public final class WindowsTextAreaUI
  extends com.sun.java.swing.plaf.windows.WindowsTextAreaUI
{
  public static ComponentUI createUI(JComponent c)
  {
    return new WindowsTextAreaUI();
  }
  
  public void installUI(JComponent c)
  {
    super.installUI(c);
    updateBackground((JTextComponent)c);
  }
  
  protected void propertyChange(PropertyChangeEvent evt)
  {
    super.propertyChange(evt);
    String propertyName = evt.getPropertyName();
    if (("editable".equals(propertyName)) || ("enabled".equals(propertyName))) {
      updateBackground((JTextComponent)evt.getSource());
    }
  }
  
  private void updateBackground(JTextComponent c)
  {
    Color background = c.getBackground();
    if (!(background instanceof UIResource)) {
      return;
    }
    Color newColor = null;
    if (!c.isEnabled()) {
      newColor = UIManager.getColor("TextArea.disabledBackground");
    }
    if ((newColor == null) && (!c.isEditable())) {
      newColor = UIManager.getColor("TextArea.inactiveBackground");
    }
    if (newColor == null) {
      newColor = UIManager.getColor("TextArea.background");
    }
    if ((newColor != null) && (newColor != background)) {
      c.setBackground(newColor);
    }
  }
}

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

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.Caret;

public final class WindowsTextFieldUI
  extends com.sun.java.swing.plaf.windows.WindowsTextFieldUI
{
  public static ComponentUI createUI(JComponent c)
  {
    return new WindowsTextFieldUI();
  }
  
  protected Caret createCaret()
  {
    return new WindowsFieldCaret();
  }
}

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

import com.jgoodies.looks.LookUtils;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JSeparator;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarSeparatorUI;

public final class WindowsToolBarSeparatorUI
  extends BasicToolBarSeparatorUI
{
  private static final int VERTICAL = LookUtils.IS_JAVA_1_4_2_OR_LATER ? 1 : 0;
  private static WindowsToolBarSeparatorUI toolBarSeparatorUI;
  
  public static ComponentUI createUI(JComponent c)
  {
    if (toolBarSeparatorUI == null) {
      toolBarSeparatorUI = new WindowsToolBarSeparatorUI();
    }
    return toolBarSeparatorUI;
  }
  
  public void paint(Graphics g, JComponent c)
  {
    Color temp = g.getColor();
    
    Color shadowColor = UIManager.getColor("ToolBar.shadow");
    Color highlightColor = UIManager.getColor("ToolBar.highlight");
    
    Dimension size = c.getSize();
    if (((JSeparator)c).getOrientation() == VERTICAL)
    {
      int x = width / 2 - 1;
      g.setColor(shadowColor);
      g.drawLine(x, 0, x, height - 1);
      g.setColor(highlightColor);
      g.drawLine(x + 1, 0, x + 1, height - 1);
    }
    else
    {
      int y = height / 2 - 1;
      g.setColor(shadowColor);
      g.drawLine(0, y, width - 1, y);
      g.setColor(highlightColor);
      g.drawLine(0, y + 1, width - 1, y + 1);
    }
    g.setColor(temp);
  }
}

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

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

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

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

import com.jgoodies.looks.BorderStyle;
import com.jgoodies.looks.HeaderStyle;
import java.awt.Component;
import java.awt.Container;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.JToolBar;
import javax.swing.LookAndFeel;
import javax.swing.border.Border;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarUI.DockingListener;
import javax.swing.plaf.metal.MetalToolBarUI;

public final class WindowsToolBarUI
  extends MetalToolBarUI
{
  private PropertyChangeListener listener;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsToolBarUI();
  }
  
  protected void installDefaults()
  {
    super.installDefaults();
    installSpecialBorder();
  }
  
  protected void installListeners()
  {
    super.installListeners();
    listener = createBorderStyleListener();
    toolBar.addPropertyChangeListener(listener);
  }
  
  protected void uninstallListeners()
  {
    toolBar.removePropertyChangeListener(listener);
    super.uninstallListeners();
  }
  
  private PropertyChangeListener createBorderStyleListener()
  {
    new PropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent e)
      {
        String prop = e.getPropertyName();
        if ((prop.equals("jgoodies.headerStyle")) || (prop.equals("jgoodies.windows.borderStyle"))) {
          WindowsToolBarUI.this.installSpecialBorder();
        }
      }
    };
  }
  
  private void installSpecialBorder()
  {
    BorderStyle borderStyle = BorderStyle.from(toolBar, "jgoodies.windows.borderStyle");
    String suffix;
    if (borderStyle == BorderStyle.EMPTY)
    {
      suffix = "emptyBorder";
    }
    else
    {
      String suffix;
      if (borderStyle == BorderStyle.SEPARATOR)
      {
        suffix = "separatorBorder";
      }
      else
      {
        String suffix;
        if (borderStyle == BorderStyle.ETCHED)
        {
          suffix = "etchedBorder";
        }
        else
        {
          String suffix;
          if (HeaderStyle.from(toolBar) == HeaderStyle.BOTH) {
            suffix = "headerBorder";
          } else {
            return;
          }
        }
      }
    }
    String suffix;
    LookAndFeel.installBorder(toolBar, "ToolBar." + suffix);
  }
  
  protected MouseInputListener createDockingListener()
  {
    return new BasicToolBarUI.DockingListener(this, toolBar);
  }
  
  protected Border createRolloverBorder()
  {
    return WindowsBorders.getRolloverButtonBorder();
  }
  
  protected void setBorderToRollover(Component c)
  {
    if ((c instanceof AbstractButton))
    {
      super.setBorderToRollover(c);
    }
    else if ((c instanceof Container))
    {
      Container cont = (Container)c;
      for (int i = 0; i < cont.getComponentCount(); i++) {
        super.setBorderToRollover(cont.getComponent(i));
      }
    }
  }
}

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

class WindowsTreeUI$1 {}

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

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

class WindowsTreeUI$LineStyleHandler
  implements PropertyChangeListener
{
  private final WindowsTreeUI this$0;
  
  WindowsTreeUI$LineStyleHandler(WindowsTreeUI x0, WindowsTreeUI.1 x1)
  {
    this(x0);
  }
  
  public void propertyChange(PropertyChangeEvent e)
  {
    String name = e.getPropertyName();
    Object value = e.getNewValue();
    if (name.equals("JTree.lineStyle")) {
      WindowsTreeUI.access$100(this$0, value);
    }
  }
  
  private WindowsTreeUI$LineStyleHandler(WindowsTreeUI paramWindowsTreeUI) {}
}

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

import java.awt.Component;
import java.awt.Graphics;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;

public final class WindowsTreeUI
  extends com.sun.java.swing.plaf.windows.WindowsTreeUI
{
  private boolean linesEnabled;
  private PropertyChangeListener lineStyleHandler;
  
  public WindowsTreeUI()
  {
    linesEnabled = true;
  }
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsTreeUI();
  }
  
  public void installUI(JComponent c)
  {
    super.installUI(c);
    updateLineStyle(c.getClientProperty("JTree.lineStyle"));
    lineStyleHandler = new LineStyleHandler(null);
    c.addPropertyChangeListener(lineStyleHandler);
  }
  
  public void uninstallUI(JComponent c)
  {
    c.removePropertyChangeListener(lineStyleHandler);
    super.uninstallUI(c);
  }
  
  protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
  {
    if (linesEnabled) {
      super.paintVerticalLine(g, c, x, top, bottom);
    }
  }
  
  protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
  {
    if (linesEnabled) {
      super.paintHorizontalLine(g, c, y, left, right);
    }
  }
  
  protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
  {
    icon.paintIcon(c, graphics, x - icon.getIconWidth() / 2 - 1, y - icon.getIconHeight() / 2);
  }
  
  private void updateLineStyle(Object lineStyle)
  {
    linesEnabled = (!"None".equals(lineStyle));
  }
  
  private class LineStyleHandler
    implements PropertyChangeListener
  {
    LineStyleHandler(WindowsTreeUI.1 x1)
    {
      this();
    }
    
    public void propertyChange(PropertyChangeEvent e)
    {
      String name = e.getPropertyName();
      Object value = e.getNewValue();
      if (name.equals("JTree.lineStyle")) {
        WindowsTreeUI.this.updateLineStyle(value);
      }
    }
    
    private LineStyleHandler() {}
  }
}

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

import java.awt.Graphics;
import javax.swing.UIManager;

final class WindowsUtils
{
  public static void drawRoundedDashedRect(Graphics g, int x, int y, int width, int height)
  {
    for (int vx = x + 1; vx < x + width; vx += 2)
    {
      g.fillRect(vx, y, 1, 1);
      g.fillRect(vx, y + height - 1, 1, 1);
    }
    int offset = (width + 1) % 2;
    for (int vy = y + 1; vy < y + height - offset; vy += 2)
    {
      g.fillRect(x, vy, 1, 1);
      g.fillRect(x + width - 1, vy + offset, 1, 1);
    }
  }
  
  static void drawFlush3DBorder(Graphics g, int x, int y, int w, int h)
  {
    g.translate(x, y);
    g.setColor(UIManager.getColor("controlLtHighlight"));
    g.drawLine(0, 0, w - 2, 0);
    g.drawLine(0, 0, 0, h - 2);
    g.setColor(UIManager.getColor("controlShadow"));
    g.drawLine(w - 1, 0, w - 1, h - 1);
    g.drawLine(0, h - 1, w - 1, h - 1);
    g.translate(-x, -y);
  }
  
  static void drawPressed3DBorder(Graphics g, int x, int y, int w, int h)
  {
    g.translate(x, y);
    g.setColor(UIManager.getColor("controlShadow"));
    g.drawLine(0, 0, w - 2, 0);
    g.drawLine(0, 0, 0, h - 2);
    g.setColor(UIManager.getColor("controlLtHighlight"));
    g.drawLine(w - 1, 0, w - 1, h - 1);
    g.drawLine(0, h - 1, w - 1, h - 1);
    g.translate(-x, -y);
  }
}

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

import com.jgoodies.looks.common.MenuItemRenderer;
import com.sun.java.swing.plaf.windows.WindowsMenuUI;
import java.awt.Color;
import java.awt.Dimension;
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.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;

public final class WindowsXPMenuUI
  extends WindowsMenuUI
{
  private static final String MENU_PROPERTY_PREFIX = "Menu";
  private static final String SUBMENU_PROPERTY_PREFIX = "MenuItem";
  private String propertyPrefix = "Menu";
  private MenuItemRenderer renderer;
  
  public static ComponentUI createUI(JComponent b)
  {
    return new WindowsXPMenuUI();
  }
  
  protected void installDefaults()
  {
    super.installDefaults();
    if ((arrowIcon == null) || ((arrowIcon instanceof UIResource))) {
      arrowIcon = UIManager.getIcon("Menu.arrowIcon");
    }
    renderer = new MenuItemRenderer(menuItem, false, acceleratorFont, selectionForeground, disabledForeground, acceleratorForeground, acceleratorSelectionForeground);
    
    Integer gap = (Integer)UIManager
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