org.openbp.swing.plaf.sky
Class SkyButtonUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.basic.BasicButtonUI
              extended by javax.swing.plaf.metal.MetalButtonUI
                  extended by org.openbp.swing.plaf.sky.SkyButtonUI
Direct Known Subclasses:
SkyToggleButtonUI

public class SkyButtonUI
extends javax.swing.plaf.metal.MetalButtonUI

This class discribes the JButton UI. This is a Singleton.

Author:
Jens Ferchland

Field Summary
 
Fields inherited from class javax.swing.plaf.metal.MetalButtonUI
disabledTextColor, focusColor, selectColor
 
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
 
Constructor Summary
SkyButtonUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Create and returns the Singleton-instance of the JButton UI.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          Returns the preferred size of an button including shadow.
 int getShadowDepth()
          Returns the depth of the shadow.
 void installUI(javax.swing.JComponent c)
          Installs the UI to a JButton.
 boolean isShadowOn()
          Returns true if the shadow is painted.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paint the GUI of a JButton.
 void setShadowDepth(int depth)
          Sets the depth of the shadow.
 void setShadowOn(boolean shadowOn)
          Switchs the shadow on and off.
 
Methods inherited from class javax.swing.plaf.metal.MetalButtonUI
createButtonListener, getDisabledTextColor, getFocusColor, getSelectColor, installDefaults, paintButtonPressed, paintFocus, paintText, uninstallDefaults, update
 
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installListeners, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkyButtonUI

public SkyButtonUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Create and returns the Singleton-instance of the JButton UI.

Parameters:
c - a JComponent value
Returns:
a ComponentUI value

installUI

public void installUI(javax.swing.JComponent c)
Installs the UI to a JButton. This method sets all Listeners, which are used to control the button.

Overrides:
installUI in class javax.swing.plaf.basic.BasicButtonUI
Parameters:
c - a JComponent value

isShadowOn

public boolean isShadowOn()
Returns true if the shadow is painted.


setShadowOn

public void setShadowOn(boolean shadowOn)
Switchs the shadow on and off.


setShadowDepth

public void setShadowDepth(int depth)
Sets the depth of the shadow.


getShadowDepth

public int getShadowDepth()
Returns the depth of the shadow.


paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paint the GUI of a JButton.

Overrides:
paint in class javax.swing.plaf.basic.BasicButtonUI
Parameters:
g - a Graphics value
c - a JComponent value

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Returns the preferred size of an button including shadow.

Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicButtonUI
Parameters:
c - a JComponent value
Returns:
a Dimension value


Copyright © 2011. All Rights Reserved.