public void mousePressed (MouseEvent me) {
      if(me.getModifiers()==MouseEvent.BUTTON1_MASK){
          switch(dMode){
              case DRAW_MODE:
                  downX=me.getX();
                  downY=me.getY();
                  break;
              case MOVE_MODE:
                  lastX=me.getX();
                  lastY=me.getY();
          }
      }
      else if(me.getModifiers()==MouseEvent.BUTTON3_MASK){
          switch(dMode){     
              case MOVE_MODE:
                  lastX=me.getX();
                  lastY=me.getY();
          }
      }
  }