Package org.graffiti.editor
Class GraffitiButtonGroup
java.lang.Object
org.graffiti.editor.GraffitiButtonGroup
public class GraffitiButtonGroup extends Object
Represents a button group.
- Version:
- $Revision: 1.5 $
-
Constructor Summary
Constructors Constructor Description GraffitiButtonGroup()
Creates a new GraffitiButtonGroup object. -
Method Summary
Modifier and Type Method Description void
addButton(ToolButton button)
Adds the given button to the button group.int
getButtonCount()
Returns the number of buttons in the group.Enumeration<?>
getElements()
Returns all the buttons that are participating in thisGraffitiButtonGroup
.ButtonModel
getSelection()
Returns the model of the selected button.boolean
isSelected(ButtonModel m)
Returns whether aButtonModel
is selected.void
remove(ToolButton button)
Removes the button from the group.void
setSelected(ButtonModel m, boolean b)
Sets the selected value for theButtonModel
.
-
Constructor Details
-
GraffitiButtonGroup
public GraffitiButtonGroup()Creates a new GraffitiButtonGroup object.
-
-
Method Details
-
getButtonCount
public int getButtonCount()Returns the number of buttons in the group.- Returns:
- the button count
-
getElements
Returns all the buttons that are participating in thisGraffitiButtonGroup
.- Returns:
- an
Enumeration
of the buttons in this group
-
setSelected
Sets the selected value for theButtonModel
. Only one button in the group may be selected at a time.- Parameters:
m
-ButtonModel
b
-true
if this button is to be selected, otherwisefalse
-
isSelected
Returns whether aButtonModel
is selected.- Parameters:
m
- DOCUMENT ME!- Returns:
true
if the button is selected, otherwise returnsfalse
-
getSelection
Returns the model of the selected button.- Returns:
- the selected button model
-
addButton
Adds the given button to the button group.- Parameters:
button
- the button to add to the group.
-
remove
Removes the button from the group.- Parameters:
button
- the button to be removed
-