SketchEditor freezes MapView when using touch screen

670
7
11-08-2022 08:34 PM
rod182211
New Contributor II

Hi, I am having issues with SketchEditor working on my touch screen. Using the mouse works fine.  When using touch, I can see the editor is started however the MapView becomes unresponsive. All other aspects within the application work fine via touch ie the Mil Symbols etc.  I followed the example as per the developers guide for Java. I am using 100.15.1 Openjdk17 and OpenJfx17

Example method:

@FXML
private void handleRectangleButtonClicked() {
graphicsOverlay.clearSelection();
sketchEditor.start(SketchCreationMode.RECTANGLE);

}

I have tried with no success.

  • Removing the FXML action event and adding an OnAction to the button

pointButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
graphicsOverlay.clearSelection();
sketchEditor.stop(); //even added a stop to see if helps 
sketchEditor.start(SketchCreationMode.POINT);

}
});

  • add the following in case it was a Javafx thread issue:

pointButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
 Platform.runLater(() -> {

graphicsOverlay.clearSelection();

sketchEditor.stop(); //even added a stop to see if helps 
sketchEditor.start(SketchCreationMode.POINT);

});

}
});

 

Any ideas or help as to how to resolve or even try welcome

In all cases using the mouse continued to work but not when using touch on my touch screen.

I apologies but I also posted this issue here Javafx SketchEditor TouchScreen Issue - Esri Community

Tags (1)
0 Kudos
7 Replies
MarkBaird
Esri Regular Contributor

Hi Rod,

I'm going to set up a touch screen to see what is happening here.  I'll report back shortly.

Mark

0 Kudos
rod182211
New Contributor II

Thank you

0 Kudos
MarkBaird
Esri Regular Contributor

Okay, I've been experimenting with things and found something interesting!

The SketchEditor classes have not altered for a very long time, but there is a definite regression in touch as you've identified which I have narrowed down to the version of JavaFX.  Basically touch with SketchEditor works fine if you switch to using JavaFX11.0.2, but I'm seeing the same issue as you with using JavaFX 17.

I'll have to dig into this some more, but it looks like there is a behaviour change after JavaFX11.  The issue still happens even in the early adopter version of JavaFX20!

I'll have to look at this some more, but the workaround for the moment is to build your app in JavaFX 11.

Does this help?

 

Mark 

0 Kudos
rod182211
New Contributor II

Yes I can roll back at the moment. Thanks for the update

0 Kudos
rod182211
New Contributor II

Just FYI I found it will work up to JavaFX16

0 Kudos
MarkBaird
Esri Regular Contributor

@rod182211 

I wanted to give you an update on this.  As you say it worked fine until JavaFX16 and we've seen the same too having looked at this some more.

There is a nice explanation here which sums up the issue which is basically a change in how touch works.

We've got some code in test at the moment where we've rewired some of the events for the SketchEditor to make it function again at JavaFX17.  We need to be mindful that JavaFX11 us only in support until September 2023 so I'm keen this is fixed.  There will be subtle changes to how the touch interaction works, but the important thing is it works again!  

In the next month we will be releasing 200.0.0 of Runtime for Java (it will be called ArcGIS Maps SDK for Java when released), so if all goes well with the testing of this fix we should be able to include it in this release.

The longer term plan is to deprecate the SketchEditor as we are working on a much improved editor for geometry which you will see next year.  

 

Mark

0 Kudos
MarkBaird
Esri Regular Contributor

@rod182211 

We've just made a release candidate cut of 200.0.0 of our next release and I can confirm that the fix to workaround the change in touch behaviour introduced in JavaFX 17 is included.

At the earliest this will be released the middle of next week...

Mark

0 Kudos