org.opensourcephysics.cabrillo.tracker
Class TFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.opensourcephysics.display.OSPFrame
                          extended by org.opensourcephysics.cabrillo.tracker.TFrame
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, AppFrame, Hidable

public class TFrame
extends OSPFrame
implements java.beans.PropertyChangeListener

This is the main frame for Tracker.

Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JButton closeInfoDialogButton
           
protected  javax.swing.JDialog dataToolDialog
           
protected  double defaultBottomDivider
           
protected  double defaultRightDivider
           
protected  javax.swing.TransferHandler fileDropHandler
           
protected  javax.swing.JDialog helpDialog
           
protected  Launcher helpLauncher
           
protected static java.lang.String helpPath
           
protected  javax.swing.JDialog infoDialog
           
protected  javax.swing.JTextPane infoTextPane
           
protected  TrackerPanel prevPanel
           
protected  javax.swing.Action saveInfoAction
           
protected  javax.swing.JButton saveInfoButton
           
protected  javax.swing.JTabbedPane tabbedPane
           
 
Fields inherited from class org.opensourcephysics.display.OSPFrame
animated, autoclear, buttonPanel, childFrames, constructorThreadGroup, customButtons, keepHidden, strategy
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TFrame()
          Constructs an empty TFrame.
TFrame(TrackerPanel trackerPanel)
          Constructs a TFrame with the specified tracker panel.
 
Method Summary
 void addTab(TrackerPanel trackerPanel)
          Adds a tab that displays the specified tracker panel.
 void checkMemory()
          Checks the current memory usage.
protected  java.awt.Component getHelpDialog()
          Gets the help dialog.
 MainTView getMainView(TrackerPanel trackerPanel)
          Gets the main view for the specified tracker panel.
 TMenuBar getMenuBar(TrackerPanel trackerPanel)
          Gets the menubar for the specified tracker panel.
 int getSelectedTab()
          Gets the selected tab index.
 java.lang.String[] getSelectedTViews(TrackerPanel trackerPanel)
          Gets the selected TViews for the specified tracker panel.
 int getTab(TrackerPanel trackerPanel)
          Returns the tab index for the specified tracker panel, or -1 if no tab is found.
 int getTabCount()
          Gets the tab count.
 java.lang.String getTabTitle(int tab)
          Gets the title of the specified tab.
 TToolBar getToolBar(TrackerPanel trackerPanel)
          Gets the toolbar for the specified tracker panel.
 TrackControl getTrackControl(TrackerPanel trackerPanel)
          Gets the track control for the specified tracker panel.
 TrackerPanel getTrackerPanel(int tab)
          Gets the tracker panel at the specified tab index.
 TView[][] getTViews(TrackerPanel trackerPanel)
          Gets the views for the specified tracker panel.
 TView[][] getTViews(TrackerPanel trackerPanel, boolean customOnly)
          Gets the views for the specified tracker panel.
 java.awt.Container[] getViews(TrackerPanel trackerPanel)
          Gets the views for the specified tracker panel.
 boolean isViewOpen(int index, TrackerPanel trackerPanel)
          Determines whether a view is open for the specified tracker panel.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
 void refresh()
          Refreshes the GUI.
 void refreshTab(TrackerPanel panel)
          Refreshes the tab for the specified tracker panel.
 void refreshWindowMenu(TrackerPanel trackerPanel)
          Refreshes the Window menu for a TrackerPanel.
 void removeTab(TrackerPanel trackerPanel)
          Removes the tab that displays the specified tracker panel.
 void setDividerLocation(TrackerPanel trackerPanel, int paneIndex, double loc)
          Sets the location of a splitpane divider for a tracker panel
 void setSelectedTab(int tab)
          Sets the selected tab index.
 void setSelectedTab(TrackerPanel trackerPanel)
          Sets the selected tab specified by tracker panel.
 void setTabTitle(int tab, java.lang.String title)
          Sets the title of the specified tab.
 void setView(TrackerPanel trackerPanel, java.awt.Container view, int pane)
          Sets the view for a specified tracker panel and pane.
 void setViews(TrackerPanel trackerPanel, java.awt.Container[] newViews)
          Sets the views for the specified tracker panel.
