code: @Override
      public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a,
              int direction, Position.Bias[] biasRet) throws BadLocationException
      {
          if (view != null)
          {
              int nextPos = view.getNextVisualPositionFrom(pos, b, a, direction,
                      biasRet);
              if (nextPos != -1)
              {
                  pos = nextPos;
              }
              else
              {
                  biasRet[0] = b;
              }
          }
          return pos;
      }
docs: Provides a way to determine the next visually represented model location
  that one might place a caret. Some views may not be visible, they might
  not be in the same order found in the model, or they just might not allow
  access to some of the locations in the model.
  
  @param pos
  the position to convert >= 0
  @param a
  the allocated region to render into
  @param direction
  the direction from the current position that can be thought of
  as the arrow keys typically found on a keyboard. This may be
  SwingConstants.WEST, SwingConstants.EAST,
  SwingConstants.NORTH, or SwingConstants.SOUTH.
  @return the location within the model that best represents the next
  location visual position.
  @exception BadLocationException
  @exception IllegalArgumentException
  for an invalid direction