|
||||||||||
| 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.
| Field Summary | |
|---|---|
private int |
frameNumber
|
protected boolean |
isViewer
|
private PamController |
pamController
|
private PamModuleInfo |
pamModuleInfo
|
private java.util.ArrayList<PamProcess> |
pamProcesses
List of PamProcesses in this unit |
private PamView |
pamView
|
private PamSidePanel |
sidePanel
Optional additional graphics component to be displayed to the left of the main tab panel control. |
private ClipboardCopier |
tabClipCopier
clipboard copier to go with tabPanel; |
private PamTabPanel |
tabPanel
Reference to a PamTabPanel containing informaton on how to set up a display relevant to the processes in this unit. |
private java.lang.String |
unitName
unitName and unitType are used to identify each PamControlledUnit. |
private java.lang.String |
unitType
unitName and unitType are used to identify each PamControlledUnit. |
| Constructor Summary | |
|---|---|
PamControlledUnit(java.lang.String unitType,
java.lang.String unitName)
Constructor for a new PamControlledUnit |
|
| Method Summary | |
|---|---|
void |
addOtherRelatedMenuItems(java.awt.Frame parentFrame,
javax.swing.JMenu menu,
java.lang.String name)
|
void |
addPamProcess(PamProcess pamProcess)
Adds a PamProcess to the ControlledUnit |
int |
addRelatedMenuItems(java.awt.Frame parentFrame,
javax.swing.JMenu menu,
java.lang.String name)
|
boolean |
canClose()
Called before Pamguard shuts down. |
javax.swing.JMenuItem |
createDetectionMenu(java.awt.Frame parentFrame)
Create a JMenu object containing MenuItems associated with PamProcesses |
javax.swing.JMenuItem |
createDisplayMenu(java.awt.Frame parentFrame)
Create a JMenu object containing MenuItems associated with the view |
javax.swing.JMenuItem |
createFileMenu(javax.swing.JFrame parentFrame)
|
javax.swing.JMenuItem |
createHelpMenu(java.awt.Frame parentFrame)
|
boolean |
fillXMLElement(org.w3c.dom.Document doc,
org.w3c.dom.Element moduleData)
Fill an XML element with data about this module. |
protected boolean |
fillXMLParameters(org.w3c.dom.Document doc,
org.w3c.dom.Element paramsEl)
Add Module specific XML data. |
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 |
PamController |
getPamController()
|
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. |
ClipboardCopier |
getTabClipCopier()
|
PamTabPanel |
getTabPanel()
Gets a reference to a panel to be added to a view |
javax.swing.JMenuBar |
getTabSpecificMenuBar(java.awt.Frame parentFrame,
javax.swing.JMenuBar standardMenu,
PamGui pamGui)
Create a tab specific menu to go with this PamControlledUnit. |
java.lang.String |
getUnitName()
Returns the name of the unit |
java.lang.String |
getUnitType()
|
boolean |
gotoTab()
|
void |
notifyArrayChanged()
Called whenever the array configuration dialog has been called. |
void |
notifyModelChanged(int changeType)
General notification when the PAMGAURD model changes. |
void |
pamHasStopped()
Called for all controlled 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(java.lang.String newName)
|
void |
saveViewerData()
Save data (to binary files and to database) in viewer mode. |
void |
setFrameNumber(int frameNumber)
|
void |
setPamController(PamController pamController)
|
void |
setPamModuleInfo(PamModuleInfo pamModuleInfo)
|
void |
setPamView(PamView pamView)
Called whenever the frme of a PamControlledunit changes (including at program startup). |
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. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private PamController pamController
private java.util.ArrayList<PamProcess> pamProcesses
private PamTabPanel tabPanel
private ClipboardCopier tabClipCopier
private PamSidePanel sidePanel
private java.lang.String unitType
private java.lang.String unitName
private PamView pamView
private PamModuleInfo pamModuleInfo
protected boolean isViewer
private int frameNumber
| Constructor Detail |
|---|
public PamControlledUnit(java.lang.String unitType,
java.lang.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(java.lang.String newName)
public void removePamProcess(PamProcess pamProcess)
pamProcess - process to removepublic void notifyModelChanged(int changeType)
changeType - type of changepublic void notifyArrayChanged()
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 javax.swing.JMenuBar getTabSpecificMenuBar(java.awt.Frame parentFrame,
javax.swing.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 javax.swing.JMenuItem createDetectionMenu(java.awt.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 javax.swing.JMenuItem createDisplayMenu(java.awt.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 java.lang.String getUnitName()
public java.lang.String getUnitType()
public void addOtherRelatedMenuItems(java.awt.Frame parentFrame,
javax.swing.JMenu menu,
java.lang.String name)
public int addRelatedMenuItems(java.awt.Frame parentFrame,
javax.swing.JMenu menu,
java.lang.String name)
public boolean gotoTab()
public PamView getPamView()
public void setPamView(PamView pamView)
pamView - public javax.swing.JMenuItem createHelpMenu(java.awt.Frame parentFrame)
public javax.swing.JMenuItem createFileMenu(javax.swing.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.public ClipboardCopier getTabClipCopier()
public PamController getPamController()
public void setPamController(PamController pamController)
pamController - the pamController to setpublic java.lang.String toString()
toString in class java.lang.Objectpublic void saveViewerData()
This gets called automatically on system exit and can also be called from the file menu.
public final boolean fillXMLElement(org.w3c.dom.Document doc,
org.w3c.dom.Element moduleData)
this is expected to only include parameters which are required for real time data collection on remote platforms using a stand alone, no GUI pamguard version.
doc - moduleData - XML element to fill.
protected boolean fillXMLParameters(org.w3c.dom.Document doc,
org.w3c.dom.Element paramsEl)
this will generally be the place where most modules set their xml settings data.
doc - paramsEl -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||