| Raben Systems, Inc. | |
| Software Development Services |
| |
Home | About Us | Articles | Downloads | Planetary images | Solar maps | Solar images | Space weather graphs | Wireless |
|
Nov 11, 2004, VR. Embedding a scripting language such as Javascript in certain types of computer applications makes it much easier for the user to repeat complex tasks that may be customized. Imaging applications, in particular, fall into this category. Processing images frequently require repeating nearly identical operations on a large number of images.
|
An application could be developed to provide the needed operations and reduce the drudgery of performing them manually. Due to differing weather conditions, cameras, telescopes, lenses, or filters it may be necessary to adjust several parameters for each operation. Adding scripting capability lets the user customize parameters for a sequence of image operations.There are a number of scripting languages and ways to embed them in a Java™ application. Javascript was chosen because the language is widely used and readily available from the Mozilla Rhino project (See http://www.mozilla.org/download.html). Apache BSF (See http://jakarta.apache.org/bsf/index.html ) provides a way to embed not only Javascript, but several other scripting language as well. Unfortunately, as of this writing there are incompatibilites between the current versions of BSF and the Mozilla Javascript library. To avoid conflicts, the approach used here was to access the Javascript library directly. The following simple example illustrates how to execute Javascript from an application. Note that only three methods are called to execute the script. Method calls in Lines 32 and 33 initialize the JavaScript environment. Line 37 actually executes the script. In the next article, we'll develop a basic image library and show how to access it with embedded JavaScript. |
||
|
|||
| ©2003, 2004 Raben Systems, Inc. All rights reserved. |
|