Skip to main content



      Home
Home » Eclipse Projects » GEF » Update not drawn
Update not drawn [message #1795184] Tue, 18 September 2018 01:54 Go to next message
Eclipse UserFriend
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 02:02 Go to previous messageGo to next message
Eclipse UserFriend
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 11:51 Go to previous message
Eclipse UserFriend
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: Mon Apr 21 02:13:01 EDT 2025

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

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

Back to the top