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(@NotNull Location location)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addButton(@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
Adds a button.
|
void |
addButtonListListener(@NotNull ButtonListListener listener)
Adds a
ButtonListListener to be notified. |
int |
getButtonCount()
Returns the total number of buttons.
|
@NotNull java.awt.Component |
getButtons()
Returns the
Container that contains all buttons. |
@Nullable javax.swing.AbstractButton |
getSelectedButton(boolean alternativeLocation)
Returns the currently selected button.
|
void |
removeButton(@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
Removes a button.
|
void |
selectButton(@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
Selects a button.
|
public DoubleButtonList(@NotNull
@NotNull Location location)
location - the locationpublic void addButtonListListener(@NotNull
@NotNull ButtonListListener listener)
ButtonListListener to be notified.listener - the button list listenerpublic void addButton(@NotNull
@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
button - the buttonalternativeLocation - whether to add the button into the alternative
locationpublic void removeButton(@NotNull
@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
button - the buttonalternativeLocation - whether to remove the button from the
alternative locationpublic void selectButton(@NotNull
@NotNull javax.swing.AbstractButton button,
boolean alternativeLocation)
button - the buttonalternativeLocation - whether to select the button in the
alternative location@Nullable public @Nullable javax.swing.AbstractButton getSelectedButton(boolean alternativeLocation)
alternativeLocation - whether to remove the button from the
alternative locationnull if no button exists@NotNull public @NotNull java.awt.Component getButtons()
Container that contains all buttons.public int getButtonCount()