()
| 710 | } |
| 711 | |
| 712 | protected synchronized void fitCursorByTop() { |
| 713 | if (cursor >= itemLayoutY.length) |
| 714 | cursor = itemLayoutY.length - 1; |
| 715 | int top = itemLayoutY[cursor]; |
| 716 | if (top < win_top) { |
| 717 | win_top = top; |
| 718 | } |
| 719 | |
| 720 | Object o = getFocusedObject(); |
| 721 | if (o == null) { |
| 722 | return; |
| 723 | } |
| 724 | |
| 725 | if (((VirtualElement) o).getVHeight() <= winHeight) { |
| 726 | if ((cursor + 1) < itemLayoutY.length) { |
| 727 | int bottom = itemLayoutY[cursor + 1] - winHeight; |
| 728 | if (bottom > win_top) { |
| 729 | win_top = bottom; |
| 730 | } |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | if (top >= win_top + winHeight) { |
| 735 | win_top = top; |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | protected void fitCursorByBottom() { |
| 740 | if ((cursor + 1) < itemLayoutY.length) { |
no test coverage detected