Package com.explodingpixels.macwidgets
Class BottomBar
- java.lang.Object
-
- com.explodingpixels.macwidgets.BottomBar
-
public class BottomBar extends java.lang.Object
A Mac style Bottom Bar. For a full descrption of what a Bottom Bar is, see the Bottom Bars section of Apple's Human Interface Guidelines. Here's an example of what this method cretes:
Here's a simple example that creates a Bottom Bar:BottomBar bottomBar = BottomBar(BottomBarSize.LARGE); bottomBar.addComponentToCenter(MacWidgetFactory.createEmphasizedLabel("My Label"));
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.awt.Color
ACTIVE_BOTTOM_COLOR
protected static java.awt.Color
ACTIVE_TOP_COLOR
protected static java.awt.Color
BORDER_HIGHLIGHT_COLOR
protected TriAreaComponent
fBottomBar
protected com.explodingpixels.macwidgets.BottomBar.SplitterHandleMouseMovementHandler
fMouseListener
protected javax.swing.JSplitPane
fSplitPane
protected static java.awt.Color
INACTIVE_BOTTOM_COLOR
protected static java.awt.Color
INACTIVE_TOP_COLOR
protected static java.awt.Color
LEOPARD_ACTIVE_BOTTOM_COLOR
protected static java.awt.Color
LEOPARD_ACTIVE_TOP_COLOR
protected static java.awt.Color
LEOPARD_BORDER_HIGHLIGHT_COLOR
protected static java.awt.Color
LEOPARD_INACTIVE_BOTTOM_COLOR
protected static java.awt.Color
LEOPARD_INACTIVE_TOP_COLOR
-
Constructor Summary
Constructors Constructor Description BottomBar(BottomBarSize size)
Creates aBottomBar
of the given size.
-
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 thisBottomBar
.void
addComponentToCenter(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the center of thisBottomBar
.void
addComponentToLeft(javax.swing.JComponent toolToAdd)
Adds the given component to the left side of thisBottomBar
.void
addComponentToLeft(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the left side of thisBottomBar
followed by the given an empty space of the given pixel width.void
addComponentToRight(javax.swing.JComponent toolToAdd)
Adds the given component to the right side of thisBottomBar
.void
addComponentToRight(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the right side of thisBottomBar
.void
forceAreasToHaveTheSameWidth()
void
forceOuterAreasToHaveTheSameWidth()
javax.swing.JComponent
getComponent()
Gets the user interface component representing thisBottomBar
.void
installDraggableWidgetOnSplitPane(javax.swing.JSplitPane splitPane)
Connects the draggable widget in thisBottomBar
to the divider of the givenJSplitPane
.void
installWindowDraggerOnWindow(java.awt.Window window)
Installs a drag listener on thisBottomBar
such that if it is dragged, it will move the givenWindow
.
-
-
-
Field Detail
-
fBottomBar
protected final TriAreaComponent fBottomBar
-
fSplitPane
protected javax.swing.JSplitPane fSplitPane
-
fMouseListener
protected final com.explodingpixels.macwidgets.BottomBar.SplitterHandleMouseMovementHandler fMouseListener
-
ACTIVE_TOP_COLOR
protected static final java.awt.Color ACTIVE_TOP_COLOR
-
ACTIVE_BOTTOM_COLOR
protected static final java.awt.Color ACTIVE_BOTTOM_COLOR
-
INACTIVE_TOP_COLOR
protected static final java.awt.Color INACTIVE_TOP_COLOR
-
INACTIVE_BOTTOM_COLOR
protected static final java.awt.Color INACTIVE_BOTTOM_COLOR
-
BORDER_HIGHLIGHT_COLOR
protected static final java.awt.Color BORDER_HIGHLIGHT_COLOR
-
LEOPARD_ACTIVE_TOP_COLOR
protected static final java.awt.Color LEOPARD_ACTIVE_TOP_COLOR
-
LEOPARD_ACTIVE_BOTTOM_COLOR
protected static final java.awt.Color LEOPARD_ACTIVE_BOTTOM_COLOR
-
LEOPARD_INACTIVE_TOP_COLOR
protected static final java.awt.Color LEOPARD_INACTIVE_TOP_COLOR
-
LEOPARD_INACTIVE_BOTTOM_COLOR
protected static final java.awt.Color LEOPARD_INACTIVE_BOTTOM_COLOR
-
LEOPARD_BORDER_HIGHLIGHT_COLOR
protected static final java.awt.Color LEOPARD_BORDER_HIGHLIGHT_COLOR
-
-
Constructor Detail
-
BottomBar
public BottomBar(BottomBarSize size)
Creates aBottomBar
of the given size.- Parameters:
size
- the height of theBottomBar
.
-
-
Method Detail
-
addComponentToLeft
public void addComponentToLeft(javax.swing.JComponent toolToAdd)
Adds the given component to the left side of thisBottomBar
.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.
-
addComponentToLeft
public void addComponentToLeft(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the left side of thisBottomBar
followed by the given an empty space of the given pixel width.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.spacer_pixels
- the amount of space to post-pend the added component with.
-
addComponentToCenter
public void addComponentToCenter(javax.swing.JComponent toolToAdd)
Adds the given component to the side of thisBottomBar
.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.
-
addComponentToCenter
public void addComponentToCenter(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the center of thisBottomBar
. If this is not the first component to be added to the center, then the given component will be preceeded by a space of the given width.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.spacer_pixels
- the amount of space to pre-pend the added component with *if* the given component is *not* the first component to be added to the center.
-
addComponentToRight
public void addComponentToRight(javax.swing.JComponent toolToAdd)
Adds the given component to the right side of thisBottomBar
.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.
-
addComponentToRight
public void addComponentToRight(javax.swing.JComponent toolToAdd, int spacer_pixels)
Adds the given component to the right side of thisBottomBar
. If this is not the first component to be added to the right, then the given component will be followed by a space of the given width.- Parameters:
toolToAdd
- the tool to add to thisBottomBar
.spacer_pixels
- the amount of space to post-pend the added component with *if* the given component is *not* the first component to be added to the center.
-
installWindowDraggerOnWindow
public void installWindowDraggerOnWindow(java.awt.Window window)
Installs a drag listener on thisBottomBar
such that if it is dragged, it will move the givenWindow
.- Parameters:
window
- theWindow
to move when the thisBottomBar
is dragged.
-
getComponent
public javax.swing.JComponent getComponent()
Gets the user interface component representing thisBottomBar
. The returnedJComponent
should be added to a container that will be displayed.- Returns:
- the user interface component representing this
BottomBar
.
-
forceAreasToHaveTheSameWidth
public void forceAreasToHaveTheSameWidth()
-
forceOuterAreasToHaveTheSameWidth
public void forceOuterAreasToHaveTheSameWidth()
-
installDraggableWidgetOnSplitPane
public void installDraggableWidgetOnSplitPane(javax.swing.JSplitPane splitPane)
Connects the draggable widget in thisBottomBar
to the divider of the givenJSplitPane
. Thus when the user drags theBottomBar
draggable widget, the givenJSplitPane
s divider location will be adjusted.- Parameters:
splitPane
- theJSplitPane
to connect the draggable widget to.
-
-