org.jaitools.demo.jiffle
Class JiffleExecutorDemo

java.lang.Object
  extended by org.jaitools.demo.jiffle.JiffleDemoBase
      extended by org.jaitools.demo.jiffle.JiffleExecutorDemo

public class JiffleExecutorDemo
extends JiffleDemoBase

Demonstrates the use of JiffleExecutor to run a script.
There are two options for running a Jiffle script...

  1. Directly, by getting a JiffleRuntime object from the compiled Jiffle object.
  2. Indirectly, by submitting a Jiffle object to a JiffleExecutor.
The advantage of the second method for computationally demanding tasks is that execution is carried out in a separate thread. The caller is informed about completion or failure via JiffleEvents and can track progress using a JiffleProgressListener.

Since:
1.1
Version:
$Id: JiffleExecutorDemo.java 1654 2011-06-16 10:46:55Z michael.bedward $
Author:
Michael Bedward

Field Summary
 
Fields inherited from class org.jaitools.demo.jiffle.JiffleDemoBase
HEIGHT, WIDTH
 
Constructor Summary
JiffleExecutorDemo()
          Constructor.
 
Method Summary
 void compileAndRun(java.io.File scriptFile)
          Compiles a script read from a file and submits it for execution.
static void main(java.lang.String[] args)
          Run the demonstration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiffleExecutorDemo

public JiffleExecutorDemo()
Constructor. Creates an instance of JiffleExecutor and sets up event handling.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Run the demonstration. The optional arg can be either the path to a user-supplied script or one of "chessboard", "interference", "ripple" or "squircle".

Parameters:
args - (optional) the script to run
Throws:
java.lang.Exception - on problems compiling the script

compileAndRun

public void compileAndRun(java.io.File scriptFile)
                   throws java.lang.Exception
Compiles a script read from a file and submits it for execution.

Parameters:
scriptFile - file containing the Jiffle script
Throws:
java.lang.Exception - on problems compiling the script


Copyright © 2011. All Rights Reserved.