Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在研究多边形拖动,也调整多边形的大小。我可以使用 org.eclipse.draw2d.RectangleFigure 绘制矩形并且可以拖动它,我将 MouseMotionListener 和 MouseListener 添加到 org.eclipse.draw2d.RectangleFigure。
但
同时为多边形尝试同样的事情。这没用。当我尝试拖动多边形时会调用 mouseDragged 事件,但它不会移动。
如果您使用 aorg.eclipse.draw2d.PolygonShape而不是 aorg.eclipse.draw2d.Polygon它应该可以按预期工作。
org.eclipse.draw2d.PolygonShape
org.eclipse.draw2d.Polygon