Class TableTrackView

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ScrollPaneConstants

public class TableTrackView extends TrackView
A JScrollPane that presents a table view of a track on a TrackerPanel. The class maintains the table as well as the associated column views JDialog.
Author:
Douglas Brown, John Welch
See Also:
  • Field Details

    • trackDataManager

      protected DatasetManager trackDataManager
      DataManager for all track data -- ALL columns
    • dataTableManager

      protected DatasetManager dataTableManager
      DataManager for all table data -- just the VISIBLE columns
    • colCount

      protected int colCount
    • datasetCount

      protected int datasetCount
    • dialogLastVisible

      protected boolean dialogLastVisible
    • refreshing

      protected boolean refreshing
      set to false during loading
    • textColumnNames

      protected final ArrayList<String> textColumnNames
    • bsTextColumnsVisible

      protected final BitSet bsTextColumnsVisible
    • selectedIndepVarValues

      protected final TreeSet<Double> selectedIndepVarValues
      used when sorting
    • dataTable

      protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTable dataTable
      the JTable
    • textColumnEditor

      protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnEditor textColumnEditor
    • textColumnModel

      protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnTableModel textColumnModel
    • columnsDialogButton

      protected JButton columnsDialogButton
      for super.toolbarComponents
    • gapsButton

      protected JButton gapsButton
      for super.toolbarComponents
    • multipleFramesButton

      protected JButton multipleFramesButton
      for super.toolbarComponents
    • multiframeCheckbox

      protected JCheckBox multiframeCheckbox
  • Constructor Details

    • TableTrackView

      public TableTrackView(TTrack track, TrackerPanel panel, TableTView view)
      Constructs a TrackTableView of the specified track on the specified tracker panel.
      Parameters:
      track - the track
      panel - the tracker panel
      view - the TableTView that will display this
  • Method Details

    • setRefreshing

      public void setRefreshing(boolean b)
    • refreshNameMaps

      protected void refreshNameMaps()
    • refresh

      public void refresh(int frameNumber, int mode)
    • getDataTable

      public org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTable getDataTable()
      Gets the datatable. For AutoTracker, NumberformatDialog
      Returns:
      the datatable
    • getToolBarComponents

      public ArrayList<Component> getToolBarComponents()
      Gets the toolbar components
      Overrides:
      getToolBarComponents in class TrackView
      Returns:
      an ArrayList of components to be added to a toolbar
    • getViewButton

      public JButton getViewButton()
      Gets the view button
      Returns:
      the view button
    • isCustomState

      public boolean isCustomState()
      Returns true if this trackview is in a custom state.
      Returns:
      true if in a custom state, false if in the default state
    • setVisible

      public void setVisible(int index, boolean visible)
      Sets the visibility of a dataset specified by index
      Parameters:
      index - the index of the column
      visible - true to show the dataset column in the table
    • setVisible

      public void setVisible(String name, boolean visible)
      Sets the visibility of a data or text column specified by name
      Parameters:
      name - the name of the column
      visible - true to show the column in the table
    • dispose

      protected void dispose()
      Overrides:
      dispose in class TrackView
    • propertyChange

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

      public void snapshot()
      Creates a snapshot of this view or its parent TViewChooser, if any.
    • setFont

      public void setFont(Font font)
      Overrides:
      setFont in class JComponent
    • setHorizontalScrolling

      protected void setHorizontalScrolling(boolean horzScroll)
      Sets the horizontal scrolling policy
      Parameters:
      horzScroll - true to enable horizontal scrolling of the table
    • setDatasetIndex

      public void setDatasetIndex(int index)
      Overrides:
      setDatasetIndex in class TrackView
    • showAllColumns

      protected void showAllColumns(boolean all)
      Shows all data columns if true. If false, shows only columns selected in the columnsDialog.
      Parameters:
      all - true to show all columns
    • getFrameAtRow

      protected int getFrameAtRow(int row)
      Gets the frame number for a view row. Returns -1 if not found.
      Parameters:
      row - the table row
      Returns:
      the frame number
    • getIndepVarValueAtRow

      protected double getIndepVarValueAtRow(int row)
      Gets the independent variable value at a view row.
      Parameters:
      row - the table row
      Returns:
      the value
    • getRowFromIndepVarValue

      protected int getRowFromIndepVarValue(double indepVarValue)
      Gets the view row at which an independent variable value is found.
      Parameters:
      indepVarValue - the value
      Returns:
      the view row
    • getSelectedIndepVarValues

      protected double[] getSelectedIndepVarValues()
      Gets the selected independent variable values.
      Returns:
      double[] of selected values
    • setSelectedIndepVarValues

      protected void setSelectedIndepVarValues(double[] vals)
      Sets the selected independent variable values.
      Parameters:
      vals - the values to select
    • createGUI

      protected void createGUI()
      Creates the GUI.
    • dataToolAction

      public void dataToolAction()
    • tableMousePressed

      protected void tableMousePressed(MouseEvent e)
    • tableHeaderMousePressed

      protected void tableHeaderMousePressed(MouseEvent e)
    • setupDelimiterMenu

      protected void setupDelimiterMenu(Action setDelimiterAction)
    • getPopup

      protected JPopupMenu getPopup()
    • getUniqueColumnName

      protected String getUniqueColumnName(String previous, boolean tryAgain)
      Gets a unique new name for a text column.
      Parameters:
      previous - the previous name (may be null)
      Returns:
      the new name
    • refreshCopyDataMenu

      protected JMenu refreshCopyDataMenu(JMenu menu)
      Refreshes a menu with appropriate copy data items for this view.
      Parameters:
      menu - the menu to refresh
      Returns:
      the refreshed menu
    • refreshToolbarPopup

      protected void refreshToolbarPopup(JPopupMenu popup)
      Refreshes a popup menu with data gap items.
      Parameters:
      popup - the popup to refresh
    • getDataColumnNames

      protected String[] getDataColumnNames()
      Gets an array of all column names.
      Returns:
      the column names
    • refreshToolbar

      public void refreshToolbar()
    • addColumnItems

      public void addColumnItems(JPopupMenu popup)
      For TableTView popup menu
      Parameters:
      popup -
    • refreshColumnDialog

      public void refreshColumnDialog(TTrack track, boolean onlyIfVisible)
    • setDialogAsLastVisible

      public void setDialogAsLastVisible(boolean vis)
    • buildForNewFunction

      public void buildForNewFunction()
    • isRefreshEnabled

      protected boolean isRefreshEnabled()
      Overrides:
      isRefreshEnabled in class TrackView
    • finalize

      public void finalize()
      Overrides:
      finalize in class TrackView