Package com.explodingpixels.macwidgets
Class MacButtonFactory
java.lang.Object
com.explodingpixels.macwidgets.MacButtonFactory
A factory for creating Mac-style buttons.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JComponentcreateGradientButton(String text, ActionListener actionListener) Creates an Apple style gradient button using the given text.static JComponentcreateGradientButton(Icon icon, ActionListener actionListener) Creates an Apple style gradient button using the givenIcon.static PopdownButtoncreateGradientPopdownButton(Icon icon, PopupMenuCustomizer popupMenuCustomizer) Creates an Apple style gradient pop-down button using the givenIcon.static MacWidgetsPainter<Component> Returns aMacWidgetsPainterthat paints a gradient matching Apple's depiction of a "Gradient style" button, depicted here.static AbstractButtonstatic AbstractButton
-
Constructor Details
-
MacButtonFactory
public MacButtonFactory()
-
-
Method Details
-
makeUnifiedToolBarButton
-
makePreferencesTabBarButton
-
getGradientButtonPainter
Returns aMacWidgetsPainterthat paints a gradient matching Apple's depiction of a "Gradient style" button, depicted here.- Returns:
- a
Painterthat paints an Apple style gradient-button background.
-
createGradientButton
Creates an Apple style gradient button using the givenIcon. The givenActionListenerwill be notified when the button's action fires.- Parameters:
icon- theIconto use in the button.actionListener- theActionListenerto notify when the created button is pressed.- Returns:
- a gradient-style button.
-
createGradientButton
Creates an Apple style gradient button using the given text. The givenActionListenerwill be notified when the button's action fires.- Parameters:
text- the text to use in the button.actionListener- theActionListenerto 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 givenIcon. The givenPopupMenuCustomizerwill be notified just prior to the pop-down menu being shown, and can thus add appropriate menu items.- Parameters:
icon- theIconto use in the button.popupMenuCustomizer- thePopupMenuCustomizerto be notified just prior to the popup menu being shown.- Returns:
- a gradient-style pop-down menu.
-