--- old/src/macosx/classes/com/apple/laf/AquaFocus.java 2011-11-19 00:09:32.000000000 +0100 +++ new/src/macosx/classes/com/apple/laf/AquaFocus.java 2011-11-19 00:09:32.000000000 +0100 @@ -16,7 +16,7 @@ public class AquaFocus { interface Drawable { - public void draw(final SunGraphics2D sg2d); + public void draw(final Graphics2D sg2d); } static boolean paintFocus(final Graphics g, final Drawable drawable) { --- old/src/macosx/classes/com/apple/laf/AquaPainter.java 2011-11-19 00:09:33.000000000 +0100 +++ new/src/macosx/classes/com/apple/laf/AquaPainter.java 2011-11-19 00:09:33.000000000 +0100 @@ -66,7 +66,7 @@ return new AquaNineSlicingImagePainter(state, metricsProvider); } - abstract void paint(final SunGraphics2D g, final T stateToPaint, final Component c); + abstract void paint(final Graphics2D g, final T stateToPaint, final Component c); final Rectangle boundsRect = new Rectangle(); final JRSUIControl control; @@ -85,7 +85,7 @@ boundsRect.setBounds(x, y, w, h); final T nextState = (T)state.derive(); - final SunGraphics2D g2d = getGraphics2D(g); + final Graphics2D g2d = getGraphics2D(g); if (g2d != null) paint(g2d, nextState, c); state = nextState; } @@ -105,7 +105,7 @@ } @Override - void paint(final SunGraphics2D g, final T stateToPaint, final Component c) { + void paint(final Graphics2D g, final T stateToPaint, final Component c) { if (metricsProvider == null) { AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect); return; @@ -132,11 +132,11 @@ } @Override - void paint(SunGraphics2D g, T stateToPaint, Component c) { + void paint(Graphics2D g, T stateToPaint, Component c) { paintFromSingleCachedImage(g, control, stateToPaint, c, boundsRect); } - static void paintFromSingleCachedImage(final SunGraphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) { + static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) { Rectangle clipRect = g.getClipBounds(); Rectangle intersection = boundsRect.intersection(clipRect); if (intersection.width <= 0 || intersection.height <= 0) return; @@ -195,7 +195,7 @@ } } - protected SunGraphics2D getGraphics2D(final Graphics g) { + protected Graphics2D getGraphics2D(final Graphics g) { try { return (SunGraphics2D)g; // doing a blind try is faster than checking instanceof } catch (Exception e) { @@ -206,6 +206,8 @@ final ProxyGraphics2D pg = (ProxyGraphics2D)g; final Graphics2D g2d = pg.getDelegate(); if (g2d instanceof SunGraphics2D) { return (SunGraphics2D)g2d; } + } else if (g instanceof Graphics2D) { + return (Graphics2D) g; } } --- old/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java 2011-11-19 00:09:34.000000000 +0100 +++ new/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java 2011-11-19 00:09:34.000000000 +0100 @@ -35,7 +35,6 @@ import javax.swing.plaf.*; import javax.swing.text.View; -import sun.java2d.SunGraphics2D; import sun.swing.SwingUtilities2; import apple.laf.*; import apple.laf.JRSUIConstants.*; @@ -306,11 +305,11 @@ } // from super.paintText - its normal text painting is totally wrong for the Mac - if (!(g instanceof SunGraphics2D)) { + if (!(g instanceof Graphics2D)) { g.setClip(temp); return; } - final SunGraphics2D g2d = (SunGraphics2D)g; + final Graphics2D g2d = (Graphics2D) g; AffineTransform savedAT = null; if (isVertical) {