[kepler-dev] Kepler Workflows as Applets

Christopher Hylands Brooks cxh at eecs.berkeley.edu
Mon Jul 12 21:35:50 PDT 2004


Dan,

Your applet worked for me under Windows XP, Mozilla 1.4, Java 1.4.2_04!

I like the simplicity of this demo, it is nice to see a non-electrical
engineering model for a change, and one that has some real world
application. 

Below are some minor nits and discussion points:

It looks like the integrator gif is missing, it can be found at
ptolemy/domains/ct/lib/integral.gif

The Plot button gifs are also missing, they are at:
ptolemy/plot/img/fill.gif
ptolemy/plot/img/format.gif
ptolemy/plot/img/print.gif
ptolemy/plot/img/reset.gif

These gifs are present in the Ptolemy II 4.0 ptolemy.jar, my guess is
that you jar'd up the class files to create the ptolemy.jar that gets
downloaded.  This is one reason I'm still using makefiles - it makes
it easier to manage the contents of jar files.  In principle, we could
have a manifest file that would list the files and subdirectories that
should go into each jar file and use ant to build the jar files.  I'm
sure someone has done this at somepoint.

One suggestion to decrease the download size is to use ptsupport.jar
and the domain specific jar files.

ptsupport.jar is  2.3Mb, whereas the Ptolemy II 4.0 ptolemy.jar is
2.7Mb. The ptolemy.jar on your website is 3.9 Mb, I'm not sure
why, probably you are jaring up all the .class files or something.

Another suggestion is to use jar indexing.  In this case, it might not
help much, but if there are many jar files, some of which are not
needed at start up time, then it could help.

For usability, it might also be helpful to label the datasets in the
plots and title the plots.  A description of the parameters in the
upper model might also help.  Edward is the real master at adding the
finishing touches to a demo, you could browse some of the models
he's done and look for ideas.  One thing that is often useful is
to suggest that the user try changing a particular parameter to get a
particular effect.  Describing why the phase plot is interesting might
be nice.

When I opened
http://www.nceas.ucsb.edu/~higgins/kepler/RunLVPredPrey.xml
within a local copy of Ptolemy, the windows came up off my screen, I
had to maximize them to see the model and the LVPredPrey
CompositeActor.

I think this is because the window property x value is negative:

    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={-1506, 491, 977, 525}}">

perhaps you have a really large screen?
Maybe having a web page that describes the model and then tells the
user that they can either open the model using Ptolemy II (File ->
Open URL) or else view the applet would be a win.  The applet would be
on a separate page, so as to avoid long download times for people
who already have Ptolemy II or Kepler installed.

It would be cool if your webpage could somehow invoke Web Start from
the Ptolemy II website or your own Web Start page, but I'm not sure if
that is possible.  The idea is that your demo would have a trivial
signed jnlp file that would then pull in jar files from elsewhere
(either the Ptolemy site or else your own site) I don't think this is
doable yet though.

It is possible to cache applet jar files, see
http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/applet_caching.html

I've not done much with applet caching, it looks to be new in Java
1.4.2. 

Also, it is possible to have a progress bar and a custom icon
instead of the Java (TM) coffee kup (TM), see

http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/special_attributes.html

I think for Vergil applets to be of much use, we have to get
look-inside working.  One possible idea is to use the single window
interface created by Thales folks.

However, in the applet, when I try to drag an icon, I get:

java.lang.SecurityException: Could not find 'ptolemy.ptII.MacOS'
System property
at ptolemy.util.StringUtilities.getProperty(StringUtilities.java:210)
at ptolemy.vergil.kernel.VergilUtilities.macOSLookAndFeel(VergilUtilities.java:85)
at ptolemy.vergil.basic.PopupMouseFilter.accept(PopupMouseFilter.java:75)
at diva.canvas.interactor.AbstractInteractor.accept(AbstractInteractor.java:64)
at diva.canvas.event.EventLayer.processLayerEvent(EventLayer.java:195)
at diva.canvas.event.EventLayer.dispatchEvent(EventLayer.java:112)
at diva.canvas.CanvasPane.processLayerEvent(CanvasPane.java:270)
at diva.canvas.CanvasPane.dispatchEvent(CanvasPane.java:90) 
at diva.canvas.JCanvas.processMouseEvent(JCanvas.java:345)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
....

Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission ptolemy.ptII.MacOS read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source) 

