如何在 Eclipse 的 Draw2d 中拖动多边形并调整其大小 org.eclipse.draw2d.Polygon

发布于 2024-12-28 19:01:32 字数 245 浏览 3 评论 0原文

我正在研究多边形拖动,以及调整多边形大小。我可以使用 org.eclipse.draw2d.RectangleFigure 绘制矩形,并且可以拖动它,我将 MouseMotionListener 和 MouseListener 添加到 org.eclipse.draw2d.RectangleFigure 中。

在为 Polygon 尝试同样的事情时。它不起作用。当我尝试拖动多边形时,将调用 mouseDragged 事件,但它不会移动。

I am working on Polygon Dragging , also Resizing of Polygon. I can draw rectangle using org.eclipse.draw2d.RectangleFigure and I am able to Drag it, I added MouseMotionListener and MouseListener to org.eclipse.draw2d.RectangleFigure.

but

while trying same thing for Polygon. it does not work. mouseDragged event gets called when i try to drag the polygon, but it does not move.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

轮廓§ 2025-01-04 19:01:32

如果您使用 org.eclipse.draw2d.PolygonShape 而不是 org.eclipse.draw2d.Polygon,它应该按照您的预期工作。

If you use a org.eclipse.draw2d.PolygonShape instead of a org.eclipse.draw2d.Polygon it should work as you expect it to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文