protected  void showDescription(TrackerPanel panel)
          Shows the description, if any.
protected  void showHelp(java.lang.String selectedNode)
          Shows a specified help topic.
protected  void showHelp(java.lang.String keywords, int pageNumber)
          Shows a specified help topic by keyword: gettingstarted, install, linux, GUI, video, filters, tracks, coords, axes, tape, offset, calibration, pointmass, cm, vector, vectorsum, profile, rgbregion, particle, plot, datatable, xml.
protected  void showTrackControl(TrackerPanel panel)
          Shows the track control if any user tracks are present.
 
Methods inherited from class org.opensourcephysics.display.OSPFrame
addButton, addChildFrame, bufferStrategyShow, clearChildFrames, clearData, clearDataAndRepaint, createBufferStrategy, dispose, getChildFrames, getChooser, getConstructorThreadGroup, getMenu, invalidateImage, isAnimated, isAutoclear, isIconified, isKeepHidden, loadDisplayMenu, loadToolsMenu, parseXMLMenu, parseXMLMenu, refreshGUI, removeMenu, removeMenuItem, render, setAnimated, setAutoclear, setDefaultCloseOperation, setFontLevel, setKeepHidden, setSize, setTitle, setVisible, show, wishesToExit
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.display.AppFrame
getDefaultCloseOperation
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

helpPath

protected static java.lang.String helpPath

tabbedPane

protected javax.swing.JTabbedPane tabbedPane

infoTextPane

protected javax.swing.JTextPane infoTextPane

saveInfoAction

protected javax.swing.Action saveInfoAction

saveInfoButton

protected javax.swing.JButton saveInfoButton

closeInfoDialogButton

protected javax.swing.JButton closeInfoDialogButton

infoDialog

protected javax.swing.JDialog infoDialog

helpDialog

protected javax.swing.JDialog helpDialog

helpLauncher

protected Launcher helpLauncher

dataToolDialog

protected javax.swing.JDialog dataToolDialog

prevPanel

protected TrackerPanel prevPanel

defaultRightDivider

protected double defaultRightDivider

defaultBottomDivider

protected double defaultBottomDivider

fileDropHandler

protected javax.swing.TransferHandler fileDropHandler
Constructor Detail

TFrame

public TFrame()
Constructs an empty TFrame.


TFrame

public TFrame(TrackerPanel trackerPanel)
Constructs a TFrame with the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Method Detail

addTab

public void addTab(TrackerPanel trackerPanel)
Adds a tab that displays the specified tracker panel.

Parameters:
trackerPanel - the tracker panel

removeTab

public void removeTab(TrackerPanel trackerPanel)
Removes the tab that displays the specified tracker panel.

Parameters:
trackerPanel - the tracker panel

getTab

public int getTab(TrackerPanel trackerPanel)
Returns the tab index for the specified tracker panel, or -1 if no tab is found.

Parameters:
trackerPanel - the tracker panel
Returns:
the tab index

getTabCount

public int getTabCount()
Gets the tab count.

Returns:
the tab count

getSelectedTab

public int getSelectedTab()
Gets the selected tab index.

Returns:
the tab index

setSelectedTab

public void setSelectedTab(int tab)
Sets the selected tab index.

Parameters:
tab - the tab index

setSelectedTab

public void setSelectedTab(TrackerPanel trackerPanel)
Sets the selected tab specified by tracker panel.

Parameters:
trackerPanel - the tracker panel

getTrackerPanel

public TrackerPanel getTrackerPanel(int tab)
Gets the tracker panel at the specified tab index.

Parameters:
tab - the tab index
Returns:
the tracker panel

getTabTitle

