Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua
Class QuaquaButtonBorder

java.lang.Object
  extended by ch.randelshofer.quaqua.QuaquaButtonBorder
All Implemented Interfaces:
javax.swing.border.Border, javax.swing.plaf.UIResource

public class QuaquaButtonBorder
extends java.lang.Object
implements javax.swing.border.Border, javax.swing.plaf.UIResource

QuaquaButtonBorder. This border uses client properties and font sizes of a JComponent to determine which style the border shall have. For some styles, the JComponent should honour size constrictions.

The following values of the client property Quaqua.Button.style are supported:

If the Quaqua.Button.style property is missing, then the following values of the client property JButton.buttonType are supported:

Version:
$Id: QuaquaButtonBorder.java 396 2011-07-05 19:32:05Z wrandelshofer $
Author:
Werner Randelshofer

Constructor Summary
QuaquaButtonBorder(java.lang.String defaultStyle)
          Creates a new instance.
 
Method Summary
 javax.swing.border.Border getBorder(javax.swing.JComponent c)
           
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Returns true, if this border has a visual cue for the disabled state of the button.
 java.awt.Insets getDefaultMargin(javax.swing.JComponent c)
          Returns the default button margin for the specified component.
protected  java.lang.String getStyle(javax.swing.JComponent c)
           
 java.awt.Insets getVisualMargin(java.awt.Component c)
           
 boolean hasPressedCue(javax.swing.JComponent c)
          Returns true, if this border has a visual cue for the pressed state of the button.
 boolean isBorderOpaque()
           
 boolean isFixedHeight(javax.swing.JComponent c)
           
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaButtonBorder

public QuaquaButtonBorder(java.lang.String defaultStyle)
Creates a new instance.

Method Detail

getBorder

public javax.swing.border.Border getBorder(javax.swing.JComponent c)

getDefaultMargin

public java.awt.Insets getDefaultMargin(javax.swing.JComponent c)
Returns the default button margin for the specified component. FIXME: We should not create a new Insets instance on each method call.


isFixedHeight

public boolean isFixedHeight(javax.swing.JComponent c)

getStyle

protected java.lang.String getStyle(javax.swing.JComponent c)

hasPressedCue

public boolean hasPressedCue(javax.swing.JComponent c)
Returns true, if this border has a visual cue for the pressed state of the button. If the border has no visual cue, then the ButtonUI has to provide it by some other means.


getVisualMargin

public java.awt.Insets getVisualMargin(java.awt.Component c)

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns true, if this border has a visual cue for the disabled state of the button. If the border has no visual cue, then the ButtonUI has to provide it by some other means. / public boolean hasDisabledCue(JComponent c) { return false; }

Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
Specified by:
isBorderOpaque in interface javax.swing.border.Border

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
paintBorder in interface javax.swing.border.Border

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