One of the main design goals was to present constructions and assignments in the Internet. This is easily possible with Java.
C.a.R. can generate HTML pages for your constructions automatically. There are two types. You can either let C.a.R. generate the complete web page, or use a template page. We explain this in detail.
There is also a special applet type that displays as a perpetual demo.
By using templates, the user can easily generate HTML pages in the style he likes. Templates contain all necessary information like colors, applet size and others. The current construction and the values in the export dialog are used to replace placeholders in the template file, and to generate the HTML file.
When exporting with templates, one has to choose a template file first, then edit the export dialog, and finally to choose the HTML output file.
Some templates require sections in the construction comment, separated by a line "~". These sections can be used at different places in the web page.
You find the following sample templates in the folder "Templates" in the documentation files.
Template | Description |
---|---|
Very simple | Applet, followed by the construction comment (example). |
Simple | Applet, followed by the construction comment in C.a.R. colors and fonts (example). |
Simple with header | First section of the construction comment, followed by the applet and the second section of the construction comment (example). |
Tutorial | A table layout using two comment sections (example). |
Here is a description of the lines of the export dialog.
This is the title of your page in <H1> style.
A relative path from the HTML file to the "zirkel.jar" file. An examples is "..", if the file is in the directory above the HTML file.
The name of the file containing the construction, usually in the same directory as the HTML file. However, the file names must be given relative to the program archive "zirkel.jar"! Absolute URLs and paths are not allowed here. An example of a relative file is "folder/file.zir".
These two icon bars let you choose the tools, which should be displayed to the user. You can get more information on the tools in the tooltips which are displayed when the mouse remains over the icon for a while.
In any case, one
should provide the undo tool.
With the
this icon the user gets
two lines of tools.
The user can only define macros, if you give him the macro tool .
And he can only
macros only, if this tool is available.
The icons with the question mark are switches for the object selection dialog, the question for points on objects and for intersections. Normally, all these dialogs and questions are turned off in applets. You might also want to enable the indicate button.
The non-visual mode, the icons help the user to find the syntax. In this mode, all construction tools work.
After the dialog, the user must choose a file in a file dialog, and one for the solution. Then you need to publish
The user can create own templates with any editor. However, foreign language users will have to use an editor, capable of editing UTF-8, like Mozilla's HTML editor, Frontpage or JE (same author as C.a.R.). Template files should have the extension "*.template".
You can use the following placeholders in your template file.
Placeholder | Result |
---|---|
#title | Replaced by the title from the export dialog. |
#comment1, #comment2, ... | Replaced by the sections of the comment (separated by lines "~"). Each paragraph is wrapped in <p>...</p> |
#comment | All of the comment. |
#text1, #text2, ... | Replaced by the sections of the comment. |
#text | All of the comment. |
#parameter | The necessary applet parameters. |
#color | Additional parameters for colors. |
#font | Additional parameters for fonts. |
#codebase | Codebase from the export dialog. This parameter should be right after CODE="..." |
Exporting without templates is no longer recommended. However, we keep this option for a while, until users get used to templates.
Note that tracks and animations are saved with the construction. They will automatically reappear in constructions, which are displayed over the Net. In this case, there is no user interaction. So you should use the plain or border style for these applets.
Here is the export dialog.
Cascading Style Sheets are useful to give several pages a common appearance. If you do not use them, leave the input empty. In the example above, the style file is in the parent directory of the construction (in this case the directory Demos).
The dimensions of the applet display.
This is the archive that you should have or that you can download from the home page of C.a.R.
You can choose a color for the page background and for the applet background. The color can be chosen with the button below.
Moreover, there are switches to save the defined colors for the construction elements and for the construction background. The background of the construction can be different from the background of the applet and the background of the page.
Will save the settings for the number of digits. Should be enabled.
This will put the comment below the applet. All browsers should be able to handle the default UTF-8 encoding. If not switch to the Windows encoding in the special settings.
This is the dialog to export an assignment.
Need to be checked to save the construction as an assignment.
These settings allow the automatic generation of a solution page, which is a separate page to display the solution. After the user finishes the assignment, the browser can jump directly to the solution page. One can also set a link to this page below the construction.
Exports the assignment comment, of course. The construction comment is only shown on the solution page.
It is possible to get an applet to load a series of constructions and display them to the user at a given rate. The applet syntax is quite different and there is no automatic export.
An example of the applet code looks like this.
<APPLET ARCHIVE="zirkel.jar" CODE="rene.zirkel.ZirkelApplet.class" WIDTH="500" HEIGHT="565" ALIGN="center"> <PARAM NAME="demo" VALUE="demo.xml"> <PARAM NAME="color" VALUE="244,244,242"> </APPLET>
The file "demo.xml" contains the file list. It is an XML file with a straightforward syntax. Here is a sample.
<?xml version="1.0" encoding="utf-8"?> <Demo delay="30"> <File name="Uhr.zir" delay="20">Clockwork</File> <File name="Cindarella-Maschine.zir">Cindarella machine</File> ... </Demo>
The delay parameters are in seconds.