Package annotation.handler
Class OneStopAnnotationHandler
java.lang.Object
annotation.handler.AnnotationHandler
annotation.handler.AnnotationChoiceHandler
annotation.handler.OneStopAnnotationHandler
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
- Direct Known Subclasses:
ManualAnnotationHandler
public abstract class OneStopAnnotationHandler
extends AnnotationChoiceHandler
implements PamSettings
Annotation manager that should be able to do absolutely everything (almost) self contained
within itself without having to add about 4 different functions to it's parent controller or process
- Author:
- dg50
-
Constructor Summary
ConstructorDescriptionOneStopAnnotationHandler
(SettingsNameProvider settingsNameProvider, PamDataBlock<PamDataUnit> pamDataBlock) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check that logging on the datablock is all set up for the current annotation selectionabstract void
Add some annotation types for the annotation handlergetDialogMenuItem
(Window window) Get a standard menu item for showing the Annotation dialog.getDialogMenuItem
(Window window, String menuName) Get a standard menu item for showing the Annotation dialog.long
boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) boolean
showDialog
(Window window) This can be used to open annotation choice information in it's own dialogMethods inherited from class annotation.handler.AnnotationChoiceHandler
addSQLLogging, createAnnotationEditMenu, getNumUsedAnnotationTypes, getSelectionPanel, getUsedAnnotationTypes, loadAnnotationChoices, updateAnnotation
Methods inherited from class annotation.handler.AnnotationHandler
addAnnotation, addAnnotations, addAnnotationSqlAddons, addAnnotationType, annotateDataUnit, findAnnotationType, findAnnotationTypeFromCode, getAnnotationMenuItems, getAvailableAnnotationTypes, removeAnnotation, removeAnnotations, removeAnnotationType, updateAnnotations
-
Constructor Details
-
OneStopAnnotationHandler
public OneStopAnnotationHandler(SettingsNameProvider settingsNameProvider, PamDataBlock<PamDataUnit> pamDataBlock)
-
-
Method Details
-
createAnnotationTypes
public abstract void createAnnotationTypes()Add some annotation types for the annotation handler -
getAnnotationChoices
- Specified by:
getAnnotationChoices
in classAnnotationChoiceHandler
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
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
-
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
-
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.
-
showDialog
This can be used to open annotation choice information in it's own dialogan alternative is to call getSelectionPanel() and incorporate it into a greater dialog, but if you do, you must call checkSQLLogging after the dialog closes.
- Parameters:
window
-- Returns:
- true if dialog selected OK (not cancelled)
-
getDialogMenuItem
Get a standard menu item for showing the Annotation dialog.- Parameters:
window
-- Returns:
- menu item
-
getDialogMenuItem
Get a standard menu item for showing the Annotation dialog.- Parameters:
window
-menuName
- String name for the menu item- Returns:
- menu item
-
checkSQLLogging
public void checkSQLLogging()Check that logging on the datablock is all set up for the current annotation selection
-