Class DoubleButtonList


  • public class DoubleButtonList
    extends java.lang.Object
    A list of buttons divided 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
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a ButtonListListener to 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 button
        alternativeLocation - 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 button
        alternativeLocation - 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 button
        alternativeLocation - 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 null if no button exists
      • getButtons

        @NotNull
        public @NotNull java.awt.Component getButtons()
        Returns the Container that contains all buttons.
        Returns:
        the container
      • getButtonCount

        public int getButtonCount()
        Returns the total number of buttons.
        Returns:
        the total number of buttons