Documentation of 'jas2.util.multibuttontoolbar.MultiButtonGroup' Java class
MultiButtonGroup
jas2.util.multibuttontoolbar

Class MultiButtonGroup



  • public class MultiButtonGroup
    extends java.lang.Object
    A MultiButtonGroup manages which of the AbstractButtons in it is visible at any given time.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MultiButtonGroup(javax.swing.AbstractButton b)
      Creates a MultiButtonGroup with one component button, which is set to be the visible button.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(javax.swing.AbstractButton b)
      Adds the button to the group.
      java.util.Enumeration getElements()
      Return all the buttons that are participating in this group.
      javax.swing.AbstractButton getVisibleButton(boolean needMouseListener)
      Return the visible button.
      boolean isVisibleButton(javax.swing.AbstractButton b)
      Returns whether the button is the visible button.
      void remove(javax.swing.AbstractButton b)
      Removes the button from the group.
      void setPositionInToolBar(int pos) 
      void setToolBar(MultiToolBar tb) 
      void setVisibleButton(javax.swing.AbstractButton b)
      Sets the button to be the visible button.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiButtonGroup

        public MultiButtonGroup(javax.swing.AbstractButton b)
        Creates a MultiButtonGroup with one component button, which is set to be the visible button. This ensures that there is always exactly one button visible (as opposed to a ButtonGroup, in which there can be either 0 or 1 buttons selected.
    • Method Detail

      • add

        public void add(javax.swing.AbstractButton b)
        Adds the button to the group.
      • remove

        public void remove(javax.swing.AbstractButton b)
        Removes the button from the group. Removing the only button is forbidden. Removing the visible button (which is allowed if there is more than one button in the group) causes the first button in the MultiButtonGroup to become the visible button.
      • getVisibleButton

        public javax.swing.AbstractButton getVisibleButton(boolean needMouseListener)
        Return the visible button.
        Parameters:
        needMouseListener - true if the visible button is being put in a toolbar that will enable it to pop up a menu that allows the visible button to be switched, false otherwise
      • setVisibleButton

        public void setVisibleButton(javax.swing.AbstractButton b)
        Sets the button to be the visible button. Note that there is no setButtonVisible method since one button must be selected at all times, which means that the visible property should not be thought of as something that can be turned on/off, but that can only be transferred.
      • isVisibleButton

        public boolean isVisibleButton(javax.swing.AbstractButton b)
        Returns whether the button is the visible button.
      • getElements

        public java.util.Enumeration getElements()
        Return all the buttons that are participating in this group.
      • setPositionInToolBar

        public void setPositionInToolBar(int pos)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.