Example #1
0
  /**
   * Creates a {@code BottomBar} of the given size.
   *
   * @param size the height of the {@code BottomBar}.
   */
  public BottomBar(BottomBarSize size) {

    createAndInstallBackgroundPainter();
    createAndInstallBorder();

    //		fBottomBar.forceOuterAreasToHaveTheSameWidth();

    // TODO use the actual border insets instead of the hard-coded value 2.
    // calculate the height of the bottom bar. this includes adding two pixels to incorporate
    // the height of the line border.
    int height = size.getHeight() + 2;
    fBottomBar.getComponent().setPreferredSize(new Dimension(-1, height));

    // install a listener that will repaint this component when the parent window's focus state
    // changes.
    WindowUtils.installJComponentRepainterOnWindowFocusChanged(fBottomBar.getComponent());
  }
Example #2
0
  private void createAndInstallBorder() {
    FocusStateMatteBorder outterBorder =
        new FocusStateMatteBorder(
            1,
            0,
            0,
            0,
            MacColorUtils.getTexturedWindowToolbarBorderFocusedColor(),
            MacColorUtils.getTexturedWindowToolbarBorderUnfocusedColor(),
            fBottomBar.getComponent());
    Border innerBorder = BorderFactory.createMatteBorder(1, 0, 0, 0, getBorderHighlightColor());
    Border lineBorders = BorderFactory.createCompoundBorder(outterBorder, innerBorder);

    // TODO determine if there is a good standard for this. there doesn't seem to be any
    // TODO consistent value used by Apple.
    // left and right edge padding.
    int padding = 5;
    fBottomBar
        .getComponent()
        .setBorder(
            BorderFactory.createCompoundBorder(
                lineBorders, BorderFactory.createEmptyBorder(0, padding, 0, padding)));
  }
Example #3
0
 /**
  * Gets the user interface component representing this {@code BottomBar}. The returned {@link
  * JComponent} should be added to a container that will be displayed.
  *
  * @return the user interface component representing this {@code BottomBar}.
  */
 public JComponent getComponent() {
   return fBottomBar.getComponent();
 }