<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,6 +16,7 @@ import com.jbidwatcher.platform.Platform;
 import com.jbidwatcher.ui.table.TableColumnController;
 
 import javax.swing.*;
+import javax.swing.border.Border;
 import javax.swing.table.DefaultTableCellRenderer;
 import java.awt.*;
 import java.util.HashMap;
@@ -76,55 +77,74 @@ public class myTableCellRenderer extends DefaultTableCellRenderer {
     } else {
       setHorizontalAlignment(JLabel.LEFT);
     }
-    Component returnComponent = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
+    JComponent returnComponent = (JComponent)super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
 
     AuctionEntry ae = (AuctionEntry)table.getValueAt(row, -1);
+    returnComponent.setOpaque(false);
     if(ae == null) return returnComponent;
 
     Color foreground = chooseForeground(ae, column, table.getForeground());
-    Color background = chooseBackground(ae, column, table.getBackground());
 
     mRow = row;
 
-    if( (row % 2) == 1) {
-      if(darkBG == null) {
-        int r = background.getRed();
-        int g = background.getGreen();
-        int b = background.getBlue();
-        r = Math.max(0, r - 20);
-        g = Math.max(0, g - 20);
-        b = Math.max(0, b - 20);
-        darkBG = new Color(r, g, b);
-      }
+    if(!Platform.isMac()) {
+      Color background = chooseBackground(ae, column, table.getBackground());
+      if ((row % 2) == 1) {
+        if (darkBG == null) darkBG = darken(background);
 
-      if (column != 2 || !ae.isMultiSniped()) {
-      if ((column != TableColumnController.SNIPE_OR_MAX &amp;&amp; column != TableColumnController.SNIPE_TOTAL) || !ae.isMultiSniped()) {
-          if(JConfig.queryConfiguration(&quot;display.alternate&quot;, &quot;true&quot;).equals(&quot;true&quot;)) {
-        }
-          background = darkBG;
+        if (column != 2 || !ae.isMultiSniped()) {
+          if ((column != TableColumnController.SNIPE_OR_MAX &amp;&amp; column != TableColumnController.SNIPE_TOTAL) || !ae.isMultiSniped()) {
+            if (JConfig.queryConfiguration(&quot;display.alternate&quot;, &quot;true&quot;).equals(&quot;true&quot;)) {
+              background = darkBG;
+            }
+          }
         }
       }
+      if (isSelected) {
+        Colors selectionColors = getSelectionColors(column, ae, foreground, background);
+
+        foreground = selectionColors.getForeground();
+        background = selectionColors.getBackground();
+      }
+      returnComponent.setBackground(background);
     }
 
     mSelected = isSelected;
-    if(isSelected) {
-      Colors selectionColors = getSelectionColors(column, ae, foreground, background);
-
-      foreground = selectionColors.getForeground();
-      background = selectionColors.getBackground();
-    }
 
     Font foo = chooseFont(returnComponent.getFont(), ae, column);
     returnComponent.setFont(foo);
     returnComponent.setForeground(foreground);
-    returnComponent.setBackground(background);
 
     return(returnComponent);
   }
 
+  private Color darken(Color background) {
+    int r = background.getRed();
+    int g = background.getGreen();
+    int b = background.getBlue();
+    r = Math.max(0, r - 20);
+    g = Math.max(0, g - 20);
+    b = Math.max(0, b - 20);
+    return new Color(r, g, b);
+  }
+
+  private Color lighten(Color background) {
+    int r = background.getRed();
+    int g = background.getGreen();
+    int b = background.getBlue();
+    r = Math.min(255, r + 20);
+    g = Math.min(255, g + 20);
+    b = Math.min(255, b + 20);
+    return new Color(r, g, b);
+  }
+
   private Map&lt;Integer, GradientPaint&gt; gradientCache = new HashMap&lt;Integer, GradientPaint&gt;();
 
+  private final static String evenList = &quot;List.evenRowBackgroundPainter&quot;;
+  private final static String oddList = &quot;List.oddRowBackgroundPainter&quot;;
+
   public void paintComponent(Graphics g) {
+    boolean painted = false;
     if(g != null) {
       if(JConfig.queryDisplayProperty(&quot;background.complex&quot;, &quot;false&quot;).equals(&quot;true&quot;)) {
         Graphics2D g2d = (Graphics2D) g;
@@ -139,9 +159,40 @@ public class myTableCellRenderer extends DefaultTableCellRenderer {
           }
           g2d.fillRect((int) bounds.getX(), (int) bounds.getY(), (int) bounds.getWidth(), (int) bounds.getHeight());
         }
+      } else {
+        if(Platform.isMac()) {
+          if(mSelected) {
+            Color selected = UIManager.getColor(&quot;Table.selectionBackground&quot;);
+            renderGradient(g, selected);
+          } else {
+            Border bgPaint = UIManager.getBorder((mRow % 2) == 0 ? evenList : oddList);
+            bgPaint.paintBorder(this, g, 0, 0, getWidth(), getHeight());
+            super.paintComponent(g);
+            painted = true;
+
+            Graphics2D g2d = (Graphics2D) g;
+            float alpha = .1f;
+            g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
+            g.setColor(Color.BLACK);
+            g.drawLine(0, getHeight()-1, getWidth(), getHeight()-1);
+          }
+        }
       }
-      super.paintComponent(g);
+      if(!painted) super.paintComponent(g);
+    }
+  }
+
+  private void renderGradient(Graphics g, Color selected) {
+    GradientPaint paint;
+    paint = gradientCache.get(cacheMapper());
+    if(paint == null) {
+      paint = new GradientPaint(0, 0, lighten(selected), 0, getHeight(), selected, false);
+      gradientCache.put(cacheMapper(), paint);
     }
+    Graphics2D g2d = (Graphics2D) g;
+    g2d.setPaint(paint);
+    Rectangle bounds = g2d.getClipBounds();
+    g2d.fillRect((int) bounds.getX(), (int) bounds.getY(), (int) bounds.getWidth(), (int) bounds.getHeight());
   }
 
   private int cacheMapper() {return 10000 * (mRow % 2) + getHeight();}</diff>
      <filename>src/com/jbidwatcher/ui/myTableCellRenderer.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c7112aca9f4476aaa435258766f9a4b29b9c9a96</id>
    </parent>
  </parents>
  <author>
    <name>Morgan Schweers</name>
    <email>cyberfox@jbidwatcher.com</email>
  </author>
  <url>http://github.com/cyberfox/jbidwatcher/commit/f42e6def36f169e194eeaaf79041cc178310ba71</url>
  <id>f42e6def36f169e194eeaaf79041cc178310ba71</id>
  <committed-date>2009-10-19T02:35:30-07:00</committed-date>
  <authored-date>2009-10-19T02:35:30-07:00</authored-date>
  <message>A first pass at making the main table look a little more Mac like when on a Mac.  It's definitely pretty; who knows if users'll like it, though.


git-svn-id: svn://svn.jbidwatcher.com/jbidwatcher/trunk@1022 b1acfa68-eb39-11db-b167-a3a8cd6b847e</message>
  <tree>12e2113431cdbe210dc99596688bade95b26497c</tree>
  <committer>
    <name>Morgan Schweers</name>
    <email>cyberfox@jbidwatcher.com</email>
  </committer>
</commit>
