Class HubServiceMode.ProfileToggler

  • Enclosing class:
    HubServiceMode

    private static class HubServiceMode.ProfileToggler
    extends java.lang.Object
    Manages a toggle button for starting/stopping profiles. This object can supply both Swing JMenuItems and AWT MenuItems with effectively the same model (which is quite hard work).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List menuItemList_  
      (package private) HubProfile profile_  
      (package private) Hub[] runners_  
      (package private) java.lang.String title_  
      (package private) javax.swing.JToggleButton.ToggleButtonModel toggleModel_  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.JMenuItem createJMenuItem()
      Returns a new Swing JMenuItem for start/stop toggle.
      java.awt.MenuItem createMenuItem()
      Returns a new AWT MenuItem for start/stop toggle.
      private void updateMenuItems()
      Updates all dispatched menu items to the current state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • runners_

        final Hub[] runners_
      • title_

        final java.lang.String title_
      • toggleModel_

        final javax.swing.JToggleButton.ToggleButtonModel toggleModel_
      • menuItemList_

        final java.util.List menuItemList_
    • Constructor Detail

      • ProfileToggler

        ProfileToggler​(HubProfile profile,
                       Hub[] runners)
        Constructor.
        Parameters:
        profile - profile to operate on
        runners - one-element array containing hub
    • Method Detail

      • createJMenuItem

        public javax.swing.JMenuItem createJMenuItem()
        Returns a new Swing JMenuItem for start/stop toggle.
        Returns:
        menu item
      • createMenuItem

        public java.awt.MenuItem createMenuItem()
        Returns a new AWT MenuItem for start/stop toggle.
        Returns:
        menu item
      • updateMenuItems

        private void updateMenuItems()
        Updates all dispatched menu items to the current state.