org.opensourcephysics.cabrillo.tracker
Class TToolBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by org.opensourcephysics.cabrillo.tracker.TToolBar
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants

public class TToolBar
extends javax.swing.JToolBar
implements java.beans.PropertyChangeListener

This is the main toolbar for Tracker.

Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
protected  class TToolBar.CalibrationButton
          A class to manage the creation and visibility of calibration tools.
 
Nested classes/interfaces inherited from class javax.swing.JToolBar
javax.swing.JToolBar.AccessibleJToolBar, javax.swing.JToolBar.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static javax.swing.Icon accelOffIcon
           
protected static javax.swing.Icon accelOnIcon
           
protected  javax.swing.JButton autotrackerButton
           
protected static javax.swing.Icon autotrackerOffIcon
           
protected static javax.swing.Icon autotrackerOnIcon
           
protected  javax.swing.JButton aVisButton
           
protected  javax.swing.JButton axesButton
           
protected static javax.swing.Icon axesOffIcon
           
protected static javax.swing.Icon axesOnIcon
           
protected  TToolBar.CalibrationButton calibrationButton
           
protected static javax.swing.Icon clipOffIcon
           
protected static javax.swing.Icon clipOnIcon
           
protected  javax.swing.JButton clipSettingsButton
           
protected  java.awt.event.ComponentListener clipSettingsDialogListener
           
protected  javax.swing.JMenu cloneMenu
           
protected  javax.swing.JButton desktopButton
           
protected static javax.swing.Icon htmlIcon
           
protected static javax.swing.Icon infoIcon
           
protected  java.awt.event.WindowListener infoListener
           
protected  javax.swing.JButton labelsButton
           
protected static javax.swing.Icon labelsOffIcon
           
protected static javax.swing.Icon labelsOnIcon
           
protected  javax.swing.JPopupMenu newPopup
           
protected  TButton newTrackButton
           
protected static javax.swing.Icon newTrackIcon
           
protected  javax.swing.JButton notesButton
           
protected  boolean notYetCalibrated
           
protected  javax.swing.JButton openBrowserButton
           
protected  javax.swing.JButton openButton
           
protected static javax.swing.Icon pointsOffIcon
           
protected static javax.swing.Icon pointsOnIcon
           
protected  javax.swing.JButton pVisButton
           
protected  javax.swing.JButton refreshButton
           
protected static javax.swing.Icon refreshIcon
           
protected  boolean refreshing
           
protected  javax.swing.JButton saveButton
           
protected  javax.swing.JButton saveZipButton
           
protected  javax.swing.JMenuItem selectNoneItem
           
protected  javax.swing.JPopupMenu selectPopup
           
protected static javax.swing.Icon separatorIcon
           
protected  javax.swing.JMenuItem showTrackControlItem
           
protected static javax.swing.Icon stickOffIcon
           
protected static javax.swing.Icon stickOffRolloverIcon
           
protected static javax.swing.Icon stickOnIcon
           
protected static javax.swing.Icon stickOnRolloverIcon
           
protected  int stretch
           
protected  javax.swing.JButton stretchButton
           
protected static javax.swing.Icon[] stretchIcons
           
protected static int[] stretchValues
           
protected static javax.swing.Icon tapeOffIcon
           
protected static javax.swing.Icon tapeOffRolloverIcon
           
protected static javax.swing.Icon tapeOnIcon
           
protected static javax.swing.Icon tapeOnRolloverIcon
           
protected  int toolbarComponentHeight
           
protected  java.awt.Component toolbarFiller
           
protected static java.util.Map<TrackerPanel,TToolBar> toolbars
           
protected static javax.swing.Icon traceOffIcon
           
protected static javax.swing.Icon traceOnIcon
           
protected  javax.swing.JButton traceVisButton
           
protected  javax.swing.JButton trackControlButton
           
protected static javax.swing.Icon trackControlIcon
           
protected static javax.swing.Icon trackControlOnIcon
           
protected  TrackerPanel trackerPanel
           
protected  javax.swing.JButton trailButton
           
protected static javax.swing.Icon[] trailIcons
           
protected  int trailLength
           
protected static int[] trailLengths
           
protected static javax.swing.Icon velocOffIcon
           
protected static javax.swing.Icon velocOnIcon
           
protected  javax.swing.JButton vVisButton
           
protected  javax.swing.JButton xMassButton
           
protected static javax.swing.Icon xmassOffIcon
           
protected static javax.swing.Icon xmassOnIcon
           
protected  javax.swing.JButton zoomButton
           
protected static java.text.NumberFormat zoomFormat
           
protected static javax.swing.Icon zoomIcon
           
protected  javax.swing.JPopupMenu zoomPopup
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
protected  void createGUI()
          Creates the GUI.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load object data.
protected  javax.swing.JPopupMenu getNewTracksPopup()
          Refreshes and returns the "new tracks" popup menu.
static TToolBar getToolbar(TrackerPanel panel)
          Gets the toolbar for the specified tracker panel.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to the following events: "selectedtrack", "selectedpoint", "track" from tracker panel, "locked" from tracks, "visible" from tape and axes.
protected  void refresh(boolean refreshTrackProperties)
          Refreshes the GUI.
protected  void refreshZoomButton()
           
 
Methods inherited from class javax.swing.JToolBar
add, addImpl, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, setFont, 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, 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, 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, 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, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toolbars

protected static java.util.Map<TrackerPanel,TToolBar> toolbars

trailLengths

protected static int[] trailLengths

newTrackIcon

protected static javax.swing.Icon newTrackIcon

trackControlIcon

protected static javax.swing.Icon trackControlIcon

trackControlOnIcon

