Package com.explodingpixels.macwidgets
Class UnifiedToolBar
- java.lang.Object
-
- com.explodingpixels.macwidgets.UnifiedToolBar
-
public class UnifiedToolBar extends java.lang.Object
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:UnifiedToolBar toolBar = new UnifiedToolBar(); JButton button = new JButton("My Button"); button.putClientProperty("JButton.buttonType", "textured"); toolBar.addComponentToLeft(button);
-
-
Constructor Summary
Constructors Constructor Description UnifiedToolBar()
Creates aUnifiedToolBar
with balanced ends.UnifiedToolBar(boolean forceSameWidth)
Creates aUnifiedToolBar
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponentToCenter(javax.swing.JComponent toolToAdd)
Adds the given component to the side of thisUnifiedToolbar
.void
addComponentToLeft(javax.swing.JComponent toolToAdd)
Adds the given component to the left side of thisUnifiedToolbar
.void
addComponentToRight(javax.swing.JComponent toolToAdd)
Adds the given component to the right side of thisUnifiedToolBar
.void
disableBackgroundPainter()
Disables any custom background painter that may be installed.javax.swing.JComponent
getComponent()
Gets the user interface component representing thisUnifiedToolBar
.void
installWindowDraggerOnWindow(java.awt.Window window)
Installs a drag listener on thisUnifiedToolBar
such that if it is dragged, it will move the givenWindow
.
-
-
-
Method Detail
-
addComponentToLeft
public void addComponentToLeft(javax.swing.JComponent toolToAdd)
Adds the given component to the left side of thisUnifiedToolbar
.- Parameters:
toolToAdd
- the tool to add to thisUnifiedToolbar
.
-
addComponentToCenter
public void addComponentToCenter(javax.swing.JComponent toolToAdd)
Adds the given component to the side of thisUnifiedToolbar
.- Parameters:
toolToAdd
- the tool to add to thisUnifiedToolbar
.
-
addComponentToRight
public void addComponentToRight(javax.swing.JComponent toolToAdd)
Adds the given component to the right side of thisUnifiedToolBar
.- Parameters:
toolToAdd
- the tool to add to thisUnifiedToolBar
.
-
installWindowDraggerOnWindow
public void installWindowDraggerOnWindow(java.awt.Window window)
Installs a drag listener on thisUnifiedToolBar
such that if it is dragged, it will move the givenWindow
.- Parameters:
window
- theWindow
to move when the thisUnifiedToolbar
is dragged.
-
getComponent
public javax.swing.JComponent getComponent()
Gets the user interface component representing thisUnifiedToolBar
. The returnedJComponent
should 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.
-
-