Class 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 a UnifiedToolBar with balanced ends.
      UnifiedToolBar​(boolean forceSameWidth)
      Creates a UnifiedToolBar.
    • 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 this UnifiedToolbar.
      void addComponentToLeft​(javax.swing.JComponent toolToAdd)
      Adds the given component to the left side of this UnifiedToolbar.
      void addComponentToRight​(javax.swing.JComponent toolToAdd)
      Adds the given component to the right side of this UnifiedToolBar .
      void disableBackgroundPainter()
      Disables any custom background painter that may be installed.
      javax.swing.JComponent getComponent()
      Gets the user interface component representing this UnifiedToolBar.
      void installWindowDraggerOnWindow​(java.awt.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 with balanced ends.
      • UnifiedToolBar

        public UnifiedToolBar​(boolean forceSameWidth)
        Creates a UnifiedToolBar.
        Parameters:
        forceSameWidth - whether the two ends should have the same width to keep the center balanced.
    • Method Detail

      • addComponentToLeft

        public void addComponentToLeft​(javax.swing.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​(javax.swing.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​(javax.swing.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​(java.awt.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 javax.swing.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.