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

Daniel Crawl crawl at sdsc.edu
Mon Mar 23 13:18:34 PDT 2009


Hi Subhav,

I was unable to reproduce this. Could you send me your actor?
Which version of kepler are you using? Also, you might try
deleting .kepler/ and re-saving the actor in your library.

  --dan



subhav mital wrote:
> Hey,
>
> After I create my actor named UserIp, I right click on it, and use the 
> 'save in library' option.
>
> When I try to call it (drag and drop the actor into the working 
> window) after re-opening Kepler, I get the error: "Change Failed: 
> Cannot create entity without a class name.in 
> <http://name.in/> [external stream] at line 1 column 29.
>
> The stack trace is:
>
> com.microstar.xml.XmlException: Cannot create entity without a class 
> name. in [external stream] at line 1 and column 29
> at ptolemy.moml.MoMLParser._checkForNull(MoMLParser.java:3618)
> at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3790)
> at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2379)
> at com.microstar.xml.XmlParser.parseElement(XmlParser.java:921)
> at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104)
> at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
> at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481)
> at com.microstar.xml.XmlParser.doParse(XmlParser.java:159)
> at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
> at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1318)
> at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1446)
> at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:270)
> at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:139)
> at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:697)
> at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1668)
> at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1187)
> at 
> ptolemy.vergil.basic.EditorDropTarget$DTListener.drop(EditorDropTarget.java:409)
> at java.awt.dnd.DropTarget.drop(Unknown Source)
> at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(Unknown Source)
> at 
> sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(Unknown 
> Source)
> at 
> sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(Unknown 
> Source)
> at sun.awt.dnd.SunDropTargetEvent.dispatch(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.processDropTargetEvent(Unknown Source)
> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
>
>
> Any idea what wrong am I doing? How should you save your actor once 
> created and instantiated from Kepler?
>
> Thanks!
>
>
> On Mon, Mar 23, 2009 at 2:44 AM, subhav mital <mital.subhav at gmail.com 
> <mailto:mital.subhav at gmail.com>> wrote:
>
>     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 <mailto: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/
>         <http://www.cs.waikato.ac.nz/%7Efracpete/>           Ph. +64
>         (7) 858-5174
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>   



More information about the Kepler-dev mailing list