Class Tracker
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Tracker
This is the default Tracker application.
- Author:
- Douglas Brown, Wolfgang Christian, Robert M. Hanson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static final String
static boolean
static swingjs.api.JSUtilI
static boolean
static boolean
static final ImageIcon
the tracker iconstatic final ImageIcon
a larger tracker iconstatic String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
Adds a path to the list of recent files.protected static boolean
Determines if two sets contain the same elements.static void
askToSetMemory
(TFrame frame) Ask about preferred memory size for TToolBarprotected static void
static int
checkMemory
(TFrame frame, boolean ignoreLowMemory) Check the memory status for TrackerIO and warn the user if needed.static int
compareVersions
(String ver1, String ver2) Compares version strings.protected static void
Creates the actions.static void
exit()
findDataFunctions
(String dirPath) Finds data functions in all DataBuilder XMLControl files found in a specified directory.static URL
getClassResource
(String resource) If JavaScript, look in an asset zip file; if not, use Tracker.class.getResource() if not.static Collection<String>
Gets the default autoload search paths.Gets the default set of configuration properties.getFrame()
Gets the frame with alias for JavaScriptGets the full set of configuration properties.protected static Collection<String>
Gets the starting autoload search paths.static Locale[]
OSP API to get the main program frame.int[]
OSP API to get the main Tracker frame location.int[]
OSP API to get the main Tracker frame size.static Icon
getResourceIcon
(String imageName, boolean resizable) Gets an icon from a class resource image.static Tracker
getTracker
(Runnable whenLoaded) Gets the shared Tracker for single-VM use.protected static Cursor
Gets the zoomInCursor.protected static Cursor
Gets the zoomOutCursor.static boolean
protected static boolean
isZoomInCursor
(Cursor cursor) Determines if a cursor is the zoomInCursor.protected static boolean
isZoomOutCursor
(Cursor cursor) Determines if a cursor is the zoomOutCursor.static void
loadControls
(Class<?> trackType, FunctionPanel panel) static void
loadControlStringObjects
(Class<?> trackType, FunctionPanel panel) static void
loadControlStrings
(Runnable reload) protected static boolean
loadCurrentVersion
(boolean ignoreInterval, boolean logToFile, boolean dialogOK) Loads the current (latest) Tracker version number and compares it with this version.void
loadExperimentURL
(String path) Replace any open tabs with a single tab loaded with the given path.protected static void
Loads preferences from a preferences file, if any.protected static void
Logs the current time (to milliseconds) with a message.static void
Main entry point when used as application.protected void
protected static String
Saves the current preferences.protected static void
setDefaultConfig
(Set<String> config) Sets the default set of configuration properties.protected static void
setPreferredLocale
(String localeName) Sets the preferred locale.protected static void
setRecentSize
(int max) Sets the maximum size of the recent files list.static void
Shows the About Tracker dialog.protected static void
showUpgradeStatus
(TrackerPanel trackerPanel) Check for upgrades and show a dialog with upgrade info.protected static boolean
Checks and updates video engine resources if needed.
-
Field Details
-
loadTabsInSeparateThread
public static boolean loadTabsInSeparateThread -
TRACKER_TEST_URL
-
doHoldRepaint
public static boolean doHoldRepaint -
allowDataFunctionControls
public static boolean allowDataFunctionControls -
allowTableRefresh
public static boolean allowTableRefresh -
allowPlotRefresh
public static boolean allowPlotRefresh -
allowDataRefresh
public static boolean allowDataRefresh -
allowViews
public static boolean allowViews -
allowMenuRefresh
public static boolean allowMenuRefresh -
allowToolbarRefresh
public static boolean allowToolbarRefresh -
timeLogEnabled
public static boolean timeLogEnabled -
jsutil
public static swingjs.api.JSUtilI jsutil -
COPYRIGHT
- See Also:
-
TRACKER_ICON
the tracker icon -
TRACKER_ICON_256
a larger tracker icon
-
-
Constructor Details
-
Tracker
public Tracker()Constructs Tracker with a blank tab and splash. -
Tracker
Constructs Tracker with a video.- Parameters:
video
- the video
-
-
Method Details
-
getResourceIcon
Gets an icon from a class resource image.- Parameters:
imageName
- the name of the image, with no pathresizable
- true to return a ResizableIcon, otherwise returns ImageIcon
-
getLocales
-
getClassResource
If JavaScript, look in an asset zip file; if not, use Tracker.class.getResource() if not.- Parameters:
resource
- "resources/...."- Returns:
- URL (with byte[ ] in _streamData if OSPRuntime.isJS)
-
getTracker
Gets the shared Tracker for single-VM use.- Parameters:
whenLoaded
-- Returns:
- the shared Tracker
-
loadExperimentURL
Replace any open tabs with a single tab loaded with the given path. JavaScript only?- Parameters:
path
-
-
getFrame
Gets the frame with alias for JavaScript- Returns:
- the frame
-
getMainFrame
OSP API to get the main program frame.- Returns:
- OSPFrame
-
getMainFrameSize
public int[] getMainFrameSize()OSP API to get the main Tracker frame size. -
getMainFrameLocation
public int[] getMainFrameLocation()OSP API to get the main Tracker frame location. -
onWindowClosing
protected void onWindowClosing() -
exit
public static void exit() -
compareVersions
Compares version strings.- Parameters:
ver1
- version 1ver2
- version 2- Returns:
- 0 if equal, 1 if ver1>ver2, -1 if ver1<ver2
-
showAboutTracker
public static void showAboutTracker()Shows the About Tracker dialog. -
findDataFunctions
Finds data functions in all DataBuilder XMLControl files found in a specified directory. This returns a map for which the keys are names of DataBuilder xml files and the values are lists of data functions as String[] {function name, expression, tracktype}- Parameters:
dirPath
- the directory path- Returns:
- map of file name to list of data functions
-
createActions
protected static void createActions()Creates the actions. -
getFullConfig
Gets the full set of configuration properties.- Returns:
- the full configuration set
-
getDefaultConfig
Gets the default set of configuration properties.- Returns:
- the default configuration set
-
setDefaultConfig
Sets the default set of configuration properties.- Parameters:
config
- a set of configuration properties
-
autoloadDataFunctions
protected static void autoloadDataFunctions() -
getDefaultAutoloadSearchPaths
Gets the default autoload search paths.- Returns:
- the default search paths
-
getInitialSearchPaths
Gets the starting autoload search paths. Search paths may be later modified by the user.- Returns:
- the search paths
-
setPreferredLocale
Sets the preferred locale.- Parameters:
localeName
- the name of the locale
-
updateResources
protected static boolean updateResources()Checks and updates video engine resources if needed.- Returns:
- true if any resources were updated
-
areEqual
Determines if two sets contain the same elements.- Parameters:
set1
-set2
-- Returns:
- true if the sets are equal
-
showUpgradeStatus
Check for upgrades and show a dialog with upgrade info. Also refresh toolbar associated with TrackerPanel, if any.- Parameters:
trackerPanel
- a TrackerPanel (may be null)
-
loadCurrentVersion
protected static boolean loadCurrentVersion(boolean ignoreInterval, boolean logToFile, boolean dialogOK) Loads the current (latest) Tracker version number and compares it with this version.- Parameters:
ignoreInterval
- true to load/compare immediatelylogToFile
- true to log in to the PHP counterdialogOK
- true to notify user if newer version available- Returns:
- true if a newer version is found and user informed
-
loadPreferences
protected static void loadPreferences()Loads preferences from a preferences file, if any. -
savePreferences
Saves the current preferences.- Returns:
- the path to the saved file
-
getZoomInCursor
Gets the zoomInCursor.- Returns:
- the cursor
-
isZoomInCursor
Determines if a cursor is the zoomInCursor.- Returns:
- true if the cursor is zoonIn
-
getZoomOutCursor
Gets the zoomOutCursor.- Returns:
- the cursor
-
isZoomOutCursor
Determines if a cursor is the zoomOutCursor.- Returns:
- true if the cursor is zoomOut
-
main
Main entry point when used as application.- Parameters:
args
- array of tracker or video file names
-
logTime
Logs the current time (to milliseconds) with a message.- Parameters:
message
-
-
addRecent
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.
-
haveDataFunctions
public static boolean haveDataFunctions() -
loadControlStringObjects
- Parameters:
trackType
-panel
-
-
loadControlStrings
- Parameters:
reload
-
-
loadControls
- Parameters:
trackType
-panel
-
-
askToSetMemory
Ask about preferred memory size for TToolBar- Parameters:
frame
-
-
checkMemory
Check the memory status for TrackerIO and warn the user if needed.- Parameters:
frame
-ignoreLowMemory
-- Returns:
- MEMORY_OK, MEMORY_IGNORE, MEMORY_DONTIGNORE, MEMORY_OUT, MEMORY_INCREASE
-