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.ObjectManages 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.ListmenuItemList_(package private) HubProfileprofile_(package private) Hub[]runners_(package private) java.lang.Stringtitle_(package private) javax.swing.JToggleButton.ToggleButtonModeltoggleModel_
-
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.JMenuItemcreateJMenuItem()Returns a new Swing JMenuItem for start/stop toggle.java.awt.MenuItemcreateMenuItem()Returns a new AWT MenuItem for start/stop toggle.private voidupdateMenuItems()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.
-
-