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
-
ButtonBar(Component)
-
-
ButtonBar(String[], Component)
- this generates just Buttons although others can be added
-
action(Event, Object)
- the button bar has the responsibility of sending messages to
the target directly
-
addButton(String)
-
-
addButtons(String[])
-
-
addChoice(String[])
- a Choice has several alternative options
-
clearButtons()
-
-
deleteButton(String)
- remove a button (synonymous with the above
-
getButton(String)
- gets the Button associated with a name; if none, returns null
-
getChoice(String)
- gets the Choice associated with a name; if none, returns null
-
removeButton(String)
-
-
removeChoice(String)
- ANY name on Choice menu will remove the Choice
-
setTarget(Component)
- the target can be reset if required
-
toString()
-
ButtonBar
public ButtonBar(Component target)
ButtonBar
public ButtonBar(String names[],
Component target)
- this generates just Buttons although others can be added
addButtons
public void addButtons(String names[])
clearButtons
public void clearButtons()
addButton
public void addButton(String name)
removeButton
public void removeButton(String name)
deleteButton
public void deleteButton(String name)
- remove a button (synonymous with the above
getButton
public Button getButton(String name)
- gets the Button associated with a name; if none, returns null
addChoice
public void addChoice(String names[])
- a Choice has several alternative options
removeChoice
public void removeChoice(String name)
- ANY name on Choice menu will remove the Choice
getChoice
public Choice getChoice(String name)
- gets the Choice associated with a name; if none, returns null
setTarget
public void setTarget(Component target)
- the target can be reset if required
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
toString
public String toString()
- Overrides:
- toString in class Component
All Packages Class Hierarchy This Package Previous Next Index