public void mouseReleased(MouseEvent mouseEvent) {
   if (this.isArmed() && this.isUseRubberBand() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
     if (this.isUseRubberBand() && measureTool.getPositions().size() == 1)
       measureTool.removeControlPoint();
     this.setActive(false);
     rubberBandTarget = null;
     // Disarm after second control point of a line or regular shape
     autoDisarm();
     mouseEvent.consume();
     measureTool.firePropertyChange(MeasureTool.EVENT_RUBBERBAND_STOP, null, null);
   } else if (this.isMoving() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
     this.setMoving(false);
     this.movingTarget = null;
     mouseEvent.consume();
   }
 }
  protected void dragSelected(SelectEvent event) {
    MeasureTool.ControlPoint point = (MeasureTool.ControlPoint) event.getTopObject();

    LatLon lastPosition = point.getPosition();
    if (point.getValue(MeasureTool.CONTROL_TYPE_LOCATION_INDEX) != null)
      lastPosition =
          measureTool
              .getPositions()
              .get((Integer) point.getValue(MeasureTool.CONTROL_TYPE_LOCATION_INDEX));

    // Delegate dragging computations to a dragger.
    this.dragger.selected(event);

    measureTool.moveControlPoint(point);
    if (measureTool.isShowAnnotation()) measureTool.updateAnnotation(point.getPosition());
    measureTool.firePropertyChange(
        MeasureTool.EVENT_POSITION_REPLACE, lastPosition, point.getPosition());
    measureTool.getWwd().redraw();
  }