public static Orientation valueOf(boolean flipAroundHorizontal, Rotation rotation) {
    Orientation result = null;

    if (!flipAroundHorizontal) {
      switch (rotation) {
      case NOTHING: result = TOP_LEFT    ; break;
      case LEFT   : result = LEFT_BOTTOM ; break;
      case OVER   : result = BOTTOM_RIGHT; break;
      case RIGHT  : result = RIGHT_TOP   ; break;
      }
    } else {
      switch (rotation) {
      case NOTHING: result = BOTTOM_LEFT ; break;
      case LEFT   : result = RIGHT_BOTTOM; break;
      case OVER   : result = TOP_RIGHT   ; break;
      case RIGHT  : result = LEFT_TOP    ; break;
      }
    }

    return result;
  }