| 1 | package com.googlecode.lanterna.graphics; |
| 2 | |
| 3 | import java.io.IOException; |
| 4 | |
| 5 | /** |
| 6 | * Describes an area that can be 'scrolled', by moving a range of lines up or down. Certain terminals will implement |
| 7 | * this through extensions and are much faster than if lanterna tries to manually erase and re-print the text. |
| 8 | * |
| 9 | * @author Andreas |
| 10 | */ |
| 11 | public interface Scrollable { |
| 12 | /** |
| 13 | * Scroll a range of lines of this Scrollable according to given distance. |
| 14 | * |
| 15 | * If scroll-range is empty (firstLine > lastLine || distance == 0) then |
| 16 | * this method does nothing. |
| 17 | * |
| 18 | * Lines that are scrolled away from are cleared. |
| 19 | * |
| 20 | * If absolute value of distance is equal or greater than number of lines |
| 21 | * in range, then all lines within the range will be cleared. |
| 22 | * |
| 23 | * @param firstLine first line of the range to be scrolled (top line is 0) |
| 24 | * @param lastLine last (inclusive) line of the range to be scrolled |
| 25 | * @param distance if > 0: move lines up, else if < 0: move lines down. |
| 26 | */ |
| 27 | void scrollLines(int firstLine, int lastLine, int distance) throws IOException; |
| 28 | } |