Package jgromacs.ui
Class Application
java.lang.Object
jgromacs.ui.Application
- Direct Known Subclasses:
TemplateApplication
Parent class of JGromacs applications.
You can extend this class to write JGromacs applications.
(See TemplateApplication.java !)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intAsks the user which index set is to be selected from the index set listprotected intaskIndexSetFromUser(IndexSetList list, String question) Asks the user which index set is to be selected from the index set listprotected voidcanRunWithoutArgument(boolean can) Sets if the application can run without argumentprotected StringgetArgumentValue(String flag) Returns the value defined by the given attribute flagprotected StringReturns the name of log fileprotected booleanisArgumentGiven(String flag) Returns true if the attribute defined by the given flag was called by the userprotected voidDon't override this method!protected abstract voidrunCore()You can override this method to include your own code.protected voidsetLogFileName(String filename) Sets the name of log fileprotected voidsetWritingToLogFile(boolean write) Sets if the application writes log fileprotected voidwriteToLogFile(String text) Sets if the application writes log file
-
Field Details
-
XMLFileName
XML configuration file name
-
-
Constructor Details
-
Application
public Application()Constructor
-
-
Method Details
-
run
Don't override this method! -
runCore
protected abstract void runCore()You can override this method to include your own code. This is the entry point of your program. -
isArgumentGiven
Returns true if the attribute defined by the given flag was called by the user- Parameters:
flag- attribute flag
-
getArgumentValue
Returns the value defined by the given attribute flag- Parameters:
flag- attribute flag- Returns:
- value
-
askIndexSetFromUser
Asks the user which index set is to be selected from the index set list- Parameters:
list- index set list to select fromquestion- question to be asked- Returns:
- list index of selected index set
-
askIndexSetFromUser
Asks the user which index set is to be selected from the index set list- Parameters:
list- index set list to select from- Returns:
- list index of selected index set
-
canRunWithoutArgument
protected void canRunWithoutArgument(boolean can) Sets if the application can run without argument- Parameters:
can- true if the application runs without argument
-
setWritingToLogFile
protected void setWritingToLogFile(boolean write) Sets if the application writes log file- Parameters:
write- true if the application writes log file
-
setLogFileName
Sets the name of log file- Parameters:
filename- name of log file
-
writeToLogFile
Sets if the application writes log file- Parameters:
write- true if the application writes log file
-
getLogFileName
Returns the name of log file- Returns:
- name of log file
-