Class jrad.util.ToolBarPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jrad.util.ToolBarPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jrad.util.ToolBarPanel

public class ToolBarPanel
extends Panel
A subclass of Panel that shows a Windows 95-style toolbar. The toolbar can track images and will automatically track the images of ImageButtons.

Variable Index

 o componentPanel
The panel which contains the toolbar contents.
 o locationCounter
The current location within the toolbar with which to place new components.
 o mediaTracker
A MediaTracker to automatically track images for the toolbar.

Constructor Index

 o ToolBarPanel()
Constructs a new ToolBarPanel.

Method Index

 o addComponent(Component)
Adds a new component to the toolbar.
 o addComponent(Component, int)
Adds a new component to the toolbar using a vertical offset.
 o addSpace()
Adds a space of standard width to the toolbar so that components may be separated.
 o addSpace(int)
Adds a space to the toolbar so that components may be separated.
 o minimumSize()
Returns the minimum size of the toolbar.
 o paint(Graphics)
Paints the toolbar and its components.
 o preferredSize()
Returns the preferred size of the toolbar.
 o trackImage(Image)
Track an image contained within the toolbar.
 o tryToWaitForImages()
Try to wait until all images tracked by the toolbar have loaded.
 o waitForImages()
Wait until all images tracked by the toolbar have loaded.

Variables

 o componentPanel
  protected Panel componentPanel
The panel which contains the toolbar contents.
 o locationCounter
  protected int locationCounter
The current location within the toolbar with which to place new components.
 o mediaTracker
  protected MediaTracker mediaTracker
A MediaTracker to automatically track images for the toolbar.

Constructors

 o ToolBarPanel
  public ToolBarPanel()
Constructs a new ToolBarPanel.

Methods

 o addComponent
  public void addComponent(Component component)
Adds a new component to the toolbar.
 o addComponent
  public void addComponent(Component component,
                           int verticalOffset)
Adds a new component to the toolbar using a vertical offset.
Parameters:
verticalOffset - the number of pixels to offset the component vertically
 o addSpace
  public void addSpace()
Adds a space of standard width to the toolbar so that components may be separated.
 o addSpace
  public void addSpace(int space)
Adds a space to the toolbar so that components may be separated.
Parameters:
space - the number of pixels to add as white space
 o minimumSize
  public Dimension minimumSize()
Returns the minimum size of the toolbar.
Overrides:
minimumSize in class Container
 o preferredSize
  public Dimension preferredSize()
Returns the preferred size of the toolbar.
Overrides:
preferredSize in class Container
 o trackImage
  public void trackImage(Image image)
Track an image contained within the toolbar.
Parameters:
image - the image to track
 o waitForImages
  public void waitForImages() throws InterruptedException
Wait until all images tracked by the toolbar have loaded.
 o tryToWaitForImages
  public void tryToWaitForImages()
Try to wait until all images tracked by the toolbar have loaded. If there is an exception, continue processing.
 o paint
  public void paint(Graphics g)
Paints the toolbar and its components.
Overrides:
paint in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index