Skip to main content



      Home
Home » Eclipse Projects » GEF » [GEF4] FXGeometryNode bounds update
[GEF4] FXGeometryNode bounds update [message #1713278] Mon, 02 November 2015 19:35 Go to next message
Eclipse UserFriend
Hi

i have a FXGeometryNode<RoundedRectangle>, after creation, i want to update the bounds later.
The roundedRectangle accepts the update, but not the FXGeometryNode

This shows the update:
RoundedRectangle roundRect = new RoundedRectangle( new Rectangle( 2, 2, 10, 10 ), 10, 10 );
roundRect.setBounds( 40, 40, 100, 50);
FXGeometryNode<RoundedRectangle> fxGeometryNode = new FXGeometryNode<>(roundRect);


Now i move the update of the bounds to be after the FXGeometryNode creation.
Here the new bounds are not visible, the rounded rectangle is shown with the first small bounds:
RoundedRectangle roundRect = new RoundedRectangle( new Rectangle( 2, 2, 10, 10 ), 10, 10 );
FXGeometryNode<RoundedRectangle> fxGeometryNode = new FXGeometryNode<>(roundRect);
roundRect.setBounds( 40, 40, 100, 50);


What is needed to have the FXGeometrynode udpated?

Frank

Re: [GEF4] FXGeometryNode bounds update [message #1713302 is a reply to message #1713278] Tue, 03 November 2015 03:23 Go to previous message
Eclipse UserFriend
The geometric abstractions provided by GEF4 Geometry do not provide a notification mechanism. As such, the FXGeometryNode will not be able to detect the bounds change of its underlying geometry. Therefore, you have two options:

1) Pass a new geometry to the FXGeometryNode:
fxGeometryNode.setGeometry(new RoundedRectangle(...))


2) Use JavaFX means (i.e. relocate and resize) to update the bounds of the FXGeometryNode:
fxGeometryNode.relocate(...)
fxGeometryNode.resize(...)

Previous Topic:In eclipse rcp adding a new gef figure doesn't invoke selection change
Next Topic:Cannot resolve Draw2D/GEF bundle for Eclipse Application
Goto Forum:
  


Current Time: Sat Nov 08 09:48:45 EST 2025

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

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

Back to the top