|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display.OSPRuntime
public class OSPRuntime
This class defines static methods related to the runtime environment.
Field Summary | |
---|---|
static java.lang.Boolean |
antiAliasText
True if text components should try and anti-alias text. |
static javax.swing.JApplet |
applet
Static reference to an applet for document/code base access. |
static boolean |
appletMode
True if running as an applet. |
protected static boolean |
authorMode
True if users allowed to author internal parameters such as Locale strings. |
static java.lang.String |
chooserDir
File Chooser starting directory. |
static java.lang.String |
CROSS_PLATFORM_LF
|
static java.lang.String |
DEFAULT_LF
|
static javax.swing.LookAndFeel |
DEFAULT_LOOK_AND_FEEL
|
static boolean |
DEFAULT_LOOK_AND_FEEL_DECORATIONS
|
static java.util.Locale[] |
defaultLocales
Array of default OSP Locales. |
static boolean |
disableAllDrawing
Disables drawing for faster start-up and to avoid screen flash in Drawing Panels. |
static java.lang.String |
GTK_LF
|
protected static boolean |
launcherMode
Set true if a program is being run within Launcher. |
static boolean |
launchingInSingleVM
True if always launching in single vm (applet mode, etc). |
static boolean |
loadDataTool
Load Data Tool, if available. |
static boolean |
loadExportTool
Load Export Tool, if available. |
static boolean |
loadFourierTool
Load Fourier Tool, if available. |
static boolean |
loadOSPLog
Load OSP Log, if available. |
static boolean |
loadTranslatorTool
Load Translator Tool, if available. |
static boolean |
loadVideoTool
Load Video Tool, if available. |
static java.util.HashMap<java.lang.String,java.lang.String> |
LOOK_AND_FEEL_TYPES
|
static java.lang.String |
METAL_LF
|
static java.lang.String |
MOTIF_LF
|
static java.lang.String |
NIMBUS_LF
|
static java.lang.String |
OSP_ICON_FILE
Location of OSP icon. |
static java.lang.String |
SYSTEM_LF
|
static boolean |
webStart
True if launched by WebStart. |
static java.lang.String |
WINDOWS_LF
|
Method Summary | |
---|---|
static java.lang.String |
chooseFilename(javax.swing.JFileChooser chooser)
Uses a JFileChooser to ask for a name. |
static java.lang.String |
chooseFilename(javax.swing.JFileChooser chooser,
java.awt.Component parent,
boolean toSave)
Uses a JFileChooser to ask for a name. |
static javax.swing.JFileChooser |
createChooser(java.lang.String description,
java.lang.String[] extensions)
Creates a JFileChooser with given description and extensions |
static javax.swing.JFileChooser |
createChooser(java.lang.String description,
java.lang.String[] extensions,
java.io.File homeDir)
Creates a JFileChooser with given description and extensions |
static javax.swing.JFileChooser |
getChooser()
Gets a file chooser. |
static java.util.Locale[] |
getDefaultLocales()
Gets Locales for languages that have properties files in the core library. |
static java.util.Locale[] |
getInstalledLocales()
Gets Locales for languages that have properties files in the core library. |
static java.util.jar.JarFile |
getLaunchJar()
Gets the jar from which the progam was launched. |
static java.lang.String |
getLaunchJarDirectory()
Gets the launch jar directory, if any. |
static java.lang.String |
getLaunchJarName()
Gets the launch jar name, if any. |
static java.lang.String |
getLaunchJarPath()
Gets the launch jar path, if any. |
static Translator |
getTranslator()
Gets the translator, if any. |
static boolean |
isAppletMode()
Determines if running as an applet |
static boolean |
isAuthorMode()
Determines if running in author mode |
static boolean |
isDefaultLookAndFeelDecorated()
Returns true if newly created JFrame s or JDialog s should have their
Window decorations provided by the current look and feel. |
static boolean |
isLauncherMode()
Gets the launcherMode property. |
static boolean |
isLinux()
Determines if OS is Linux |
static boolean |
isMac()
Determines if OS is Mac |
static boolean |
isPopupTrigger(java.awt.event.InputEvent e)
Determines if an InputEvent is a popup trigger. |
static boolean |
isVista()
Determines if OS is Vista |
static boolean |
isWebStart()
Determines if launched by WebStart |
static boolean |
isWindows()
Determines if OS is Windows |
static void |
setAuthorMode(boolean b)
Sets the authorMode property. |
static void |
setLauncherMode(boolean b)
Sets the launcherMode property. |
static void |
setLaunchJarPath(java.lang.String path)
Sets the launch jar path. |
static boolean |
setLookAndFeel(boolean useDefaultLnFDecorations,
java.lang.String lookAndFeel)
Sets the look and feel of the user interface. |
static void |
showAboutDialog(java.awt.Component parent)
Shows the about dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static volatile boolean disableAllDrawing
public static boolean loadVideoTool
public static boolean loadExportTool
public static boolean loadDataTool
public static boolean loadFourierTool
public static boolean loadTranslatorTool
public static boolean loadOSPLog
public static java.util.Locale[] defaultLocales
protected static boolean launcherMode
public static java.lang.Boolean antiAliasText
public static boolean appletMode
public static javax.swing.JApplet applet
public static boolean webStart
protected static boolean authorMode
public static java.lang.String chooserDir
public static final java.lang.String OSP_ICON_FILE
public static boolean launchingInSingleVM
public static final java.lang.String CROSS_PLATFORM_LF
public static final java.lang.String NIMBUS_LF
public static final java.lang.String SYSTEM_LF
public static final java.lang.String METAL_LF
public static final java.lang.String GTK_LF
public static final java.lang.String MOTIF_LF
public static final java.lang.String WINDOWS_LF
public static final java.lang.String DEFAULT_LF
public static final javax.swing.LookAndFeel DEFAULT_LOOK_AND_FEEL
public static final boolean DEFAULT_LOOK_AND_FEEL_DECORATIONS
public static final java.util.HashMap<java.lang.String,java.lang.String> LOOK_AND_FEEL_TYPES
Method Detail |
---|
public static void showAboutDialog(java.awt.Component parent)
public static boolean setLookAndFeel(boolean useDefaultLnFDecorations, java.lang.String lookAndFeel)
useDefaultLnFDecorations
- lookAndFeel
-
public static boolean isDefaultLookAndFeelDecorated()
JFrame
s or JDialog
s should have their
Window decorations provided by the current look and feel. This is only
a hint, as certain look and feels may not support this feature.
public static boolean isWindows()
public static boolean isMac()
public static boolean isLinux()
public static boolean isVista()
public static boolean isPopupTrigger(java.awt.event.InputEvent e)
public static boolean isWebStart()
public static boolean isAppletMode()
public static boolean isAuthorMode()
public static void setAuthorMode(boolean b)
b
- booleanpublic static void setLauncherMode(boolean b)
b
- booleanpublic static boolean isLauncherMode()
public static void setLaunchJarPath(java.lang.String path)
public static java.lang.String getLaunchJarName()
public static java.lang.String getLaunchJarPath()
public static java.lang.String getLaunchJarDirectory()
public static java.util.jar.JarFile getLaunchJar()
public static java.util.Locale[] getDefaultLocales()
public static java.util.Locale[] getInstalledLocales()
public static Translator getTranslator()
public static javax.swing.JFileChooser getChooser()
public static java.lang.String chooseFilename(javax.swing.JFileChooser chooser)
chooser
- JFileChooser
public static java.lang.String chooseFilename(javax.swing.JFileChooser chooser, java.awt.Component parent, boolean toSave)
chooser
- JFileChooserparent
- Parent component for messagestoSave
- true if we will save to the chosen file, false if we will read from it
public static javax.swing.JFileChooser createChooser(java.lang.String description, java.lang.String[] extensions)
description
- String A description stringextensions
- String[] An array of allowed extensions
public static javax.swing.JFileChooser createChooser(java.lang.String description, java.lang.String[] extensions, java.io.File homeDir)
description
- String A description stringextensions
- String[] An array of allowed extensionshomeDir
- File The target directory when the user clicks the home icon
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |