简体   繁体   English

我可以在Jogl中嵌入Swing组件吗?

[英]Can I embed Swing components in Jogl?

I need to build a complex graphical editor for Eclipse. 我需要为Eclipse构建一个复杂的图形编辑器。 I don't like draw2d, and I find it weak for my requirements compared to java2d. 我不喜欢draw2d,与java2d相比,它对我的​​要求很弱。

I can use Swing on SWT, so I'll probably be using Swing to build my editor. 我可以在SWT上使用Swing,所以我可能会使用Swing构建我的编辑器。 However, I am keen to implement some fancy stuff which would require mixing bezier curves, shapes etc with Swing components. 但是,我热衷于实现一些花哨的东西,这需要将Bezier曲线,形状等与Swing组件混合。 For example, imagine a swing table connected to another swing component with a bezier spline. 例如,假设一个旋转台通过贝塞尔曲线样条线连接到另一个旋转组件。 I would like to create hovering controls positioned relative to existing ones: imagine a custom swing component appearing in response to a mouse over, when the mouse is on the table I've mentioned. 我想创建相对于现有控件定位的悬停控件:想象当鼠标在我提到的桌子上时,响应于鼠标悬停而出现的自定义摆动组件。 Visual studio's hovering debug windows or Word 2010's text properties widget appearing when you select a text would be examples similar to what I want. 选择文本时出现的Visual Studio的悬停调试窗口或Word 2010的文本属性小部件将是类似于我想要的示例。

On top of all of this, I'd like to animate, fade in, fade out built in swing widgets and custom components, such as curves etc. 最重要的是,我想制作动画,淡入,淡出内置的挥杆小部件和自定义组件(例如曲线等)。

JavaFX allowed using Swing components in its version 1.X, which would give me pretty much all that I want, but they threw away this functionality in 2.x. JavaFX允许在其1.X版本中使用Swing组件,这几乎可以满足我的所有需求,但是他们在2.x版本中放弃了此功能。 You can only embed JavaFX in swing or swt now, not the other way around. 您现在只能将JavaFX嵌入swing或swt中,而不能反过来。

After searching for options, I've come across Jogl, which claims integration with AWT and Swing widgets, though I can't really understand what that means. 在搜索选项之后,我遇到了Jogl,它声称与AWT和Swing小部件集成,尽管我真的不明白这意味着什么。 Can I draw all my curves, widgets etc on a GLJpanel, animate these with openGL, and add implement the kind of functionality I've described above? 我可以在GLJpanel上绘制所有曲线,小部件等,并用openGL对其进行动画处理,并添加实现上述功能的工具吗? This is all supposed to happen in Eclipse, so I'm supposed to embed this in SWT. 所有这些都应该在Eclipse中发生,所以我应该将其嵌入SWT中。

Am I looking for trouble here, or is this possible? 我在这里找麻烦还是有可能吗?

我将对所有动画(淡入等)使用timingframework(http://java.net/projects/timingframework)。对于酷炫的弹出控件,您可以使用JXLayer / JLayer(http://java.net/projects / jxlayer /(用于JDK 6支持)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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