public void onMouseUp(MouseUpEvent event) {
		if (event.getNativeButton() != NativeEvent.BUTTON_RIGHT) {
			Coordinate coordinate = getWorldPosition(event);
			if (distanceLine.getOriginalLocation() == null) {
				distanceLine.setGeometry(getFactory().createLineString(new Coordinate[] { coordinate }));
				mapWidget.registerWorldPaintable(distanceLine);
				mapWidget.registerWorldPaintable(lineSegment);
				dispatchState(State.START);
			} else {
				Geometry geometry = (Geometry) distanceLine.getOriginalLocation();
				InsertCoordinateOperation op = new InsertCoordinateOperation(geometry.getNumPoints(), coordinate);
				geometry = op.execute(geometry);
				distanceLine.setGeometry(geometry);
				tempLength = (float) geometry.getLength();
				updateMeasure(event, true);
				dispatchState(State.CLICK);
			}
			mapWidget.render(mapWidget.getMapModel(), RenderGroup.VECTOR, RenderStatus.UPDATE);
		}
	}
public void onMouseUp ( MouseUpEvent event ) { if ( event . getNativeButton ( ) != NativeEvent . BUTTON_RIGHT ) { Coordinate coordinate = getWorldPosition ( event ) ; if ( distanceLine . getOriginalLocation ( ) == null ) { distanceLine . setGeometry ( getFactory ( ) . createLineString ( new Coordinate [ ] { coordinate } ) ) ; mapWidget . registerWorldPaintable ( distanceLine ) ; mapWidget . registerWorldPaintable ( lineSegment ) ; dispatchState ( State . START ) ; } else { Geometry geometry = ( Geometry ) distanceLine . getOriginalLocation ( ) ; InsertCoordinateOperation op = new InsertCoordinateOperation ( geometry . getNumPoints ( ) , coordinate ) ; geometry = op . execute ( geometry ) ; distanceLine . setGeometry ( geometry ) ; tempLength = ( float ) geometry . getLength ( ) ; updateMeasure ( event , true ) ; dispatchState ( State . CLICK ) ; } mapWidget . render ( mapWidget . getMapModel ( ) , RenderGroup . VECTOR , RenderStatus . UPDATE ) ; } }
Set a new point on the distance-line.