Class AnnotatorPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.annotator.AnnotatorPanel
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.gui.core.MenuBarProvider,ImageObserver,MenuContainer,Serializable,Accessible
public class AnnotatorPanel extends adams.gui.core.BasePanel implements adams.gui.core.MenuBarProvider, adams.core.CleanUpHandlerPanel for viewing and annotating videos- Author:
- sjb90
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static StringANNOTATION_SESSION_FILEstatic StringBACKGROUND_SESSION_FILEstatic StringBINDINGS_SESSION_FILEprotected adams.gui.action.AbstractBaseActionm_ActionClearBackgroundclear background actionprotected adams.gui.action.AbstractBaseActionm_ActionEditBindingsEdit Bindings actionprotected adams.gui.action.AbstractBaseActionm_ActionExportAnnotationsExport annotationsprotected adams.gui.action.AbstractBaseActionm_ActionExtractBackgroundextract background actionprotected adams.gui.action.AbstractBaseActionm_ActionLoadBindingsopen bindingsprotected adams.gui.action.AbstractBaseActionm_ActionNewAnnotationsNew annotations actionprotected adams.gui.action.AbstractBaseActionm_ActionNewBindingsNew Bindings action.protected adams.gui.action.AbstractBaseActionm_ActionOpenAnnotationsprotected adams.gui.action.AbstractBaseActionm_ActionOpenBackgroundopen background actionprotected adams.gui.action.AbstractBaseActionm_ActionSaveAnnotationsprotected adams.gui.action.AbstractBaseActionm_ActionSaveBackgroundsave background actionprotected adams.gui.action.AbstractBaseActionm_ActionSaveBindingssave bindingsprotected adams.gui.action.AbstractBaseActionm_ActionViewBackgroundview background actionprotected TrailFileChooserm_AnnotationsFileChooserprotected adams.gui.chooser.ImageFileChooserm_BackgroundFileChooserfile chooser for imagesprotected BufferedImagem_BackgroundImagethe extracted background imageprotected adams.gui.core.BasePanelm_BindingPanela panel for the annotation bindingsprotected List<Binding>m_Bindingsthe list to store the bindingsprotected EditBindingsDialogm_BindingsDialogdialogprotected adams.core.DateFormatm_dateFormatterDate formater for outputing timestampsprotected EventQueuem_EventQueuethe queue that handles binding eventsprotected adams.gui.chooser.SpreadSheetFileChooserm_ExportFileChooserthe file chooser for exporting trails.protected ExtractBackgroundDialogm_ExtractDialogthe dialog for extracting the background imageprotected adams.gui.chooser.BaseFileChooserm_LoadPropertiesFileChooserthe file chooser for saving bindings.protected JMenum_MenuAnnotationLoadRecentAnnotationsrecent files menu for Annotationsprotected JMenum_MenuBackgroundLoadRecentBackgroundrecent files menu for backgroundsprotected JMenuBarm_MenuBarmenu badprotected JMenum_MenuFileLoadRecentBindingsrecent bindings menuprotected JMenum_MenuFileLoadRecentVideosrecent files menu for videosprotected JMenuItemm_MenuItemAnnotationsOpenprotected JMenuItemm_MenuItemBackgroundExtractmenu item for background extractprotected JMenuItemm_MenuItemBackgroundSaveAsmenu item for background save asprotected JMenuItemm_MenuItemBackgroundViewmenu item for background viewprotected JMenuItemm_MenuItemFileOpenmenu item for 'open'protected JMenuItemm_MenuItemVideoClosefor closing the programprotected adams.gui.core.RecentFilesHandler<JMenu>m_RecentAnnotationsHandlerRecent file handler for Annotationsprotected adams.gui.core.RecentFilesHandler<JMenu>m_RecentBackgroundHandlerRecent file handler for backgroundsprotected adams.gui.core.RecentFilesHandler<JMenu>m_RecentBindingsHandlerhandler for recent bindingsprotected adams.gui.core.RecentFilesHandler<JMenu>m_RecentVideosHandlerRecent file handler for videosprotected adams.gui.chooser.BaseFileChooserm_SavePropertiesFileChooserthe file chooser for saving bindings.protected Tickerm_Tickerthe ticker that takes care of toggleable bindignsprotected adams.gui.core.TitleGeneratorm_TitleGeneratora title generatorprotected VLCjDirectRenderPanelm_VideoPlayera video player panelstatic StringVIDEO_SESSION_FILE-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description AnnotatorPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()protected voidclearBackground()Clears the current background.protected voidclose()Closes the dialog, if possible.voideditBindings()Pops up dialog for editing bindingsvoidexport()Exports the current trail to a spreadsheet file that the user selects.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).protected voidinitActions()for initializing actionsprotected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.voidloadBindings()Loads bindings from a file selected by the uservoidloadBindings(String bindingPath)Loads bindings from a file selected by the uservoidnewBindings()Resets the bindings.protected voidopenAnnotations()Loads annotations from a trail fileprotected voidopenAnnotations(adams.core.io.PlaceholderFile file)Loads annotations from a trail fileprotected voidopenBackground()loads a background from a fileprotected voidopenBackground(adams.core.io.PlaceholderFile file)protected voidresetBindingBar()protected voidsaveAnnotations()Saves the current annotation to a trail fileprotected voidsaveBackground()Saves the background to the selected filevoidsaveBindings()Saves the current bindings to a file selected by the uservoidsetTitle(String value)Sets the base title to use for the title generator.protected voidupdate()Updates title and menu items.protected voidupdateBindingBar()Updates the binding bar to contain an indicator for every bindingprotected voidupdateMenu()Updates the state of the menu items.protected voidupdateTitle()Updates the title of the dialog.protected voidviewBackground()shows the current background image in a dialog-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
VIDEO_SESSION_FILE
public static final String VIDEO_SESSION_FILE
- See Also:
- Constant Field Values
-
BINDINGS_SESSION_FILE
public static final String BINDINGS_SESSION_FILE
- See Also:
- Constant Field Values
-
ANNOTATION_SESSION_FILE
public static final String ANNOTATION_SESSION_FILE
- See Also:
- Constant Field Values
-
BACKGROUND_SESSION_FILE
public static final String BACKGROUND_SESSION_FILE
- See Also:
- Constant Field Values
-
m_TitleGenerator
protected adams.gui.core.TitleGenerator m_TitleGenerator
a title generator
-
m_VideoPlayer
protected VLCjDirectRenderPanel m_VideoPlayer
a video player panel
-
m_BindingPanel
protected adams.gui.core.BasePanel m_BindingPanel
a panel for the annotation bindings
-
m_BindingsDialog
protected EditBindingsDialog m_BindingsDialog
dialog
-
m_MenuBar
protected JMenuBar m_MenuBar
menu bad
-
m_MenuItemFileOpen
protected JMenuItem m_MenuItemFileOpen
menu item for 'open'
-
m_RecentVideosHandler
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentVideosHandler
Recent file handler for videos
-
m_MenuFileLoadRecentVideos
protected JMenu m_MenuFileLoadRecentVideos
recent files menu for videos
-
m_RecentAnnotationsHandler
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentAnnotationsHandler
Recent file handler for Annotations
-
m_MenuAnnotationLoadRecentAnnotations
protected JMenu m_MenuAnnotationLoadRecentAnnotations
recent files menu for Annotations
-
m_RecentBackgroundHandler
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentBackgroundHandler
Recent file handler for backgrounds
-
m_MenuBackgroundLoadRecentBackground
protected JMenu m_MenuBackgroundLoadRecentBackground
recent files menu for backgrounds
-
m_MenuItemVideoClose
protected JMenuItem m_MenuItemVideoClose
for closing the program
-
m_ActionNewBindings
protected adams.gui.action.AbstractBaseAction m_ActionNewBindings
New Bindings action.
-
m_ActionEditBindings
protected adams.gui.action.AbstractBaseAction m_ActionEditBindings
Edit Bindings action
-
m_ActionNewAnnotations
protected adams.gui.action.AbstractBaseAction m_ActionNewAnnotations
New annotations action
-
m_ActionOpenAnnotations
protected adams.gui.action.AbstractBaseAction m_ActionOpenAnnotations
-
m_MenuItemAnnotationsOpen
protected JMenuItem m_MenuItemAnnotationsOpen
-
m_ActionSaveAnnotations
protected adams.gui.action.AbstractBaseAction m_ActionSaveAnnotations
-
m_ActionExtractBackground
protected adams.gui.action.AbstractBaseAction m_ActionExtractBackground
extract background action
-
m_ActionExportAnnotations
protected adams.gui.action.AbstractBaseAction m_ActionExportAnnotations
Export annotations
-
m_ActionSaveBindings
protected adams.gui.action.AbstractBaseAction m_ActionSaveBindings
save bindings
-
m_ActionLoadBindings
protected adams.gui.action.AbstractBaseAction m_ActionLoadBindings
open bindings
-
m_dateFormatter
protected adams.core.DateFormat m_dateFormatter
Date formater for outputing timestamps
-
m_ExportFileChooser
protected adams.gui.chooser.SpreadSheetFileChooser m_ExportFileChooser
the file chooser for exporting trails.
-
m_SavePropertiesFileChooser
protected adams.gui.chooser.BaseFileChooser m_SavePropertiesFileChooser
the file chooser for saving bindings.
-
m_LoadPropertiesFileChooser
protected adams.gui.chooser.BaseFileChooser m_LoadPropertiesFileChooser
the file chooser for saving bindings.
-
m_EventQueue
protected EventQueue m_EventQueue
the queue that handles binding events
-
m_RecentBindingsHandler
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentBindingsHandler
handler for recent bindings
-
m_MenuFileLoadRecentBindings
protected JMenu m_MenuFileLoadRecentBindings
recent bindings menu
-
m_Ticker
protected Ticker m_Ticker
the ticker that takes care of toggleable bindigns
-
m_AnnotationsFileChooser
protected TrailFileChooser m_AnnotationsFileChooser
-
m_ExtractDialog
protected ExtractBackgroundDialog m_ExtractDialog
the dialog for extracting the background image
-
m_BackgroundImage
protected BufferedImage m_BackgroundImage
the extracted background image
-
m_ActionClearBackground
protected adams.gui.action.AbstractBaseAction m_ActionClearBackground
clear background action
-
m_ActionOpenBackground
protected adams.gui.action.AbstractBaseAction m_ActionOpenBackground
open background action
-
m_ActionSaveBackground
protected adams.gui.action.AbstractBaseAction m_ActionSaveBackground
save background action
-
m_ActionViewBackground
protected adams.gui.action.AbstractBaseAction m_ActionViewBackground
view background action
-
m_BackgroundFileChooser
protected adams.gui.chooser.ImageFileChooser m_BackgroundFileChooser
file chooser for images
-
m_MenuItemBackgroundExtract
protected JMenuItem m_MenuItemBackgroundExtract
menu item for background extract
-
m_MenuItemBackgroundSaveAs
protected JMenuItem m_MenuItemBackgroundSaveAs
menu item for background save as
-
m_MenuItemBackgroundView
protected JMenuItem m_MenuItemBackgroundView
menu item for background view
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classadams.gui.core.BasePanel
-
initActions
protected void initActions()
for initializing actions
-
viewBackground
protected void viewBackground()
shows the current background image in a dialog
-
openBackground
protected void openBackground()
loads a background from a file
-
openBackground
protected void openBackground(adams.core.io.PlaceholderFile file)
-
saveBackground
protected void saveBackground()
Saves the background to the selected file
-
clearBackground
protected void clearBackground()
Clears the current background.
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUIin classadams.gui.core.BasePanel
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBarin interfaceadams.gui.core.MenuBarProvider- Returns:
- the menu bar
-
update
protected void update()
Updates title and menu items.
-
updateTitle
protected void updateTitle()
Updates the title of the dialog.
-
updateMenu
protected void updateMenu()
Updates the state of the menu items.
-
cleanUp
public void cleanUp()
- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler
-
updateBindingBar
protected void updateBindingBar()
Updates the binding bar to contain an indicator for every binding
-
resetBindingBar
protected void resetBindingBar()
-
setTitle
public void setTitle(String value)
Sets the base title to use for the title generator.- Parameters:
value- the title to use- See Also:
m_TitleGenerator
-
close
protected void close()
Closes the dialog, if possible.
-
newBindings
public void newBindings()
Resets the bindings.
-
editBindings
public void editBindings()
Pops up dialog for editing bindings
-
export
public void export()
Exports the current trail to a spreadsheet file that the user selects.
-
loadBindings
public void loadBindings()
Loads bindings from a file selected by the user
-
saveAnnotations
protected void saveAnnotations()
Saves the current annotation to a trail file
-
openAnnotations
protected void openAnnotations()
Loads annotations from a trail file
-
openAnnotations
protected void openAnnotations(adams.core.io.PlaceholderFile file)
Loads annotations from a trail file
-
loadBindings
public void loadBindings(String bindingPath)
Loads bindings from a file selected by the user
-
saveBindings
public void saveBindings()
Saves the current bindings to a file selected by the user
-
-