public static Balloon.Position getBalloonPosition(Editor editor) {
    int line = editor.getCaretModel().getVisualPosition().line;
    Rectangle area = editor.getScrollingModel().getVisibleArea();
    int startLine = area.y / editor.getLineHeight() + 1;
    return (line - startLine) * editor.getLineHeight() < 200 ? Balloon.Position.below : Balloon.Position.above;
  }
public static Balloon.Position getBalloonPosition(Editor editor)