BaseDOMElement.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:appformer 作者:
protected void setupDelegatingMouseDownHandler() {
    widgetContainer.addDomHandler(new MouseDownHandler() {
                                      @Override
                                      public void onMouseDown(final MouseDownEvent event) {
                                          gridLayer.onNodeMouseDown(new NodeMouseDownEvent(event) {

                                              @Override
                                              public int getX() {
                                                  //Adjust the x-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getX() + widgetContainer.getElement().getOffsetLeft();
                                              }

                                              @Override
                                              public int getY() {
                                                  //Adjust the y-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getY() + widgetContainer.getElement().getOffsetTop();
                                              }
                                          });
                                      }
                                  },
                                  MouseDownEvent.getType());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号