[kepler-dev] [Bug 4915] PortParameters instantiated from Outline tab cannot be deleted

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Mon May 3 16:17:02 PDT 2010


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4915

Christopher Brooks <cxh at eecs.berkeley.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |cxh at eecs.berkeley.edu
         Resolution|FIXED                       |

--- Comment #6 from Christopher Brooks <cxh at eecs.berkeley.edu> 2010-05-03 16:17:00 PDT ---
The executive summary is that I can't reproduce this bug before the change to
ParameterPort.  Is the change to ParameterPort necessary?


Details:
In Kepler-2.0 release candidate 1 (installed on April 21), I can't get a
PortParameter:
1. Start Kepler-2.0 release candidate 1
2. In "Search Components", enter "PortParameter" and hit  Search
3.  Try to drag the PortParameter into the canvas.  I get:

com.microstar.xml.XmlException: Cannot create entity without a class name. in
[external stream] at line 2 and column 23
    at ptolemy.moml.MoMLParser._checkForNull(MoMLParser.java:3792)
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3973)
    at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2493)
    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.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:1402)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530)
    at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:270)
    at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171)
    at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:732)
    at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1762)
    at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1533)
    at
ptolemy.vergil.basic.EditorDropTarget$DTListener.drop(EditorDropTarget.java:450)
    at java.awt.dnd.DropTarget.drop(DropTarget.java:430)
    at
sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500)
    at
sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:53)
    at
sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:812)
    at
sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:736)
    at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:29)
    at java.awt.Component.dispatchEventImpl(Component.java:3926)
    at java.awt.Container.dispatchEventImpl(Container.java:2068)
    at java.awt.Component.dispatchEvent(Component.java:3903)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
    at
java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4007)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3861)
    at java.awt.Container.dispatchEventImpl(Container.java:2054)
    at java.awt.Window.dispatchEventImpl(Window.java:1801)
    at java.awt.Component.dispatchEvent(Component.java:3903)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


In the current Kepler trunk with the ParameterPort change, I can delete the
ParameterPort.

The change is:
> svn diff -r 57040 ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java
> Index: ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java
> ===================================================================
> --- ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java	(revision 57040)
> +++ ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java	(working copy)
> @@ -80,6 +80,8 @@
>                  "tokenConsumptionRate", new IntToken(1));
>          tokenConsumptionRate.setVisibility(Settable.NOT_EDITABLE);
>          tokenConsumptionRate.setPersistent(false);
> +
> +        new Parameter(this,"_notDraggable");
>      }
>  
>      ///////////////////////////////////////////////////////////////////


The log message is:
> r57732 | aschultz | 2010-04-29 21:11:15 -0700 (Thu, 29 Apr 2010) | 1 line
>
> reference Kepler bug 4915. This change prevents ParameterPorts from being dragged to the canvas


_notDraggable is used in ptolemy/vergil/tree/PTree.java:

        public void dragGestureRecognized(DragGestureEvent e) {
   ...
                if (object instanceof NamedObj
                        && !_isPropertySet((NamedObj) object, "_notDraggable"))
{
                    PtolemyTransferable transferable = new
PtolemyTransferable();
                    transferable.addObject((NamedObj) object);

                    //initial cursor, transferable, dsource listener
                    e
                            .startDrag(DragSource.DefaultCopyNoDrop,
                                    transferable, dsl);
                }
...

The _notDraggable line is from:
> r57545 | cxh | 2010-04-02 15:37:08 -0700 (Fri, 02 Apr 2010) | 1 line
>
> Change from Sean Riddle: added _isPropertySet() so that things can be made non-draggable, used in ecogrid.

Anyway, with the above change to ParameterPort, I can delete the ParameterPort.
1. Start up the devel version
2. In "Search Components", enter "PortParameter" and hit  Search
3. Drag the PortParameter into the canvas
4. Highlight the entire PortParameter and hit delete. 
5. The PortParameter is gone.

However, there are some problems.
1. I'm concerned because adding a field increases the size of models slightly
and also
changes the output of a few tests.  It might be possible to avoid saving this
data?

In the Kepler head, I can drag the arrow around separately from the dot. 
Ptolemy II had this
problem, but it was solved awhile ago:

2007-03-09 21:51  cxh

    * [r45502] /trunk/ptolemy/configs/utilityPortParameter.xml,
      /trunk/ptolemy/vergil/actor/ExternalIOPortController.java:
      PortParameter was rendered as two pieces, which caused problems
      when dragging. See
      https://chess.eecs.berkeley.edu/bugzilla/show_bug.cgi?id=34


If I revert to a previous version of ParameterPort:
svn update -r 57040 ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java

Then I cannot replicate this bug?

So, I'm wondering if the change to ptII is necessary?

-- 
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Kepler-dev mailing list