org.pushingpixels.flamingo.internal.ui.common
Class BasicCommandButtonPanelUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.PanelUI
          extended by org.pushingpixels.flamingo.internal.ui.common.CommandButtonPanelUI
              extended by org.pushingpixels.flamingo.internal.ui.common.BasicCommandButtonPanelUI

public class BasicCommandButtonPanelUI
extends CommandButtonPanelUI

Basic UI for command button panel JCommandButtonPanel.


Nested Class Summary
protected  class BasicCommandButtonPanelUI.ColumnFillLayout
          Column-fill layout for the button panel.
protected  class BasicCommandButtonPanelUI.RowFillLayout
          Row-fill layout for the button panel.
 
Field Summary
protected  JCommandButtonPanel buttonPanel
          The associated command button panel.
protected  javax.swing.event.ChangeListener changeListener
          Change listener on buttonPanel.
protected static java.awt.Insets GROUP_INSETS
          Default insets of button panel groups.
protected  javax.swing.JLabel[] groupLabels
          Labels of the button panel groups.
protected  java.awt.Rectangle[] groupRects
          Bounds of button panel groups.
protected  java.beans.PropertyChangeListener propertyChangeListener
          Property change listener on buttonPanel.
 
Constructor Summary
BasicCommandButtonPanelUI()
           
 
Method Summary
protected  java.awt.LayoutManager createLayoutManager()
          Returns the layout manager for the associated button panel.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
protected  java.awt.Insets getGroupInsets()
          Returns the insets of button panel groups.
protected  int getGroupTitleHeight(int groupIndex)
          Returns the height of the group title strip.
protected  int getLayoutGap()
          Returns the layout gap for button panel components.
 int getPreferredHeight(int buttonVisibleRows, int titleVisibleRows)
          Returns the preferred size of the associated button panel for the specified parameters.
protected  void installComponents()
          Installs sub-components on the associated button panel.
protected  void installDefaults()
          Installs defaults on the associated button panel.
protected  void installListeners()
          Installs listeners on the associated button panel.
 void installUI(javax.swing.JComponent c)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
protected  void paintGroupBackground(java.awt.Graphics g, int groupIndex, int x, int y, int width, int height)
          Paints the background of the specified button panel group.
protected  void paintGroupTitleBackground(java.awt.Graphics g, int groupIndex, int x, int y, int width, int height)
          Paints the background of the title of specified button panel group.
protected  void recomputeGroupHeaders()
          Recomputes the components for button group headers.
protected  void uninstallComponents()
          Uninstalls sub-components from the associated button panel.
protected  void uninstallDefaults()
          Uninstalls defaults from the associated button panel.
protected  void uninstallListeners()
          Uninstalls listeners from the associated button panel.
 void uninstallUI(javax.swing.JComponent c)
           
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buttonPanel

protected JCommandButtonPanel buttonPanel
The associated command button panel.


groupLabels

protected javax.swing.JLabel[] groupLabels
Labels of the button panel groups.


groupRects

protected java.awt.Rectangle[] groupRects
Bounds of button panel groups.


propertyChangeListener

protected java.beans.PropertyChangeListener propertyChangeListener
Property change listener on buttonPanel.


changeListener

protected javax.swing.event.ChangeListener changeListener
Change listener on buttonPanel.


GROUP_INSETS

protected static final java.awt.Insets GROUP_INSETS
Default insets of button panel groups.

Constructor Detail

BasicCommandButtonPanelUI

public BasicCommandButtonPanelUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.ComponentUI

installDefaults

protected void installDefaults()
Installs defaults on the associated button panel.


installComponents

protected void installComponents()
Installs sub-components on the associated button panel.


installListeners

protected void installListeners()
Installs listeners on the associated button panel.


uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI

uninstallDefaults

protected void uninstallDefaults()
Uninstalls defaults from the associated button panel.


uninstallComponents

protected void uninstallComponents()
Uninstalls sub-components from the associated button panel.


uninstallListeners

protected void uninstallListeners()
Uninstalls listeners from the associated button panel.


createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
Returns the layout manager for the associated button panel.

Returns:
The layout manager for the associated button panel.

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.ComponentUI

paintGroupBackground

protected void paintGroupBackground(java.awt.Graphics g,
                                    int groupIndex,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
Paints the background of the specified button panel group.

Parameters:
g - Graphics context.
groupIndex - Group index.
x - X coordinate of the button group bounds.
y - Y coordinate of the button group bounds.
width - Width of the button group bounds.
height - Height of the button group bounds.

paintGroupTitleBackground

protected void paintGroupTitleBackground(java.awt.Graphics g,
                                         int groupIndex,
                                         int x,
                                         int y,
                                         int width,
                                         int height)
Paints the background of the title of specified button panel group.

Parameters:
g - Graphics context.
groupIndex - Group index.
x - X coordinate of the button group title bounds.
y - Y coordinate of the button group title bounds.
width - Width of the button group title bounds.
height - Height of the button group title bounds.

getGroupTitleHeight

protected int getGroupTitleHeight(int groupIndex)
Returns the height of the group title strip.

Parameters:
groupIndex - Group index.
Returns:
The height of the title strip of the specified group.

getGroupInsets

protected java.awt.Insets getGroupInsets()
Returns the insets of button panel groups.

Returns:
The insets of button panel groups.

getLayoutGap

protected int getLayoutGap()
Returns the layout gap for button panel components.

Returns:
The layout gap for button panel components.

recomputeGroupHeaders

protected void recomputeGroupHeaders()
Recomputes the components for button group headers.


getPreferredHeight

public int getPreferredHeight(int buttonVisibleRows,
                              int titleVisibleRows)
Returns the preferred size of the associated button panel for the specified parameters.

Parameters:
buttonVisibleRows - Target number of visible button rows.
titleVisibleRows - Target number of visible group title rows.
Returns:
The preferred size of the associated button panel for the specified parameters.