org.opensourcephysics.cabrillo.tracker
Class Tracker

java.lang.Object
  extended by org.opensourcephysics.cabrillo.tracker.Tracker

public class Tracker
extends java.lang.Object

This is the default Tracker application.

Author:
Douglas Brown

Field Summary
protected static java.util.Locale[] locales
           
static java.lang.String rootXMLPath
           
static javax.swing.ImageIcon TRACKER_ICON
          the tracker icon
static javax.swing.ImageIcon TRACKER_ICON_256
          a larger tracker icon
 
Constructor Summary
Tracker()
          Constructs Tracker with a blank tab.
Tracker(Video video)
          Constructs Tracker with a video.
 
Method Summary
protected static void addRecent(java.lang.String filename, boolean atEnd)
          Adds a path to the list of recent files.
protected static boolean areEqual(java.util.Set<?> set1, java.util.Set<?> set2)
          Determines if two sets contain the same elements.
protected static void createActions()
          Creates the actions.
protected static java.util.Set<java.lang.String> getDefaultConfig()
          Gets the default set of configuration properties.
 TFrame getFrame()
          Gets the frame.
protected static java.util.Set<java.lang.String> getFullConfig()
          Gets the full set of configuration properties.
static java.awt.Image getOSXDockImage()
          Gets an image for the OSX dock.
static Tracker getTracker()
          Gets the shared Tracker for single-VM use.
protected static java.awt.Cursor getZoomInCursor()
          Gets the zoomInCursor.
protected static java.awt.Cursor getZoomOutCursor()
          Gets the zoomOutCursor.
protected static void loadCurrentVersion(boolean ignoreInterval)
           
protected static void loadPreferences()
          Loads preferences from a preferences file, if any.
protected static void loadStarterPrefs()
          Loads preferences from the deprecated tracker_starter prefs file.
protected static void logTime(java.lang.String message)
          Logs the current time (to milliseconds) with a message.
static void main(java.lang.String[] args)
          Main entry point when used as application.
protected static void relaunch(int memorySize, java.lang.String javaPath)
          Attempts to relaunch Tracker with specified runtime parameters.
protected static java.lang.String savePreferences()
          Saves the current preferences.
protected static void setCache(java.lang.String cachePath)
          Sets the cache path.
protected static void setDefaultConfig(java.util.Set<java.lang.String> config)
          Sets the default set of configuration properties.
protected static void setPreferredLocale(java.lang.String localeName)
          Sets the preferred locale.
protected static void setProgress(int progress)
          Sets the progress in percent for splash display.
protected static void setRecentSize(int max)
          Sets the maximum size of the recent files list.
static void showAboutTracker()
          Shows the About Tracker dialog.
protected static void splash(java.lang.String message)
          Displays a message in the splash screen.
protected static boolean updateResources()
          Checks and updates QuickTime and other system resources.
protected static void writeRelaunchLog(java.lang.String cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACKER_ICON

public static final javax.swing.ImageIcon TRACKER_ICON
the tracker icon


TRACKER_ICON_256

public static final javax.swing.ImageIcon TRACKER_ICON_256
a larger tracker icon


rootXMLPath

public static java.lang.String rootXMLPath

locales

protected static java.util.Locale[] locales
Constructor Detail

Tracker

public Tracker()
Constructs Tracker with a blank tab.


Tracker

public Tracker(Video video)
Constructs Tracker with a video.

Parameters:
video - the video
Method Detail

getTracker

public static Tracker getTracker()
Gets the shared Tracker for single-VM use.

Returns:
the tracker panel

getFrame

public TFrame getFrame()
Gets the frame.

Returns:
the frame

getOSXDockImage

public static java.awt.Image getOSXDockImage()
Gets an image for the OSX dock.

Returns:
a Tracker icon image

showAboutTracker

public static void showAboutTracker()
Shows the About Tracker dialog.


createActions

protected static void createActions()
Creates the actions.


relaunch

protected static void relaunch(int memorySize,
                               java.lang.String javaPath)
Attempts to relaunch Tracker with specified runtime parameters.

Parameters:
frame - the existing TFrame
memorySize - the desired memory size in MB
javaPath - the java executable path
trackerJar - the Tracker jar filename

writeRelaunchLog

protected static void writeRelaunchLog(java.lang.String cmd)

getFullConfig

protected static java.util.Set<java.lang.String> getFullConfig()
Gets the full set of configuration properties.

Returns:
the full configuration set

getDefaultConfig

protected static java.util.Set<java.lang.String> getDefaultConfig()
Gets the default set of configuration properties.

Returns:
the default configuration set

setDefaultConfig

protected static void setDefaultConfig(java.util.Set<java.lang.String> config)
Sets the default set of configuration properties.

Parameters:
config - a set of configuration properties

setPreferredLocale

protected static void setPreferredLocale(java.lang.String localeName)
Sets the preferred locale.

Parameters:
localeName - the name of the locale

setCache

protected static void setCache(java.lang.String cachePath)
Sets the cache path.

Parameters:
cachePath - the cache path

updateResources

protected static boolean updateResources()
Checks and updates QuickTime and other system resources.

Returns:
true if any resources were updated

areEqual

protected static boolean areEqual(java.util.Set<?> set1,
                                  java.util.Set<?> set2)
Determines if two sets contain the same elements.

Parameters:
set1 -
set2 -
Returns:
true if the sets are equal

loadCurrentVersion

protected static void loadCurrentVersion(boolean ignoreInterval)

loadPreferences

protected static void loadPreferences()
Loads preferences from a preferences file, if any.


savePreferences

protected static java.lang.String savePreferences()
Saves the current preferences.

Returns:
the path to the saved file

getZoomInCursor

protected static java.awt.Cursor getZoomInCursor()
Gets the zoomInCursor.

Returns:
the cursor

getZoomOutCursor

protected static java.awt.Cursor getZoomOutCursor()
Gets the zoomOutCursor.

Returns:
the cursor

main

public static void main(java.lang.String[] args)
Main entry point when used as application.

Parameters:
args - array of tracker or video file names

splash

protected static void splash(java.lang.String message)
Displays a message in the splash screen.

Parameters:
message -

setProgress

protected static void setProgress(int progress)
Sets the progress in percent for splash display.

Parameters:
progress - a number from 0 (start) to 100 (done)

logTime

protected static void logTime(java.lang.String message)
Logs the current time (to milliseconds) with a message.

Parameters:
message -

addRecent

protected static void addRecent(java.lang.String filename,
                                boolean atEnd)
Adds a path to the list of recent files.

Parameters:
filename - the absolute path to a recently opened or saved file.
atEnd - true to add at end of the list

setRecentSize

protected static void setRecentSize(int max)
Sets the maximum size of the recent files list. Limited to 12 or less.

Parameters:
max - the desired maximum size.

loadStarterPrefs

protected static void loadStarterPrefs()
Loads preferences from the deprecated tracker_starter prefs file.