コード例 #1
0
  public void mouseClicked(MouseEvent e) {

    if (!(e.getSource().getClass().getName()).equalsIgnoreCase("VisualItem")
        && !UILib.isButtonPressed(e, button1)) {
      if (gv.getDisplay().getCursor().getType() == (Cursor.DEFAULT_CURSOR)) {
        // release all focus and neighbour highlight
        TupleSet ts = vis.getGroup(Visualization.FOCUS_ITEMS);
        if (gv.getRecStatus() == 2 && gv.fromIndirect && (ts.getTupleCount() == 0) && !gv.fromAll)
          gv.showDirectGraph();

        ts.clear();
        vis.removeGroup("depthEdge");
        gv.releaseSearchFocus();
      }
    }

    if (UILib.isButtonPressed(e, button1) && e.getClickCount() == 1) {
      if (gv.getDisplay().getCursor().getName().equals("zoom")) admin.toggleZoom();
      else if (gv.getDisplay().getCursor().getName().equals("zoomout")) admin.toggleZoomOut();
      else if (gv.getDisplay().getCursor().getName().equals("zoomin")) admin.toggleZoomIn();
      else if (gv.getDisplay().getCursor().getName().equals("zoomout1")) admin.toggleZoomOut1();
      else if (gv.getDisplay().getCursor().getName().equals("zoomin1")) admin.toggleZoomIn1();
      else if (gv.getDisplay().getCursor().getName().equals("pan")) admin.togglePan();
    }
  }
コード例 #2
0
  @Override
  public void itemClicked(VisualItem item, MouseEvent e) {

    if (!filterCheck(item)
        || v != item.getVisualization()
        || !UILib.isButtonPressed(e, button)
        || e.getClickCount() != ccount) {
      return;
    }

    if (e.isControlDown()) {
      if (focusedTupleSet.containsTuple(item)) {
        focusedTupleSet.removeTuple(item);
        if (item == curFocus) {
          curFocus = null;
          Iterator<VisualItem> focusedTuples = focusedTupleSet.tuples();
          while (focusedTuples.hasNext()) {
            curFocus = focusedTuples.next();
          }
        }
      } else {
        focusedTupleSet.addTuple(item);
        curFocus = item;
      }
    } else {
      focusedTupleSet.setTuple(item);
      curFocus = item;
    }

    runActivity(v);
  }
コード例 #3
0
  @Override
  public void mouseClicked(MouseEvent e) {

    if (!UILib.isButtonPressed(e, button)) {
      return;
    }

    curFocus = null;
    focusedTupleSet.clear();

    runActivity(v);
  }
コード例 #4
0
ファイル: ZoomControl.java プロジェクト: iadgov/GRASSMARLIN
 /** @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) */
 public void mousePressed(MouseEvent e) {
   if (UILib.isButtonPressed(e, button)) {
     Display display = (Display) e.getComponent();
     if (display.isTranformInProgress()) {
       yLast = -1;
       System.err.println("can't move");
       return;
     }
     display.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
     display.getAbsoluteCoordinate(e.getPoint(), down);
     yLast = e.getY();
   }
 }
コード例 #5
0
  /** {@inheritDoc} */
  public void mouseDragged(MouseEvent mouseEvent) {
    if (UILib.isButtonPressed(mouseEvent, MOUSE_PANNING_BUTTON)) {
      Display pannedDisplay = (Display) mouseEvent.getSource();

      int currentHorizontalMousePosition = mouseEvent.getX();
      int horizontalMovement = currentHorizontalMousePosition - m_horizontalMouseDownPosition;

      pannedDisplay.pan(horizontalMovement, 0);
      pannedDisplay.repaint();

      if (m_synchronizedDisplay != null) {
        m_synchronizedDisplay.pan(horizontalMovement, 0);
        m_synchronizedDisplay.repaint();
      }

      m_horizontalMouseDownPosition = currentHorizontalMousePosition;
    }
  }
コード例 #6
0
ファイル: ZoomControl.java プロジェクト: iadgov/GRASSMARLIN
  /** @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent) */
  public void mouseDragged(MouseEvent e) {
    if (UILib.isButtonPressed(e, button)) {
      Display display = (Display) e.getComponent();
      if (display.isTranformInProgress() || yLast == -1) {
        yLast = -1;
        return;
      }

      int y = e.getY();
      int dy = y - yLast;
      double zoom = 1 + ((double) dy) / 100;

      int status = zoom(display, down, zoom, true);
      int cursor = Cursor.N_RESIZE_CURSOR;
      if (status == NO_ZOOM) cursor = Cursor.WAIT_CURSOR;
      display.setCursor(Cursor.getPredefinedCursor(cursor));

      yLast = y;
    }
  }
コード例 #7
0
 /** {@inheritDoc} */
 public void mouseReleased(MouseEvent mouseEvent) {
   if (UILib.isButtonPressed(mouseEvent, MOUSE_PANNING_BUTTON)) {
     m_horizontalMouseDownPosition = -1;
   }
 }
コード例 #8
0
ファイル: ZoomControl.java プロジェクト: iadgov/GRASSMARLIN
 /** @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) */
 public void mouseReleased(MouseEvent e) {
   if (UILib.isButtonPressed(e, button)) {
     e.getComponent().setCursor(Cursor.getDefaultCursor());
   }
 }
コード例 #9
0
ファイル: PanControl.java プロジェクト: mongkie/mongkie
 protected boolean isValid(MouseEvent e) {
   if (UILib.isButtonPressed(e, m_button) && !UILib.isModifierPressed(e)) {
     return true;
   }
   return false;
 }