Package org.opensourcephysics.tools
Class EjsTool
java.lang.Object
org.opensourcephysics.tools.EjsTool
Utility classes to work with Ejs at a high level
- Version:
- 1.0
- Author:
- Francisco Esquembre (http://fem.um.es)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionejsConfirmList
(Component _target, Dimension _size, String _message, String _title, List<?> _list, JComponent _bottomComponent) This method receives a list of objects which it exposes to the user.static Dimension
getEjsAppletDimension
(Class<?> _ejsClass) Returns the preferred dimension for the simulation's main window.static String
Gets the path of a file in standard form.static String
static boolean
hasEjsModel
(Class<?> _ejsClass) Whether a class provides an Ejs model.static boolean
Runs the Ejs model corresponding to the given class.static boolean
Runs the Ejs model corresponding to the given class providing a given password The model and resources required will be extracted using the ResourceLoader utility.static void
saveInformation
(String _home, String _release) To be used by EJS version 3.47 and earlier only.static void
saveInformation
(String _binDirectoryPath, String _sourceDirectoryPath, String _release) To be used by EJS version 4.0 and later only.static void
-
Field Details
-
GET_MODEL_METHOD
- See Also:
-
GET_RESOURCES_METHOD
- See Also:
-
GET_APPLET_DIMENSION_METHOD
- See Also:
-
-
Constructor Details
-
EjsTool
public EjsTool()
-
-
Method Details
-
setLocale
-
getString
-
hasEjsModel
Whether a class provides an Ejs model.- Parameters:
_ejsClass
- Class- Returns:
- boolean
-
getEjsAppletDimension
Returns the preferred dimension for the simulation's main window.- Parameters:
_ejsClass
- Class- Returns:
- boolean
-
runEjs
Runs the Ejs model corresponding to the given class. The model and resources required will be extracted using the ResourceLoader utility.- Parameters:
_ejsClass
- Class- Returns:
- boolean true if successful
-
runEjs
Runs the Ejs model corresponding to the given class providing a given password The model and resources required will be extracted using the ResourceLoader utility.- Parameters:
_ejsClass
- Class_password
- String- Returns:
- boolean true if successful
-
saveInformation
To be used by EJS version 3.47 and earlier only. It is here to make sure that the information saved matches the information read by runEjs().- Parameters:
_release
- String
-
saveInformation
public static void saveInformation(String _binDirectoryPath, String _sourceDirectoryPath, String _release) To be used by EJS version 4.0 and later only. It is here to make sure that the information saved matches the information read by runEjs().- Parameters:
_binDirectoryPath
- String The binary directory from which EJS was launched_sourceDirectoryPath
- String The source directory path_release
- String The EJS release version
-
getPath
Gets the path of a file in standard form. If it is a directory, the path ends in "/" -
ejsConfirmList
-
ejsConfirmList
public static List<Object> ejsConfirmList(Component _target, Dimension _size, String _message, String _title, List<?> _list, JComponent _bottomComponent) This method receives a list of objects which it exposes to the user. The user can remove objects from the list and click OK. The class then returns the modified list. If the user clicks cancel it will return null- Parameters:
_target
- Component The dialog will be shown relative to this component_size
- Dimension The size of the display dialog_message
- String The message to display_title
- String The title for the display dialog_list
- java.util.List<?> The initial list of objects_bottomComponent
- JComponent and additional component to show at the bottom- Returns:
- AbstractList
-