[kepler-dev] Help with Pop Up Box in Kepler

subhav mital mital.subhav at gmail.com
Sun Mar 22 23:44:49 PDT 2009


Thanks for that..It worked...Kepler Rocks!

I can share the code or upload it for others to use.

Thanks..


On Sun, Mar 22, 2009 at 12:46 AM, Peter Reutemann <fracpete at gmail.com>wrote:

> > The working code for a pop-up box which accepts user values is given
> below:
>
> [...]
>
> > 1) Following my question about creating a pop-up box in Kepler which
> accepts
> > user input, how should I go about implementing this functionality in
> Kepler
> > ? ( The above code works on Eclipse)
> > 2) I need to create an actor with an output port that takes this input
> value
> > from the user and makes it available there. (So as to use this value in
> > conjunction with other actors such as the Display actor)
>
> Just a quick stab at what the fire() method of an actor could look
> like (not tested whether Kepler likes user interaction):
>
>  /**
>   * Lets the user enter a value and broadcasts it.
>   *
>   * @throws IllegalActionException If there is no director.
>   */
>  public void fire() throws IllegalActionException {
>    super.fire();
>
>    String reply = JOptionPane.showInputDialog("Please enter value");
>    if (reply == nul)
>      return;
>
>    output.broadcast(new StringToken(reply));
>  }
>
> Your actor would be derived from ptolemy.actor.lib.Source and the
> output port would have to be of type STRING (defined in the actor's
> constructor):
>    output.setTypeEquals(BaseType.STRING);
>
> Cheers, Peter
> --
> Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ
> http://www.cs.waikato.ac.nz/~fracpete/           Ph. +64 (7) 858-5174
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20090323/8a5aae5d/attachment.html>


More information about the Kepler-dev mailing list