Choosing the Right Toolkit for a 2D Modeling Project in Java

I am looking for a toolkit that will allow me to create widgets containing 2D graphics for modeling an elevator in Java. Once created, these widgets will be integrated with the infrastructure of SWT, Swing, or QtJambi.

Background Information:

I am developing an elevator simulator for fun. My main goal is to increase my knowledge of Java, the Eclipse IDE and, more importantly, concurrency. This is definitely fun, and I liked to implement this State Machine Pattern .

In any case, I am at a point where I would like to see the Elevator on the screen, and not limit myself to recording its operations on the console.

I will probably choose SWT, Swing, or QtJambi for the user interface controls, but I'm wondering what to do with the graphical part of the simulation.

+2
source share
3 answers

You can use the SWT canvas (or the Swing canvas, or the OpenGL canvas via JOGL, ...), and configure it as an observer of your simulation, and whenever the simulation state changes, you can redraw the new state.

+1
source

You can get abstract graphics from a chart visualization tool like JGraph . You can use this to visualize the state of your elevator. However, I’m not sure how flexible these chart visualization tools are and whether you can add your own graphics and animations.

+1
source

You really want to use widgets. Are users using Graphics2D + and native abstractions not better?

0
source

Source: https://habr.com/ru/post/1277407/


All Articles