MoveEvent(JSONObject json) throws JSONException {
  super(TYPE_MOVE,json);
  if (TextUtils.isEmpty(mBlockId)) {
    throw new JSONException(TYPENAME_MOVE + " requires " + JSON_BLOCK_ID);
  }
  mOldParentId=null;
  mOldInputName=null;
  mOldPositionX=mOldPositionY=0;
  String newCoordinateStr=json.optString(JSON_NEW_COORDINATE);
  if (newCoordinateStr != null) {
    int comma=newCoordinateStr.indexOf(',');
    if (comma == -1) {
      throw new JSONException("Invalid " + JSON_NEW_COORDINATE + ": "+ newCoordinateStr);
    }
    try {
      mNewPositionX=Integer.parseInt(newCoordinateStr.substring(0,comma));
      mNewPositionY=Integer.parseInt(newCoordinateStr.substring(comma + 1));
    }
 catch (    NumberFormatException e) {
      throw new JSONException("Invalid " + JSON_NEW_COORDINATE + ": "+ newCoordinateStr);
    }
  }
 else {
  }
}

MoveEvent ( JSONObject json ) throws JSONException { super ( TYPE_MOVE , json ) ; if ( TextUtils . isEmpty ( mBlockId ) ) { throw new JSONException ( TYPENAME_MOVE + " requires " + JSON_BLOCK_ID ) ; } mOldParentId = null ; mOldInputName = null ; mOldPositionX = mOldPositionY = 0 ; String newCoordinateStr = json . optString ( JSON_NEW_COORDINATE ) ; if ( newCoordinateStr != null ) { int comma = newCoordinateStr . indexOf ( ',' ) ; if ( comma == - 1 ) { throw new JSONException ( "Invalid " + JSON_NEW_COORDINATE + ": " + newCoordinateStr ) ; } try { mNewPositionX = Integer . parseInt ( newCoordinateStr . substring ( 0 , comma ) ) ; mNewPositionY = Integer . parseInt ( newCoordinateStr . substring ( comma + 1 ) ) ; } catch ( NumberFormatException e ) { throw new JSONException ( "Invalid " + JSON_NEW_COORDINATE + ": " + newCoordinateStr ) ; } } else { } }
constructs a moveevent from the json serialized representation .
