org.pushingpixels.flamingo.internal.ui.ribbon
Class BasicRibbonBandUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.pushingpixels.flamingo.internal.ui.ribbon.RibbonBandUI
          extended by org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonBandUI

public class BasicRibbonBandUI
extends RibbonBandUI

Basic UI for ribbon band JRibbonBand.


Nested Class Summary
protected static class BasicRibbonBandUI.CollapsedButtonPopupPanel
          Popup panel that shows the contents of the ribbon band when it is in a collapsed state.
protected static class BasicRibbonBandUI.RoundBorder
          Round border for the ribbon bands.
 
Field Summary
protected  JCommandButton collapsedButton
          The button for collapsed state.
protected  AbstractCommandButton expandButton
          The band expand button.
protected  java.awt.event.ActionListener expandButtonActionListener
          Action listener on the expand button.
protected  java.awt.event.MouseListener mouseListener
          Mouse listener on the associated ribbon band.
protected  java.beans.PropertyChangeListener propertyChangeListener
          Listens to property changes on the associated ribbon band.
protected  AbstractRibbonBand<AbstractBandControlPanel> ribbonBand
          The associated ribbon band.
protected  float rolloverAmount
           
protected  org.pushingpixels.trident.Timeline rolloverTimeline
           
 
Constructor Summary
BasicRibbonBandUI()
           
 
Method Summary
protected  void configureExpandButton()
           
protected  JCommandButton createExpandButton()
          Creates the expand button for the associated ribbon band.
protected  java.awt.LayoutManager createLayoutManager()
          Invoked by installUI to create a layout manager object to manage the JCommandButtonStrip.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 int getBandTitleHeight()
          Returns the height of the ribbon band title area.
 AbstractCommandButton getCollapsedButton()
          Deprecated. 
 AbstractCommandButton getExpandButton()
          Deprecated. 
 int getPreferredCollapsedWidth()
           
 float getRolloverAmount()
           
protected  void installComponents()
          Installs subcomponents on the associated ribbon band.
protected  void installDefaults()
          Installs default parameters on the associated ribbon band.
protected  void installListeners()
          Installs listeners on the associated ribbon band.
 void installUI(javax.swing.JComponent c)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
protected  void paintBandBackground(java.awt.Graphics graphics, java.awt.Rectangle toFill)
          Paints band background.
protected  void paintBandTitle(java.awt.Graphics g, java.awt.Rectangle titleRectangle, java.lang.String title)
          Paints band title pane.
protected  void paintBandTitleBackground(java.awt.Graphics g, java.awt.Rectangle titleRectangle, java.lang.String title)
          Paints band title pane.
 void setRolloverAmount(float rolloverAmount)
           
protected  void syncExpandButtonIcon()
           
 void trackMouseCrossing(boolean isMouseIn)
           
protected  void unconfigureExpandButton()
           
protected  void uninstallComponents()
          Uninstalls components from the associated ribbon band.
protected  void uninstallDefaults()
          Uninstalls default parameters from the associated ribbon band.
protected  void uninstallListeners()
          Uninstalls listeners from the associated ribbon band.
 void uninstallUI(javax.swing.JComponent c)
           
 void update(java.awt.Graphics g, javax.swing.JComponent c)
           
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ribbonBand

protected AbstractRibbonBand<AbstractBandControlPanel> ribbonBand
The associated ribbon band.


collapsedButton

protected JCommandButton collapsedButton
The button for collapsed state.


expandButton

protected AbstractCommandButton expandButton
The band expand button. Is visible when the AbstractRibbonBand.getExpandActionListener() of the associated ribbon band is not null.


rolloverAmount

protected float rolloverAmount

rolloverTimeline

protected org.pushingpixels.trident.Timeline rolloverTimeline

mouseListener

protected java.awt.event.MouseListener mouseListener
Mouse listener on the associated ribbon band.


propertyChangeListener

protected java.beans.PropertyChangeListener propertyChangeListener
Listens to property changes on the associated ribbon band.


expandButtonActionListener

protected java.awt.event.ActionListener expandButtonActionListener
Action listener on the expand button.

Constructor Detail

BasicRibbonBandUI

public BasicRibbonBandUI()
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

uninstallUI

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

installDefaults

protected void installDefaults()
Installs default parameters on the associated ribbon band.


installComponents

protected void installComponents()
Installs subcomponents on the associated ribbon band.


createExpandButton

protected JCommandButton createExpandButton()
Creates the expand button for the associated ribbon band.

Returns:
Expand button for the associated ribbon band.

syncExpandButtonIcon

protected void syncExpandButtonIcon()

installListeners

protected void installListeners()
Installs listeners on the associated ribbon band.


configureExpandButton

protected void configureExpandButton()

uninstallDefaults

protected void uninstallDefaults()
Uninstalls default parameters from the associated ribbon band.


uninstallComponents

protected void uninstallComponents()
Uninstalls components from the associated ribbon band.


uninstallListeners

protected void uninstallListeners()
Uninstalls listeners from the associated ribbon band.


unconfigureExpandButton

protected void unconfigureExpandButton()

createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
Invoked by installUI to create a layout manager object to manage the JCommandButtonStrip.

Returns:
a layout manager object

update

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

paint

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

paintBandTitle

protected void paintBandTitle(java.awt.Graphics g,
                              java.awt.Rectangle titleRectangle,
                              java.lang.String title)
Paints band title pane.

Parameters:
g - Graphics context.
titleRectangle - Rectangle for the title pane.
title - Title string.

paintBandTitleBackground

protected void paintBandTitleBackground(java.awt.Graphics g,
                                        java.awt.Rectangle titleRectangle,
                                        java.lang.String title)
Paints band title pane.

Parameters:
g - Graphics context.
titleRectangle - Rectangle for the title pane.
title - Title string.

setRolloverAmount

public void setRolloverAmount(float rolloverAmount)

paintBandBackground

protected void paintBandBackground(java.awt.Graphics graphics,
                                   java.awt.Rectangle toFill)
Paints band background.

Parameters:
graphics - Graphics context.
toFill - Rectangle for the background.

getRolloverAmount

public float getRolloverAmount()
Specified by:
getRolloverAmount in class RibbonBandUI

getBandTitleHeight

public int getBandTitleHeight()
Returns the height of the ribbon band title area.

Specified by:
getBandTitleHeight in class RibbonBandUI
Returns:
The height of the ribbon band title area.

getPreferredCollapsedWidth

public int getPreferredCollapsedWidth()
Specified by:
getPreferredCollapsedWidth in class RibbonBandUI

trackMouseCrossing

public void trackMouseCrossing(boolean isMouseIn)
Specified by:
trackMouseCrossing in class RibbonBandUI

getExpandButton

@Deprecated
public AbstractCommandButton getExpandButton()
Deprecated. 

This method is for unit tests only and should not be called by the application code.

Returns:
The expand button of the matching ribbon band.

getCollapsedButton

@Deprecated
public AbstractCommandButton getCollapsedButton()
Deprecated. 

This method is for unit tests only and should not be called by the application code.

Returns:
The expand button of the matching ribbon band.