在Java中为2D模拟项目选择合适的工具包 [英] Selecting proper toolkit for a 2D simulation project in Java

查看:179
本文介绍了在Java中为2D模拟项目选择合适的工具包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个工具包,可以让我设计包含2D图形的小部件,用于Java中的电梯模拟。一旦创建,这些小部件将与SWT,Swing或QtJambi框架集成在一起。



背景信息:

我正在开发电梯模拟器以获得乐趣。我的主要目标是增加对Java,Eclipse IDE和更重要的并发的了解。这当然很有趣,我很喜欢实现这个状态机模式

无论如何,我希望在屏幕上看到电梯并且不会限制自己在控制台上记录其操作。



我可能会选择SWT,Swing或QtJambi作为UI控件,但我想知道如何处理模拟的图形部分。 $ b

解决方案

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


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.

解决方案

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

这篇关于在Java中为2D模拟项目选择合适的工具包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