Package PamView
Class GuiFrameManager
java.lang.Object
PamView.GuiFrameManager
- All Implemented Interfaces:
 PAMControllerGUI,PamSettings,SettingsNameProvider,PamViewInterface
The GuiFrameManager manages multiple PamGui frames, each 
 of which may contain multiple tabs of module information 
 and a side panel.
 
The user can move tabs between the various frames and create new frames by right clicking on the tabs themselves.
- Author:
 - Doug Gillespie
 - See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddControlledUnit(PamControlledUnit controlledUnit) Called whenever a pamcontrolled unit is added ot the model.voidaddView(PamViewInterface newView) Add a PAMView Interface.voidcloseExtraFrame(PamGui pamGui) Closes a PamGui FRame (not the main one) All tabs are first moved to the main frame (No.protected voidvoidCalled to destroy modelvoidenableGUIControl(boolean enable) Enable and disable the entire GUI.voidfindGUI()Function that can move GUI frames back onto the main window.voidGoes through all open frames before they start closing and gets their parameters into the structure which will be written to the psf file.getFrame(int iFrame) Get a framegetFrameGui(int iFrame) Get a frame GUI.getFrameName(int iFrame) Get a name for a frame which can be used in their titles and in menus, etc.intCalled on startup to grab pamsettings/database from somewhere.getMenuFrameName(int iFrame) getModuleName(Object parentFrame, PamModuleInfo moduleInfo) Get the name for a controlled unit from user input.intGet the total number of frameslonggetTabPopupMenu(PamGui pamGui, int tabIndex) booleanThe 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 pamModelInterface) Called when the controller is ready for the fire view.voidMake a list of Gui frames - that is all PamView's with a frame number > 0 which indicates they are a GUI frame.voidmodelChanged(int changeType) voidnotifyLoadProgress(PamTaskUpdate progress) Notify the GUI that some loading is taking placevoidnotifyModelChanged(int changeType) Notification flag that the model has changedvoidpamEnded()voidpamStart()voidvoidpamStop()voidremoveControlledUnit(PamControlledUnit controlledUnit) Called whenever a controlled unit is removed.voidremoveView(PamViewInterface oldView) booleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidsetDefaultFrameIcon(Image frameIcon) voidvoidShow the GUI for a specific controlled unitvoid 
- 
Constructor Details
- 
GuiFrameManager
 
 - 
 - 
Method Details
- 
getFrameList
 - 
makeFrameList
public void makeFrameList()Make a list of Gui frames - that is all PamView's with a frame number > 0 which indicates they are a GUI frame. Other frames, such as the model view, have a frame number invalid input: '<' 0. - 
getNumFrames
public int getNumFrames()Get the total number of frames- Returns:
 - number of frames.
 
 - 
getFrame
Get a frame- Parameters:
 iFrame- frame number- Returns:
 - frame.
 
 - 
closeExtraFrame
Closes a PamGui FRame (not the main one) All tabs are first moved to the main frame (No. 0) then the frame is removed from the list of frames then the frame is closed.- Parameters:
 pamGui- reference to frame to close.
 - 
getAllFrameParameters
public void getAllFrameParameters()Goes through all open frames before they start closing and gets their parameters into the structure which will be written to the psf file. - 
getFrameGui
Get a frame GUI. This is a single frame whihc holds a GUI with tabs etc.- Parameters:
 iFram- e- the frame index to get.- Returns:
 - the frame GUI to get.
 
 - 
getTabPopupMenu
 - 
getMenuFrameName
 - 
getFrameName
Get a name for a frame which can be used in their titles and in menus, etc.- Parameters:
 iFrame- frame Number- Returns:
 - names String
 
 - 
sortFrameTitles
public void sortFrameTitles() - 
addControlledUnit
Description copied from interface:PamViewInterfaceCalled whenever a pamcontrolled unit is added ot the model.- Specified by:
 addControlledUnitin interfacePamViewInterface- Parameters:
 controlledUnit- - the added controlled unit.
 - 
removeControlledUnit
Description copied from interface:PamViewInterfaceCalled whenever a controlled unit is removed.- Specified by:
 removeControlledUnitin interfacePamViewInterface- Parameters:
 controlledUnit-
 - 
addView
Description copied from interface:PAMControllerGUIAdd a PAMView Interface. This mirrors many of the functions in PAMControllerGUI- Specified by:
 addViewin interfacePAMControllerGUI
 - 
removeView
 - 
showControlledUnit
Description copied from interface:PamViewInterfaceShow the GUI for a specific controlled unit- Specified by:
 showControlledUnitin interfacePamViewInterface- Parameters:
 unit- -the controlled unit to show.
 - 
pamStart
public void pamStart() - 
pamStop
public void pamStop() - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from interface:PAMControllerGUINotification flag that the model has changed- Specified by:
 notifyModelChangedin interfacePAMControllerGUI- Parameters:
 changeType-
 - 
destroyModel
public void destroyModel()Description copied from interface:PAMControllerGUICalled to destroy model- Specified by:
 destroyModelin interfacePAMControllerGUI
 - 
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
 
 - 
getUnitName
- 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
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 - 
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/
 - 
getCollapseMenuItem
 - 
collapseAllFrames
protected void collapseAllFrames() - 
notifyLoadProgress
Description copied from interface:PAMControllerGUINotify the GUI that some loading is taking place- Specified by:
 notifyLoadProgressin interfacePAMControllerGUI- Parameters:
 progress- - the 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-pamModelInterface-- Returns:
 - init and retuirn the first view
 
 - 
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.
 
 - 
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
 - 
setDefaultFrameIcon
 - 
getDefaultFrameIcon
 - 
findGUI
public void findGUI()Function that can move GUI frames back onto the main window. Can be used to recover a GUI if it's on a monitor that is not present. 
 -