/**
   * The mouse location changed during a drag, while this MapTool was the active one.
   *
   * @param point The location of the mouse in world coordinates.
   * @param evt The original event.
   */
  public void updateDrag(Point2D.Double point, MouseEvent evt) {
    // just in case we didn't get a mousePressed-Event
    if (dragStartPos == null) {
      dragStartPos = (Point2D.Double) point.clone();
      setMeasureCursor();
      return;
    }

    // if this is the first time mouseDragged is called, capture the screen.
    if (dragCurrentPos == null) captureBackground();

    dragCurrentPos = (Point2D.Double) point.clone();
    mapComponent.repaint();

    reportDistance(false);
  }
Example #2
0
 /**
  * The mouse location changed during a drag, while this MapTool was the active tool.
  *
  * @param point The location of the mouse in world coordinates.
  * @param evt The original event.
  */
 @Override
 public void updateDrag(Point2D.Double point, MouseEvent evt) {
   // just in case we didn't get a mousePressed event
   if (dragStartPos == null) {
     dragStartPos = (Point2D.Double) point.clone();
   } else {
     double dx = dragStartPos.getX() - point.getX();
     double dy = dragStartPos.getY() - point.getY();
     mapComponent.offsetVisibleArea(dx, dy);
   }
 }
Example #3
0
 @Override
 public Object getTransformRestoreData() {
   return origin.clone();
 }
Example #4
0
 public Object clone() {
   return new RobotState((Point2D.Double) location.clone(), heading, velocity, time, smoothing);
 }
 /**
  * The mouse starts a drag, while this MapTool was the active one.
  *
  * @param point The location of the mouse in world coordinates.
  * @param evt The original event.
  */
 public void startDrag(Point2D.Double point, MouseEvent evt) {
   setMeasureCursor();
   this.dragStartPos = (Point2D.Double) point.clone();
 }
Example #6
0
 /**
  * The mouse starts a drag, while this MapTool is the active one.
  *
  * @param point The location of the mouse in world coordinates.
  * @param evt The original event.
  */
 @Override
 public void startDrag(Point2D.Double point, MouseEvent evt) {
   // store the start location of the drag.
   dragStartPos = (Point2D.Double) point.clone();
 }