Class TableTrackView
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
org.opensourcephysics.cabrillo.tracker.TrackView
org.opensourcephysics.cabrillo.tracker.TableTrackView
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
,ScrollPaneConstants
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.JScrollPane
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar
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
FieldsModifier and TypeFieldDescriptionprotected final BitSet
protected int
protected JButton
for super.toolbarComponentsprotected int
protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTable
the JTableprotected DatasetManager
DataManager for all table data -- just the VISIBLE columnsprotected boolean
protected JButton
for super.toolbarComponentsprotected JCheckBox
protected JButton
for super.toolbarComponentsprotected boolean
set to false during loadingused when sortingprotected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnEditor
protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnTableModel
protected DatasetManager
DataManager for all track data -- ALL columnsFields inherited from class org.opensourcephysics.cabrillo.tracker.TrackView
clipAdjusting, forceRefresh, frame, highlightFrames, highlightRows, highlightVisible, myDatasetIndex, myID, myType, panelID, prevDatasetIndex, toolbarComponents, trackIcon, viewParent
Fields inherited from class javax.swing.JScrollPane
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
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
Fields inherited from interface javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
-
Constructor Summary
ConstructorsConstructorDescriptionTableTrackView
(TTrack track, TrackerPanel panel, TableTView view) Constructs a TrackTableView of the specified track on the specified tracker panel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnItems
(JPopupMenu popup) For TableTView popup menuvoid
protected void
Creates the GUI.void
protected void
dispose()
void
finalize()
protected String[]
Gets an array of all column names.org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTable
Gets the datatable.protected int
getFrameAtRow
(int row) Gets the frame number for a view row.protected double
getIndepVarValueAtRow
(int row) Gets the independent variable value at a view row.protected JPopupMenu
getPopup()
protected int
getRowFromIndepVarValue
(double indepVarValue) Gets the view row at which an independent variable value is found.protected double[]
Gets the selected independent variable values.Gets the toolbar componentsprotected String
getUniqueColumnName
(String previous, boolean tryAgain) Gets a unique new name for a text column.Gets the view buttonboolean
Returns true if this trackview is in a custom state.protected boolean
void
Responds to property change events.void
refresh
(int frameNumber, int mode) void
refreshColumnDialog
(TTrack track, boolean onlyIfVisible) protected JMenu
refreshCopyDataMenu
(JMenu menu) Refreshes a menu with appropriate copy data items for this view.protected void
void
protected void
refreshToolbarPopup
(JPopupMenu popup) Refreshes a popup menu with data gap items.void
setDatasetIndex
(int index) void
setDialogAsLastVisible
(boolean vis) void
protected void
setHorizontalScrolling
(boolean horzScroll) Sets the horizontal scrolling policyvoid
setRefreshing
(boolean b) protected void
setSelectedIndepVarValues
(double[] vals) Sets the selected independent variable values.protected void
setupDelimiterMenu
(Action setDelimiterAction) void
setVisible
(int index, boolean visible) Sets the visibility of a dataset specified by indexvoid
setVisible
(String name, boolean visible) Sets the visibility of a data or text column specified by nameprotected void
showAllColumns
(boolean all) Shows all data columns if true.void
snapshot()
Creates a snapshot of this view or its parent TViewChooser, if any.protected void
protected void
Methods inherited from class org.opensourcephysics.cabrillo.tracker.TrackView
getIcon, getName, getOwner, highlightFrames, setClipAdjusting, toString, trimDefined
Methods inherited from class javax.swing.JScrollPane
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, 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, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, 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, 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, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
trackDataManager
DataManager for all track data -- ALL columns -
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 refreshingset to false during loading -
textColumnNames
-
bsTextColumnsVisible
-
selectedIndepVarValues
used when sorting -
dataTable
protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTable dataTablethe JTable -
textColumnEditor
protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnEditor textColumnEditor -
textColumnModel
protected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnTableModel textColumnModel -
columnsDialogButton
for super.toolbarComponents -
gapsButton
for super.toolbarComponents -
multipleFramesButton
for super.toolbarComponents -
multiframeCheckbox
-
-
Constructor Details
-
TableTrackView
Constructs a TrackTableView of the specified track on the specified tracker panel.- Parameters:
track
- the trackpanel
- the tracker panelview
- 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
Gets the toolbar components- Overrides:
getToolBarComponents
in classTrackView
- Returns:
- an ArrayList of components to be added to a toolbar
-
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 columnvisible
-true
to show the dataset column in the table
-
setVisible
Sets the visibility of a data or text column specified by name- Parameters:
name
- the name of the columnvisible
-true
to show the column in the table
-
dispose
protected void dispose() -
propertyChange
Responds to property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classTrackView
- Parameters:
e
- the property change event
-
snapshot
public void snapshot()Creates a snapshot of this view or its parent TViewChooser, if any. -
setFont
- Overrides:
setFont
in classJComponent
-
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 classTrackView
-
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
-
tableHeaderMousePressed
-
setupDelimiterMenu
-
getPopup
-
getUniqueColumnName
Gets a unique new name for a text column.- Parameters:
previous
- the previous name (may be null)- Returns:
- the new name
-
refreshCopyDataMenu
Refreshes a menu with appropriate copy data items for this view.- Parameters:
menu
- the menu to refresh- Returns:
- the refreshed menu
-
refreshToolbarPopup
Refreshes a popup menu with data gap items.- Parameters:
popup
- the popup to refresh
-
getDataColumnNames
Gets an array of all column names.- Returns:
- the column names
-
refreshToolbar
public void refreshToolbar() -
addColumnItems
For TableTView popup menu- Parameters:
popup
-
-
refreshColumnDialog
-
setDialogAsLastVisible
public void setDialogAsLastVisible(boolean vis) -
buildForNewFunction
public void buildForNewFunction() -
isRefreshEnabled
protected boolean isRefreshEnabled()- Overrides:
isRefreshEnabled
in classTrackView
-
finalize
public void finalize()
-