next up previous contents index
Next: 8.6 Limitations Up: 8. SCC - A Previous: 8.4 Example   Contents   Index


8.5 Applet Interface

The user may provide a customized interface for the model. This is done by manually writing a Java application, which instantiates the model class and provides input/output channels to it.

Figure 8.4: Applet interface for the Java code synthesized from a DCharts model
Image appletinterface

A general applet interface is written to be used with any DCharts model. It is embedded in webpages and executed in a JVM, as shown in Figure 8.4. This interface has a similar look as the SVM simulator. The state hierarchy is shown as a tree in the left panel. All the enabled events are listed in the ``Events'' list. The ``Output'' box displays the output from the model. The ``Command'' box accepts commands from the user. Accepted commands are limited to enabled events. Debugging is not supported. Exiting the program is not applicable for an applet.

This applet is written in Java source file svmapplet.java in the test/applet/ subdirectory of the SVM directory. It supports a model parameter. Its value is the name of the model class to be loaded. The applet automatically looks for the model class and instantiates an instance of it. If an error occurs, an error message is displayed.


next up previous contents index
Next: 8.6 Limitations Up: 8. SCC - A Previous: 8.4 Example   Contents   Index
Thomas Huining Feng 2004-04-28