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.MenuItem
exitItem_
private javax.swing.Action
hideAct_
private java.awt.MenuItem
hideItem_
private java.awt.event.ActionListener
iconListener_
private javax.swing.Action
showAct_
private java.awt.MenuItem
showItem_
private SysTray
sysTray_
private java.lang.Object
trayIcon_
-
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 void
configureMenus()
Configures menus on the window.void
configureSysTray()
Performs configuration.void
configureWindow()
Perform configuration of window.private void
setWindowVisible(boolean isVis)
Sets visibility for the hub control window, adjusting actions as appropriate.void
tidyGui()
Performs any required tidying operations.private java.awt.MenuItem
toMenuItem(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.BasicWindowConfig
Configures menus on the window. Invoked by configureWindow.- Overrides:
configureMenus
in classHubServiceMode.BasicWindowConfig
-
configureWindow
public void configureWindow()
Description copied from class:HubServiceMode.BasicWindowConfig
Perform configuration of window.- Overrides:
configureWindow
in classHubServiceMode.BasicWindowConfig
-
configureSysTray
public void configureSysTray() throws java.awt.AWTException
Performs configuration.- Throws:
java.awt.AWTException
-
tidyGui
public void tidyGui()
Description copied from interface:HubServiceMode.Tidier
Performs any required tidying operations. May be assumed to be called on the AWT Event Dispatch Thread.- Specified by:
tidyGui
in interfaceHubServiceMode.Tidier
- Overrides:
tidyGui
in 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
-
-