|TAMS / Java / Hades / applets: contents|
This page describes the basic usage of the Hades simulator applet.
System requirements and browser setup:
General information and user-interface:
Additional and further documentation:
System requirements and setup
Java JDK/JRE 1.4.2 or higherTo run the Hades applets, you will need a Java-enabled HTML-browser with support for at least Java version 1.4.0. All such browsers can be used to view the applet pages; this includes Internet Explorer, Firefox, Mozilla, Opera, Safari, Konqueror, etc. The applets were developed with and have been tested using JDK/JRE (Java development kit or Java runtime environment) version 1.4.2 on Windows and Linux machines, but should also run on newer Java virtual machines (namely Java 5.0) and different operating systems including Mac OS X. Please make sure to enable Java support in your browser's preferences before trying to run the applets. You should also enable the Java console if your browser provides a separate setting for this, because some status and error messages are directed to the console.
Java webstartYou can also run the simulation framework as a standalone application via the webstart (.jnlp) links from the table-of-contents page and all applet pages. Once you click on one of the webstart links, the Java webstart installer should automatically download and check the Hades software and ask you again before running the simulator. If your browser just displays the .jnlp files as an XML-document, you might have to (re-)install a suitable version of Java or change your browser settings - please consult your browser documentation. If your browser queries you about how to handle .jnlp files, you might try to select the javaws (.exe) program from your Java virtual machine installation, e.g. $JDKDIR/jre/javaws/javaws. Note that saving a .jnlp file locally is useless, because the file contains hardcoded references to our webserver.
Memory limitUnfortunately, the default installation of the Java-plugin sets an upper limit of 64 MBytes of memory size for all applets running in your browser. This limit is no problem for most of the smaller demonstrations, but is way too small for some of the larger circuits. The default applet caching mechanism implies that parts of the total memory are reserved for recently visited applets, which reduces the amount of memory for the current active applet. Also, there seems to be an (as yet undiscovered) memory-leak, which means that about 0.5 MBytes of memory are lost each time an applet is opened. If you step through the list of all applets, the limit of 64 MBytes is quickly reached.
If the Java plugin runs out of memory, the applets will react very slowly to user input, and the simulation might show bugs due to internal out-of-memory errors. In this case, you will have to exit and restart your browser, because there is currently no way to re-initialize the Java plugin or to increase the amount of memory at runtime.
Therefore, it is recommended to specify a larger amount of memory
before running the applets.
Open the Java plugin control panel and select a larger maximum
amount of memory via the user-interface or runtime switches.
For example, add the
The details depend on your operating system and Java version;
please check your system documentation or ask your local Java guru for help.
In the original JDK/JRE from Sun Microsystems, the Java plugin control panel
application is located at $JDKDIR/jre/bin/ControlPanel(.exe).
The image below shows a screenshot of the control panel with the
Download time and problemsA big advantage of using Java applets is that the user does not need to keep track on how to install and update the applet software. You only need a web-browser with installed Java virtual machine, and the applet software will be downloaded and started automatically.
The downside, however, is that you also need some patience, because downloading the software will take a while, especially on slow (analog modem) dialup lines. Once loaded, the applet software files will be cached by your browser, so that re-opening the web-page with the applet or opening another web-page that uses the same applet code will be much faster. For the Hades applet demos, loading the first applet will be quite slow, but opening another webpage should take a few seconds at most.
Unfortunately, the security mechanisms of Java enforce that your browser will not start a Java applet until it has downloaded the complete applet software. If the applet is digitally signed, the browser will also check those signatures before trying to run the applet code.
If the webmaster chooses to use the standard Hades software archive
To reduce the download and startup times, the webmaster might also
decide to partition the Hades software archives.
This makes sense, because most applets reference and use only a small
subset of all simulation models contained in the complete
At the moment, we are not quite sure whether the monolithic-big-applet-archive approach or the multiple-smaller-applet-archives approach is better. The former incurs a possibly very long startup time at the first download, but no additional download times are required afterwards; also, the single applet archive is easier to maintain. The latter means that the basic applets start faster, but additional download pauses are required when browsing through the applet collection. Please provide your feedback and ideas about this problem!
Applet configurationMany attributes of the Hades user-interface and simulator can be controlled via entries in configuration files. This includes default values for colors, fonts, simulation control and startup, etc. The global configuration file, called hades/.hadesrc, is read together with the Java software from the the hades.jar archive file. It mainly provides useful default settings.
A webdesigner can specify a second configuration file via
After reading those global configuration files, the Hades editor attempts to read the user and local configuration files, which allows you to customize the simulator to your personal perferences. While the Hades applet will also try to read these files, the default security settings deny all file access to Java applets, which means that reading your local configuration files will fail.
Applet security and .java.policyFor obvious and good reasons, severe security restrictions apply to Java applets downloaded from the web. Unless you tell your browser and Java plug-in that an applet should be considered trustworthy, it is denied all security-relevant functions: windows created by the applet carry a warning banner ("applet window"), all file and most network operations are denied, printing is disabled, as are many other operations.
However, the security mechanism used by Java allows you to specify exactly
what operations are to be permitted for each application and applet,
based on the original codebase (webserver URL).
To allow the Hades applets to read files on your local computer,
you will have to edit the global Java security configuration file,
Please check your Java documentation for details about creating and editing the policy file via the policytool program. Unfortunately, that program is rather user-unfriedly and difficult to use. Therefore, we offer a small utility to help you create a java.policy file with the settings required to run Hades with full functionality as an applet. Please click the following link for details about our Java Policy Editor.
Finally, it is also possible to just edit the policy file
with your favorite text editor;
just make sure not to introduce any syntax errors.
(While our sample configuration file also includes an example (commented out) of the AllPermission setting, this should only be used during applet development or when all else fails. Visiting an unknown website with the AllPermission setting in effect is not a good idea.)
User-interface overviewThe Hades applet consists of the main schematics viewer component in the center and the simulation control panel at the bottom. As the applets are meant to teach the behaviour of digital circuits via demonstrations of pre-defined examples, most editing functions are disabled and you cannot modify the structure of the circuits. However, you can control all switches and change the parameters of simulation components (e.g. gate-delays or memory contents) via the edit component function and the corresponding property sheet dialog windows. Most configuration options and edit commands can be selected either via the popup-menu or alternatively via bindkeys from the schematics viewer.
Please check the applet welcome page and user-interface overview for an introduction and interactive demonstration(s) of the Hades applet. Follow the "next" links on the pages to learn about the the basic concepts of the Hades user-interface.
Fixed applet size, or external windowDue to limitations in the current versions of HTML and XHTML, the size of embedded interactive objects like Flash animations or Java applets has to be specified in the documents, usually via fixed numbers. The optional resize-function provided by Java applet does not work in most browsers. Therefore, resizing the browser window will not resize the applets.
For best compatibility with the standard screen resolutions found on current LCD monitors and projectors (800x600 and 1024x768 pixels), all applet webpages contain relatively small applets at 700x500 pixels. This allows to display the navigation menu on the left together with the applet and the first few lines of circuit description on the screen. The zoom factor of the editor is then calculated so that the circuit schematics into the applet. This works well for most of the simple circuits, but may result in pretty small zoom factors for some of the more complex circuits.
If necessary, select the open in external window popup-menu item to open a new external window and to display the circuit schematics in this window. You can then resize the window to fit your screen. When you next select the open in external window function, the applet should remember the window size and position selected previously. Click the window-close button to close the external window and return to the inline applet embedded into the webpage.
Popup-MenuMost configuration options and edit commands can be selected both via the popup-menu or bindkeys from the schematics viewer. Please visit the popup-menu page for a description and screenshot of the popup-menu.
BindkeysWhile you can select most of the applet commands via the control buttons or the popup-menu, it is often much faster to type bindkeys (also called accelerator keys) to select frequently used functions.
Note that the behaviour of the Hades editor depends on whether view-mode is selected or not. When view-mode is active, the editor first checks whether some input component (switch, power-on-reset, clock-generator, etc.) is registered for a keystroke. If such component is found, the keystroke is used to control the component, which is much easier and faster than moving the mouse around to click on the component. If the tooltips to be used to control simulation components are not indicated in the schematics or corresponding documentation, just enable tooltips (via the popup-menu) and rest the mouse cursor a few seconds over a component. The tooltip window indicates the shortcut key for that component.
Often, the '
If view-mode is deselected, the editor will bind many simple keystrokes
to edit commands, e.g. '
In both view-mode and edit-mode, the Hades editor and applet also accept several of the common keyboard shortcuts, when used together with the control-key as a modifier.
Additionally, the Hades applet supports the following bindkeys, unless those keys are used to control input switches in the current schematics:
Simulation controlYou can use the buttons on the simulator control panel at the bottom of the applet area (or editor window) to start, pause, or stop the simulation. The following screenshot shows the layout of the control panel; from left to right:
Logic model and glow-mode colorsThe so-called 'glow-mode' of the Hades applets uses different colors to indicate the current logical value of the wires (signals) that connect the simulation components. During the simulation, the colors are updated whenever a logical value changes, so that you can easily watch the behaviour of your circuits.
Most gate-level simulation models in Hades use a nine-valued logic model based on the industry-standard system called 'std_logic_1164'. For details, please see the logic values and glow-mode colors demonstration page. The main idea is to provide additional logic values besides the standard values '0' (low voltage) and '1' (high voltage), so that the simulation can distinguish other important situations like 'X' (unknown value) or 'Z' (tri-state, not-driven).
The actual mapping from logical value to colors depends on the signal type and the settings in your Hades configuration files. In the default configuration of the applets, the following colors are used for the five most important states:
The use of the rather 'aggressive' colors cyan and magenta for the 'U' and 'X' values makes it very easy to spot problems (like unconnected or short-circuited signals) during the simulation.
SwitchesThe main purpose of the applets is to allow you "to play" with digital circuits. In the default simulation mode, the simulator tracks the current inputs to the circuit and calculates and visualizes the corresponding state of all gates and signals of the circuit. While some circuits are fully self-contained or driven by special stimuli generator components, most circuits include interactive switches, that allow you to change the inputs to the circuit in real-time and watch the corresponding changes in circuit state.
There are several variants of interactive switches. Please check the interactive switches demos for further information:
Slow startup:Please see the download tips above for information about a possible slow startup of the applets. You will need some patience for the first download when downloading the applets over a standard analog or ISDN modem connection.
Deadlocks:In general, the applets should work pretty well and reliably. Unfortunately, a few of the applets can be troublesome on specific combinations of Java virtual machine and browser. For example, some Linux systems with JDK 1.4.2 installed will load and run the image processing demos without problems, but the virtual machine may deadlock for unknown reasons when trying to exit the webpage with the image processing demo. In case of such problems, you will usually have to exit and restart your browser. In some rare cases, you might even have to kill the Java virtual machine via your operating system (e.g. task manager). Most of these problems seem to be fixed in JDK 1.5.0.
Please provide detailed feedback (applet, operating system, browser, Java virtual machine, ...) when you experience such problems in order to help debugging.
Keyboard focus problems:Unfortunately, keyboard input into applets does not always work as expected, due to bugs in the interaction between the Java virtual machine and the web-browser(s).
A frequent problem is that the applets do not react to keyboard input at all, because the browser does not give them the so-called keyboard focus: in other works, the browser does not propagate keyboard events to the applets. For example, on my Linux system with Mozilla (1.7.7), this seems to happen when the applets are not completely visible due to a small browser window size. Naturally, due to the large number of operating-system/browser/JavaVM combinations, many different behaviours are possible. Try the following actions to restore the keyboard focus to the applet:
User-interface getting slowIf the user-interface of the active applet begins to feel really slow, the Java virtual machine might have run (almost) out of memory, so that garbage-collection overhead completely dominates actual useful computation. Please quit and restart your browser.
Memory usage (out of memory errors)As noted above, the default installation of the Java-plugin sets an upper limit of 64 MBytes of memory size for all applets running in your browser, which may be too small. If necessary, increase the memory limit as explained above. If the Java virtual machine runs out of memory, you will have to quit and then restart your browser.
Further documentationFor further documentation, please check the following pages:
|Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)|