Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX and a Timeline ?

 
Ingi Erlings
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have an idea for an application for my alotment and I wonder if JavaFX could be the "silver bullet" here.
I would like to create a simple canvas that emulates my alotment with my vegetables + sunflowers.
The timeline would for instance strech from early april to end of september.
The application would have a canvas showing the alotment : 10 x 13 meters.
I am able to plot a number of icons on the canvas: such as all the sunflowers.
The sunflower has 4 stages which describes the sunflowe lifecycle under good circumstances :
small-medium-max-dead and each stages has an Icon ( small yellow circle, medium yellow circle, large yellow circle and finally a brown medium circle ).
So if a plant 30 sunflowers on different dates I can 'play' the simulation and see hos they grow and die.

Is this possible ?

regards, i
 
Hendrik Ebbers
author
Ranch Hand
Posts: 32
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure!
If you are familiar with Java2D or HTML5 Canvas you could use the JavaFX Canvas Control. In this control you can paint whatever you want on a graphics canvas. Here is a quick overview: http://docs.oracle.com/javase/8/javafx/graphics-tutorial/canvas.htm#JFXGR214
My book contains an example, too.
But the better approach is to use the JavaFX scene graph. The scene graph can contain, layout, manage and render all your components. By doing so you can add event listeners, etc. on all the components. How the scene graph is working and how you can define own layouts, etc. is part of my book
 
Ingi Erlings
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Thanks Hendrik for your reply and the oracle-link.
Must take a look at this book, would love to learn this.

regards, Ingo
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic