Package com.explodingpixels.macwidgets
Class UnifiedToolBar
java.lang.Object
com.explodingpixels.macwidgets.UnifiedToolBar
A Mac style Unified Tool Bar. For a full description of what a Unified Tool
Bar is, see the Toolbars section of Apple's Human Interface Guidelines. Here's an
example of the what this method creates:
Here's a simple example that creates a Unified Tool Bar with a single button:
Here's a simple example that creates a Unified Tool Bar with a single button:
UnifiedToolBar toolBar = new UnifiedToolBar();
JButton button = new JButton("My Button");
button.putClientProperty("JButton.buttonType", "textured");
toolBar.addComponentToLeft(button);
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aUnifiedToolBarwith balanced ends.UnifiedToolBar(boolean forceSameWidth) Creates aUnifiedToolBar. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponentToCenter(JComponent toolToAdd) Adds the given component to the side of thisUnifiedToolbar.voidaddComponentToLeft(JComponent toolToAdd) Adds the given component to the left side of thisUnifiedToolbar.voidaddComponentToRight(JComponent toolToAdd) Adds the given component to the right side of thisUnifiedToolBar.voidDisables any custom background painter that may be installed.Gets the user interface component representing thisUnifiedToolBar.voidinstallWindowDraggerOnWindow(Window window) Installs a drag listener on thisUnifiedToolBarsuch that if it is dragged, it will move the givenWindow.
-
Constructor Details
-
UnifiedToolBar
public UnifiedToolBar()Creates aUnifiedToolBarwith balanced ends. -
UnifiedToolBar
public UnifiedToolBar(boolean forceSameWidth) Creates aUnifiedToolBar.- Parameters:
forceSameWidth- whether the two ends should have the same width to keep the center balanced.
-
-
Method Details
-
addComponentToLeft
Adds the given component to the left side of thisUnifiedToolbar.- Parameters:
toolToAdd- the tool to add to thisUnifiedToolbar.
-
addComponentToCenter
Adds the given component to the side of thisUnifiedToolbar.- Parameters:
toolToAdd- the tool to add to thisUnifiedToolbar.
-
addComponentToRight
Adds the given component to the right side of thisUnifiedToolBar.- Parameters:
toolToAdd- the tool to add to thisUnifiedToolBar.
-
installWindowDraggerOnWindow
Installs a drag listener on thisUnifiedToolBarsuch that if it is dragged, it will move the givenWindow.- Parameters:
window- theWindowto move when the thisUnifiedToolbaris dragged.
-
getComponent
Gets the user interface component representing thisUnifiedToolBar. The returnedJComponentshould be added to a container that will be displayed.- Returns:
- the user interface component representing this
UnifiedToolBar.
-
disableBackgroundPainter
public void disableBackgroundPainter()Disables any custom background painter that may be installed.
-