如何在 Eclipse 的 Draw2d 中拖动多边形并调整其大小 org.eclipse.draw2d.Polygon
我正在研究多边形拖动,以及调整多边形大小。我可以使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用
org.eclipse.draw2d.PolygonShape
而不是org.eclipse.draw2d.Polygon
,它应该按照您的预期工作。If you use a
org.eclipse.draw2d.PolygonShape
instead of aorg.eclipse.draw2d.Polygon
it should work as you expect it to.