Package pamViewFX
Class PamGuiManagerFX
java.lang.Object
pamViewFX.PamGuiManagerFX
- All Implemented Interfaces:
 PAMControllerGUI,PamSettings,SettingsNameProvider,PamViewInterface
Handles the FX based GUI. The GUI is made up of multiple PAMGuiFX stages. The
 PAMGuiManagerFX handles the number of these stages and starting/closing the
 GUI.
- Author:
 - Jamie Macaulay
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddControlledUnit(PamControlledUnit controlledUnit) Add a controlled unit to the scene.voidaddView(PamViewInterface newView) Add a PAMView Interface.voidCalled to destroy modelvoidenableGUIControl(boolean enable) Enable and disable the entire GUI.voidGet the data model pane.getFrame(int i) Get a stage.intCalled on startup to grab pamsettings/database from somewhere.static PamGuiManagerFXGet the instance of the PAMGuiManagerjavafx.stage.StagegetModuleName(Object parentFrame, PamModuleInfo moduleInfo) Get the name for a controlled unit from user input.getModuleName(PamModuleInfo moduleInfo) Create a dialog to name a new module.intGet the number of stagesGet CSS for PAMGUARD GUI standard 'look and feel'Get CSS for PAMGUARD GUI standard 'look and feel' for regular dialogsGet a list of the current PamGUIFX frames available.Get CSS for PAMGUARD setting 'look and feel' for sliding dialogsjavafx.stage.WindowlongbooleanSettings ManagerbooleanThe GUI may have a callback into the PamController once it has all been set up.voidinit()Called immediately after the creation of the GUI in the PAMController.initPrimaryView(PamController pamController, PamModel pamModel) Called when the controller is ready for the fire view.voidmodelChanged(int changeType) voidnotifyLoadProgress(PamTaskUpdate pamTaskUpdate) Notify the GUI that progress has been made in an external task.voidnotifyModelChanged(int changeType) Notification flag that the model has changedvoidpamEnded()voidvoidpamStop(javafx.stage.WindowEvent e) booleanprepareToClose(boolean weShouldSave) This get's called whenever the main window closes - ideally, I'd like to stop this happening when the system is running, but since that's not possible, just make sure everything has stopped.voidremoveControlledUnit(PamControlledUnit controlledUnit) Remove a controlled unit from the scene.booleanrestoreSettings(PamControlledUnitSettings settings) voidsetPamRunning(boolean running) Set the GUI to show PAMGUARD has started or stopped.javafx.stage.StagesetPrimaryStage(javafx.stage.Stage primaryStage2) voidsetPrimaryView(PamGuiFX primaryView) voidstatic javafx.scene.control.ButtonTypeshowAlertDialog(String strheader, String confirm) Show the alert dialog.voidShow the GUI for a specific controlled unitvoidshowLoadMode(boolean loadMode) Show GUI in load mode.voidvoidswitchToTab(UserDisplayNodeFX userDisplayNodeFX) Switch to the tab which contains a certain display within it's content area.static voidtitleFont1style(javafx.scene.control.Labeled label) Set the label style for titlesstatic voidtitleFont2style(javafx.scene.control.Labeled label) Set the label style for sub titles 
- 
Field Details
- 
iconSize
public static int iconSizeThe default size for icons in PAMGaurd- helps keep everything looking coherent. - 
iconColor
public static javafx.scene.paint.Color iconColor 
 - 
 - 
Constructor Details
- 
PamGuiManagerFX
 
 - 
 - 
Method Details
- 
getPrimaryView
- Returns:
 - the primaryView
 
 - 
setPrimaryView
- Parameters:
 primaryView- the primaryView to set
 - 
getInstance
Get the instance of the PAMGuiManager- Returns:
 - the instance;
 
 - 
titleFont1style
public static void titleFont1style(javafx.scene.control.Labeled label) Set the label style for titles- Parameters:
 label-
 - 
titleFont2style
public static void titleFont2style(javafx.scene.control.Labeled label) Set the label style for sub titles- Parameters:
 label- - the label style.
 - 
getPamGuiFXList
Get a list of the current PamGUIFX frames available.- Returns:
 - a list of the current showing PamGUIFX frames.
 
 - 
addControlledUnit
Add a controlled unit to the scene. The controlled unit may have a graphical component or no graphical component at all.- Specified by:
 addControlledUnitin interfacePamViewInterface- Parameters:
 controlledUnit- -
 - 
removeControlledUnit
Remove a controlled unit from the scene. The controlled unit may have a graphical component or no graphical component at all.- Specified by:
 removeControlledUnitin interfacePamViewInterface- Parameters:
 controlledUnit- - the controlled unit to remove (here we're removing all it's displays)
 - 
getPamSettingsCSS
Get CSS for PAMGUARD setting 'look and feel' for sliding dialogs- Returns:
 - the CSS for settings feels.
 
 - 
getPamCSS
Get CSS for PAMGUARD GUI standard 'look and feel'- Returns:
 - the standard CSS fro PAMGUARD.
 
 - 
getPamDialogCSS
Get CSS for PAMGUARD GUI standard 'look and feel' for regular dialogs- Returns:
 - the standard CSS fro PAMGUARD.
 
 - 
