Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "AMP/UserGuide/Escape/Converting From Ascape"
Line 11: | Line 11: | ||
Because Escape uses SWT and Ascape uses Swing, there are a few unavoidable incompatibilities. Most of these we avoid by using higher level APIs but here are the key changes that you're likely to have to make: | Because Escape uses SWT and Ascape uses Swing, there are a few unavoidable incompatibilities. Most of these we avoid by using higher level APIs but here are the key changes that you're likely to have to make: | ||
− | + | ||
+ | =====Convert the low-level imports from AWT and Swing to SWT===== | ||
+ | The simplest way to accomplish this is to remove all of the imports and then organize imports. For example: | ||
java.awt.Color to org.eclipse.swt.graphics.Color | java.awt.Color to org.eclipse.swt.graphics.Color | ||
java.awt.Graphics to org.eclipse.draw2d.Graphics | java.awt.Graphics to org.eclipse.draw2d.Graphics |
Revision as of 16:57, 7 October 2009
Contents
Converting Existing Ascape models to Escape
There are only a few changes should have to make to existing Ascape models or to use existing Ascape documentation to develop Escape models.
Model
The core model is completely API compatible. No changes!
View
Because Escape uses SWT and Ascape uses Swing, there are a few unavoidable incompatibilities. Most of these we avoid by using higher level APIs but here are the key changes that you're likely to have to make:
Convert the low-level imports from AWT and Swing to SWT
The simplest way to accomplish this is to remove all of the imports and then organize imports. For example:
java.awt.Color to org.eclipse.swt.graphics.Color java.awt.Graphics to org.eclipse.draw2d.Graphics
A great way to make this obvious is to prevent the awt and swing classes from being used at all. Right-click on project, choose "Build Path:Configure Build Path", go to Libraries tab, open JRE System Library, choose "Access Rules", edit, and then add entries for java/awt/** and javax/swing/**. The code will regenerate and you'll have error markers for all of the stuff that won't work with Escape and Eclipse. 2.
Configuration
Instead of using Ant, Escape has really nice support for parameterizing and testing models. See Experimenting and Testing (todo). If you do want to work with ant you will need to install the plugins from the Sourceforge download site. (These have dependencies that I didn't want to bother with going through the Eclipse IP process to get in. If for some reason you think these should be part of core Escape let Miles know and I'll take care of it.) Ant has not been tested for Escape so it's not even clear it will work.
Current Limitations
- Escape is pretty robust, and the APIs are solid and well-tested but the runtime is not going to be as stable for a while as Ascape which has been around for a long time.
- Escape graphics performance is generally slower especially for charts. But on the other hand you can run multiple models at once and the headless models should perform just as well as console launched Ascape programs. In practice this shouldn't affect your normal model exploration work.
- We don't have the speed slider working yet. See [1]
- Charts only support time series, not histograms and pie. See [2]