org.opensourcephysics.controls
Class ControlUtils

java.lang.Object
  extended by org.opensourcephysics.controls.ControlUtils

public class ControlUtils
extends java.lang.Object


Method Summary
static java.lang.String e2(double d)
          Convert a double to a string, printing two decimal places including exponent.
static java.lang.String e3(double d)
          Convert a double to a string, printing three decimal places including exponent.
static java.lang.String e4(double d)
          Convert a double to a string, printing four decimal places including exponent.
static java.lang.String f2(double d)
          Convert a double to a string, printing two decimal places.
static java.lang.String f3(double d)
          Convert a double to a string, printing three decimal places.
static java.lang.String f4(double d)
          Convert a double to a string, printing four decimal places.
static java.lang.String getSystemProperties()
           
static javax.swing.JFileChooser getXMLFileChooser()
          Gets a file chooser.
static void loadParameters(Control control, java.awt.Component parent)
          Loads control parameters from a text file using a dialog box.
static void saveToFile(java.lang.Object object, java.awt.Component parent)
          Pops up a "Save File" file chooser dialog and takes user through process of saving and object to a file.
static void saveXML(java.lang.Object obj)
           
static javax.swing.JFrame showSystemProperties(boolean vis)
          Shows the about dialog.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

f2

public static java.lang.String f2(double d)
Convert a double to a string, printing two decimal places.

Parameters:
d - Input double

f3

public static java.lang.String f3(double d)
Convert a double to a string, printing three decimal places.

Parameters:
d - Input double

e2

public static java.lang.String e2(double d)
Convert a double to a string, printing two decimal places including exponent.

Parameters:
d - Input double

e3

public static java.lang.String e3(double d)
Convert a double to a string, printing three decimal places including exponent.

Parameters:
d - Input double

e4

public static java.lang.String e4(double d)
Convert a double to a string, printing four decimal places including exponent.

Parameters:
d - Input double

f4

public static java.lang.String f4(double d)
Convert a double to a string, printing four decimal places.

Parameters:
d - Input double

showSystemProperties

public static javax.swing.JFrame showSystemProperties(boolean vis)
Shows the about dialog.


getSystemProperties

public static java.lang.String getSystemProperties()

loadParameters

public static void loadParameters(Control control,
                                  java.awt.Component parent)
Loads control parameters from a text file using a dialog box.


saveToFile

public static void saveToFile(java.lang.Object object,
                              java.awt.Component parent)
Pops up a "Save File" file chooser dialog and takes user through process of saving and object to a file.

Parameters:
object - the object that will be converted to a string and saved
parent - the parent component of the dialog, can be null; see showDialog in class JFileChooser for details

saveXML

public static void saveXML(java.lang.Object obj)

getXMLFileChooser

public static javax.swing.JFileChooser getXMLFileChooser()
Gets a file chooser.

Returns:
the chooser