|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPamController.PamControlledUnit
public abstract class PamControlledUnit
PamControlledUnit is an abstract class that is used to contain all the information required for an actual detector, sub detection process or display within Pamguard.
See the how to make Pamguard plug-ins overview.
Each unit will probably have a PamProcess, which will do something like caclulate FFT's, look for whistles, read a sound card, etc. Associated with each process there may or may not be a display or a display component (e.g. a toolbar window for controlling file playback speed, a panel to be added to a GUI, menu's for controlling the algorithm and / or the various bits of the display).
Each PamControlledUnit along with one or more PamProcesses and display units comprises a kind of mini MVC, the PamControlledUnit being the Controller, the PamProcesses and their associated data blocks the model and the display comonents the view.
Each PamProcess requires a reference to a PamControllerUnit in it's constructor, so PamProcesses can only exist within this framework.
Subclasses of PamControlledUnit should handle menu commands associated with any menu's they are responsible for and send those commands on to their processes and other display comonents as necessary.
A View in the Pamguard MVC can query for a list of PamControlledUnits, the view can then see which have a display, etc and add them to the view.
| Constructor Summary | |
|---|---|
PamControlledUnit(String unitType,
String unitName)
Constructor for a new PamControlledUnit |
|
| Method Summary | |
|---|---|
void |
addOtherRelatedMenuItems(Frame parentFrame,
JMenu menu,
String name)
|
void |
addPamProcess(PamProcess pamProcess)
Adds a PamProcess to the ControlledUnit |
int |
addRelatedMenuItems(Frame parentFrame,
JMenu menu,
String name)
|
boolean |
canClose()
Called before Pamguard shuts down. |
JMenuItem |
createDetectionMenu(Frame parentFrame)
Create a JMenu object containing MenuItems associated with PamProcesses |
JMenuItem |
createDisplayMenu(Frame parentFrame)
Create a JMenu object containing MenuItems associated with the view |
JMenuItem |
createFileMenu(JFrame parentFrame)
|
JMenuItem |
createHelpMenu(Frame parentFrame)
|
int |
getFrameNumber()
Get the number of the frame that side and tab panels for this module should sit on. |
int |
getNumPamProcesses()
Gets the total number of PamProcesses controlled by this Controller |
PamModuleInfo |
getPamModuleInfo()
|
PamProcess |
getPamProcess(int iP)
|
PamView |
getPamView()
|
PamSidePanel |
getSidePanel()
Gets a reference to a small panel to be displayed along the left hand edge of the main tab panel. |
PamTabPanel |
getTabPanel()
Gets a reference to a panel to be added to a view |
JMenuBar |
getTabSpecificMenuBar(Frame parentFrame,
JMenuBar standardMenu,
PamGui pamGui)
Create a tab specific menu to go with this PamControlledUnit. |
String |
getUnitName()
Returns the name of the unit |
String |
getUnitType()
|
boolean |
gotoTab()
|
void |
notifyModelChanged(int changeType)
|
void |
pamHasStopped()
Called for all contorlled units after Pam acquisition has stopped |
void |
pamToStart()
called just before data acquisition starts. |
void |
removePamProcess(PamProcess pamProcess)
Removes a process. |
boolean |
removeUnit()
|
void |
rename(String newName)
|
void |
setFrameNumber(int frameNumber)
|
void |
setPamModuleInfo(PamModuleInfo pamModuleInfo)
|
void |
setPamView(PamView pamView)
|
void |
setSidePanel(PamSidePanel sidePanel)
Sets the side panel for the PamControlledUnit Side panels are shown down the left hand side of the main Pamguard GUI and are always visible, irrespective of which tab is being viewed on the main tabbed display. |
void |
setTabPanel(PamTabPanel tabPanel)
Sets the tab panel for the PamControlledUnit. |
void |
setupControlledUnit()
called for all PamControlledUnits after all units have been created. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PamControlledUnit(String unitType,
String unitName)
unitName - name of unit| Method Detail |
|---|
public PamProcess getPamProcess(int iP)
iP - -
The index of the process
public int getNumPamProcesses()
public void addPamProcess(PamProcess pamProcess)
pamProcess - Reference to a PamProcesspublic boolean removeUnit()
public void rename(String newName)
public void removePamProcess(PamProcess pamProcess)
pamProcess - process to removepublic void notifyModelChanged(int changeType)
public PamTabPanel getTabPanel()
PamTabPanel,
PamSidePanelpublic int getFrameNumber()
public void setFrameNumber(int frameNumber)
public PamSidePanel getSidePanel()
It is possible for a PamControlled unit to have a side panel without having a pamTabPanel.
PamSidePanel,
PamTabPanel
public JMenuBar getTabSpecificMenuBar(Frame parentFrame,
JMenuBar standardMenu,
PamGui pamGui)
Default is to throw back the standard menu to be used. This function should clone the standard menu and then modify the clone (usually by replacing the Display sub menu)
standardMenu - the standard menu for the Pam GUI.
public JMenuItem createDetectionMenu(Frame parentFrame)
parentFrame - The owner frame of the menu
Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.
public JMenuItem createDisplayMenu(Frame parentFrame)
Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.
public void setupControlledUnit()
public void pamToStart()
public void pamHasStopped()
public boolean canClose()
public String getUnitName()
public String getUnitType()
public void addOtherRelatedMenuItems(Frame parentFrame,
JMenu menu,
String name)
public int addRelatedMenuItems(Frame parentFrame,
JMenu menu,
String name)
public boolean gotoTab()
public PamView getPamView()
public void setPamView(PamView pamView)
public JMenuItem createHelpMenu(Frame parentFrame)
public JMenuItem createFileMenu(JFrame parentFrame)
parentFrame - parent frame for the menu
public void setSidePanel(PamSidePanel sidePanel)
Side panels are generally used to display summary information for the PamControlledUnit or to provide quick access controls.
sidePanel - Reference to a PamSidePanel objectPamSidePanelpublic void setTabPanel(PamTabPanel tabPanel)
tabPanel - public PamModuleInfo getPamModuleInfo()
public void setPamModuleInfo(PamModuleInfo pamModuleInfo)
pamModuleInfo - The pamModuleInfo to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||