Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF4] Problem implementing ClickableAreaBehavior
[GEF4] Problem implementing ClickableAreaBehavior [message #1719997] Wed, 13 January 2016 16:08 Go to next message
Xavier JACQUES is currently offline Xavier JACQUESFriend
Messages: 10
Registered: October 2015
Junior Member
Hello,

I'm trying to implement ClickableAreaBehavior in our project by starting from the logo example project.
We used GEF4 3.11.0 M4 version.

I only change this line compared to FXClickableAreaBehavior class:
getHost().getVisual().getCurveNode().clickableAreaWidthProperty()
				.bind(clickableAreaBinding);

to
((GeometryNode<IGeometry>) getHost().getVisual()).clickableAreaWidthProperty().bind(clickableAreaBinding);

Because i want the behavior applied on every GeometryNode object.

I bind the behavior like in the example:
adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(ClickableAreaBehavior.class);


The problem is I have a NullPointerException when this line is called in my behavior:
((GeometryNode<IGeometry>) getHost().getVisual()).clickableAreaWidthProperty().bind(clickableAreaBinding);


It is caused by the fact the geometryProperty.getValue() is null (line 148 in GeometryNode)
I think maybe just add a test if not null before could solve the problem are you agree with that?

Than you.
Re: [GEF4] Problem implementing ClickableAreaBehavior [message #1720469 is a reply to message #1719997] Mon, 18 January 2016 19:18 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
I think there are two problems here. First, you do not seem to have initialized the geometry of your GeometryNode and second, we do not seem to be safe guarded against this. Can you please open a bugzilla so we add the respective check to GeometryNode?
Re: [GEF4] Problem implementing ClickableAreaBehavior [message #1720590 is a reply to message #1720469] Tue, 19 January 2016 14:53 Go to previous message
Xavier JACQUES is currently offline Xavier JACQUESFriend
Messages: 10
Registered: October 2015
Junior Member
No Message Body
Previous Topic:[GEF4] geometry intersection computation duration
Next Topic:Adding another GraphicalViewer in GraphicalEditorWithFlyoutPalette
Goto Forum:
  


Current Time: Thu Apr 25 19:10:07 GMT 2024

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

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

Back to the top