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 voidaddButton(ToolButton button)Adds the given button to the button group.intgetButtonCount()Returns the number of buttons in the group.Enumeration<?>getElements()Returns all the buttons that are participating in thisGraffitiButtonGroup.ButtonModelgetSelection()Returns the model of the selected button.booleanisSelected(ButtonModel m)Returns whether aButtonModelis selected.voidremove(ToolButton button)Removes the button from the group.voidsetSelected(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
Enumerationof 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-ButtonModelb-trueif this button is to be selected, otherwisefalse
-
isSelected
Returns whether aButtonModelis selected.- Parameters:
m- DOCUMENT ME!- Returns:
trueif 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
-