Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Where are my ScrollEvents going?
Where are my ScrollEvents going? [message #1706448] Wed, 26 August 2015 22:46 Go to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
I know the ScrollPane is not directly supported by e(fx)clipse. But I was able to wrap the ScrollPane with a BorderPane and get to render.

I have taken code that worked in a JavaFX application and put the code into e4 class with a @PostConstruct DI to build the ScrollPane which is wrapped by the BorderPane.

My problem is that I need the mouse wheel scroll event. In the Java FX application the below code works. In the e4 part it does not work. I have invoked the setOnScroll() to every part, The BorderPane, ScrooPane, Layout (Vox) and Scene. The mouse scroll event never makes it to any pane.

spane.setOnScroll(new EventHandler<ScrollEvent>() {
    	@Override
	      public void handle(ScrollEvent event) {
	    	  System.out.println("In ScrollEvent event for spane:");
	    	  event.consume();
	      }
});


What seems to be the default behavior (Horizontal scroll) is getting the mouse scroll event and moving the rendering up and down.

Why is the setOnScroll not working?

P.S. I am somewhat new to e4 and JavaFX, so my mistake could be something simple.


Oxygen 3a
Windows 10
Re: Where are my ScrollEvents going? [message #1706471 is a reply to message #1706448] Thu, 27 August 2015 07:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 27.08.15 00:46, Paul Roubekas wrote:
> I know the ScrollPane is not directly supported by e(fx)clipse. But I

Just to clarify - of course e(fx)clipse supports ScrollPane what we
don't support is to directly inject into your part bean!

> was able to wrap the ScrollPane with a BorderPane and get to render.

Yes that's the way to go.

> I have taken code that worked in a JavaFX application and put the code
> into e4 class with a @PostConstruct DI to build the ScrollPane which is
> wrapped by the BorderPane.

Ok

>
> My problem is that I need the mouse wheel scroll event. In the Java FX
> application the below code works. In the e4 part it does not work. I
> have invoked the setOnScroll() to every part, The BorderPane, ScrooPane,
> Layout (Vox) and Scene. The mouse scroll event never makes it to any
> pane.
> spane.setOnScroll(new EventHandler<ScrollEvent>() {
> @Override
> public void handle(ScrollEvent event) {
> System.out.println("In ScrollEvent event for spane:");
> event.consume();
> }
> });
>
> What seems to be the default behavior (Horizontal scroll) is getting the
> mouse scroll event and moving the rendering up and down.
>
> Why is the setOnScroll not working?

I don't know why it is not working for you. I just made a simple test
application and there it works without problems.

We are not catching events in our code so I can not explain why this is
not working for you.

> P.S. I am somewhat new to e4 and JavaFX, so my mistake could be
> something simple.

I don't think this has anything to do with e4 - I'm fairly certain that
there's somewhere a small mistake (most likely in your code) which makes
it not work but with the information I have I'm unable to help more than
that.

Tom
Re: Where are my ScrollEvents going? [message #1706558 is a reply to message #1706471] Thu, 27 August 2015 16:48 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
I found the difference. In a Java FX application the mouse wheel scroll event go to the StackPane. When in e(FX)clipe the mouse wheel scroll event goes to the dataGraph.



Oxygen 3a
Windows 10
Re: Where are my ScrollEvents going? [message #1706663 is a reply to message #1706558] Fri, 28 August 2015 13:09 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I'm not sure what I should learn from that but I want to point out that the scroll event is a delivered always to the node under the mouse pointer no matter if it is the focus node.
Previous Topic:e(fx)clipse CSS Editor is nowhere to be found
Next Topic:Please review new wiki page for errors
Goto Forum:
  


Current Time: Thu Jan 16 20:02:13 GMT 2025

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

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

Back to the top