Class TrackerPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, Scrollable, InteractiveMouseHandler, OSPRuntime.Disposable, Renderable

public class TrackerPanel extends VideoPanel implements Scrollable
This extends VideoPanel to manage and draw TTracks. It is Tracker's main view and repository of a video and its associated tracks.
Author:
Douglas Brown
See Also:
  • Field Details

    • PROPERTY_TRACKERPANEL_CLEAR

      public static final String PROPERTY_TRACKERPANEL_CLEAR
      See Also:
    • PROPERTY_TRACKERPANEL_IMAGE

      public static final String PROPERTY_TRACKERPANEL_IMAGE
      See Also:
    • PROPERTY_TRACKERPANEL_LOADED

      public static final String PROPERTY_TRACKERPANEL_LOADED
      See Also:
    • PROPERTY_TRACKERPANEL_MAGNIFICATION

      public static final String PROPERTY_TRACKERPANEL_MAGNIFICATION
      See Also:
    • PROPERTY_TRACKERPANEL_SELECTEDPOINT

      public static final String PROPERTY_TRACKERPANEL_SELECTEDPOINT
      See Also:
    • PROPERTY_TRACKERPANEL_SELECTEDTRACK

      public static final String PROPERTY_TRACKERPANEL_SELECTEDTRACK
      See Also:
    • PROPERTY_TRACKERPANEL_SIZE

      public static final String PROPERTY_TRACKERPANEL_SIZE
      See Also:
    • PROPERTY_TRACKERPANEL_STEPNUMBER

      public static final String PROPERTY_TRACKERPANEL_STEPNUMBER
      See Also:
    • PROPERTY_TRACKERPANEL_TRACK

      public static final String PROPERTY_TRACKERPANEL_TRACK
      See Also:
    • PROPERTY_TRACKERPANEL_UNITS

      public static final String PROPERTY_TRACKERPANEL_UNITS
      See Also:
    • PROPERTY_TRACKERPANEL_VIDEO

      public static final String PROPERTY_TRACKERPANEL_VIDEO
      See Also:
    • PROPERTY_TRACKERPANEL_VIDEOVISIBLE

      public static final String PROPERTY_TRACKERPANEL_VIDEOVISIBLE
      See Also:
    • MIN_ZOOM

      public static final double MIN_ZOOM
      The minimum zoom level
      See Also:
    • MAX_ZOOM

      public static final double MAX_ZOOM
      The maximum zoom level
      See Also:
    • ZOOM_STEP

      public static final double ZOOM_STEP
      The zoom step size
    • ZOOM_LEVELS

      public static final double[] ZOOM_LEVELS
      The fixed zoom levels
    • STICK

      public static final String STICK
      Calibration tool types
      See Also:
    • TAPE

      public static final String TAPE
      Calibration tool types
      See Also:
    • CALIBRATION

      public static final String CALIBRATION
      Calibration tool types
      See Also:
    • OFFSET

      public static final String OFFSET
      Calibration tool types
      See Also:
    • frame

      protected TFrame frame
    • panelID

      protected Integer panelID
      a unique identifier for this TrackerPanel
    • selectedPoint

      protected TPoint selectedPoint
    • selectedStep

      protected Step selectedStep
    • selectingPanelID

      protected Integer selectingPanelID
    • selectedTrack

      protected TTrack selectedTrack
    • newlyMarkedPoint

      protected TPoint newlyMarkedPoint
    • dirty

      protected Rectangle dirty
    • prevPixelTransform

      protected AffineTransform prevPixelTransform
    • zoom

      protected double zoom
    • scrollPane

      protected JScrollPane scrollPane
    • enabled

      protected Set<String> enabled
    • snapPoint

      protected TPoint snapPoint
    • currentState

      protected XMLControl currentState
    • currentCoords

      protected XMLControl currentCoords
    • currentSteps

      protected XMLControl currentSteps
    • pointState

      protected TPoint pointState
    • mouseHandler

      protected TMouseHandler mouseHandler
    • badNameLabel

      protected JLabel badNameLabel
    • dataBuilder

      protected TrackDataBuilder dataBuilder
    • dataToolVisible

      protected boolean dataToolVisible
    • customViewsProperty

      protected XMLProperty customViewsProperty
    • selectedViewsProperty

      protected XMLProperty selectedViewsProperty
    • selectedViewTypesProperty

      protected XMLProperty selectedViewTypesProperty
    • selectedTrackViewsProperty

      protected XMLProperty selectedTrackViewsProperty
    • dividerLocs

      protected double[] dividerLocs
    • zoomCenter

      protected Point zoomCenter
    • visibleFilters

      protected Map<Filter,Point> visibleFilters
    • trackControlX

      protected int trackControlX
    • trackControlY

      protected int trackControlY
    • infoX

      protected int infoX
    • infoY

      protected int infoY
    • defaultSavePath

      protected String defaultSavePath
    • openedFromPath

      protected String openedFromPath
    • modelBuilder

      protected ModelBuilder modelBuilder
    • trackControl

      protected TrackControl trackControl
    • isModelBuilderVisible

      protected boolean isModelBuilderVisible
    • isShiftKeyDown

      protected boolean isShiftKeyDown
    • isControlKeyDown

      protected boolean isControlKeyDown
    • isEnterKeyDown

      protected boolean isEnterKeyDown
    • isAutoPaste

      protected boolean isAutoPaste
    • calibrationTools

      protected ArrayList<TTrack> calibrationTools
      changeable TapeMeasure, Calibration, OffsetOrigin
    • visibleCalibrationTools

      protected Set<TTrack> visibleCalibrationTools
    • measuringTools

      protected Set<TTrack> measuringTools
    • visibleMeasuringTools

      protected Set<TTrack> visibleMeasuringTools
    • author

      protected String author
    • contact

      protected String contact
    • autoTracker

      protected AutoTracker autoTracker
    • algorithmDialog

      protected DerivativeAlgorithmDialog algorithmDialog
    • attachmentDialog

      protected AttachmentDialog attachmentDialog
    • guestsDialog

      protected PlotGuestDialog guestsDialog
    • unitsDialog

      protected UnitsDialog unitsDialog
    • pasteDataDialog

      protected PasteDataDialog pasteDataDialog
    • isNotesVisible

      protected boolean isNotesVisible
    • supplementalFilePaths

      protected TreeSet<String> supplementalFilePaths
    • pageViewFilePaths

      protected Map<String,String> pageViewFilePaths
    • selectedSteps

      protected StepSet selectedSteps
    • hideDescriptionWhenLoaded

      protected boolean hideDescriptionWhenLoaded
    • massParamListener

      protected PropertyChangeListener massParamListener
    • massChangeListener

      protected PropertyChangeListener massChangeListener
    • formatPatterns

      protected TreeMap<String,String>[] formatPatterns
    • lengthUnit

      protected String lengthUnit
    • massUnit

      protected String massUnit
    • unitsVisible

      protected boolean unitsVisible
    • coordStringBuilder

      protected TCoordinateStringBuilder coordStringBuilder
    • andWorld

      protected ArrayList<Integer> andWorld
    • dividerFractions

      protected double[] dividerFractions
    • numberFormatDialog

      public NumberFormatDialog numberFormatDialog
    • title

      protected String title
  • Constructor Details

    • TrackerPanel

      public TrackerPanel()
      Constructs a blank TrackerPanel with a player. We need a frame - at the very least, new TFrame()
    • TrackerPanel

      public TrackerPanel(boolean ignored)
    • TrackerPanel

      public TrackerPanel(TFrame frame)
      Constructs a blank TrackerPanel with a player and GUI.
    • TrackerPanel

      public TrackerPanel(TFrame frame, Video video)
      Constructs a TrackerPanel with a video and player.
      Parameters:
      video - the video
    • TrackerPanel

      public TrackerPanel(TFrame frame, TrackerPanel panel)
    • TrackerPanel

      public TrackerPanel(TFrame frame, Video video, TrackerPanel panel)
      load with video -- not supported
      Parameters:
      frame -
      video -
      panel -
  • Method Details

    • getID

      public Integer getID()
    • setTFrame

      public void setTFrame(TFrame frame)
    • isWorldPanel

      public boolean isWorldPanel()
    • getActions

      public Map<String,AbstractAction> getActions()
    • setGUI

      protected void setGUI()
    • addVideoPlayer

      protected void addVideoPlayer()
      Overrides:
      addVideoPlayer in class VideoPanel
    • setMouseListeners

      protected void setMouseListeners()
      Overrides:
      setMouseListeners in class InteractivePanel
    • setVideo

      public void setVideo(Video newVideo)
      Overrides VideoPanel setVideo method.
      Overrides:
      setVideo in class VideoPanel
      Parameters:
      newVideo - the video; may be null
    • getTitle

      public String getTitle()
      Gets the title for tabs, menus, etc.
      Returns:
      the title
    • getToolTipPath

      public String getToolTipPath()
      Gets the path used as tooltip for the tab.
      Returns:
      the path
    • getDescription

      public String getDescription()
      Gets the description of this panel.
      Returns:
      the description
    • setDescription

      public void setDescription(String desc)
      Sets the description of this panel.
      Parameters:
      desc - a description
    • getModelBuilder

      public ModelBuilder getModelBuilder()
      Gets the model builder.
      Returns:
      the model builder
    • addDirtyRegion

      public void addDirtyRegion(Rectangle dirtyRect)
      Adds the specified rectangle to the dirty region. The dirty region is repainted when repaintDirtyRegion is called. A null dirtyRect argument is ignored.
      Parameters:
      dirtyRect - the dirty rectangle
    • repaintDirtyRegion

      public void repaintDirtyRegion()
      Repaints the dirty region.
    • getTracks

      public ArrayList<TTrack> getTracks()
      Gets a list of TTracks being drawn on this panel.
      Returns:
      a list of tracks
    • getTracksTemp

      public ArrayList<TTrack> getTracksTemp()
      Gets a list of TTracks being drawn on this panel.
      Returns:
      a list of tracks
    • getUserTracks

      public ArrayList<TTrack> getUserTracks()
      Gets the list of user-controlled TTracks on this panel.
      Returns:
      a list of tracks under direct user control
    • getExportableTracks

      public ArrayList<TTrack> getExportableTracks()
      Gets the list of TTracks with exportable data on this panel.
      Returns:
      a list of tracks with exportable data
    • getTracksToSave

      public ArrayList<TTrack> getTracksToSave()
      Gets the list of TTracks to save with this panel.
      Returns:
      a list of tracks to save
    • getTrack

      public TTrack getTrack(String name)
    • getTrack

      public TTrack getTrack(String name, ArrayList<TTrack> list)
      Gets the first track with the specified name
      Parameters:
      name - the name of the track
      Returns:
      the track
    • addTrack

      public void addTrack(TTrack track)
      Adds a track.
      Parameters:
      track - the track to add
    • isTrackViewDisplayed

      protected boolean isTrackViewDisplayed(TTrack track)
      Determines if the specified track is currently displayed in a table or plot view.
      Parameters:
      track - the track
      Returns:
      true if displayed in a plot or table view
    • createFunctionPanel

      protected FunctionPanel createFunctionPanel(TTrack track)
      Creates a new FunctionPanel for a track.
      Parameters:
      track - the track
      Returns:
      the FunctionPanel
    • removePointMassListeners

      public void removePointMassListeners(PointMass pointMass)
    • removeTrack

      public void removeTrack(TTrack track)
      Removes a track.
      Parameters:
      track - the track to remove
    • containsTrack

      public boolean containsTrack(TTrack track)
      Determines if the specified track is in this tracker panel.
      Parameters:
      track - the track to look for
      Returns:
      true if this contains the track
    • eraseAll

      public void eraseAll()
      Erases all tracks in this tracker panel.
    • askSaveIfChanged

      public void askSaveIfChanged(Function<Boolean,Void> whenClosed, Runnable whenCanceled)
      Saves this TrackerPanel if changed, then runs the appropriate Runnable
    • getDrawables

      public ArrayList<Drawable> getDrawables()
      Overrides VideoPanel getDrawables method.
      Overrides:
      getDrawables in class VideoPanel
      Returns:
      a list of Drawable objects
    • getSystemDrawables

      public ArrayList<Drawable> getSystemDrawables()
      Gets the list of system Drawables.
      Returns:
      a list of Drawable objects
    • addDrawable

      public void addDrawable(Drawable drawable)
      Overrides VideoPanel addDrawable method.
      Overrides:
      addDrawable in class VideoPanel
      Parameters:
      drawable - the drawable object
    • moveToBack

      public void moveToBack(Drawable drawable)
      Moves a drawable behind all others except the video.
      Parameters:
      drawable - the drawable object
    • removeDrawable

      public void removeDrawable(Drawable drawable)
      Overrides VideoPanel removeDrawable method.
      Overrides:
      removeDrawable in class VideoPanel
      Parameters:
      drawable - the drawable object
    • removeObjectsOfClass

      public <T extends Drawable> void removeObjectsOfClass(Class<T> c)
      Overrides VideoPanel removeObjectsOfClass method.
      Overrides:
      removeObjectsOfClass in class VideoPanel
      Parameters:
      c - the class to remove
      See Also:
    • clear

      public void clear()
      Overrides VideoPanel clear method.
      Overrides:
      clear in class VideoPanel
    • clearTracks

      public void clearTracks()
      Clears all tracks.
    • setCoords

      public void setCoords(ImageCoordSystem _coords)
      Overrides VideoPanel setCoords method.
      Overrides:
      setCoords in class VideoPanel
      Parameters:
      _coords - the new image coordinate system
    • setReferenceFrame

      public void setReferenceFrame(String trackName)
      Sets the reference frame by name. If the name is null or not found, the default reference frame is used.
      Parameters:
      trackName - the name of a point mass
    • getAxes

      public CoordAxes getAxes()
      Gets the coordinate axes.
      Returns:
      the CoordAxes
    • getMat

      public TMat getMat()
      Gets the mat.
      Returns:
      the first TMat in the drawable list
    • getSnapPoint

      public TPoint getSnapPoint()
      Gets the origin snap point.
      Returns:
      the snap point
    • setCursor

      public void setCursor(Cursor c)
      Overrides:
      setCursor in class Component
    • setSelectedTrack

      public void setSelectedTrack(TTrack track)
      Sets the selected track.
      Parameters:
      track - the track to select
    • getSelectedTrack

      public TTrack getSelectedTrack()
      Gets the selected track.
      Returns:
      the selected track
    • setSelectedPoint

      public void setSelectedPoint(TPoint point)
      Sets the selected point. Also sets the selected step, track, and selecting panel.
      Parameters:
      point - the point to receive actions
    • getSelectingPanelID

      public Integer getSelectingPanelID()
      Returns pointID if this panel is actively selecting.
      Returns:
    • getSelectedPoint

      public TPoint getSelectedPoint()
      Gets the selected point.
      Returns:
      the selected point
    • getSelectedStep

      public Step getSelectedStep()
      Gets the selected step.
      Returns:
      the selected step
    • setMagnification

      public void setMagnification(double magnification)
      Sets the magnification.
      Parameters:
      magnification - the desired magnification
    • getMagnification

      public double getMagnification()
      Gets the magnification.
      Returns:
      the magnification
    • setImageWidth

      public void setImageWidth(double w)
      Sets the image width in image units. Overrides VideoPanel method.
      Overrides:
      setImageWidth in class VideoPanel
      Parameters:
      w - the width
    • setImageHeight

      public void setImageHeight(double h)
      Sets the image height in image units. Overrides VideoPanel method.
      Overrides:
      setImageHeight in class VideoPanel
      Parameters:
      h - the height
    • setImageSize

      public void setImageSize(double w, double h)
      Sets the image size in image units.
      Parameters:
      w - the width
      h - the height
    • setClipSettingsVisible

      public ClipInspector setClipSettingsVisible(Boolean vis)
      Sets the visibility of the clip settings dialog.
      Parameters:
      vis - null to toggle visibility, otherwise usual true/false
    • setScrollPane

      public void setScrollPane(JScrollPane scroller)
      Sets the scroll pane.
      Parameters:
      scroller - the scroll pane containing this panel
    • getPreferredScrollableViewportSize

      public Dimension getPreferredScrollableViewportSize()
      Gets the preferred scrollable viewport size.
      Specified by:
      getPreferredScrollableViewportSize in interface Scrollable
      Returns:
      the preferred scrollable viewport size
    • getScrollableUnitIncrement

      public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
      Gets the scrollable unit increment.
      Specified by:
      getScrollableUnitIncrement in interface Scrollable
      Parameters:
      visibleRect - the rectangle currently visible in the scrollpane
      orientation - the orientation of the scrollbar
      direction - the direction of movement of the scrollbar
      Returns:
      the scrollable unit increment
    • getScrollableBlockIncrement

      public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
      Gets the scrollable block increment.
      Specified by:
      getScrollableBlockIncrement in interface Scrollable
      Parameters:
      visibleRect - the rectangle currently visible in the scrollpane
      orientation - the orientation of the scrollbar
      direction - the direction of movement of the scrollbar
      Returns:
      the scrollable block increment
    • getScrollableTracksViewportWidth

      public boolean getScrollableTracksViewportWidth()
      Gets whether this tracks the viewport width in a scrollpane.
      Specified by:
      getScrollableTracksViewportWidth in interface Scrollable
      Returns:
      true if this tracks the width
    • getScrollableTracksViewportHeight

      public boolean getScrollableTracksViewportHeight()
      Gets whether this tracks the viewport height.
      Specified by:
      getScrollableTracksViewportHeight in interface Scrollable
      Returns:
      true if this tracks the height
    • isUnitsVisible

      public boolean isUnitsVisible()
      Gets the units visibility.
      Returns:
      true if units are displayed
    • setUnitsVisible

      public void setUnitsVisible(boolean visible)
      Sets the units visibility.
      Parameters:
      visible - true to display units
    • getMassUnit

      public String getMassUnit()
      Gets the mass unit.
      Returns:
      the mass unit
    • setMassUnit

      public boolean setMassUnit(String unit)
      Sets the mass unit.
      Parameters:
      unit - the mass unit
      Returns:
      true if unit was changed
    • getLengthUnit

      public String getLengthUnit()
      Gets the length unit.
      Returns:
      the length unit
    • setLengthUnit

      public boolean setLengthUnit(String unit)
      Sets the length unit.
      Parameters:
      unit - the length unit
      Returns:
      true if unit was changed
    • setTimeUnit

      public boolean setTimeUnit(String unit)
      Description copied from class: VideoPanel
      Sets the time unit.
      Overrides:
      setTimeUnit in class VideoPanel
      Parameters:
      unit - the time unit
      Returns:
      true if unit was changed
    • getUnits

      public String getUnits(TTrack track, String var)
      Gets the units for a given track and variable.
      Parameters:
      track - the track
      var - the variable
      Returns:
      the units
    • isShowCoordinates

      public boolean isShowCoordinates()
      Returns true if mouse coordinates are displayed. Overrides DrawingPanel method to report false if a point is selected.
      Overrides:
      isShowCoordinates in class DrawingPanel
      Returns:
      true if mouse coordinates are displayed
    • setMessage

      public void setMessage(String msg)
      Shows a message in BR corner. Overrides DrawingPanel method.
      Overrides:
      setMessage in class DrawingPanel
      Parameters:
      msg - the message
    • importData

      @Deprecated protected void importData(String dataString, Object source)
      Deprecated.
      See importDataAsync
      Parameters:
      dataString -
      source -
    • importDataAsync

      public void importDataAsync(String dataString, Object source, Runnable whenDone)
      Imports Data from a data string (delimited fields) into a DataTrack. The data string must be parsable by DataTool. If the string is a path, an attempt is made to get the data string with ResourceLoader. Optionally asynchronous (required async for JavaScript) Source object (model) may be String path, JPanel controlPanel, Tool tool, etc
      Parameters:
      dataString - delimited fields parsable by DataTool, or a path to a Resource
      source - the data source (may be null)
      whenDone - Runnable to run when complete
    • refreshTrackData

      protected void refreshTrackData(int mode)
      Refreshes all data in tracks and views.
    • refreshDecimalSeparators

      protected void refreshDecimalSeparators()
      Description copied from class: DrawingPanel
      Refreshes the decimal separators.
      Overrides:
      refreshDecimalSeparators in class DrawingPanel
    • getMouseEvent

      protected MouseEvent getMouseEvent()
      Gets the most recent mouse event.
      Returns:
      the MouseEvent
    • getPopupMenu

      public JPopupMenu getPopupMenu()
      Gets the popup menu. Overrides DrawingPanel method.
      Overrides:
      getPopupMenu in class DrawingPanel
    • getPopup

      protected JPopupMenu getPopup()
    • getUnitsDialog

      public UnitsDialog getUnitsDialog()
      Gets the units dialog.
      Returns:
      the units dialog
    • getAttachmentDialog

      public AttachmentDialog getAttachmentDialog(TTrack track)
      Gets the attachment dialog for attaching measuring tool points to point masses.
      Parameters:
      track - a measuring tool
      Returns:
      the attachment dialog
    • getPasteDataDialog

      public PasteDataDialog getPasteDataDialog()
      Gets the PasteDataDialog for pasting data into TrackerJS.
      Returns:
      the PasteDataDialog
    • getPlotGuestDialog

      public PlotGuestDialog getPlotGuestDialog(TrackPlottingPanel plot)
      Gets the plot guest dialog for comparing multiple track data in a single plot.
      Parameters:
      plot - a TrackPlottingPanel
      Returns:
      the plot guest dialog
    • getDataBuilder

      protected FunctionTool getDataBuilder()
      Gets the data builder for defining custom data functions.
      Returns:
      the data builder
    • getAlgorithmDialog

      protected DerivativeAlgorithmDialog getAlgorithmDialog()
      Gets the Algorithms dialog.
      Returns:
      the properties dialog
    • getNextName

      protected String getNextName(String name, String connector)
      Gets the next available name (and color, based on the attached suffix) for a track.
      Parameters:
      name - the default name with no letter suffix
      connector - the string connecting the name and letter
      Returns:
      name + connector + letter or null
    • restoreViews

      protected void restoreViews()
      Restores the views to a non-maximized state.
    • setCursorForMarking

      protected boolean setCursorForMarking(boolean invert, InputEvent e)
      Sets the cursor to a crosshair when the selected track is marking and is unmarked on the current frame. Also displays hints as a side effect.
      Parameters:
      invert - true to invert the normal state
      e - an input event
      Returns:
      true if marking (ie next mouse click will mark a TPoint)
    • handleKeyPress

      protected void handleKeyPress(KeyEvent e)
      Handles keypress events for selected points.
      Parameters:
      e - the key event
    • getEnabled

      public Set<String> getEnabled()
      Gets the enabled property set.
      Returns:
      the set of enabled properties
    • setEnabled

      public void setEnabled(Set<String> enable)
      Sets the enabled property set.
      Parameters:
      enable - the set of enabled properties
    • isEnabled

      public boolean isEnabled(String key)
      Gets the enabled state for the specified key.
      Parameters:
      key - the string key
      Returns:
      true if enabled
    • setEnabled

      public void setEnabled(String key, boolean enable)
      Sets the enabled state for the specified key.
      Parameters:
      key - the string key
      enable - true to enable the key
    • isCreateTracksEnabled

      public boolean isCreateTracksEnabled()
      REturns true if any new.trackType is enabled.
      Returns:
      true if enabled
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class VideoPanel
      Parameters:
      e - the property change event
    • setImageBorder

      public void setImageBorder(double borderFraction)
      Overrides VideoPanel setImageBorder method to set the image border.
      Overrides:
      setImageBorder in class VideoPanel
      Parameters:
      borderFraction - the border fraction
    • getFilePath

      public String getFilePath()
      Overrides VideoPanel getFilePath method.
      Overrides:
      getFilePath in class VideoPanel
      Returns:
      the relative path to the file
    • scale

      public void scale()
      Overrides DrawingPanel scale method.
      Overrides:
      scale in class DrawingPanel
    • setMouseCursor

      public void setMouseCursor(Cursor cursor)
      Overrides DrawingPanel setMouseCursor method. This blocks the crosshair cursor (from iad mouse controller) so that Tracker can set cursors for marking tracks.
      Overrides:
      setMouseCursor in class DrawingPanel
      Parameters:
      cursor - the requested cursor
    • setFontLevel

      public void setFontLevel(int level)
      Sets the font level.
      Overrides:
      setFontLevel in class DrawingPanel
      Parameters:
      level - the desired font level
    • isZoomEvent

      public boolean isZoomEvent(MouseEvent e)
      Returns true if an event starts or ends a zoom operation. Used by OptionController. Overrides DrawingPanel method.
      Overrides:
      isZoomEvent in class DrawingPanel
      Parameters:
      e - a mouse event
      Returns:
      true if a zoom event
    • getInteractive

      public Interactive getInteractive()
      Overrides InteractivePanel getInteractive method. This checks the selected track (if any) first.
      Overrides:
      getInteractive in class InteractivePanel
      Returns:
      the interactive drawable identified by the most recent mouse event
    • getXYCoordinateStringBuilder

      public XYCoordinateStringBuilder getXYCoordinateStringBuilder(TPoint point)
      Description copied from class: VideoPanel
      Gets a XYCoordinateStringBuilder for a TPoint to display its coordinates. This default implementation returns the static TPoint string builder.
      Overrides:
      getXYCoordinateStringBuilder in class VideoPanel
      Parameters:
      point - the TPoint
      Returns:
      the XYCoordinateStringBuilder
    • getMattedImage

      protected BufferedImage getMattedImage()
    • deletePoint

      protected void deletePoint(TPoint pt)
      Deletes a point.
      Parameters:
      pt - the point to delete
    • deleteSelectedSteps

      protected void deleteSelectedSteps()
      Deletes the selected steps, if any.
    • scale

      protected void scale(ArrayList<Drawable> drawables)
      Overrides VideoPanel scale method to handle zoom
      Overrides:
      scale in class VideoPanel
      Parameters:
      drawables - the list of drawable objects
    • paintComponent

      public void paintComponent(Graphics g)
      Paints this component. Overrides DrawingPanel method to log times
      Overrides:
      paintComponent in class DrawingPanel
      Parameters:
      g - the graphics context
    • getDefaultImageWidth

      protected static double getDefaultImageWidth()
      Gets the default image width for new empty panels
      Returns:
      width
    • getDefaultImageHeight

      protected static double getDefaultImageHeight()
      Gets the default image height for new empty panels
      Returns:
      height
    • getTFrame

      public TFrame getTFrame()
      Gets the TFrame parent of this panel
      Returns:
      the TFrame, if any
    • getAutoTracker

      protected AutoTracker getAutoTracker(boolean forceNew)
      Gets the autotracker for this panel
      Returns:
      the autotracker, if any
    • getFormatPatterns

      protected TreeMap<String,String> getFormatPatterns(int ttype)
      Gets the default format patterns for a specified track type
      Parameters:
      trackType - the track type
      Returns:
      a map of variable name to pattern
    • setInitialFormatPatterns

      protected void setInitialFormatPatterns()
      Sets the initial default format patterns for all track types and existing tracks
    • dispose

      public void dispose()
      Disposes of this panel permanently. Only to be used upon tab removal, and only to be run once.
      Specified by:
      dispose in interface OSPRuntime.Disposable
      Overrides:
      dispose in class VideoPanel
    • setTrackName

      protected void setTrackName(TTrack track, String newName, boolean postEdit)
      Sets the name of a track. This checks the name against those of existing tracks and prompts the user for a new name if a duplicate is found. After three failed attempts, a unique name is formed by appending a number.
      Parameters:
      track - the track to name
      newName - the proposed name
      postEdit - true to post an undoable edit
    • showFilterInspectors

      protected void showFilterInspectors()
      Shows the visible filter inspectors, if any.
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load object data.
      Returns:
      the XML.ObjectLoader
    • isAutoRefresh

      public boolean isAutoRefresh()
    • setAutoRefresh

      public void setAutoRefresh(boolean b)
    • updateMainPopup

      public JPopupMenu updateMainPopup()
    • isStepsInZoomBox

      protected boolean isStepsInZoomBox()
    • setVideoVisible

      public void setVideoVisible(boolean visible)
    • isPaintable

      public boolean isPaintable()
    • repaint

      public void repaint()
      Overrides:
      repaint in class DrawingPanel
    • repaint

      public void repaint(long time, int x, int y, int w, int h)
      All repaints funnel through this method
      Overrides:
      repaint in class JComponent
    • setVisible

      public void setVisible(boolean b)
      Description copied from class: DrawingPanel
      Makes the component visible or invisible. Overrides JComponent.setVisible.
      Overrides:
      setVisible in class DrawingPanel
      Parameters:
      b - true to make the component visible; false to make it invisible
    • notifyLoadingComplete

      public void notifyLoadingComplete()
    • taintEnabled

      public void taintEnabled()
    • getEnabledCount

      public int getEnabledCount()
    • clearTainted

      public void clearTainted()
    • doPaste

      public void doPaste(String data)
      Pastes a string and imports any objects or data. Called by pasteXML menu item
      Parameters:
      data - the data string
    • doAutoPaste

      public void doAutoPaste(String dataString) throws Exception
      Pastes a string and reloads external models (DataTracks). Called by clipboard listener when auto-pasting
      Parameters:
      dataString - the data string
      Throws:
      Exception
    • initialize

      public void initialize(FileDropHandler fileDropHandler)
    • getDrawablesTemp

      public <T extends Drawable> ArrayList<T> getDrawablesTemp(Class<T> type)
    • getTrackByName

      public <T extends TTrack> T getTrackByName(Class<T> type, String name)
    • clearTemp

      public void clearTemp()
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class DrawingPanel
    • cloneNamed

      public void cloneNamed(String name)
    • checkAndClearTracks

      public void checkAndClearTracks()
      Check for locked tracks and get list of xml strings for undoableEdit. From clearTracks action.
    • reload

      protected void reload()
      Reload tracks from datafile. This may be useful if a user edits track data directly in the xml file.
    • openURLFromDialog

      public void openURLFromDialog()
    • toggleAxesVisible

      public void toggleAxesVisible()
    • addVideoFilter

      public void addVideoFilter(String type)
    • offerReloadVM

      protected void offerReloadVM(String ext, String message)
      Overrides:
      offerReloadVM in class VideoPanel
    • onLoaded

      public void onLoaded()
    • getTabName

      public String getTabName()
    • onBlocked

      public void onBlocked()
    • addListeners

      public void addListeners(String[] names, PropertyChangeListener listener)
    • removeListeners

      public void removeListeners(String[] names, PropertyChangeListener listener)
    • refreshNotesDialog

      public void refreshNotesDialog()
    • main

      public static void main(String[] args)
    • ref

      public TrackerPanel ref(Object o)
      Identifying only for debugging purposes. Currently just TTrack.
      Parameters:
      o -
      Returns:
    • getMainPanel

      public TrackerPanel getMainPanel()
      Return the actual panel, which in the case of WorldTView is not this, rather the TrackerPanel it was initialized with.
      Returns:
    • refreshMenus

      public void refreshMenus(String why)
    • unTracked

      protected boolean unTracked()
    • getMenuBar

      public TMenuBar getMenuBar(boolean forceNew)
    • getToolBar

      public TToolBar getToolBar(boolean forceNew)
    • getTrackBar

      public TTrackBar getTrackBar(boolean forceNew)
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object
    • getMatBounds

      public Rectangle getMatBounds()