borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.control
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.Panel +----borland.jbcl.control.BevelPanel +----borland.jbcl.control.ButtonBar +----borland.jbcl.control.NavigatorControl
Variables Constructors Properties Methods Event Listeners
Implements BlackBox, MenuContainer, ImageObserver, Serializable
A ButtonBar object is a container for buttons. You add buttons to the ButtonBar using the addImageButton() or addTextButton() methods. The ButtonBar defaults to a horizontal bar with buttons that are spaced four pixels apart. You override these defaults by setting the alignment property to set the display alignment and the addSpace() method to specify a different spacing between buttons.
When a button on the ButtonBar is clicked, an ActionEvent is sent to all registered listeners. The ID associated with the ActionEvent contains the ID of the button that was clicked. When notified of the event, each listener can act on the event, or pass it on to another method for handling.
public static final int IMAGE_ONLY = 2A constant used with the buttonType property that specifies image-only buttons.
public static final int TEXT_AND_IMAGE = 3A constant used with the buttonType property that specifies both text and image buttons.
public static final int TEXT_ONLY = 1A constant used with the buttonType property that specifies text-only buttons.
protected transient ActionMulticaster actionMulticaster
protected transient MouseMotionMulticaster mouseMotionMulticaster
protected transient MouseMulticaster mouseMulticaster
public ButtonBar()Constructs a ButtonBar component with the default settings of TEXT_AND_IMAGE and HORIZONTAL orientation.
Buttons are added to the ButtonBar from left to right for a horizontal ButtonBar or top down for a vertical ButtonBar.
public int getAlignment() public void setAlignment(int alignment)Stores the alignment for this ButtonBar. Accepted values for alignment are defined in Alignment variables.
public int getButtonType() public void setButtonType(int buttonType)Stores the type of the ButtonBar. Accepted values are TEXT_ONLY, IMAGE_ONLY, or TEXT_AND_IMAGE.
public int getHgap() public void setHgap(int gap)Returns or sets the horizontal gap setting, in pixels for this ButtonBar.
public String getImageBase() public void setImageBase(java.lang.String ib)Specifies the base location for finding the images specified in the imageNames property. The location can be a Universal Resource Locator (URL), a relative path, or an absolute path prefix.
public String[] getImageNames() public void setImageNames(java.lang.String[] imageNames)Specifies the array of String names for the images displayed on the ButtonBar.
public String[] getLabels() public void setLabels(java.lang.String[] labels)Specifies the array of String names for the buttons in the ButtonBar. The array represents the buttons to be added (replacing old) to the ButtonBar. These labels also distinguish the added buttons as the ActionCommand in the ActionPerformed method on the ButtonBar.
public void setLayout(java.awt.LayoutManager layout)Write-only property that specifies the java.awt.LayoutManager for the ButtonBar.
public Dimension getPreferredSize()Stores the preferred dimensions to use when drawing the ButtonBar.
public int getVgap() public void setVgap(int gap)Stores the vertical gap setting, in pixels, for this ButtonBar.
protected Component addImageButton(java.awt.Image image, java.lang.String label, java.lang.String command)Creates a new ImageButton with the properties specified in its parameters and adds it to the ButtonBar.
Parameters:
protected Component addSpace()Adds a space 4 pixels wide between each button on the ButtonBar object, repaints the ButtonBar object, and returns the Component object. To specify the amount of space between buttons, use addSpace(int).
protected Component addSpace(int gap)Adds the specified amount of space (in pixels) between each button then repaints the ButtonBar.
See also: addSpace()
protected Component addTextButton(java.lang.String label, java.lang.String command)Adds a button to the ButtonBar that displays a text string specified by label and assigns it the actionId specified by actionId. The actionId is any integer value by which you can later refer to this button and keep track of it. When a button is pressed, the actionEvent occurs, and registered listeners of the ButtonBar are notified. Using the actionId, listeners can determine exactly which button was pressed and what actions should take place.
Parameters:
protected void assureImages()
public void doLayout()
Overrides: java.awt.Container.doLayout()
protected void invalidateButtons()
protected void invalidateImages()
protected void rebuild()
public void setButtonEnabled(int index, boolean enabled)Enables or disables a particular button by index
Parameters:
public void setButtonEnabled(java.lang.String label, boolean enabled)Enables or disables a particular button by label.
Parameters:
public synchronized void addActionListener(java.awt.event.ActionListener l) public synchronized void removeActionListener(java.awt.event.ActionListener l)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public synchronized void addFocusListener(java.awt.event.FocusListener l) public synchronized void removeFocusListener(java.awt.event.FocusListener l)
public synchronized void addKeyListener(java.awt.event.KeyListener l) public synchronized void removeKeyListener(java.awt.event.KeyListener l)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)