Quaqua 8.0 2011-10-02

ch.randelshofer.quaqua.icon
Class QuaquaNativeButtonStateIcon

java.lang.Object
  extended by ch.randelshofer.quaqua.util.CachedPainter
      extended by ch.randelshofer.quaqua.icon.QuaquaNativeButtonStateIcon
All Implemented Interfaces:
javax.swing.Icon
Direct Known Subclasses:
QuaquaNativeButtonStateIcon.UIResource

public class QuaquaNativeButtonStateIcon
extends CachedPainter
implements javax.swing.Icon

Native Aqua icon for an AbstractButton. This icon draws everything except the focus ring. To draw the focus wring, wrap this border into a FocusedIcon.

Version:
$Id: QuaquaNativeButtonStateIcon.java 432 2011-08-07 08:39:32Z wrandelshofer $
Author:
Werner Randelshofer

Nested Class Summary
static class QuaquaNativeButtonStateIcon.UIResource
           
 
Constructor Summary
QuaquaNativeButtonStateIcon(OSXAquaPainter.Widget widget, int width, int height)
           
QuaquaNativeButtonStateIcon(OSXAquaPainter.Widget widget, int xoffset, int yoffset, int width, int height)
           
 
Method Summary
protected  java.awt.Image createImage(java.awt.Component c, int w, int h, java.awt.GraphicsConfiguration config)
          Creates the image to cache.
 int getIconHeight()
           
 int getIconWidth()
           
 boolean isBorderOpaque()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
protected  void paintToImage(java.awt.Component c, java.awt.Graphics g, int w, int h, java.lang.Object args)
          Paints the representation to cache to the supplied Graphics.
protected  void paintToImage(java.awt.Component c, java.awt.Image img, int w, int h, java.lang.Object args)
          Paints the representation to cache to the supplied Graphics.
 
Methods inherited from class ch.randelshofer.quaqua.util.CachedPainter
getMaxCachedImageSize, paint, paintImage, setMaxCachedImageSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaNativeButtonStateIcon

public QuaquaNativeButtonStateIcon(OSXAquaPainter.Widget widget,
                                   int width,
                                   int height)

QuaquaNativeButtonStateIcon

public QuaquaNativeButtonStateIcon(OSXAquaPainter.Widget widget,
                                   int xoffset,
                                   int yoffset,
                                   int width,
                                   int height)
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

createImage

protected java.awt.Image createImage(java.awt.Component c,
                                     int w,
                                     int h,
                                     java.awt.GraphicsConfiguration config)
Description copied from class: CachedPainter
Creates the image to cache. This returns an opaque image, subclasses that require translucency or transparency will need to override this method.

Overrides:
createImage in class CachedPainter
Parameters:
c - Component painting to
w - Width of image to create
h - Height to image to create
config - GraphicsConfiguration that will be rendered to, this may be null.

paintToImage

protected void paintToImage(java.awt.Component c,
                            java.awt.Image img,
                            int w,
                            int h,
                            java.lang.Object args)
Description copied from class: CachedPainter
Paints the representation to cache to the supplied Graphics.

Overrides:
paintToImage in class CachedPainter
Parameters:
c - Component painting to
img - Image to paint to
w - Width to paint to
h - Height to paint to
args - Arguments supplied to paint

paintToImage

protected void paintToImage(java.awt.Component c,
                            java.awt.Graphics g,
                            int w,
                            int h,
                            java.lang.Object args)
Description copied from class: CachedPainter
Paints the representation to cache to the supplied Graphics.

Specified by:
paintToImage in class CachedPainter
Parameters:
c - Component painting to
g - Graphics to paint to
w - Width to paint to
h - Height to paint to
args - Arguments supplied to paint

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

isBorderOpaque

public boolean isBorderOpaque()

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.