protected static javax.swing.Icon trackControlOnIcon

zoomIcon

protected static javax.swing.Icon zoomIcon

clipOffIcon

protected static javax.swing.Icon clipOffIcon

clipOnIcon

protected static javax.swing.Icon clipOnIcon

axesOffIcon

protected static javax.swing.Icon axesOffIcon

axesOnIcon

protected static javax.swing.Icon axesOnIcon

tapeOffIcon

protected static javax.swing.Icon tapeOffIcon

tapeOnIcon

protected static javax.swing.Icon tapeOnIcon

tapeOffRolloverIcon

protected static javax.swing.Icon tapeOffRolloverIcon

tapeOnRolloverIcon

protected static javax.swing.Icon tapeOnRolloverIcon

stickOffIcon

protected static javax.swing.Icon stickOffIcon

stickOnIcon

protected static javax.swing.Icon stickOnIcon

stickOffRolloverIcon

protected static javax.swing.Icon stickOffRolloverIcon

stickOnRolloverIcon

protected static javax.swing.Icon stickOnRolloverIcon

pointsOffIcon

protected static javax.swing.Icon pointsOffIcon

pointsOnIcon

protected static javax.swing.Icon pointsOnIcon

velocOffIcon

protected static javax.swing.Icon velocOffIcon

velocOnIcon

protected static javax.swing.Icon velocOnIcon

accelOffIcon

protected static javax.swing.Icon accelOffIcon

accelOnIcon

protected static javax.swing.Icon accelOnIcon

traceOffIcon

protected static javax.swing.Icon traceOffIcon

traceOnIcon

protected static javax.swing.Icon traceOnIcon

labelsOffIcon

protected static javax.swing.Icon labelsOffIcon

labelsOnIcon

protected static javax.swing.Icon labelsOnIcon

xmassOffIcon

protected static javax.swing.Icon xmassOffIcon

xmassOnIcon

protected static javax.swing.Icon xmassOnIcon

autotrackerOffIcon

protected static javax.swing.Icon autotrackerOffIcon

autotrackerOnIcon

protected static javax.swing.Icon autotrackerOnIcon

infoIcon

protected static javax.swing.Icon infoIcon

refreshIcon

protected static javax.swing.Icon refreshIcon

htmlIcon

protected static javax.swing.Icon htmlIcon

trailIcons

protected static javax.swing.Icon[] trailIcons

stretchValues

protected static int[] stretchValues

stretchIcons

protected static javax.swing.Icon[] stretchIcons

separatorIcon

protected static javax.swing.Icon separatorIcon

zoomFormat

protected static java.text.NumberFormat zoomFormat

trackerPanel

protected TrackerPanel trackerPanel

refreshing

protected boolean refreshing

infoListener

protected java.awt.event.WindowListener infoListener

stretch

protected int stretch

openButton

protected javax.swing.JButton openButton

openBrowserButton

protected javax.swing.JButton openBrowserButton

saveButton

protected javax.swing.JButton saveButton

saveZipButton

protected javax.swing.JButton saveZipButton

newTrackButton

protected TButton newTrackButton

trackControlButton

protected javax.swing.JButton trackControlButton

clipSettingsButton

protected javax.swing.JButton clipSettingsButton

calibrationButton

protected TToolBar.CalibrationButton calibrationButton

axesButton

protected javax.swing.JButton axesButton

zoomButton

protected javax.swing.JButton zoomButton

autotrackerButton

protected javax.swing.JButton autotrackerButton

traceVisButton

protected javax.swing.JButton traceVisButton

pVisButton

protected javax.swing.JButton pVisButton

vVisButton

protected javax.swing.JButton vVisButton

aVisButton

protected javax.swing.JButton aVisButton

xMassButton

protected javax.swing.JButton xMassButton

trailButton

protected javax.swing.JButton trailButton

labelsButton

protected javax.swing.JButton labelsButton

stretchButton

protected javax.swing.JButton stretchButton

trailLength

protected int trailLength

newPopup

protected javax.swing.JPopupMenu newPopup

selectPopup

protected javax.swing.JPopupMenu selectPopup

showTrackControlItem

protected javax.swing.JMenuItem showTrackControlItem

selectNoneItem

protected javax.swing.JMenuItem selectNoneItem

notesButton

protected javax.swing.JButton notesButton

refreshButton

protected javax.swing.JButton refreshButton

desktopButton

protected javax.swing.JButton desktopButton

toolbarFiller

protected java.awt.Component toolbarFiller

toolbarComponentHeight

protected int toolbarComponentHeight

cloneMenu

protected javax.swing.JMenu cloneMenu

notYetCalibrated

protected boolean notYetCalibrated

clipSettingsDialogListener

protected java.awt.event.ComponentListener clipSettingsDialogListener

zoomPopup

protected javax.swing.JPopupMenu zoomPopup
Method Detail

createGUI

protected void createGUI()
Creates the GUI.


refreshZoomButton

protected void refreshZoomButton()

refresh

protected void refresh(boolean refreshTrackProperties)
Refreshes the GUI.

Parameters:
refreshTrackProperties - true to refresh the track display properties

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to the following events: "selectedtrack", "selectedpoint", "track" from tracker panel, "locked" from tracks, "visible" from tape and axes.

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

getNewTracksPopup

protected javax.swing.JPopupMenu getNewTracksPopup()
Refreshes and returns the "new tracks" popup menu.

Returns:
the popup

getToolbar

public static TToolBar getToolbar(TrackerPanel panel)
Gets the toolbar for the specified tracker panel.

Parameters:
panel - the tracker panel
Returns:
the toolbar

getLoader

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

Returns:
the XML.ObjectLoader