public static void moveDirection ( Point p , int direction , int dx , int dy ) { if ( direction >= DIRECTION_COUNT ) { throw new IllegalArgumentException ( "Fine coordinates not supported." ) ; } switch ( direction ) { case NORTH : case NORTHWEST : case NORTHEAST : p . y -= dy ; } switch ( direction ) { case SOUTH : case SOUTHWEST : case SOUTHEAST : p . y += dy ; } switch ( direction ) { case WEST : case SOUTHWEST : case NORTHWEST : p . x -= dx ; } switch ( direction ) { case EAST : case SOUTHEAST : case NORTHEAST : p . x += dx ; } }
Move the specified point in the specified screen direction adjusting by the specified adjustments . Fine directions are not supported .