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.ScrollBarNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BitSetprotected intprotected JButtonfor super.toolbarComponentsprotected intprotected org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTablethe JTableprotected DatasetManagerDataManager for all table data -- just the VISIBLE columnsprotected booleanprotected JButtonfor super.toolbarComponentsprotected JCheckBoxprotected JButtonfor super.toolbarComponentsprotected booleanset to false during loadingused when sortingprotected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnEditorprotected org.opensourcephysics.cabrillo.tracker.TableTrackView.TextColumnTableModelprotected DatasetManagerDataManager 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, viewParentFields inherited from class javax.swing.JScrollPane
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewportFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields 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 TypeMethodDescriptionvoidaddColumnItems(JPopupMenu popup) For TableTView popup menuvoidprotected voidCreates the GUI.voidprotected voiddispose()voidfinalize()protected String[]Gets an array of all column names.org.opensourcephysics.cabrillo.tracker.TableTrackView.TrackDataTableGets the datatable.protected intgetFrameAtRow(int row) Gets the frame number for a view row.protected doublegetIndepVarValueAtRow(int row) Gets the independent variable value at a view row.protected JPopupMenugetPopup()protected intgetRowFromIndepVarValue(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 StringgetUniqueColumnName(String previous, boolean tryAgain) Gets a unique new name for a text column.Gets the view buttonbooleanReturns true if this trackview is in a custom state.protected booleanvoidResponds to property change events.voidrefresh(int frameNumber, int mode) voidrefreshColumnDialog(TTrack track, boolean onlyIfVisible) protected JMenurefreshCopyDataMenu(JMenu menu) Refreshes a menu with appropriate copy data items for this view.protected voidvoidprotected voidrefreshToolbarPopup(JPopupMenu popup) Refreshes a popup menu with data gap items.voidsetDatasetIndex(int index) voidsetDialogAsLastVisible(boolean vis) voidprotected voidsetHorizontalScrolling(boolean horzScroll) Sets the horizontal scrolling policyvoidsetRefreshing(boolean b) protected voidsetSelectedIndepVarValues(double[] vals) Sets the selected independent variable values.protected voidsetupDelimiterMenu(Action setDelimiterAction) voidsetVisible(int index, boolean visible) Sets the visibility of a dataset specified by indexvoidsetVisible(String name, boolean visible) Sets the visibility of a data or text column specified by nameprotected voidshowAllColumns(boolean all) Shows all data columns if true.voidsnapshot()Creates a snapshot of this view or its parent TViewChooser, if any.protected voidprotected voidMethods inherited from class org.opensourcephysics.cabrillo.tracker.TrackView
getIcon, getName, getOwner, highlightFrames, setClipAdjusting, toString, trimDefinedMethods 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, updateUIMethods 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, updateMethods 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, validateTreeMethods 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:
getToolBarComponentsin 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-trueto 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-trueto show the column in the table
-
dispose
protected void dispose() -
propertyChange
Responds to property change events.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein 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:
setFontin 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:
setDatasetIndexin 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:
isRefreshEnabledin classTrackView
-
finalize
public void finalize()
-