public void undo(){
  for (int i=pathEvents.size() - 1; i >= 0; i--) {
    if (pathEvents.remove(i).isMove)     break;
  }
  applyEvents();
  invalidate();
}

public void undo ( ) { for ( int i = pathEvents . size ( ) - 1 ; i >= 0 ; i -- ) { if ( pathEvents . remove ( i ) . isMove ) break ; } applyEvents ( ) ; invalidate ( ) ; }
undo ' s the last draw action .
