Package PamView
Class PamGui
java.lang.Object
PamView.PamView
PamView.PamGui
- All Implemented Interfaces:
 WindowListener,EventListener,PamSettings,SettingsNameProvider,PamViewInterface
- Author:
 - Doug Gillespie
 
 
Simple PamGui implementing a tab control.
 
- 
Field Summary
FieldsFields inherited from class PamView.PamView
frame, pamControllerInterface, pamModelInterface - 
Constructor Summary
ConstructorsConstructorDescriptionPamGui(PamController pamControllerInterface, PamModel pamModelInterface, int frameNumber)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidCalled whenever a pamcontrolled unit is added ot the model.voidenableGUIControl(boolean enable) Enable and disable the entire GUI.static WindowfindComponentWindow(JComponent component) find a parent window for a JComponent.findControlledUnit(int tabNo) protected voidGet the GUi parameters before saving so that these can be written to the psf file, even if the Window was previouslu closed.Get the main panel, this contains all components within the frame.longGet the side panel.Get the main tab pane.protected voidImport settings from an external psf file.static booleanStatic flag to say that at least one GUI has opened.voidmodelChanged(int changeType) static voidstatic voidpackFrame(JComponent component) find the frame owning the given component and pack it.voidpamEnded()voidvoidCalled whenever a controlled unit is removed.voidbooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidsetTabFont(Font font) Set font for the main tab panel.intsetTabsSize(Dimension dimension) Set all tab sizes to a new dimensionvoidvoidsetToolBarVisible(boolean useToolBar) Set whether the top toolbar (with the record/viewer play buttons) is visible or notvoidshowControlledUnit(PamControlledUnit pamControlledUnit) tells the view to show the main display panel of a pamControlledUnitvoidshowDialog(String s1, String s2, int dialogType) voidSet up specific settings for the tab - get's called quite a lot, including whenever modules are added or removed in order to make sure that menus contain the correct options for existing modules.voidToggle between full screen and not full screen.voidImplementation of WindowListenervoidvoidvoidvoidvoidvoidMethods inherited from class PamView.PamView
getFrameNumber, getGuiFrame, setFrameNumber 
- 
Field Details
- 
guiParameters
 
 - 
 - 
Constructor Details
- 
PamGui
 
 - 
 - 
Method Details
- 
isSomethingShowing
public static boolean isSomethingShowing()Static flag to say that at least one GUI has opened.- Returns:
 - true when one or more GUI frames are visible.
 
 - 
addControlledUnit
Description copied from interface:PamViewInterfaceCalled whenever a pamcontrolled unit is added ot the model.- Specified by:
 addControlledUnitin interfacePamViewInterface- Parameters:
 unit- - the added controlled unit.
 - 
setTitle
- Specified by:
 setTitlein interfacePamViewInterface
 - 
removeControlledUnit
Description copied from interface:PamViewInterfaceCalled whenever a controlled unit is removed.- Specified by:
 removeControlledUnitin interfacePamViewInterface- Parameters:
 unit-
 - 
renameControlledUnit
- Specified by:
 renameControlledUnitin classPamView
 - 
findControlledUnit
 - 
ShowTabSpecificSettings
public void ShowTabSpecificSettings()Set up specific settings for the tab - get's called quite a lot, including whenever modules are added or removed in order to make sure that menus contain the correct options for existing modules. - 
makeGuiMenu
 - 
importSettings
protected void importSettings()Import settings from an external psf file. - 
openURL
 - 
pamEnded
public void pamEnded()- Specified by:
 pamEndedin interfacePamViewInterface
 - 
pamStarted
public void pamStarted()- Specified by:
 pamStartedin interfacePamViewInterface
 - 
modelChanged
public void modelChanged(int changeType) - Specified by:
 modelChangedin interfacePamViewInterface
 - 
setTabsSize
Set all tab sizes to a new dimension- Parameters:
 dimension- - the new tab size to set.font- - the tab font to set.
 - 
setTabFont
Set font for the main tab panel.- Parameters:
 font- - the font to set.
 - 
windowActivated
Implementation of WindowListener- Specified by:
 windowActivatedin interfaceWindowListener
 - 
windowClosing
- Specified by:
 windowClosingin interfaceWindowListener
 - 
windowOpened
- Specified by:
 windowOpenedin interfaceWindowListener
 - 
windowIconified
- Specified by:
 windowIconifiedin interfaceWindowListener
 - 
windowDeiconified
- Specified by:
 windowDeiconifiedin interfaceWindowListener
 - 
windowDeactivated
- Specified by:
 windowDeactivatedin interfaceWindowListener
 - 
windowClosed
- Specified by:
 windowClosedin interfaceWindowListener
 - 
getGuiParameters
protected void getGuiParameters()Get the GUi parameters before saving so that these can be written to the psf file, even if the Window was previouslu closed. - 
showDialog
 - 
showControlledUnit
Description copied from class:PamViewtells the view to show the main display panel of a pamControlledUnit- Specified by:
 showControlledUnitin interfacePamViewInterface- Specified by:
 showControlledUnitin classPamView- Parameters:
 pamControlledUnit-
 - 
getViewName
- Specified by:
 getViewNamein classPamView
 - 
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
 
 - 
getMainTab
 - 
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/
 - 
packFrame
find the frame owning the given component and pack it.- Parameters:
 component-
 - 
toggleFullScreen
public void toggleFullScreen()Toggle between full screen and not full screen. - 
setToolBarVisible
public void setToolBarVisible(boolean useToolBar) Set whether the top toolbar (with the record/viewer play buttons) is visible or not- Parameters:
 useToolBar- - true to have it visible (default)
 - 
getMainPanel
Get the main panel, this contains all components within the frame.- Returns:
 - the main panel.
 
 - 
getSidePanel
Get the side panel. This holds all the side pane.s- Returns:
 - the side panel.
 
 - 
getTabbedPane
Get the main tab pane.- Returns:
 - the tab pane.
 
 - 
findComponentWindow
find a parent window for a JComponent. This can be useful in finding windows to open child dialogs when the object holding the component may not have a direct reference back to it's dialog.- Parameters:
 component- any Swing component- Returns:
 - parent Window (or frame) if it can be found
 
 
 -