快速 Java 形状操作
我的团队缺乏时间来实现简单的形状编辑器。我们必须能够创建、删除、移动和复制简单的形状,例如矩形和线条。这必须是一个独立的应用程序(可能不使用小程序)。我们已经完全实现了支撑应用程序的模型以及控制器。有什么建议吗?
编辑:这是一个更大的应用程序的一部分。只是缺少演示元素,需要澄清一下。
My team is short on time in implementing a simple shape editor. We have to be able to create, delete, move, and copy simple shapes like rectangles and lines. This has to be a stand-alone application (may not use applets). We've fully implemented our model underpinning the application, as well as the controllers. Any advice?
Edit: This is part of a much larger application. Just missing the presentation element, to clarify.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想显示图形,请查看 Java2D 库。
这是 API: http://download- llnw.oracle.com/javase/1.4.2/docs/guide/2d/spec.html
还有很多很多教程:(这里是一个) http://download.oracle .com/javase/tutorial/2d/index.html
只需尝试谷歌搜索 Java 2D 示例或一些类似的查询。
我想您会发现用 Java 绘制 2D 形状实际上非常容易:)
If you're just wanting to display graphics, check out the Java2D library.
Here is the API: http://download-llnw.oracle.com/javase/1.4.2/docs/guide/2d/spec.html
There are also many many tutorials: (here is one) http://download.oracle.com/javase/tutorial/2d/index.html
Just try Googling Java 2D examples or some similar query.
I think you'll find it's actually pretty easy to draw 2D shape in Java :)
我一直在使用 JHotDraw,这是我自己的应用程序中的图形编辑器。你可以参考他们的源代码。他们相当广泛地使用设计模式。
它是一款还不错的图形编辑器,由经典设计模式的作者之一Erich Gamma 原创。
I had been using JHotDraw, a figure editor in my own application. You may refer to their source code. They are using design pattern quite extensively.
It is a not too bad figure editor, and it is originated by Erich Gamma, one of the author of classic design pattern.