This looks like a bug in 4.0, I'll see about fixing it.

I hacked around using the IntRangeParameter Slider, which makes for a
cool demo that allows me to change the parameters.  I had to insert
a Scale actor for each slider to scale the integers down to doubles
between 0 and 1.0

In Ptolemy II 4.0, we use javascript to select different
object/embed/applet html code.  In PtolemyII 5.0, we will probably
just use applet tags which will not work for Netscape 4.x users.

Also, I started modifying the applet code generator so that it
will also generate Web Start files, but never really completed that
work.

My notes about Web Start are at
ptII/ptweb/ptolemyII/ptII4.0/ptII4.0/doc/webStartHelp.htm

ptII/mk/jnlp.mk contains the Web Start specific rules.
In theory
  cd $PTII
  make jnlp_all

will create $PTII/signed, copy over jar files, sign them with a
temporary self-signed certificate and create vergil.jnlp, which
uses the full configuration.  

.jnlp files are created for other configurations as well.

Anyway, the model is a cool model, I spent a certain amount of time
trying different parameters to get different effects.

-Christopher

Edward wrote: 
--------

    
    This is nice, but I have to confess that overall we've been pretty
    disappointed with applets as a mechanism for distributing Ptolemy II
    models...
    
    An alternative that seems to work better is to create webstart
    distributions.  These can be linked to from an ordinary web page,
    but run local code, and update the code only when it is out of
    date (vs. applets that will download the code anytime you invoke
    them in a new instance of the browser).  The result is fully
    interactive...
    
    Moreover, we can use this as a mechanism for users to create
    their own models by modifying the demo ones. A configuration
    can be provided with specialized libraries and help pages to
    address a particular problem area...
    
    Edward
    
    At 09:25 AM 7/2/2004 -0700, Daniel Higgins wrote:
    >Hi All,
    >
    >    I tried a simple experiment of creating some on-line web pages with 
    > Kepler workflows using the applet tools in Ptolemy.  See
    >
    >http://www.nceas.ucsb.edu/~higgins/kepler/Kepler_Workflows.html 
    ><http://www.nceas.ucsb.edu/%7Ehiggins/kepler/Kepler_Workflows.html>
    >
    >This is very preliminary test example. It will only work with newer 
    >browsers and you must have a Java Plugin installed on your machine. A fast
    
    >internet connection is also needed since large amount of data are 
    >transferred. (Although much less that is involved in actually installing 
    >Kepler). And even with a fast connection, there will be some delay before 
    >the applets appear. Some of thiese problems could be solved with some effo
   rt.
    >
    >Overall, it is very easy to display simple Kepler workflows in an applet 
    >and be able to execute the workflow. One simply set the workflow moml file
    
    >name as a parameter for the applet. Again, this is just a very preliminary
    
    >example. Let me know if you have problems since this has only been tested 
    >on a few systems. (Please include OS and Browser types and versions/)
    >
    >Thanks
    >
    >Dan
    >
    >--
    >---------------------------------
    >Dan Higgins
    >Software Developer
    >National Center for Ecological Analysis and Synthesis (NCEAS) 735 State 
    >St. Rm 205 Santa Barbara, CA 93101 805-892-2531 higgins at nceas.ucsb.edu 
    >---------------------------------
    >
    >_______________________________________________
    >kepler-dev mailing list
    >kepler-dev at ecoinformatics.org
    >http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
    
    ------------
    Edward A. Lee, Professor
    518 Cory Hall, UC Berkeley, Berkeley, CA 94720
    phone: 510-642-0455, fax: 510-642-2739
    eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
    
    _______________________________________________
    kepler-dev mailing list
    kepler-dev at ecoinformatics.org
    http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
--------



More information about the Kepler-dev mailing list