com.explodingpixels.macwidgets
Class UnifiedToolBar

java.lang.Object
  extended by com.explodingpixels.macwidgets.UnifiedToolBar

public class UnifiedToolBar
extends 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
UnifiedToolBar()
          Creates a UnifiedToolBar.
 
Method Summary
 void addComponentToCenter(JComponent toolToAdd)
          Adds the given component to the side of this UnifiedToolbar.
 void addComponentToLeft(JComponent toolToAdd)
          Adds the given component to the left side of this UnifiedToolbar.
 void addComponentToRight(JComponent toolToAdd)
          Adds the given component to the right side of this UnifiedToolBar.
 void disableBackgroundPainter()
          Disables any custom background painter that may be installed.
 JComponent getComponent()
          Gets the user interface component representing this UnifiedToolBar.
 void installWindowDraggerOnWindow(Window window)
          Installs a drag listener on this UnifiedToolBar such that if it is dragged, it will move the given Window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnifiedToolBar

public UnifiedToolBar()
Creates a UnifiedToolBar.

Method Detail

addComponentToLeft

public void addComponentToLeft(JComponent toolToAdd)
Adds the given component to the left side of this UnifiedToolbar.

Parameters:
toolToAdd - the tool to add to this UnifiedToolbar.

addComponentToCenter

public void addComponentToCenter(JComponent toolToAdd)
Adds the given component to the side of this UnifiedToolbar.

Parameters:
toolToAdd - the tool to add to this UnifiedToolbar.

addComponentToRight

public void addComponentToRight(JComponent toolToAdd)
Adds the given component to the right side of this UnifiedToolBar.

Parameters:
toolToAdd - the tool to add to this UnifiedToolBar.

installWindowDraggerOnWindow

public void installWindowDraggerOnWindow(Window window)
Installs a drag listener on this UnifiedToolBar such that if it is dragged, it will move the given Window.

Parameters:
window - the Window to move when the this UnifiedToolbar is dragged.

getComponent

public JComponent getComponent()
Gets the user interface component representing this UnifiedToolBar. The returned JComponent 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.