public java.lang.String getTabTitle(int tab)
Gets the title of the specified tab.

Parameters:
tab - the tab index
Returns:
the title

refreshTab

public void refreshTab(TrackerPanel panel)
Refreshes the tab for the specified tracker panel.

Parameters:
panel - the tracker panel

setTabTitle

public void setTabTitle(int tab,
                        java.lang.String title)
Sets the title of the specified tab.

Parameters:
tab - the tab index
title - the title

setView

public void setView(TrackerPanel trackerPanel,
                    java.awt.Container view,
                    int pane)
Sets the view for a specified tracker panel and pane.

Parameters:
trackerPanel - the tracker panel
view - the new view
pane - the pane number

setViews

public void setViews(TrackerPanel trackerPanel,
                     java.awt.Container[] newViews)
Sets the views for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
newViews - an array of up to 4 views

getViews

public java.awt.Container[] getViews(TrackerPanel trackerPanel)
Gets the views for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
an array of views

getTViews

public TView[][] getTViews(TrackerPanel trackerPanel)
Gets the views for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
an array of views

getTViews

public TView[][] getTViews(TrackerPanel trackerPanel,
                           boolean customOnly)
Gets the views for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
customOnly - true to return only customized views
Returns:
an array of views

getSelectedTViews

public java.lang.String[] getSelectedTViews(TrackerPanel trackerPanel)
Gets the selected TViews for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
an array of TViews (some elements may be null)

isViewOpen

public boolean isViewOpen(int index,
                          TrackerPanel trackerPanel)
Determines whether a view is open for the specified tracker panel.

Parameters:
index - the view index
trackerPanel - the tracker panel
Returns:
true if it is open

setDividerLocation

public void setDividerLocation(TrackerPanel trackerPanel,
                               int paneIndex,
                               double loc)
Sets the location of a splitpane divider for a tracker panel

Parameters:
trackerPanel - the tracker panel
paneIndex - the index of the split pane
loc - the desired divider location

getMainView

public MainTView getMainView(TrackerPanel trackerPanel)
Gets the main view for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
a MainTView

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - the property change event

getToolBar

public TToolBar getToolBar(TrackerPanel trackerPanel)
Gets the toolbar for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
a TToolBar

getMenuBar

public TMenuBar getMenuBar(TrackerPanel trackerPanel)
Gets the menubar for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
a TMenuBar

getTrackControl

public TrackControl getTrackControl(TrackerPanel trackerPanel)
Gets the track control for the specified tracker panel.

Parameters:
trackerPanel - the tracker panel
Returns:
a TrackControl

refresh

public void refresh()
Refreshes the GUI.


refreshWindowMenu

public void refreshWindowMenu(TrackerPanel trackerPanel)
Refreshes the Window menu for a TrackerPanel.

Parameters:
trackerPanel - the TrackerPanel

getHelpDialog

protected java.awt.Component getHelpDialog()
Gets the help dialog.

Returns:
the help dialog

showHelp

protected void showHelp(java.lang.String selectedNode)
Shows a specified help topic.

Parameters:
selectedNode - the name of the help node to be displayed

showHelp

protected void showHelp(java.lang.String keywords,
                        int pageNumber)
Shows a specified help topic by keyword: gettingstarted, install, linux, GUI, video, filters, tracks, coords, axes, tape, offset, calibration, pointmass, cm, vector, vectorsum, profile, rgbregion, particle, plot, datatable, xml.

Parameters:
keywords - the keywords of the help node to be displayed
pageNumber - the html page number

showTrackControl

protected void showTrackControl(TrackerPanel panel)
Shows the track control if any user tracks are present.

Parameters:
panel - the tracker panel

showDescription

protected void showDescription(TrackerPanel panel)
Shows the description, if any.

Parameters:
panel - the tracker panel

checkMemory

public void checkMemory()
Checks the current memory usage. If the total memory being used approaches the max available, this reopens Tracker in a new larger java vm.