Package org.astrogrid.samp.hub
Class HubServiceMode.SysTrayWindowConfig
- java.lang.Object
-
- org.astrogrid.samp.hub.HubServiceMode.BasicWindowConfig
-
- org.astrogrid.samp.hub.HubServiceMode.SysTrayWindowConfig
-
- All Implemented Interfaces:
HubServiceMode.Tidier
- Enclosing class:
- HubServiceMode
private static class HubServiceMode.SysTrayWindowConfig extends HubServiceMode.BasicWindowConfig
Takes care of hub display window configuration with system tray functionality.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.MenuItemexitItem_private javax.swing.ActionhideAct_private java.awt.MenuItemhideItem_private java.awt.event.ActionListenericonListener_private javax.swing.ActionshowAct_private java.awt.MenuItemshowItem_private SysTraysysTray_private java.lang.ObjecttrayIcon_-
Fields inherited from class org.astrogrid.samp.hub.HubServiceMode.BasicWindowConfig
configProfiles_, exitAct_, frame_, hubService_, profileTogglers_, runners_
-
-
Constructor Summary
Constructors Constructor Description SysTrayWindowConfig(javax.swing.JFrame frame, HubProfile[] profiles, Hub[] runners, GuiHubService hubService, SysTray sysTray)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureMenus()Configures menus on the window.voidconfigureSysTray()Performs configuration.voidconfigureWindow()Perform configuration of window.private voidsetWindowVisible(boolean isVis)Sets visibility for the hub control window, adjusting actions as appropriate.voidtidyGui()Performs any required tidying operations.private java.awt.MenuItemtoMenuItem(javax.swing.Action act)Turns an action into an AWT menu item.
-
-
-
Field Detail
-
sysTray_
private final SysTray sysTray_
-
showAct_
private final javax.swing.Action showAct_
-
hideAct_
private final javax.swing.Action hideAct_
-
showItem_
private final java.awt.MenuItem showItem_
-
hideItem_
private final java.awt.MenuItem hideItem_
-
exitItem_
private final java.awt.MenuItem exitItem_
-
iconListener_
private final java.awt.event.ActionListener iconListener_
-
trayIcon_
private java.lang.Object trayIcon_
-
-
Constructor Detail
-
SysTrayWindowConfig
SysTrayWindowConfig(javax.swing.JFrame frame, HubProfile[] profiles, Hub[] runners, GuiHubService hubService, SysTray sysTray)Constructor.- Parameters:
frame- hub windowprofiles- hub profiles to runrunners- 1-element array which will contain an associated hub runner object if one existshubService- object providing hub servicessysTray- system tray facade object
-
-
Method Detail
-
configureMenus
protected void configureMenus()
Description copied from class:HubServiceMode.BasicWindowConfigConfigures menus on the window. Invoked by configureWindow.- Overrides:
configureMenusin classHubServiceMode.BasicWindowConfig
-
configureWindow
public void configureWindow()
Description copied from class:HubServiceMode.BasicWindowConfigPerform configuration of window.- Overrides:
configureWindowin classHubServiceMode.BasicWindowConfig
-
configureSysTray
public void configureSysTray() throws java.awt.AWTExceptionPerforms configuration.- Throws:
java.awt.AWTException
-
tidyGui
public void tidyGui()
Description copied from interface:HubServiceMode.TidierPerforms any required tidying operations. May be assumed to be called on the AWT Event Dispatch Thread.- Specified by:
tidyGuiin interfaceHubServiceMode.Tidier- Overrides:
tidyGuiin classHubServiceMode.BasicWindowConfig
-
setWindowVisible
private void setWindowVisible(boolean isVis)
Sets visibility for the hub control window, adjusting actions as appropriate.- Parameters:
isVis- true for visible, false for invisible
-
toMenuItem
private java.awt.MenuItem toMenuItem(javax.swing.Action act)
Turns an action into an AWT menu item.- Parameters:
act- action- Returns:
- MenuItem facade
-
-