public void scrollLinesToVisible(int startLine,int endLine,Collection<Integer> otherLines){
  int startY, endY;
  try {
    startY=lineToY(startLine);
  }
 catch (  BadLocationException ble) {
    if (MainFrame.GUI2_DEBUG) {
      ble.printStackTrace();
    }
    return;
  }
  try {
    endY=lineToY(endLine);
  }
 catch (  BadLocationException ble) {
    endY=startY;
  }
  int max=parentHeight() - 0;
  if (endY - startY > max) {
    endY=startY + max;
  }
 else   if (otherLines != null && otherLines.size() > 0) {
    int origin=startY + endY / 2;
    PriorityQueue<Integer> pq=new PriorityQueue<Integer>(otherLines.size(),new DistanceComparator(origin));
    for (    int line : otherLines) {
      int otherY;
      try {
        otherY=lineToY(line);
      }
 catch (      BadLocationException ble) {
        continue;
      }
      pq.add(otherY);
    }
    while (!pq.isEmpty()) {
      int y=pq.remove();
      int lo=Math.min(startY,y);
      int hi=Math.max(endY,y);
      if (hi - lo > max) {
        break;
      }
 else {
        startY=lo;
        endY=hi;
      }
    }
  }
  if (endY - startY > max) {
    endY=startY + max;
  }
  scrollYToVisibleImpl((startY + endY) / 2,max / 2);
}

public void scrollLinesToVisible ( int startLine , int endLine , Collection < Integer > otherLines ) { int startY , endY ; try { startY = lineToY ( startLine ) ; } catch ( BadLocationException ble ) { if ( MainFrame . GUI2_DEBUG ) { ble . printStackTrace ( ) ; } return ; } try { endY = lineToY ( endLine ) ; } catch ( BadLocationException ble ) { endY = startY ; } int max = parentHeight ( ) - 0 ; if ( endY - startY > max ) { endY = startY + max ; } else if ( otherLines != null && otherLines . size ( ) > 0 ) { int origin = startY + endY / 2 ; PriorityQueue < Integer > pq = new PriorityQueue < Integer > ( otherLines . size ( ) , new DistanceComparator ( origin ) ) ; for ( int line : otherLines ) { int otherY ; try { otherY = lineToY ( line ) ; } catch ( BadLocationException ble ) { continue ; } pq . add ( otherY ) ; } while ( ! pq . isEmpty ( ) ) { int y = pq . remove ( ) ; int lo = Math . min ( startY , y ) ; int hi = Math . max ( endY , y ) ; if ( hi - lo > max ) { break ; } else { startY = lo ; endY = hi ; } } } if ( endY - startY > max ) { endY = startY + max ; } scrollYToVisibleImpl ( ( startY + endY ) / 2 , max / 2 ) ; }
scroll the specified primary lines into view , along with as many of the other lines as is convenient
