public class DoubleButtonList
extends java.lang.Object
buttons
divided into two parts. At most one
button in each part is active at any time.Constructor and Description |
---|
DoubleButtonList(Location location)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addButton(javax.swing.AbstractButton button,
boolean alternativeLocation)
Adds a button.
|
void |
addButtonListListener(ButtonListListener listener)
Adds a
ButtonListListener to be notified. |
int |
getButtonCount()
Returns the total number of buttons.
|
java.awt.Component |
getButtons()
Returns the
Container that contains all buttons. |
javax.swing.AbstractButton |
getSelectedButton(boolean alternativeLocation)
Returns the currently selected button.
|
void |
removeButton(javax.swing.AbstractButton button,
boolean alternativeLocation)
Removes a button.
|
void |
selectButton(javax.swing.AbstractButton button,
boolean alternativeLocation)
Selects a button.
|
public DoubleButtonList(@NotNull Location location)
location
- the locationpublic void addButtonListListener(@NotNull ButtonListListener listener)
ButtonListListener
to be notified.listener
- the button list listenerpublic void addButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)
button
- the buttonalternativeLocation
- whether to add the button into the alternative
locationpublic void removeButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)
button
- the buttonalternativeLocation
- whether to remove the button from the
alternative locationpublic void selectButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)
button
- the buttonalternativeLocation
- whether to select the button in the
alternative location@Nullable public javax.swing.AbstractButton getSelectedButton(boolean alternativeLocation)
alternativeLocation
- whether to remove the button from the
alternative locationnull
if no button exists@NotNull public java.awt.Component getButtons()
Container
that contains all buttons.public int getButtonCount()