Class FullScreenToolBar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FullScreenToolBar extends JPanel
The FullScreenToolBar class is a horizontal toolbar for full screen modes. The toolbar is semi-translucent, and each button on the toolbar is represented by an icon and text label which is displayed only when the mouse cursor is over the button. Buttons may be simple buttons or toggle buttons. Buttons may be safely added to the toolbar without losing them in their original layout since buttons are only used for their icons and text.
Since:
3.2.2
Author:
Peter Hollemans
See Also:
  • Field Details

    • MOUSE_ACTIVITY_PROPERTY

      public static final String MOUSE_ACTIVITY_PROPERTY
      The property name for mouse activity.
      See Also:
  • Constructor Details

    • FullScreenToolBar

      public FullScreenToolBar()
      Creates a new toolbar.
  • Method Details

    • getAlpha

      public float getAlpha()
      Gets the alpha composite value currently set for painting the toolbar.
      Returns:
      the alpha value in the range [0..1].
    • setAlpha

      public void setAlpha(float alpha)
      Sets the new alpha composite value for painting the toolbar.
      Parameters:
      alpha - the new alpha value in the range [0..1].
    • addSeparator

      public void addSeparator()
      Adds a new separator after the current button.
    • addButton

      public void addButton(AbstractButton button, String label)
      Adds a new button to the toolbar.
      Parameters:
      button - the new button to add.
      label - the label to use for the button.
    • addButton

      public void addButton(AbstractButton button, Icon icon, String label)
      Adds a new button to the toolbar.
      Parameters:
      button - the new button to add.
      icon - the icon to use, or null to use the button's own icon.
      label - the label to use for the button.
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getGhostIcons

      public static Icon[] getGhostIcons(Icon icon)
      Creates a ghostly looking version of an icon.
      Parameters:
      icon - the original icon to use as a source.
      Returns:
      the ghostly looking icons derived from the source as [normal, highlighted].
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.