throws BadLocationException
  public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a,                                       int direction, Position.Bias[] biasRet)  {    int retVal = -1;    switch (direction)      {      case SwingConstants.WEST:      case SwingConstants.EAST:        retVal = getNextEastWestVisualPositionFrom(pos, b, a, direction,                                                   biasRet);        break;      case SwingConstants.NORTH:      case SwingConstants.SOUTH:        retVal = getNextNorthSouthVisualPositionFrom(pos, b, a, direction,                                                     biasRet);        break;      default:        throw new IllegalArgumentException("Illegal value for direction.");      }    return retVal;  }