A Chimera demo can be started by opening a demo source file or a Chimera web data file that has a demo embedded. Demos included within the Chimera installation directory can be started from the Tools... Demos menu.
At each stage or "panel" of a demo, changes may occur within the main Chimera window, and explanatory text is shown in a separate dialog. Buttons on the dialog control the demo:
Within a demo, text shown as a link may be a standard link to a web page (URL) or may connect to a set of commands or code that will execute when the text is clicked. Right-clicking on the link text brings up a context menu to:
The Demo extension provides for the creation and replay of demos in Chimera. A demo consists of operations in Chimera and explanatory text shown in a dialog window. One demo may include several panels, where a panel generally consists of:
Within a Chimera installation, each directory under share/Demo/demos/ represents one demo and must contain a source file (instructions for the demo) named demo.src. For example, the file share/Demo/demos/COX_Demo/demo.src contains the instructions for the demo that is started by choosing Tools... Demos... Cyclooxygenase Demo from the menu. The name that appears in the menu is set within the file share/Demo/ChimeraExtension.py.
Any demo (regardless of whether it is in the Chimera installation directory) can be run by opening the associated demo source file. Data files opened by the demo should be in the same directory as the source file.
Tools... Demos... Save Current Demo As... brings up a dialog for saving the source file of the current demo. Any associated data files will be saved in the same directory as the source file.
Demo includes a built-in mechanism for resetting positions to correct for any manipulations by the user. Clicking Next regenerates the position directly due to the commands of the current panel (in case the user had subsequently moved anything) before executing the commands of the following one. Clicking Back executes any undo commands and then regenerates the position due to the commands of the previous panel.
The Chimera demo source file type can be designated by the suffix .src (part of the filename) or the prefix demo: (not part of the filename).
The demo source file format is similar to XML in that tags delimit different types of information. The tags are described formally below; it may also be useful to view an example. Each tag must be on a line by itself. If the start tag for a certain element is included, the corresponding end tag must also be included.
Tag | Meaning |
---|---|
[INFO] [END INFO] |
Start and end of general information about the demo (optional).
Possible contents:
|
[START] [END] |
Start and end of information pertaining to a given panel, without specification of an individual autodelay. |
[START AUTODELAY=n] [END] |
Start and end of information pertaining to a given panel, with specification of an individual autodelay n. This is the time in seconds to pause after executing the commands in the panel when AutoRun is being used. An individual autodelay overrides any global autodelay. |
[TEXT] [END TEXT] |
Start and end of a block of explanatory text for a given
panel (optional).
The use of several HTML
tags is supported within this section:
|
[COMMANDS] [END COMMANDS] |
Start and end of commands for a given panel (optional). |
[UNDO] [END UNDO] |
Start and end of commands
that undo the commands for a given panel (optional).
If undo commands are present, the demo dialog Back button will
be enabled for the panel.
The demo developer is responsible for determining what commands are needed to undo all operations other than positioning/scaling. If the commands for the panel only change positioning and/or scaling, an empty set of undo tags can still be included so that the Back button will be enabled. |