用java构建的Genome浏览器:Swing和awt还是Swing和Processing?
我正在编写一个基因组浏览器,主要用于查看染色体重排的历史。目前该项目是一系列使用 Processing 编写的概念验证演示。此时,如果我不进行任何根本性的更改,最终的应用程序将是一个带有 GUI 的 Web 小程序,该 GUI 由 Swing 组件构建,可打开 PApplet 以实际显示正在发生的重新排列。
我的问题是:我应该放弃处理并切换到纯 Swing/AWT 吗?这是我的第一个大型 java 项目。我正在 eclipse 中构建,但我也可以使用 netbeans。例如,如果我可以将 PApplet 对象嵌入到 JFrame 中,那就太棒了。
I'm writing a genome browser designed primarily to view the history of chromosomal rearrangements. Right now the project is a series of proof-of-concept demos written using Processing. At this point if I don't make any radical changes the final application will be a web applet with a gui built of swing components that open PApplets to actually show the rearrangements happening.
My question is: Should I give up on processing and switch over to pure Swing/AWT? This is my first big java project. I'm building in eclipse, but I can use netbeans as well. If I could embed PApplet objects inside a JFrame, for example, that would make my day.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
processing.core.PApplet
扩展了java.applet.Applet
,因此应该可以嵌入PApplet
在java.awt.Frame
中,如文章 小程序⇒应用程序:混合开关击球手。另请参阅混合重组件和轻组件。附录:来自 API,“< code>Processing 在
Frame
中运行,而不是在JFrame
中运行。但是,没有什么可以阻止您嵌入PApplet
。 code> 到JFrame
中,”除了 上面提到的局限性。processing.core.PApplet
extendsjava.applet.Applet
, so it should be possible to embeda
PApplet
in ajava.awt.Frame
, as discussed in the article Applet ⇒ application: Hybrid Switch Hitters. See also, Mixing heavy and light components.Addendum: From the API, "
Processing
runs in aFrame
and not aJFrame
. However, there's nothing to prevent you from embedding aPApplet
into aJFrame
," except for the limitations mentioned above.请记住,我对Processing或您的项目几乎一无所知,所以我只能给您一般性建议。
在每次重大设计更改之前,您应该问自己一个问题:我想通过进行此更改来解决什么问题?如果当前的架构有效,那么您应该保留它。如果它不起作用,那么您应该首先定义它有问题的具体问题(我注意到您没有这样做)。
Keep in mind that I know almost nothing about either Processing or your project, so I can only give you general advice.
The question that you should ask yourself before every major design change: what problem am I trying to solve by making this change? If the current architecture works, then you should keep it. If it's not working, then you should start by defining the specific things that are wrong with it (which I notice you didn't do).