X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fterminal%2Fswing%2FTerminalScrollController.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fterminal%2Fswing%2FTerminalScrollController.java;h=0000000000000000000000000000000000000000;hp=6810da3bea88ee60cc8f8030ad867dd880ac3d83;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/terminal/swing/TerminalScrollController.java b/src/com/googlecode/lanterna/terminal/swing/TerminalScrollController.java deleted file mode 100644 index 6810da3..0000000 --- a/src/com/googlecode/lanterna/terminal/swing/TerminalScrollController.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of lanterna (http://code.google.com/p/lanterna/). - * - * lanterna is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Copyright (C) 2010-2015 Martin - */ -package com.googlecode.lanterna.terminal.swing; - -/** - * This interface can be used to control the backlog scrolling of a SwingTerminal. It's used as a callback by the - * {@code SwingTerminal} when it needs to fetch the scroll position and also used whenever the backlog changes to that - * some view class, like a scrollbar for example, can update its view accordingly. - * @author Martin - */ -public interface TerminalScrollController { - /** - * Called by the SwingTerminal when the terminal has changed or more lines are entered into the terminal - * @param totalSize Total number of lines in the backlog currently - * @param screenSize Number of lines covered by the terminal window at its current size - */ - void updateModel(int totalSize, int screenSize); - - /** - * Called by the SwingTerminal to know the 'offset' into the backlog. Returning 0 here will always draw the latest - * lines; if you return 5, it will draw from five lines into the backlog and skip the 5 most recent lines. - * @return According to this scroll controller, how far back into the backlog are we? - */ - int getScrollingOffset(); - - /** - * Implementation of {@link TerminalScrollController} that does nothing - */ - final class Null implements TerminalScrollController { - @Override - public void updateModel(int totalSize, int screenSize) { - } - - @Override - public int getScrollingOffset() { - return 0; - } - } -}