public abstract class VideoBarVisualisation extends TimelineObjectAdapter<Video<MBFImage>> implements AnimatedVisualisationProvider
This class will process the data in a separate thread. Obviously, it's not sensible to call this class with a "live" data stream, such as from a VideoCapture object.
Modifier and Type | Class and Description |
---|---|
class |
VideoBarVisualisation.VideoTimelineMarker
A marker for marking data frames within the data bar
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected int |
audioHeight
The height to plot the audio
|
protected Float[] |
barColour
The background colour of the bar
|
protected int |
nFrame
The frame being processed
|
protected long |
nFrames
Number of frames in the data in total
|
protected VideoBarVisualisation.VideoTimelineMarker |
processingMarker
The marker that's used for processing progress
|
endTime, pixelTransformer, startTime
clearBeforeDraw, data, visImage
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
protected |
VideoBarVisualisation(Video<MBFImage> video) |
Modifier and Type | Method and Description |
---|---|
void |
addAnimatedVisualisationListener(AnimatedVisualisationListener avl)
Add a visualisation listener to be informed of animation events.
|
protected void |
fireAnimationEvent()
Fire an event to say a new vis update is available
|
Float[] |
getBarColour() |
long |
getEndTimeMilliseconds()
Returns the end time of the timeline object in the timeline.
|
protected double |
getTimePosition(int nFrame)
Returns the position of the given frame at the scale of the current
display.
|
protected double |
getTimePosition(Timecode t)
Returns the position of the given timecode at the scale of the current
display.
|
Video<MBFImage> |
getVideo()
Return the data being shown by this bar.
|
abstract void |
processFrame(MBFImage frame,
Timecode t)
Process a particular frame of the data.
|
void |
processVideo()
Begin processing the data in a separate thread.
|
void |
removeAnimatedVisualisationListener(AnimatedVisualisationListener avl)
Remove a given listener from being informed of animation events.
|
void |
setBarColour(Float[] barColour) |
void |
update()
If you override this method, you should call it at the end of your
own implementation.
|
getStartTimeMilliseconds, setDataPixelTransformer, setStartTimeMilliseconds
addOverlay, componentHidden, componentMoved, componentResized, componentShown, getRequiredSize, getVisualisationImage, isAllowResize, newVisualisationAvailable, paint, removeOverlay, setAllowResize, setClearBeforeDraw, setData, setRequiredSize, showWindow, update, updateVis, updateVis
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, 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, setVisible, unregisterKeyboardAction
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getVisualisationImage, setRequiredSize, updateVis
getPreferredSize, getRequiredSize
protected final int audioHeight
protected long nFrames
protected VideoBarVisualisation.VideoTimelineMarker processingMarker
protected int nFrame
protected VideoBarVisualisation(Video<MBFImage> video)
data
- public abstract void processFrame(MBFImage frame, Timecode t)
frame
- The frame to processt
- The timecode.public void processVideo()
protected void fireAnimationEvent()
public Float[] getBarColour()
public void setBarColour(Float[] barColour)
barColour
- the barColour to setpublic Video<MBFImage> getVideo()
protected double getTimePosition(Timecode t)
t
- the timecode for which to give the position.protected double getTimePosition(int nFrame)
nFrame
- The frame indexpublic long getEndTimeMilliseconds()
getEndTimeMilliseconds
in interface TimelineObject
getEndTimeMilliseconds
in class TimelineObjectAdapter<Video<MBFImage>>
TimelineObjectAdapter.getEndTimeMilliseconds()
public void addAnimatedVisualisationListener(AnimatedVisualisationListener avl)
addAnimatedVisualisationListener
in interface AnimatedVisualisationProvider
avl
- The listener to addAnimatedVisualisationProvider.addAnimatedVisualisationListener(org.openimaj.vis.AnimatedVisualisationListener)
public void removeAnimatedVisualisationListener(AnimatedVisualisationListener avl)
removeAnimatedVisualisationListener
in interface AnimatedVisualisationProvider
avl
- The listener to removeAnimatedVisualisationProvider.removeAnimatedVisualisationListener(org.openimaj.vis.AnimatedVisualisationListener)
public void update()
visImage
member to be available and of the correct size.
The method simply needs to draw the visualisation to this MBFImage
.
You should wrap any drawing code in a synchronized block, synchronized on
the visImage - this stops the image being repainted to the screen half way
through drawing.
Update is called from the paint() method so should ideally not force a repaint() as this will call a continuous repaint loop.
update
in class VisualisationImpl<Video<MBFImage>>
VisualisationImpl.update()