Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Update not drawn
Update not drawn [message #1795184] Tue, 18 September 2018 05:54 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi

in my visual i want to react onto a model change by changing the end point of a line.

// org.eclipse.gef.geometry.planar.Line
// ..
GeometryNode<Line> line1 = newLine(  0.0, 30.0, 17.0, 30.0 );
// ..
 Group group = new Group(shape, line1, line2, line3, point1, connectionLine );


In my handler i can change the background color, this works.
But when i change the lines end point, the change is not shown.

double y = selection ? 40 : 20;
System.out.println("sel "+y);
line1.getGeometry().setY2(y);


What could be the problem?

Frank
Re: Update not drawn [message #1795185 is a reply to message #1795184] Tue, 18 September 2018 06:02 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
search around long time, wrote this question, and stumbled about the hint now...

GeometryNode doc says:
Quote:
Please note that because IGeometry does not support change notifications itself, changes to the underlying IGeometry will not be recognized by the GeometryNode unless the geometry property is changed.


Line line = line1.getGeometry().getCopy();
line.setY2(y);
line1.geometryProperty().set(line);


Or is there a more elegant way to trigger the geometry property update?
Re: Update not drawn [message #1801051 is a reply to message #1795185] Fri, 11 January 2019 16:51 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Frank,

until notifications are supported, there is no other correct way I could think of that is less elegant. (E.g. you could update the paths used for rendering under the hood, but then you also need to adjust the layout-xy and other properties of GeometryNode to match its rendering, which is already done when setting a geometry.)

Best regards,
Matthias
Previous Topic:Realizing simple bendable connections
Next Topic:Connection: how to update control points
Goto Forum:
  


Current Time: Tue Apr 16 05:16:20 GMT 2024

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

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

Back to the top