2 Replies Latest reply on Dec 15, 2010 3:06 PM by ludwig95

    AIR vs JavaFX

    ludwig95

      Hi,


      I am posting this message in both JavaFX and AIR/Flash forums to see if my initial impressions are generally correct and to get opinions before I get into development. I have a strong Java background but have enjoyed the things I have tried in AIR/Flex and ActionScript 3 (and please feel free to correct me if my AIR assumptions are incorrect).


      I wish to create a desktop application that is graphical in nature but has reasonably complex logic incorporated. The user interface will consist of two parts. The first part will have a number of screens with traditional user interface containers, components and layouts (think screens with lists, trees, entry fields, buttons, images etc.). The second part of the user interface will be very graphical in nature with small regional maps (not google maps but bitmap drawings of specific areas) and shapes logically moving around the map and user interaction with these shapes and the map (a lot more than this, but that is the basic premise) .
      For the first part (the more traditional UI) I still want to have this interesting, rich and well designed. My impression is that AIR would excel here compared to JavaFX. The AIR/Flex environment is far more mature, has a far better selection of controls, great UI tooling (sorry JavaFX you are not even close yet). For the second part of the UI (the graphical part) I thought AIR/Flex would be great here also but as I started to look at it, it seems to have the old traditional "get a graphics object" and then start to do chains of operations "graphics.beginfill()"; graphics.drawRect(); graphics.endfill(). I have written in this style before and it is generally laborious (would I write this in AIR or Flash with ActionScript 3? not sure - still learning) JavaFX with its scenegraph seems far more intuitive, logical, and simple. I big win for JavaFX for this part.


      So which environment to choose? If JavaFX wasn't so incomplete and immature with the first part I might pick it. I know Java well and the logic part would be quicker for me (also free tooling). But JavaFX is undergoing an entire re-do very late in the game and it suffers greatly when compared to Flex/AIR for the first part of the UI. But a core part of the application will be the graphical part and I just don't know if I want to go through the procedural graphics thing one more time, this time with AIR/Flash. Ther scenegraph in JavaFX just seems so superior.

       


      Any comments appreciated.

        • 1. Re: AIR vs JavaFX
          Joe ... Ward Level 4

          I'm not sure the basic approaches to graphics are all that different, although perhaps JavaFX has its primitives at a different level.

           

          At the lowest level, Flash has the display list, which looks pretty similar to the scenegraph (even to the point of using a stage object).

          See http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3e.html

           

          You can create nodes (DisplayObjects) in the list and draw graphics (or load bitmaps, etc). This is procedural drawing at the basic level, but you can do it modularly and create your own primitives. Also the GraphicsPath feature can be handy (http://help.adobe.com/en_US/as3/dev/WS749610B4-4709-4f75-BBA0-650BF52623CA.htm)l

           

          At a higher level, Flex recently added support for declarative graphics: http://oreilly.com/flex/excerpts/flex-4-cookbook/graphics.html

          • 2. Re: AIR vs JavaFX
            ludwig95 Level 1

            Joe,


            Thanks for the information and the URLs. I can start to get a sense of what you are saying but I am not quite there yet (part of my learning curve in the FLEX/AIR world).

             

            It is interesting that when I read JavaFX stuff I get a pretty clear picture of one unified model. I may not know it all, but all the material seems to portray the underlying model in the same light. I can take those foundations and build on them logically. I get the same sense in the Silverlight world of Microsoft. But when I start to try and do this in the Adobe world I seem to run into different underlying models or at least different views of those models (and that is certainly not to say there isn't one unified mode, I am sure there is, but at times it just does not become apparent). At times I am not sure if I need to switch paradigms and tooling to get things done or not. Should I take a more traditional ActionScript/Flash approach for graphics and then hop into the Flex/AIR world for the rest of the UI? Do they tie together well? I have been looking for a definitive book but they all seem to approach UI/graphics development differently.

             

            I think I may want to start with your last URL (re: Flex declaritive graphics) but then again maybe I should be starting with the "Basics of ActionScript display programming".