Beispiel #1
0
  @Override
  public void onMouseDown(final MouseDownEvent event) {
    VConsole.log("onMouseDown");
    extractSelection();
    removeSelectionBox();

    if (currentKeyModifiers.contains(KeyCodes.KEY_CTRL)) {
      selectionBox.setSelectionBoxStartX(event.getX());
      selectionBox.setSelectionBoxStartY(event.getY());
      selectionBox.setSelectionBoxVisible(true);
      VConsole.log(
          "onMouseDown - selection started:"
              + selectionBox.getSelectionBoxStartX()
              + ","
              + selectionBox.getSelectionBoxStartY());
    } else if (event.getSource() instanceof VNode) {
      onMove = false;
    } else if (event.getSource() instanceof DrawingArea) {
      onMove = true;
      startX = event.getX();
      startY = event.getY();
      VConsole.log("onMouseDown - moving");
    } else {
      VConsole.error("onMouseDown - UNKNOWN STATE");
    }
  }
Beispiel #2
0
 private void removeSelectionBox() {
   if (selectionBox.isSelectionBoxVisible()) {
     canvas.remove(selectionBox);
     selectionBox.setSelectionBoxVisible(false);
     VConsole.log("selection box removed from canvas");
     selectionBox.setSelectionBoxRightHandSide(true);
   }
 }
Beispiel #3
0
 private void paintGraph() {
   selectionBox.setSelectionBoxVisible(false);
   fps = 1f / ((System.currentTimeMillis() - paintStartTime) / 1000f);
   paintStartTime = System.currentTimeMillis();
   if (showInfo) {
     if (info != null) {
       canvas.remove(info);
     }
     canvas.add(info = getInfo());
   }
 }