Package org.astrogrid.samp.hub
Class HubServiceMode.ProfileToggler
- java.lang.Object
-
- org.astrogrid.samp.hub.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_
-
Constructor Summary
Constructors Constructor Description ProfileToggler(HubProfile profile, Hub[] runners)
Constructor.
-
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.
-
-
-
Field Detail
-
profile_
final HubProfile profile_
-
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 onrunners
- 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.
-
-