Class DoubleButtonList
- java.lang.Object
-
- net.sf.gridarta.gui.utils.tabbedpanel.DoubleButtonList
-
public class DoubleButtonList extends java.lang.ObjectA list ofbuttonsdivided into two parts. At most one button in each part is active at any time.
-
-
Constructor Summary
Constructors Constructor Description DoubleButtonList(@NotNull Location location)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Adds a button.voidaddButtonListListener(@NotNull ButtonListListener listener)Adds aButtonListListenerto be notified.intgetButtonCount()Returns the total number of buttons.@NotNull java.awt.ComponentgetButtons()Returns theContainerthat contains all buttons.@Nullable javax.swing.AbstractButtongetSelectedButton(boolean alternativeLocation)Returns the currently selected button.voidremoveButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Removes a button.voidselectButton(@NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Selects a button.
-
-
-
Constructor Detail
-
DoubleButtonList
public DoubleButtonList(@NotNull @NotNull Location location)Creates a new instance.- Parameters:
location- the location
-
-
Method Detail
-
addButtonListListener
public void addButtonListListener(@NotNull @NotNull ButtonListListener listener)Adds aButtonListListenerto be notified.- Parameters:
listener- the button list listener
-
addButton
public void addButton(@NotNull @NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Adds a button.- Parameters:
button- the buttonalternativeLocation- whether to add the button into the alternative location
-
removeButton
public void removeButton(@NotNull @NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Removes a button.- Parameters:
button- the buttonalternativeLocation- whether to remove the button from the alternative location
-
selectButton
public void selectButton(@NotNull @NotNull javax.swing.AbstractButton button, boolean alternativeLocation)Selects a button.- Parameters:
button- the buttonalternativeLocation- whether to select the button in the alternative location
-
getSelectedButton
@Nullable public @Nullable javax.swing.AbstractButton getSelectedButton(boolean alternativeLocation)
Returns the currently selected button.- Parameters:
alternativeLocation- whether to remove the button from the alternative location- Returns:
- the selected button or
nullif no button exists
-
getButtons
@NotNull public @NotNull java.awt.Component getButtons()
Returns theContainerthat contains all buttons.- Returns:
- the container
-
getButtonCount
public int getButtonCount()
Returns the total number of buttons.- Returns:
- the total number of buttons
-
-