简体   繁体   English

调整Draw2d Touch的监听器大小

[英]Resize listener for Draw2d Touch

Forgive me if this is a dumb question, I'm a newbie with Draw2d Touch ( http://www.draw2d.org/ ). 如果这是一个愚蠢的问题,请原谅我,我是Draw2d Touch( http://www.draw2d.org/ )的新手。 I need to attach a listener to a Rectangle to notify me when the Rectangle is being resized. 我需要在Rectangle上附加一个侦听器,以在调整Rectangle大小时通知我。 I have searched the API but I haven't found anything helpful. 我已经搜索了API,但没有发现任何有用的信息。

I thought that it could be located in DragDropEditPolicy but no luck. 我以为它可以位于DragDropEditPolicy中,但是没有运气。

Any help is appreciated. 任何帮助表示赞赏。

Have you solved the question yet? 你解决了这个问题了吗? If not then the JSON Example should give you a hint: 如果没有,那么JSON Example应该给你一个提示:

You can add a event listener: 您可以添加事件监听器:

canvas.getCommandStack().addEventListener(function(e){
    if(e.isPostChangeEvent()){
    // displayJSON(canvas); OR call your resize-handler-method
    }
});

This you get after the resize is done (something like onMouseUpEvent) 调整大小后,您会收到此信息(类似于onMouseUpEvent)

Or you can overwrite the repaint method (which is inheritet by all the shapes. 或者,您可以覆盖repaint方法(由所有形状继承)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM