DrawFX – this is JaaavaaaFX

DrawFX has made some good progress these days. A lot of new features/improvements have been implemented like:

  • Priority for tasks: tasks now have a priority which can be LOW, NORMAL and HIGH. The colour of each sticky accords the task’s priority: green for LOW, yellow for NORMAL and orange for HIGH ;
  • It is possible to have multiple layers
  • A “Pen” tool has been added. It draws a line (composed of squares) while the mouse is dragged. The thickness can be modified using a slider ;
  • A “Rectangle” tool has been added in order to draw rectangles. The stroke’s color is the primary color, the fill’s color the secondary one. The width of the stroke can be changed using a slider ;
  • An “Ellipse” tool has been added in order to draw ellipses. The stroke’s color is the primary color, the fill’s color the secondary one. The width of the stroke can be changed using a slider ;
  • A “Shape” tool has been added in order to draw polygons. One click with the primary mouse’s button in the drawing area draws a line between the current click’s location and the previous one, while a double click closes the polygon. The stroke’s color is the primary color, the fill’s color the secondary one. The width of the stroke can be changed using a slider ;
  • A “Move” tool has been added and allows to move a layer ;
  • The “Eraser” tool now have a width and height properties ;
  • The “Bucket” tool is now able to only fill an area delimited by a bound color. For example you can change the color of a polygon by using this tool ;
  • The “Brush” tool has been improved. It now draws shapes defined by a SVG path. By default, the SVG path is a square, but can be changed to any valid path. In my screencast I use the path of a Java logo. It is also to possible to specify the scale X and Y to resize the shape represented by the path.

I still have some nice features left in my mind.

7 Responses to DrawFX – this is JaaavaaaFX

  1. agonnist says:

    Genial ca ! Je suis plutot débutant en javaFx et je souhaite réaliser une application de dessins, il me manque le tracé des rectangles et des elipses comme dans la video, je ne sais pas trop comment les faire. Mettez vous a disposition votre code source ?
    Merci bonne soirée

    • Thierry WASYL says:

      Il suffit d’appeler les méthodes fillRect et strokeRect à partir du GraphicsContext de votre Canvas. Idem pour les ellipses.

  2. Pingback: Java desktop links of the week, December 31 | Jonathan Giles

  3. Pingback: JavaFX links of the week, December 31 // JavaFX News, Demos and Insight // FX Experience

  4. Frank Stahl says:

    Very impressive! It is possible to use the API to draw GIS objects within our Application?

    • Thierry WASYL says:

      If you have the geographical coordinates of your GIS, you can. When you know where to draw, drawing it is not the most difficult part (maybe the easier one). And I don’t use any external APIs, only the JavaFX runtime.

  5. Pingback: Java desktop links of the week, December 31 – Jonathan Giles

Leave a reply to Thierry WASYL Cancel reply