Detailed Animation Generator Help

As of the 23rd May 2022 this website is archived and will receive no further updates.

understandinguncertainty.org was produced by the Winton programme for the public understanding of risk based in the Statistical Laboratory in the University of Cambridge. The aim was to help improve the way that uncertainty and risk are discussed in society, and show how probability and statistics can be both useful and entertaining.

Many of the animations were produced using Flash and will no longer work.

Introduction

Obtain UUAnimationGenerator from CVS and drag its build file to the Flex Builder
ant panel.

Use this build file to
(a) Populate a Flex or AIR project with template data, so it runs straight away.
(b) Add commands, tabs, view/mediator pairs, and proxy templates as needed.
You will need to run add-tab at least once to get a working animation.

For (a), you start with a newly created Flex Builder project, edit build properties,
then run 'new-project' and run 'main'.
The project is populated from data in the templates directory. It will not overwrite or modify existing files.

For (b), you target an existing project. The ApplicationFacade and StartupCommand should be seeded with
ANT LIST comments. If you created the project in (a), these comments will already be there.
These special comments mark locations where new statements will be inserted. For example, if you run the
add-proxy target, then a template Proxy class will be inserted, and a statement will be added to StartupCommand
which creates and registers the proxy.

Installation

Install optional ant task jars
Install scripting jar from http://jakarta.apache.org/site/downloads/downloads_bsf.cgi (bsf.jar)
Install rhino javascript http://www.mozilla.org/rhino/ (js.jar, maybe js-14.jar)
Install jsch-0.1..41.jar or later
Install commons-logging jar from http://commons.apache.org/downloads/download_logging.cgi

The scripting tasks are needed to convert Command and Proxy names to upper and lower case variants.

(a) For each new project

Create a new Flex (or Air) project

Edit UUAnimationGenerator project.properties
Define new project name, directory and main file
Define the initial tabs, and references to tabMediators and tabViews

Run the 'new-project' target to clear out the main project file and allow the 'main' target to install its own version.

Run the 'main' target to populate the project

As the files are copied from the template, various tokens (strings starting and ending in @)
are replaced by property values defined in the property file(s).

If it fails, delete the offending files in the new project, correct the properties, and run 'main' again.
Files will not be overwritten.

Run the 'add-tab' target to insert at least one tab into the animation.

(b) First run of the new project

If you now refresh the newly created project in FB, you will see that it contains a build.xml file. Drag this to the
FB ant panel and run the default 'CompileForDebug' target. A debug distribution will be created in build-debug.
Click on the down arrow next to the normal debug beetle and select 'Other'. This opens up a form where you can clone a copy of the
normal FB debug setup, directing the clone to build-debug rather than the usual bin-debug. You can continue to build and debug
using the ant CompileForDebug task, or you can add the libraries you need into Flex Projct Build and debug as normal using the
bin-debug output folder.

(c) Adding stuff to an existing project

You might need to add the '//ANT LIST' comments to the appropriate places in ApplicationFacade and StartupCommand if you want to use these targets to add items to an old project not generated by UUAnimationGenerator. The //ANT LIST comments label lists of statements that must be appended whenever ant adds a view, mediator, proxy, command or tab. Mostly the targets will prompt you for the name of the thing you are adding, and will create template class files for you to edit.
e.g.:

add-tab:

Run the target and give it a tab name like Animation
Ant will create AnimationView, AnimationMediator, and install the tab in the main animation file tables.

add-command:

Run the target, give it a Command Name (e.g. LoadFile).
Ant will create LoadFileCommand.
If you have the correct ANT LIST comments then
Ant will import and register LoadFileCommand in ApplicationFacade and make the LOADFILE command constant.

Supported AnimatonGenerator Targets

new-project Clears out FB created files so they can be regenerated (like the main project mxml file)
main Populates a Flex or AIR project created by Flex Builder.
add-command Adds a PureMVC command
add-command-and-proxy Adds a PureMVC command and similarly named Proxy
add-macro-command Adds a PureMVC macro command (one that sequences other PureMVC commands)
add-proxy Adds a PureMVC Proxy
add-proxy-with-VO Adds a PureMVC Proxy with Virtual Object (used for DB access)
add-tab Adds a UU animation tab, tabView and tabMediator
add-view-mediator Adds a PureMVC view/mediator pair
add-VO Adds a Virtual Object.

Supported Animation Build Targets

asdoc Generate documentation tree from sources
cleanAll clears all distribution directories
cleanDebug clears the build-debug directory
cleanSite clears the build-site directory
cleanStandalone clears the standalone directory
compileForDebug Compiles with debug into the build-debug directory. The ant equivalent to bin-debug.
compileForSite Compiles an optimised distribution into the build-site directory.
compileForStandalone Compiles a debug-free distribution into the standalone directory.
installOnSite Installs the build-site swf on the site. You may need to edit this target to add config file installations
touch Touches sources to force recompilation on the next compile target.
updateLibraries Fetches the current RSL libraries from the server and stores them in the project rsl folder.

Free tags: 
Levels: