java.beans.PropertyChangeListener, java.util.EventListener, InteractiveMouseHandler, Renderablepublic class VideoPanel extends InteractivePanel implements java.beans.PropertyChangeListener
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContainerDrawingPanel.ZoomBoxInteractivePanel.IADMouseController| Modifier and Type | Field | Description |
|---|---|---|
boolean |
changed |
set to true when this panel has been changed, false when saved
|
protected ImageCoordSystem |
coords |
|
protected java.io.File |
dataFile |
|
java.lang.String |
defaultFileName |
default file name used for initial saveAs
|
protected static int |
defaultHeight |
|
protected static int |
defaultWidth |
|
protected boolean |
drawingInImageSpace |
|
protected java.util.Map<java.lang.String,java.lang.Class<? extends Filter>> |
filterClasses |
|
protected double |
imageBorder |
|
protected double |
imageHeight |
|
protected double |
imageWidth |
|
protected TextPanel |
messagePanel |
|
protected TextPanel |
mousePanel |
|
protected VideoPlayer |
player |
|
protected boolean |
playerVisible |
|
protected java.awt.geom.Point2D |
pt |
|
protected Video |
video |
|
protected double |
xOffset |
|
protected double |
yOffset |
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTadjustableGutter, antialiasShapeOn, antialiasTextOn, autoscaleItem, autoscaleMargin, autoscaleX, autoscaleXMax, autoscaleXMin, autoscaleY, autoscaleYMax, autoscaleYMin, bgColor, blMessageBox, BOTTOM_LEFT, BOTTOM_RIGHT, bottomGutter, bottomGutterPreferred, brMessageBox, clipAtGutter, coordinateStrBuilder, currentTime, customInspector, decimalFormat, dimensionSetter, drawableList, dxmax, dxmin, dymax, dymin, enableZoom, fixedPixelPerUnit, fixedScale, glassPanel, glassPanelLayout, guiChangeListener, height, imageRatio, leftGutter, leftGutterPreferred, logScaleX, logScaleY, mouseController, offscreenImage, optionController, pixelMatrix, pixelTransform, popupmenu, propertiesItem, RECORD_PAINT_TIMES, refreshDelay, refreshTimer, rightGutter, rightGutterPreferred, scaleItem, scientificFormat, showCoordinates, snapshotItem, squareAspect, tlMessageBox, TOP_LEFT, TOP_RIGHT, topGutter, topGutterPreferred, trMessageBox, vidCap, viewRect, width, workingImage, xceil, xfloor, xLeftMarginPercentage, xmax, xmaxPreferred, xmin, xminPreferred, xPixPerUnit, xRightMarginPercentage, yBottomMarginPercentage, yceil, yfloor, ymax, ymaxPreferred, ymin, yminPreferred, yPixPerUnit, yTopMarginPercentage, zoomBox, zoomCount, zoomDelay, zoomInItem, zoomOutItem, zoomTimerABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHcontainsInteractive, interactive, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, mouseAction, mouseEvent| Constructor | Description |
|---|---|
VideoPanel() |
Constructs a blank VideoPanel with a player.
|
VideoPanel(Video video) |
Constructs a VideoPanel with a video and player.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addDrawable(Drawable drawable) |
Adds a drawable object to the drawable list.
|
void |
addFilter(java.lang.Class<? extends Filter> filterClass) |
Adds a video filter class to the map of available filters.
|
protected boolean |
checkImage() |
Overrides DrawingPanel checkImage method so offscreenImage will not include
the videoPlayer.
|
void |
clear() |
Removes all drawable objects except the video.
|
void |
clearFilters() |
Clears all video filter classes from the map of available filters.
|
ImageCoordSystem |
getCoords() |
Gets the current image coordinate system used for drawing.
|
java.io.File |
getDataFile() |
Gets the file where data is saved.
|
java.util.ArrayList<Drawable> |
getDrawables() |
Overrides DrawingPanel getDrawables method.
|
java.lang.String |
getFilePath() |
Gets the default path for the saveAs method.
|
java.util.Map<java.lang.String,java.lang.Class<? extends Filter>> |
getFilters() |
Gets the map of available video filters.
|
int |
getFrameNumber() |
Gets the current frame number.
|
double |
getImageBorder() |
Gets the image border.
|
double |
getImageHeight() |
Gets the image height in image units (1.0 unit/pixel).
|
double |
getImageWidth() |
Gets the image width in image units.
|
static XML.ObjectLoader |
getLoader() |
Returns an XML.ObjectLoader to save and load data for this object.
|
VideoPlayer |
getPlayer() |
Gets the video player.
|
int |
getStepNumber() |
Gets the current step number.
|
Video |
getVideo() |
Gets the video.
|
java.awt.geom.Point2D |
getWorldMousePoint() |
Gets the world coordinates of the last mouse event
|
XYCoordinateStringBuilder |
getXYCoordinateStringBuilder(TPoint point) |
Gets a XYCoordinateStringBuilder for a TPoint to display its coordinates.
|
void |
hideMouseBox() |
Hides the mouse box
|
DataTrack |
importData(Data data,
java.lang.Object source) |
Imports Data from a source into a DataTrack.
|
boolean |
isDrawingInImageSpace() |
Returns true if this is drawing in image space rather than
world space.
|
boolean |
isPlayerVisible() |
Gets the video player visibility.
|
boolean |
isShowCoordinates() |
Returns true if mouse coordinates are displayed
|
protected void |
paintEverything(java.awt.Graphics g) |
Overrides DrawingPanel paintEverything method.
|
void |
propertyChange(java.beans.PropertyChangeEvent e) |
Responds to property change events.
|
void |
removeDrawable(Drawable drawable) |
Removes a drawable object from the drawable list.
|
void |
removeFilter(java.lang.Class<?> filterClass) |
Removes a video filter class from the map of available filters.
|
<T extends Drawable> |
removeObjectsOfClass(java.lang.Class<T> c) |
Removes all objects of the specified class.
|
protected void |
scale(java.util.ArrayList<Drawable> drawables) |
Overrides DrawingPanel scale method to handle drawing in imagespace
|
void |
setCoords(ImageCoordSystem newCoords) |
Sets the image coordinate system used to convert between
image and world spaces.
|
void |
setDataFile(java.io.File file) |
Sets the file in which data is saved.
|
void |
setDrawingInImageSpace(boolean imagespace) |
Sets the drawing space to imagespace or worldspace.
|
void |
setImageBorder(double borderFraction) |
Sets the image border.
|
void |
setImageHeight(double h) |
Sets the image height in image units (1.0 unit/pixel).
|
void |
setImageWidth(double w) |
Sets the image width in image units.
|
void |
setPlayerVisible(boolean visible) |
Shows or hides the video player.
|
void |
setVideo(Video newVideo) |
Sets the video.
|
void |
setVideo(Video newVideo,
boolean playAllSteps) |
Sets the video.
|
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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, 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, validateTreeactionPerformed, addDrawableAtIndex, addDrawables, addOptionController, buildPopupmenu, checkWorkingImage, computeGutters, enableInspector, findViewRect, getAspectRatio, getBottomGutter, getCoordinateStringBuilder, getDimensionSetter, getDrawables, getGlassPanel, getGutters, getHeight, getImageRatio, getLeftGutter, getMaxPixPerUnit, getMeasure, getObjectOfClass, getPixelMatrix, getPixelTransform, getPopupMenu, getPreferredXMax, getPreferredXMin, getPreferredYMax, getPreferredYMin, getRightGutter, getScale, getTopGutter, getVideoTool, getViewRect, getWidth, getXMax, getXMin, getXPixPerUnit, getYMax, getYMin, getYPixPerUnit, getZoomBox, hasInspector, hideInspector, invalidateImage, isAdjustableGutter, isAntialiasShapeOn, isAntialiasTextOn, isAutoscaleX, isAutoscaleXMax, isAutoscaleXMin, isAutoscaleY, isAutoscaleYMax, isAutoscaleYMin, isBuffered, isClipAtGutter, isFixedScale, isIconified, isLogScaleX, isLogScaleY, isPointInside, isSquareAspect, isValidImage, isZoom, isZoomEvent, limitAutoscaleX, limitAutoscaleY, measure, paint, paintComponent, paintDrawableList, paintFirst, paintLast, pixToX, pixToY, project, recomputeTransform, refreshDecimalSeparators, refreshGUI, removeDrawables, removeOptionController, render, render, replaceDrawable, resetGutters, scale, scaleX, scaleY, setAdjustableGutter, setAntialiasShapeOn, setAntialiasTextOn, setAutoscaleMargin, setAutoscaleX, setAutoscaleY, setBounds, setBounds, setBuffered, setClipAtGutter, setCoordinateStringBuilder, setCustomInspector, setFixedScale, setFontFactor, setFontLevel, setGutters, setGutters, setIgnoreRepaint, setMessage, setMessage, setMouseCursor, setPixelScale, setPixelsPerUnit, setPopupMenu, setPreferredGutters, setPreferredMinMax, setPreferredMinMax, setPreferredMinMaxX, setPreferredMinMaxY, setSquareAspect, setVideoTool, setVisible, setXLeftMarginPercentage, setXMarginPercentage, setXMarginPercentage, setXRightMarginPercentage, setYBottomMarginPercentage, setYMarginPercentage, setYMarginPercentage, setYTopMarginPercentage, setZoom, showInspector, snapshot, validateImage, xToGraphics, xToPix, yToGraphics, yToPix, zoomIn, zoomOutgetCurrentDraggable, getInteractive, getMouseAction, getMouseButton, getMouseClickCount, getMouseIntX, getMouseIntY, getMouseX, getMouseY, handleMouseAction, saveMouseEvent, scaleX, scaleY, setInteractiveMouseHandler, setShowCoordinatesaddAncestorListener, 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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, 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, updateprotected static int defaultWidth
protected static int defaultHeight
public boolean changed
public java.lang.String defaultFileName
protected VideoPlayer player
protected TextPanel mousePanel
protected TextPanel messagePanel
protected Video video
protected boolean playerVisible
protected boolean drawingInImageSpace
protected double imageWidth
protected double imageHeight
protected double xOffset
protected double yOffset
protected double imageBorder
protected ImageCoordSystem coords
protected java.awt.geom.Point2D pt
protected java.io.File dataFile
protected java.util.Map<java.lang.String,java.lang.Class<? extends Filter>> filterClasses
public VideoPanel()
public VideoPanel(Video video)
video - the video to be drawnpublic void setVideo(Video newVideo, boolean playAllSteps)
newVideo - the videoplayAllSteps - true to play all stepspublic void setVideo(Video newVideo)
newVideo - the videopublic Video getVideo()
public double getImageWidth()
public void setImageWidth(double w)
w - the widthpublic double getImageHeight()
public void setImageHeight(double h)
h - the heightpublic double getImageBorder()
public void setImageBorder(double borderFraction)
borderFraction - the border fractionpublic void setCoords(ImageCoordSystem newCoords)
newCoords - the image coordinate systempublic ImageCoordSystem getCoords()
public void setDataFile(java.io.File file)
file - the data filepublic java.io.File getDataFile()
public java.lang.String getFilePath()
public void setDrawingInImageSpace(boolean imagespace)
imagespace - true to draw in imagespacepublic boolean isDrawingInImageSpace()
true if drawing in image spacepublic VideoPlayer getPlayer()
public void setPlayerVisible(boolean visible)
visible - true to show the playerpublic boolean isPlayerVisible()
true if the player is visiblepublic int getStepNumber()
public int getFrameNumber()
public java.util.ArrayList<Drawable> getDrawables()
getDrawables in class DrawingPanelpublic void addDrawable(Drawable drawable)
addDrawable in class InteractivePaneldrawable - the drawable objectpublic void removeDrawable(Drawable drawable)
removeDrawable in class DrawingPaneldrawable - the drawable objectpublic <T extends Drawable> void removeObjectsOfClass(java.lang.Class<T> c)
removeObjectsOfClass in class DrawingPanelc - the class to removeDrawingPanel.removeDrawables(Class c)public void clear()
clear in class InteractivePanelpublic void addFilter(java.lang.Class<? extends Filter> filterClass)
filterClass - the filter class to addpublic void removeFilter(java.lang.Class<?> filterClass)
filterClass - the filter class to removepublic void clearFilters()
public java.util.Map<java.lang.String,java.lang.Class<? extends Filter>> getFilters()
public boolean isShowCoordinates()
true if mouse coordinates are displayedpublic void hideMouseBox()
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - the property change eventpublic DataTrack importData(Data data, java.lang.Object source)
data - the Data to importsource - the data source (may be null)protected void paintEverything(java.awt.Graphics g)
paintEverything in class DrawingPanelg - the graphics context to draw onprotected void scale(java.util.ArrayList<Drawable> drawables)
scale in class DrawingPaneldrawables - the list of drawable objectsprotected boolean checkImage()
true if the image is correctly sizedpublic java.awt.geom.Point2D getWorldMousePoint()
public XYCoordinateStringBuilder getXYCoordinateStringBuilder(TPoint point)
point - the TPointpublic static XML.ObjectLoader getLoader()