private int mapDirection(boolean isLeft){
  if (isLeft) {
    if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
      return SwingConstants.WEST;
    }
    return SwingConstants.NORTH;
  }
  if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
    return SwingConstants.EAST;
  }
  return SwingConstants.SOUTH;
}

private int mapDirection ( boolean isLeft ) { if ( isLeft ) { if ( splitPane . getOrientation ( ) == JSplitPane . HORIZONTAL_SPLIT ) { return SwingConstants . WEST ; } return SwingConstants . NORTH ; } if ( splitPane . getOrientation ( ) == JSplitPane . HORIZONTAL_SPLIT ) { return SwingConstants . EAST ; } return SwingConstants . SOUTH ; }
convert the orientation of the pane into compass points based on the pane orientation and the left - right orientation of the containter .
