com.ait.lienzo.client.core.shape.Rectangle.getLayer()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.ait.lienzo.client.core.shape.Rectangle.getLayer方法的一些代码示例,展示了Rectangle.getLayer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.getLayer方法的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Rectangle
类名称:Rectangle
方法名:getLayer

Rectangle.getLayer介绍

暂无

代码示例

代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-charts

@Override
  public void onNodeDragMove(NodeDragMoveEvent event) {
    int currentX = event.getX();
    int currentY = event.getY();
    int incrementX = currentX - initialXPosition;
    int incrementY = currentY - initialYPosition;
    double finalWidth = ChartResizer.this.width + incrementX;
    double finalHeight = ChartResizer.this.height + incrementY;
    resizeRectangle.setWidth(finalWidth).setHeight(finalHeight);
    Point2D start = new Point2D(finalWidth / 2, finalHeight / 2);
    resizeArrow1.setStart(start).setEnd(new Point2D(finalWidth, finalHeight / 2));
    resizeArrow2.setStart(start).setEnd(new Point2D(finalWidth / 2, finalHeight));
    resizeArrow3.setStart(start).setEnd(new Point2D(0, finalHeight / 2));
    resizeArrow4.setStart(start).setEnd(new Point2D(finalWidth / 2, 0));
    // Fire the resize event with apply flag not set (not final size yet).
    ChartResizer.this.fireEvent(new ChartResizeEvent(finalWidth, finalHeight, false));
    
    LayerRedrawManager.get().schedule(resizeRectangle.getLayer());
  }
});

代码示例来源:origin: com.ahome-it/lienzo-charts

@Override
  public void onNodeDragMove(NodeDragMoveEvent event)
  {
    int currentX = event.getX();
    int currentY = event.getY();
    int incrementX = currentX - initialXPosition;
    int incrementY = currentY - initialYPosition;
    double finalWidth = ChartResizer.this.width + incrementX;
    double finalHeight = ChartResizer.this.height + incrementY;
    resizeRectangle.setWidth(finalWidth).setHeight(finalHeight);
    Point2D start = new Point2D(finalWidth / 2, finalHeight / 2);
    resizeArrow1.setStart(start).setEnd(new Point2D(finalWidth, finalHeight / 2));
    resizeArrow2.setStart(start).setEnd(new Point2D(finalWidth / 2, finalHeight));
    resizeArrow3.setStart(start).setEnd(new Point2D(0, finalHeight / 2));
    resizeArrow4.setStart(start).setEnd(new Point2D(finalWidth / 2, 0));
    showSizeText(sizeText, finalWidth, finalHeight);
    // Fire the resize event with apply flag not set (not final size yet).
    ChartResizer.this.fireEvent(new ChartResizeEvent(finalWidth, finalHeight, false));
    resizeRectangle.getLayer().batch();
  }
});

相关文章