Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Calling the doRefreshVisual Method
Calling the doRefreshVisual Method [message #1800742] Mon, 07 January 2019 15:43 Go to next message
Servan Kilec is currently offline Servan KilecFriend
Messages: 7
Registered: October 2018
Junior Member
How can I call the doRefreshVisual (Connection visual) method of the MindMapConnectionPart class each time the connection length is changed?

regards,

Servan Killec

[Updated on: Tue, 22 January 2019 14:10]

Report message to a moderator

Re: Calling the doRefreshVisual Method [message #1802533 is a reply to message #1800742] Mon, 11 February 2019 15:24 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Servan,

the doRefreshVisual() method is called, for example, in response to content changes.

The method is meant to refresh the part's visual to match the part's contents, i.e. you should only implement logic in that refresh method to change the appearance of the part (i.e. its visual) to match the model data associated with the part (i.e. its content).

Maybe you can get better help if you rephrase your issue. What is the actual feature you want to implement?

Best regards,
Matthias
Re: Calling the doRefreshVisual Method [message #1803189 is a reply to message #1802533] Mon, 25 February 2019 07:52 Go to previous messageGo to next message
Servan Kilec is currently offline Servan KilecFriend
Messages: 7
Registered: October 2018
Junior Member
Hello Matthias,

So basically I have cardinalities on 2 Nodes, when I move one of them I want that the cardinalities are aligned correctly depending on the position and therefore I need to Update the connection its visuals by using the method
doRefreshVisual(Connection visual)
from the class
DiagramConnectionPart
but if I move one node this method is never invoked.

index.php/fa/34952/0/

Best regards
Servan

[Updated on: Mon, 25 February 2019 13:56]

Report message to a moderator

Re: Calling the doRefreshVisual Method [message #1803199 is a reply to message #1803189] Mon, 25 February 2019 09:38 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Servan,

within GEF, only visual changes are performed during interaction (usually). These are complemented by content changes upon completion of interaction. This is when doRefreshVisual() should be executed in order to adapt the visualisation to the contents.

The default mechanisms execute BendVisualOperation while manipulating a Connection. Therefore, setVisualBendPoints() is invoked during those interactions, updating the connection visual.

Basically, you can change the visual in any way during interaction, and then ensure that the next refresh will yield the same result.

Therefore, you are not bound to the Connection or IBendable API. Instead, you can subclass the TranslateOnDragHandler and invoke a custom method, e.g. connectionPart.updateLabels(). However, when completing interaction, you have to change the content so that the next doRefreshVisual() will show the same updated labels.

Best regards,
Matthias
Re: Calling the doRefreshVisual Method [message #1803236 is a reply to message #1803199] Mon, 25 February 2019 14:14 Go to previous messageGo to next message
Servan Kilec is currently offline Servan KilecFriend
Messages: 7
Registered: October 2018
Junior Member
Hello Matthias

I was not able to find the TranslateOnDragHandler class, however I managed to solve my problem by simply overriding the method refresh() from the Connection class in my MindMapConnectionVisual class.

Best regards
Servan

[Updated on: Tue, 26 February 2019 06:39]

Report message to a moderator

Re: Calling the doRefreshVisual Method [message #1803389 is a reply to message #1803236] Wed, 27 February 2019 18:45 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Servan,

these are two very different things: Connection.refresh() and ConnectionPart.refreshVisual(). The first is just updating a visual. The latter is updating a part so that its visual will reflect its content.

I do not understand how overriding Connection.refresh() solves your problem unless you are updating the labels within that refresh() method. Most certainly, the part's doRefreshVisual() method is still not called during interaction, right?

However, good to hear that you solved your issue :-)

Best regards,
Matthias
Re: Calling the doRefreshVisual Method [message #1804192 is a reply to message #1803389] Wed, 20 March 2019 08:33 Go to previous message
Servan Kilec is currently offline Servan KilecFriend
Messages: 7
Registered: October 2018
Junior Member
Hello Matthias

Matthias Wienand wrote on Wed, 27 February 2019 18:45

I do not understand how overriding Connection.refresh() solves your problem unless you are updating the labels within that refresh() method. Most certainly, the part's doRefreshVisual() method is still not called during interaction, right?


Exactly, I update the labels with the refresh() method and yes the part's
doRefreshVisual() method is still not called.

But it works as i wanted :D.
Thank you.
Previous Topic:GEF5 Problem Setting Graph Background
Next Topic:[GEF4] Adapter binding warning messages
Goto Forum:
  


Current Time: Thu Oct 06 07:28:09 GMT 2022

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

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

Back to the top