Class ExampleScript5

java.lang.Object
  extended bycom.swath.UserDefinedScript
      extended byExampleScript5

public class ExampleScript5
extends UserDefinedScript

This script shows how to create and display your own custom parameter window. You can add any components you like. Read more about the Java Abstract Window Toolkit (AWT) or the Swing framework for information about how to use the different components available.

Since:
SWATH 1.4

Constructor Summary
ExampleScript5()
           
 
Method Summary
 void endScript(boolean finished)
          Called by the framework when the script is finished.
 java.lang.String getDescription()
          Called by the framework to get the description of the script.
 java.lang.String getName()
          Called by the framework to get the name of the script.
 boolean initScript()
          Called by the framework to initialise the script.
 boolean runScript()
          Called by the framework to run the script.
 
Methods inherited from class com.swath.UserDefinedScript
atPrompt, execInstance, getClassName, getParams, getResource, initInstance, postEvent, printTrace, printTrace, registerParam, showUserParamWindow, showUserParamWindow, sleep
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleScript5

public ExampleScript5()
Method Detail

getName

public java.lang.String getName()
Description copied from class: UserDefinedScript
Called by the framework to get the name of the script.
You should override this method.

Overrides:
getName in class UserDefinedScript
Returns:
The script name.

getDescription

public java.lang.String getDescription()
Description copied from class: UserDefinedScript
Called by the framework to get the description of the script.
You should override this method to provide a script description.

The script description can be an URL to a HTML page or file. It can also be normal HTML text or plain text.

By default, a file named ScriptClass.html or ScriptClass.txt is used if found.

Examples:

Overrides:
getDescription in class UserDefinedScript
Returns:
The script description.

initScript

public boolean initScript()
                   throws java.lang.Exception
Description copied from class: UserDefinedScript
Called by the framework to initialise the script.
You should override this method to make your own initialisation.

Overrides:
initScript in class UserDefinedScript
Returns:
true if the initialisation was successful, otherwise false.
Throws:
java.lang.Exception
See Also:
UserDefinedScript.atPrompt(int), UserDefinedScript.showUserParamWindow(Panel,int,int), UserDefinedScript.showUserParamWindow(JPanel,int,int)

runScript

public boolean runScript()
                  throws java.lang.Exception
Description copied from class: UserDefinedScript
Called by the framework to run the script.
You should override this method to define the script body.

Overrides:
runScript in class UserDefinedScript
Returns:
true if the script finished correctly, otherwise false.
Throws:
java.lang.Exception

endScript

public void endScript(boolean finished)
               throws java.lang.Exception
Description copied from class: UserDefinedScript
Called by the framework when the script is finished.
You can override this method to clean up after the script if needed.

Overrides:
endScript in class UserDefinedScript
Parameters:
finished - true if the script finished correctly or false if the script was interrupted in some way.
Throws:
java.lang.Exception