简体   繁体   中英

Selecting proper toolkit for a 2D simulation project in Java

I am looking for a toolkit that will allow me to design widgets containing 2D graphics for an elevator simulation in Java. Once created, those widgets will be integrated with SWT, Swing, or QtJambi framework.

Background information:

I am developing an Elevator Simulator for fun. My main goal is to increase my knowledge of Java, Eclipse IDE, and more importantly concurrency. It is certainly fun and I enjoyed implementing this State Machine Pattern .

Anyway, I am at a point where I would like to see the Elevator on the screen and not limit myself to log its operations on the console.

I will probably choose SWT, Swing, or QtJambi for the UI controls but I am wondering what to do with the graphical part of the simulation.

您可以使用 SWT 画布(或 Swing 画布,或通过 JOGL 的 OpenGL 画布,...),并将其设置为模拟的观察者,并且每当模拟状态发生变化时,您都可以重绘新状态。

You could get some abstract graphics out of a Graph visualisation tool such as JGraph . You could use this to visualise which state your elevator is in. However, i'm not sure how flexible these sort of graph visualisation tools are and whether you can add your own graphics and animations.

Are you sure you actually want to be using widgets. Would using Graphics2D+friends and your own abstractions not be a better fit?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM