コード例 #1
0
ファイル: VCytographer.java プロジェクト: osmax/vaadin-graph
 private void removeSelectionBox() {
   if (selectionBox.isSelectionBoxVisible()) {
     canvas.remove(selectionBox);
     selectionBox.setSelectionBoxVisible(false);
     VConsole.log("selection box removed from canvas");
     selectionBox.setSelectionBoxRightHandSide(true);
   }
 }
コード例 #2
0
ファイル: VCytographer.java プロジェクト: osmax/vaadin-graph
 private void extractSelection() {
   final int x1 = selectionBox.getSelectionBoxStartX();
   final int y1 = selectionBox.getSelectionBoxStartY();
   if (selectionBox.isSelectionBoxVisible()) {
     final int x2 = x1 + selectionBox.getWidth();
     final int y2 = y1 + selectionBox.getHeight();
     VConsole.log("selectNodesAndEdgesInTheBox: " + x1 + "," + y1 + " " + x2 + "," + y2);
     selectNodesAndEdgesInTheBox(x1, y1, x2, y2);
   }
 }
コード例 #3
0
ファイル: VCytographer.java プロジェクト: osmax/vaadin-graph
  @Override
  public void onMouseMove(final MouseMoveEvent event) {
    final int currentX = event.getX();
    final int currentY = event.getY();

    if (selectionBox.isSelectionBoxVisible()) {
      selectionBox.drawSelectionBox(canvas, currentX, currentY);
    } else if (graph.getMovedShape() != null) {
      final VNode moved = graph.getMovedShape();
      moved.moveNode(currentX, currentY);
    } else if (onLink) {
      if (linkLine != null) {
        canvas.remove(linkLine);
      }
      linkLine = getLinkLine(currentX, currentY);
      canvas.add(linkLine);
    } else if (onMove && event.getSource().equals(canvas)) {
      graph.moveGraph(startX - currentX, startY - currentY);
      startX = currentX;
      startY = currentY;
    }
  }