Class pmr.simplegraph.ButtonBar
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.simplegraph.ButtonBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----pmr.simplegraph.ButtonBar

public class ButtonBar
extends Panel
a bar (Panel) to which widgets can be added. It might save some hacking around the AWT. The widgets each have a String (name) by which they are identified and which is used to transmit their identity in an action

The bar must be created with a target, to which the events are sent. This activates the action(event, arg) of target, which should be a Component.

Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o ButtonBar(Component)
 o ButtonBar(String[], Component)
this generates just Buttons although others can be added

Method Index

 o action(Event, Object)
the button bar has the responsibility of sending messages to the target directly
 o addButton(String)
 o addButtons(String[])
 o addChoice(String[])
a Choice has several alternative options
 o clearButtons()
 o deleteButton(String)
remove a button (synonymous with the above
 o getButton(String)
gets the Button associated with a name; if none, returns null
 o getChoice(String)
gets the Choice associated with a name; if none, returns null
 o removeButton(String)
 o removeChoice(String)
ANY name on Choice menu will remove the Choice
 o setTarget(Component)
the target can be reset if required
 o toString()

Constructors

 o ButtonBar
  public ButtonBar(Component target)
 o ButtonBar
  public ButtonBar(String names[],
                   Component target)
this generates just Buttons although others can be added

Methods

 o addButtons
  public void addButtons(String names[])
 o clearButtons
  public void clearButtons()
 o addButton
  public void addButton(String name)
 o removeButton
  public void removeButton(String name)
 o deleteButton
  public void deleteButton(String name)
remove a button (synonymous with the above
 o getButton
  public Button getButton(String name)
gets the Button associated with a name; if none, returns null
 o addChoice
  public void addChoice(String names[])
a Choice has several alternative options
 o removeChoice
  public void removeChoice(String name)
ANY name on Choice menu will remove the Choice
 o getChoice
  public Choice getChoice(String name)
gets the Choice associated with a name; if none, returns null
 o setTarget
  public void setTarget(Component target)
the target can be reset if required
 o action
  public boolean action(Event e,
                        Object arg)
the button bar has the responsibility of sending messages to the target directly
Overrides:
action in class Component
 o toString
  public String toString()
Overrides:
toString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index