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.
-
Constructor Summary
ConstructorDescriptionPamGui
(PamController pamControllerInterface, PamModel pamModelInterface, int frameNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called whenever a pamcontrolled unit is added ot the model.void
enableGUIControl
(boolean enable) Enable and disable the entire GUI.static Window
findComponentWindow
(JComponent component) find a parent window for a JComponent.findControlledUnit
(int tabNo) Get the main panel, this contains all components within the frame.long
Get the side panel.Get the main tab pane.static boolean
Static flag to say that at least one GUI has opened.void
modelChanged
(int changeType) static void
static void
packFrame
(JComponent component) find the frame owning the given component and pack it.void
pamEnded()
void
void
Called whenever a controlled unit is removed.void
boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
setTabFont
(Font font) Set font for the main tab panel.int
setTabsSize
(Dimension dimension) Set all tab sizes to a new dimensionvoid
void
setToolBarVisible
(boolean useToolBar) Set whether the top toolbar (with the record/viewer play buttons) is visible or notvoid
showControlledUnit
(PamControlledUnit pamControlledUnit) tells the view to show the main display panel of a pamControlledUnitvoid
showDialog
(String s1, String s2, int dialogType) void
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.void
Toggle between full screen and not full screen.void
Implementation of WindowListenervoid
void
void
void
void
void
Methods inherited from class PamView.PamView
getFrameNumber, getGuiFrame, setFrameNumber
-
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:PamViewInterface
Called whenever a pamcontrolled unit is added ot the model.- Specified by:
addControlledUnit
in interfacePamViewInterface
- Parameters:
unit
- - the added controlled unit.
-
setTitle
- Specified by:
setTitle
in interfacePamViewInterface
-
removeControlledUnit
Description copied from interface:PamViewInterface
Called whenever a controlled unit is removed.- Specified by:
removeControlledUnit
in interfacePamViewInterface
-
renameControlledUnit
- Specified by:
renameControlledUnit
in 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
-
openURL
-
pamEnded
public void pamEnded()- Specified by:
pamEnded
in interfacePamViewInterface
-
pamStarted
public void pamStarted()- Specified by:
pamStarted
in interfacePamViewInterface
-
modelChanged
public void modelChanged(int changeType) - Specified by:
modelChanged
in 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:
windowActivated
in interfaceWindowListener
-
windowClosing
- Specified by:
windowClosing
in interfaceWindowListener
-
windowOpened
- Specified by:
windowOpened
in interfaceWindowListener
-
windowIconified
- Specified by:
windowIconified
in interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconified
in interfaceWindowListener
-
windowDeactivated
- Specified by:
windowDeactivated
in interfaceWindowListener
-
windowClosed
- Specified by:
windowClosed
in interfaceWindowListener
-
showDialog
-
showControlledUnit
Description copied from class:PamView
tells the view to show the main display panel of a pamControlledUnit- Specified by:
showControlledUnit
in interfacePamViewInterface
- Specified by:
showControlledUnit
in classPamView
- Parameters:
pamControlledUnit
- -the controlled unit to show.
-
getViewName
- Specified by:
getViewName
in classPamView
-
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
-
getUnitName
- 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
-
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
-
getMainTab
-
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/
-
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
-