/screensaver

Testing out canvas/graphics in JavaFX

Primary LanguageJava

Screensaver application

This app is just a screensaver that generates random shapes (circles, rectangles, hexagons).

Recent edition:

  • Added an example to use strategy pattern for drawing shapes in different forms (circles, rectangles, hexagons)
  • Instead of using inheritance (extending from Shape) I made different draw strategies (CircleDraw, HexagonDraw, RectangleDraw)
  • Now you have more freedom to add new behaviours with ease.

Note: Maybe not the best example to demonstrate the Strategy pattern.

Preview:

preview