}
}
private boolean canMove( int direction ){
nextCursor[0]=currentCursor[0];
nextCursor[1]=currentCursor[1];
nextCursor[2]=currentCursor[2];
nextCursor[3]=currentCursor[3];
switch (direction){
case DIRECTION_UP:
if (this.currentCursor[1] - 1 >= 0) {//向上还有移动空间
this.nextCursor[1]--;//向上移动一下
if (!setMoveRange()){ //不能移动
this.nextCursor[1]++;//退回来
return false;
}
else {
this.nextCursor[1]++;//退回来
return true;
}
}
else
return false;
case DIRECTION_DOWN:
if (this.currentCursor[1] + 1 < Images.HEIGHT) {//向下还有移动空间
this.nextCursor[1]++;//向下移动一下
if (!setMoveRange()){ //不能移动
this.nextCursor[1]--;//退回来
return false;
}
else {
this.nextCursor[1]--;//退回来
return true;
}
}
else
return false;
case DIRECTION_LEFT:
if (this.currentCursor[0] - 1 >= 0) {//向左还有移动空间