setPamRunning
public void setPamRunning(boolean running) Set the GUI to show PAMGUARD has started or stopped. - 
pamStop
public void pamStop(javafx.stage.WindowEvent e)  - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from interface:PAMControllerGUINotification flag that the model has changed- Specified by:
 notifyModelChangedin interfacePAMControllerGUI- Parameters:
 changeType-
 - 
addView
Description copied from interface:PAMControllerGUIAdd a PAMView Interface. This mirrors many of the functions in PAMControllerGUI- Specified by:
 addViewin interfacePAMControllerGUI
 - 
showControlledUnit
Description copied from interface:PamViewInterfaceShow the GUI for a specific controlled unit- Specified by:
 showControlledUnitin interfacePamViewInterface- Parameters:
 unit- -the controlled unit to show.
 - 
destroyModel
public void destroyModel()Description copied from interface:PAMControllerGUICalled to destroy model- Specified by:
 destroyModelin interfacePAMControllerGUI
 - 
enableGUIControl
public void enableGUIControl(boolean enable) Description copied from interface:PamViewInterfaceEnable and disable the entire GUI.- Specified by:
 enableGUIControlin interfacePamViewInterface- Parameters:
 enable- - true to enable the GUI/
 - 
getMainScene
public javafx.stage.Stage getMainScene() - 
sortFrameTitles
public void sortFrameTitles() - 
getAllFrameParameters
public void getAllFrameParameters() - 
getNumFrames
public int getNumFrames()Get the number of stages- Returns:
 - the number of stages (windows) currently open.
 
 - 
getFrame
Get a stage.- Parameters:
 i- - frame number- Returns:
 - the stage
 
 - 
getModuleName
Create a dialog to name a new module.- Parameters:
 moduleInfo-- Returns:
 - the new name of the module.
 
 - 
switchToTab
Switch to the tab which contains a certain display within it's content area.- Parameters:
 userDisplayNodeFX- - the display to show.
 - 
getDataModelFX
Get the data model pane.- Returns:
 - the data model pane.
 
 - 
showLoadMode
public void showLoadMode(boolean loadMode) Show GUI in load mode. SHows load bars etc.- Parameters:
 loadMode- - shoe the GUI in loadMode;
 - 
notifyLoadProgress
Notify the GUI that progress has been made in an external task.- Specified by:
 notifyLoadProgressin interfacePAMControllerGUI- Parameters:
 pamTaskUpdate- - class which holds information on the Task and progress.
 - 
getInitialSettings
Description copied from interface:PAMControllerGUICalled on startup to grab pamsettings/database from somewhere.- Specified by:
 getInitialSettingsin interfacePAMControllerGUI- Returns:
 - the pamsettings/database.
 
 - 
init
public void init()Description copied from interface:PAMControllerGUICalled immediately after the creation of the GUI in the PAMController.- Specified by:
 initin interfacePAMControllerGUI
 - 
hasCallBack
public boolean hasCallBack()Description copied from interface:PAMControllerGUIThe GUI may have a callback into the PamController once it has all been set up. If this is the case then on init() PAMController stops and relies on the GUI code to call the relevant setupPAMGuard folder once the GUI thread is happy everything is being set up properly.- Specified by:
 hasCallBackin interfacePAMControllerGUI- Returns:
 
 - 
initPrimaryView
Description copied from interface:PAMControllerGUICalled when the controller is ready for the fire view.- Specified by:
 initPrimaryViewin interfacePAMControllerGUI- Parameters:
 pamController-pamModel-- Returns:
 - init and retuirn the first view
 
 - 
setPrimaryStage
public javafx.stage.Stage setPrimaryStage(javafx.stage.Stage primaryStage2)  - 
getModuleName
Description copied from interface:PAMControllerGUIGet the name for a controlled unit from user input.- Specified by:
 getModuleNamein interfacePAMControllerGUI- Parameters:
 parentFrame- - an object which can be the parent frame for the dialog.moduleInfo- - the type of controlled unit.- Returns:
 - the name of the module.
 
 - 
showAlertDialog
Show the alert dialog.- Parameters:
 strheader-confirm-- Returns:
 
 - 
prepareToClose
public boolean prepareToClose(boolean weShouldSave) This get's called whenever the main window closes - ideally, I'd like to stop this happening when the system is running, but since that's not possible, just make sure everything has stopped.- Parameters:
 weShouldSave- true if the settings should get saved to the psf file, false if otherwise- Returns:
 - true if ok to close, false otherwise.
 
 - 
getShowLoadMode
public boolean getShowLoadMode() - 
pamStarted
public void pamStarted()- Specified by:
 pamStartedin interfacePamViewInterface
 - 
pamEnded
public void pamEnded()- Specified by:
 pamEndedin interfacePamViewInterface
 - 
modelChanged
public void modelChanged(int changeType) - Specified by:
 modelChangedin interfacePamViewInterface
 - 
setTitle
- Specified by:
 setTitlein interfacePamViewInterface
 - 
getFrameNumber
public int getFrameNumber()- Specified by:
 getFrameNumberin interfacePamViewInterface- Returns:
 - Frame number used by the multiple GUI frames. All other objects, such as the model view should return invalid input: '<' 0.
 
 - 
getGuiFrame
- Specified by:
 getGuiFramein interfacePamViewInterface
 - 
getUnitName
Settings Manager- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 settings-- Returns:
 - true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
 
 - 
getPrimaryStage
public javafx.stage.Window getPrimaryStage() 
 -