03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Custom Applets<br />

ptolemy/domains/domain/domain.jar — A domain specific jar file such as de.jar, where domain is<br />

replaced by a domain name;<br />

ptolemy/domains/domain/demo/Demo/Demo.jar — A model-specific jar file. Models with sophisticated<br />

GUIs that use Listeners can result in multiple .class files per .java file, so having a jar file<br />

can help download speeds.<br />

The third jar file is not needed if the model resides in a single .class file. To use jar files, you must<br />

modify the HTML shown in figure 8.2 to read as shown in figure 8.11.<br />

An important downside of using jar files is that during Java development, one must regenerate the<br />

jar files each time a Java file is recompiled. If you are developing an applet, you may want to avoid<br />

using jar files, or only include jar files that are from packages that are not actively being developed.<br />

How Jar files are built. To know which jar files in the Ptolemy <strong>II</strong> tree you might need for your applet,<br />

you need to know how the jar files are constructed. The short story is that every package has a jar file<br />

that includes subpackages. Since the package structure mirrors the directory structure, it is easy to<br />

FIGURE 8.10. Result of running the applet of figure 8.8 with horizontal layout, and including the top-level<br />

parameters.<br />

<br />

<br />

<br />

<br />

No Java Plug-in support for applet, see<br />

http://java.sun.com/products/plugin/<br />

<br />

FIGURE 8.11. An HTML segment that modifies that of figure 8.2 to use jar files. This text can be found in<br />

$PT<strong>II</strong>/doc/tutorial/tutorialApplet4.htm.<br />

Heterogeneous Concurrent Modeling and Design 8-243

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!