本文介绍了Java 2D中的可拖动矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要绘制一些UML组件(类,包等)使用Java 2D然后能够拖动它们。有没有办法做到这一点?我的意思是,要使形状可拖动?
I need to draw some UML components (classes, packages etc) using Java 2D and then be able to drag them around. Is there a way to do this? I mean, to make a shape "draggable"?
推荐答案
被设计为技术和结构化图形的Java GUI框架。链接的说明了如何自定义绘图编辑器。示例 org.jhotdraw.samples.draw.Main
是一个合理的起点, JModeller
是一个简单的UML编辑器使用框架构建。
JHotDraw
was designed as "a Java GUI framework for technical and structured Graphics." The linked JHotDraw Pattern Language: JHotDraw Domain Overview illustrates how to customize drawing editors. The sample org.jhotdraw.samples.draw.Main
is a reasonable starting point, and JModeller
is a simple UML editor built using the framework.
这篇关于Java 2D中的可拖动矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!