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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addControlledUnit
(PamControlledUnit controlledUnit) Add a controlled unit to the scene.void
addView
(PamViewInterface newView) Add a PAMView Interface.void
Called to destroy modelvoid
enableGUIControl
(boolean enable) Enable and disable the entire GUI.void
Get the data model pane.getFrame
(int i) Get a stage.int
Called on startup to grab pamsettings/database from somewhere.static PamGuiManagerFX
Get the instance of the PAMGuiManagerjavafx.stage.Stage
getModuleName
(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.int
Get 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.Window
long
boolean
Settings Managerboolean
The GUI may have a callback into the PamController once it has all been set up.void
init()
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.void
modelChanged
(int changeType) void
notifyLoadProgress
(PamTaskUpdate pamTaskUpdate) Notify the GUI that progress has been made in an external task.void
notifyModelChanged
(int changeType) Notification flag that the model has changedvoid
pamEnded()
void
void
pamStop
(javafx.stage.WindowEvent e) 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.void
removeControlledUnit
(PamControlledUnit controlledUnit) Remove a controlled unit from the scene.boolean
restoreSettings
(PamControlledUnitSettings settings) void
setPamRunning
(boolean running) Set the GUI to show PAMGUARD has started or stopped.javafx.stage.Stage
setPrimaryStage
(javafx.stage.Stage primaryStage2) void
setPrimaryView
(PamGuiFX primaryView) void
static javafx.scene.control.ButtonType
showAlertDialog
(String strheader, String confirm) Show the alert dialog.void
Show the GUI for a specific controlled unitvoid
showLoadMode
(boolean loadMode) Show GUI in load mode.void
void
switchToTab
(UserDisplayNodeFX userDisplayNodeFX) Switch to the tab which contains a certain display within it's content area.static void
titleFont1style
(javafx.scene.control.Labeled label) Set the label style for titlesstatic void
titleFont2style
(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:
addControlledUnit
in 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:
removeControlledUnit
in 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:PAMControllerGUI
Notification flag that the model has changed- Specified by:
notifyModelChanged
in interfacePAMControllerGUI
-
addView
Description copied from interface:PAMControllerGUI
Add a PAMView Interface. This mirrors many of the functions in PAMControllerGUI- Specified by:
addView
in interfacePAMControllerGUI
-
showControlledUnit
Description copied from interface:PamViewInterface
Show the GUI for a specific controlled unit- Specified by:
showControlledUnit
in interfacePamViewInterface
- Parameters:
unit
- -the controlled unit to show.
-
destroyModel
public void destroyModel()Description copied from interface:PAMControllerGUI
Called to destroy model- Specified by:
destroyModel
in interfacePAMControllerGUI
-
enableGUIControl
public void enableGUIControl(boolean enable) Description copied from interface:PamViewInterface
Enable and disable the entire GUI.- Specified by:
enableGUIControl
in 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:
notifyLoadProgress
in interfacePAMControllerGUI
- Parameters:
pamTaskUpdate
- - class which holds information on the Task and progress.
-
getInitialSettings
Description copied from interface:PAMControllerGUI
Called on startup to grab pamsettings/database from somewhere.- Specified by:
getInitialSettings
in interfacePAMControllerGUI
- Returns:
- the pamsettings/database.
-
init
public void init()Description copied from interface:PAMControllerGUI
Called immediately after the creation of the GUI in the PAMController.- Specified by:
init
in interfacePAMControllerGUI
-
hasCallBack
public boolean hasCallBack()Description copied from interface:PAMControllerGUI
The 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:
hasCallBack
in interfacePAMControllerGUI
- Returns:
-
initPrimaryView
Description copied from interface:PAMControllerGUI
Called when the controller is ready for the fire view.- Specified by:
initPrimaryView
in interfacePAMControllerGUI
- Returns:
- init and retuirn the first view
-
setPrimaryStage
public javafx.stage.Stage setPrimaryStage(javafx.stage.Stage primaryStage2) -
getModuleName
Description copied from interface:PAMControllerGUI
Get the name for a controlled unit from user input.- Specified by:
getModuleName
in 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:
pamStarted
in interfacePamViewInterface
-
pamEnded
public void pamEnded()- Specified by:
pamEnded
in interfacePamViewInterface
-
modelChanged
public void modelChanged(int changeType) - Specified by:
modelChanged
in interfacePamViewInterface
-
setTitle
- Specified by:
setTitle
in interfacePamViewInterface
-
getFrameNumber
public int getFrameNumber()- Specified by:
getFrameNumber
in 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:
getGuiFrame
in interfacePamViewInterface
-
getUnitName
Settings Manager- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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()
-