| [GEF4] FXGeometryNode bounds update [message #1713278] |
Mon, 02 November 2015 19:35  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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(...)
|
|
|
Powered by
FUDForum. Page generated in 0.02852 seconds