com.explodingpixels.macwidgets

## Class MacButtonFactory

- java.lang.Object
- - com.explodingpixels.macwidgets.MacButtonFactory

-     public class MacButtonFactory
      extends Object

  A factory for creating Mac-style buttons.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MacButtonFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JComponent` | `createGradientButton(Icon icon, ActionListener actionListener)` Creates an Apple style gradient button using the given `Icon`.
    `static JComponent` | `createGradientButton(String text, ActionListener actionListener)` Creates an Apple style gradient button using the given text.
    `static PopdownButton` | `createGradientPopdownButton(Icon icon, PopupMenuCustomizer popupMenuCustomizer)` Creates an Apple style gradient pop-down button using the given `Icon`.
    `static MacWidgetsPainter<Component>` | `getGradientButtonPainter()` Returns a `MacWidgetsPainter` that paints a gradient matching Apple's depiction of a "Gradient style" button, depicted here.
    `static AbstractButton` | `makePreferencesTabBarButton(AbstractButton button)`
    `static AbstractButton` | `makeUnifiedToolBarButton(AbstractButton button)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MacButtonFactory

          public MacButtonFactory()

  - ### Method Detail

    - #### makeUnifiedToolBarButton

          public static AbstractButton makeUnifiedToolBarButton(AbstractButton button)

    - #### makePreferencesTabBarButton

          public static AbstractButton makePreferencesTabBarButton(AbstractButton button)

    - #### getGradientButtonPainter

          public static MacWidgetsPainter<Component> getGradientButtonPainter()

      Returns a `MacWidgetsPainter` that paints a gradient matching Apple's depiction of a "Gradient style" button, depicted here.
      Returns:
        a `Painter` that paints an Apple style gradient-button background.

    - #### createGradientButton

          public static JComponent createGradientButton(Icon icon,
                                        ActionListener actionListener)

      Creates an Apple style gradient button using the given `Icon`. The given `ActionListener` will be notified when the button's action fires.
      Parameters:
        `icon` - the `Icon` to use in the button.
        `actionListener` - the `ActionListener` to notify when the created button is pressed.
      Returns:
        a gradient-style button.

    - #### createGradientButton

          public static JComponent createGradientButton(String text,
                                        ActionListener actionListener)

      Creates an Apple style gradient button using the given text. The given `ActionListener` will be notified when the button's action fires.
      Parameters:
        `text` - the text to use in the button.
        `actionListener` - the `ActionListener` to notify when the created button is pressed.
      Returns:
        a gradient-style button.

    - #### createGradientPopdownButton

          public static PopdownButton createGradientPopdownButton(Icon icon,
                                                  PopupMenuCustomizer popupMenuCustomizer)

      Creates an Apple style gradient pop-down button using the given `Icon`. The given `PopupMenuCustomizer` will be notified just prior to the pop-down menu being shown, and can thus add appropriate menu items.
      Parameters:
        `icon` - the `Icon` to use in the button.
        `popupMenuCustomizer` - the `PopupMenuCustomizer` to be notified just prior to the popup menu being shown.
      Returns:
        a gradient-style pop-down menu.