Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Pictogram Element Not updating after DirectEdit
Pictogram Element Not updating after DirectEdit [message #676190] Fri, 03 June 2011 06:44 Go to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello,

I have a pretty complicated pictogram hierarchy with nested container shapes and shapes. I have a editable 'Text' in one of the shapes. When the 'DirectEditingFeature' is called on the pictogram element, though the domain model is setting the right values, the pictogram element is not refreshed.

However when I redraw the main parent(layouting), everything is updated. Does anybody have any ideas on this? I see in the tutorial that after the name is edited for EClass upon create, a call is made to update its parent (updatePictogramElement(((Shape) pe).getContainer())). Do I have to call updation of all the parent containers to get my text updated ? [Tried that, but still no result]

Thanks in advance for help.

Thanks,
Murthy
Re: Pictogram Element Not updating after DirectEdit [message #676217 is a reply to message #676190] Fri, 03 June 2011 09:05 Go to previous messageGo to next message
Christian Brand is currently offline Christian BrandFriend
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Hi. You should check your update features. What shapes are they responsible for?
After editing the domain model you have to call an update (updatePictogramElement(PictogramElement pe)) of the pictogram element you have an update feature registered for. Best regards, Christian


Christian Brand
SAP AG - Walldorf - Germany
Re: Pictogram Element Not updating after DirectEdit [message #676229 is a reply to message #676217] Fri, 03 June 2011 10:00 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello Christian,

Thanks for your suggestion.

I have already called updatePictogramElement for the pictogram element the domain model is linked with and for which the update feature was registered. When i debug more, I also find that the graphicsAlgorithm for the pictogram has been updated with the new value, but the editor in the screen still shows the old value. Any ideas/thoughts ?

Thanks,
Murthy

Re: Pictogram Element Not updating after DirectEdit [message #676735 is a reply to message #676229] Mon, 06 June 2011 11:23 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Don't know exactly whats the reason, but just found a workable solution. Not a pretty one, but it works for me.

After the direct edit is done for a text control within nested shapes and containers, I update the main (root)pictogram element. Also after updating I call the layoutElement method and every thing works fine. The snippet which i use is as below.

		//The pictogram element that is being updated
		updatePictogramElement(((Shape) pe)); 
		//My Root container
		ContainerShape container = ((Shape) pe).getContainer().getContainer().getContainer();
		//Just increase the 'Y' co-ordinate of the graphical algorithm so that layout is called
		container.getGraphicsAlgorithm().setY(container.getGraphicsAlgorithm().getY()+1);
		//Call Layout
		layoutPictogramElement(container);


Kindly someone let me know if there exists a better solution to this.

Regards,
Murthy
Re: Pictogram Element Not updating after DirectEdit [message #691838 is a reply to message #676190] Sat, 02 July 2011 14:26 Go to previous messageGo to next message
Kalle  is currently offline Kalle Friend
Messages: 3
Registered: June 2011
Junior Member
Again using a topic for a similar problem: I created and added a Connection to the diagram between two Classes. The Connection is initially labeled with a text. This works fine. Furthermore I created a DirectEditingFeature for the Connection and a ConnectionFilter and a ConnectionSection for the property view of my Connection. This also works fine, the value of the label is shown in the properties view and it can be changed. I use a FocusListener and an UpdateFeature to refresh the pictogramElement of the Connection but this doesn't work.
Interestingly the directEdit or the edit in the properties view is executed: Wenn I click on the label of the Connection or the Connection itself, the current labelText is shown in my properties view and when I change the labelText via properties view or via the directEdit, the new labelText is saved. When I click on the label or the Connection again, the new labelText is shown in my properties view. When I click on the label, so that the text can be directly edited, the editable textField shows the new labelText. But when I confirm the change of the textLabel, the old textLabel is shown on the diagram. However the new labelText is shown in the properties view.

I'm a bit confused about the behavior of my diagram. Any common mistakes I made?
Maybe I'm not quite familiar with Connections and ConnectionDecorators: How does Graphiti handle the connection of these two elements? How is the change of one element recognized by the other element?

Thanks for your reply.
Re: Pictogram Element Not updating after DirectEdit [message #692378 is a reply to message #691838] Mon, 04 July 2011 10:23 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
This sounds as if your update feature is not correctly working. Either is
does not recognize the changed value or the actual update does not work
correctly.

In general ConnectionDecorators are children of Connections. Usually you
would link a Connection to a business object, as soon as that changes a
corresponding update feature for that BO is searched. That would then need
to update both the Connection and ConnectionDecorator.

There's also a section on editable property sheets in our FAQ:
http://www.eclipse.org/graphiti/developers/faq.php . Maybe that helps.

Michael

"Kalle" schrieb im Newsbeitrag news:iun98v$vko$1@news.eclipse.org...

Again using a topic for a similar problem: I created and added a Connection
to the diagram between two Classes. The Connection is initially labeled with
a text. This works fine. Furthermore I created a DirectEditingFeature for
the Connection and a ConnectionFilter and a ConnectionSection for the
property view of my Connection. This also works fine, the value of the label
is shown in the properties view and it can be changed. I use a FocusListener
and an UpdateFeature to refresh the pictogramElement of the Connection but
this doesn't work.
Interestingly the directEdit or the edit in the properties view is executed:
Wenn I click on the label of the Connection or the Connection itself, the
current labelText is shown in my properties view and when I change the
labelText via properties view or via the directEdit, the new labelText is
saved. When I click on the label or the Connection again, the new labelText
is shown in my properties view. When I click on the label, so that the text
can be directly edited, the editable textField shows the new labelText. But
when I confirm the change of the textLabel, the old textLabel is shown on
the diagram. However the new labelText is shown in the properties view.

I'm a bit confused about the behavior of my diagram. Any common mistakes I
made?
Maybe I'm not quite familiar with Connections and ConnectionDecorators: How
does Graphiti handle the connection of these two elements? How is the change
of one element recognized by the other element?

Thanks for your reply.
Previous Topic:Connections anchored to Connections?
Next Topic:Convenient direct editing
Goto Forum:
  


Current Time: Fri Aug 07 19:39:06 GMT 2020

Powered by FUDForum. Page generated in 0.02114 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top