1

i am using ArcGIS Library for a geospatial project. the sample codes available in their website was fully in java Swing. i need to do path animation in it using javaFX. is it possible.? if yes, can any one suggest me a sample code to create a map.? Sample code for creating a map in Swing

3 Answers3

0

I don't think you can pull this off using JavaFX, since JMap extends JComponent and is a class provided by the ArcGIS. Unless, they release a version which is supporting JavaFX, things are not very good.

The least you can do is to embed this JMap into a JavaFX application using SwingNode. An example on how to achieve this can be found here.

I am not sure what you want to achieve, when you say "path animation in it", but if it has something that can be achieved without using the internal components of JMap, you can do it !

ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
0

JMap is a Swing component. JavaFX 1 was built on Swing and supported wrapping a Swing component. JavaFX 2 does not use Swing and does not support wrapping a Swing component. It is anticipated that the upcoming JavaFX 8 will support using Swing components in a JavaFX application.

UPDATE: ArcGIS Runtime is getting support for JavaFX! See http://blogs.esri.com/esri/arcgis/2014/09/17/arcgis-runtime-plays-at-10-2-4/ for details.

You have some options:

  • Go back to JavaFX 1 (not a good idea IMO)
  • Turn it around and use JavaFX components in a Swing application (see http://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm)
  • Wait for Java 8, or go get the developer preview of Java 8.
  • Wait for ArcGIS Runtime 10.2.4 (to be released any day now), which will have beta support for JavaFX.

Sources:

How to wrap a swing component in a javaFX 2.0 application

Class SwingNode (JavaFX 8)

Community
  • 1
  • 1
Gary Sheppard
  • 4,764
  • 3
  • 25
  • 35
0

Maybe a bit late but... ArcGIS Runtime for Java's latest beta (Quartz) offers much more JavaFX support.

https://developers.arcgis.com/java/beta/guide/release-notes-java.htm

Ken
  • 474
  • 6
  • 8