Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] new diagram connection element

Should I open a ticket or do you just want to put that change in?

On Thu, Jan 19, 2012 at 1:31 AM, Shenxue Zhou <shenxue.zhou@xxxxxxxxxx> wrote:

Greg, I just checked in the change to line 217 of DiagramEmbeddedConnectionTemplate class. What you discovered was the right solution for this regression. Thanks!

 

Shenxue

 

From: Shenxue Zhou
Sent: Wednesday, January 18, 2012 10:23 AM


To: Sapphire project
Subject: Re: [sapphire-dev] new diagram connection element

 

Hi Greg,

 

It seems that you are using Sapphire 0.5 (the head branch) with Graphiti plugin. 0.5 is in the process of conversion from Graphiti based diagram rendering to GEF based diagram rendering and it’s not 100% ready yet. The problem you described seemed to be introduced recently in 0.5 branch and it only occurs with Graphiti based diagram. I can reproduce it.  I’ll fix it in 0.5.

 

I wonder whether you should use Sapphire 0.4 for stability purpose. We haven’t decided a date for Sapphire 0.5 yet.

 

Thanks for debugging and reporting this problem.

 

Shenxue

 

From: Greg Amerson [mailto:gregory.amerson@xxxxxxxxxxx]
Sent: Tuesday, January 17, 2012 7:59 PM
To: Sapphire project
Subject: Re: [sapphire-dev] new diagram connection element

 

Hey Shenxue, 

 

I did a stepped through with a debugger and can give some more information.  For my case I'm using the EmbeddedDiagram connection template, so in the diagram editor a new embedded connection is being created.  On line 217 of DiagramEmbeddedConnectionTemplate.java for new embedded connections it is calling createNewConnectionPart and it is passing in null for the srcNodeModel.  In this case when the "edit the label" action is executed the code on line 583 of DiagramConnectionTemplate that responds to the label property being changes, checks the srcModelNode for connections and it doesn't find the just previously created embedded connection, since it compares the list of connection properties form the source node and the digramConnectionsMap.  The connectionsMap is not correct (has one less connection) because the 'null' was passed in previously.  

 

I just naively modified line 217 of DiagramEmbeddedConnectionTemplate to pass in the srcNodeModel that is available in that context and it seemed to fix my issue with the duplciate connection being created.  However, this change may affect other things negatively.  Hopefully this is enough information for you to be able to know where to go from here.

 

I've attached my patch just so you can see my single one-line change easier.

 

Thanks,

Greg

 

On Wed, Jan 18, 2012 at 10:08 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:

Hi Shenxue,

 

Thanks for the note about the default value, I will give it a try.

 

Regarding the new connection, yes when I type in a name (when the label is initially blank) as soon as I hit enter, the connection is duplicated.  I can see if I can debug through it today and take a look.

 

 

On Wed, Jan 18, 2012 at 2:03 AM, Shenxue Zhou <shenxue.zhou@xxxxxxxxxx> wrote:

As for the default label, the label text can be an _expression_ in which you can specify a default value. Here is an example:

 

    <connection-binding>

      <connection-id>controlFlowCase</connection-id>

      <property>ControlFlowRules</property>

      <label>

        <text>${FromOutcome == null ? "&lt;*&gt;" : FromOutcome}</text>

      </label>

      ....

    </connection-binding>

 

When editing the label text, it should not create a new diagram connection part. Do you see a new connection showing up in your diagram when you edit a label?

 

Shenxue

 

From: Greg Amerson [mailto:gregory.amerson@xxxxxxxxxxx]
Sent: Tuesday, January 17, 2012 3:27 AM
To: Sapphire project
Subject: Re: [sapphire-dev] new diagram connection element

 

Nevermind, this issue, it was because I had debug breakpoints during the creation and when I would resume the label box was not automatically made editable.  But when I do it with breakpoints disabled I see the label editing feature.

 

But this leads to my 2nd question, in my diagram when I do edit the label it will duplicate the connection part in the diagram, but it doesn't duplicate anything in the underlying model.  Any thoughts?

On Tue, Jan 17, 2012 at 5:19 PM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:

I have a case where a new connection that is created in the diagram editor sets a property on a modelElement but it doesn't yet have a valid label so the label doesn't show up and is not able to be edited.  

 

Is there a way that I can be notified when a new connection is created so that I can initialize the connection model element so that it will have a default label?

 

Thanks!

 

--

Greg Amerson

Liferay, Inc.



 

--

Greg Amerson

Liferay, Inc.

 

_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev



 

--

Greg Amerson

Liferay, Inc.



 

--

Greg Amerson

Liferay, Inc.


_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev




--
Greg Amerson
Liferay, Inc.


Back to the top