package terminal; import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.terminal.Terminal; import com.googlecode.lanterna.terminal.virtual.VirtualTerminalListener; public class FlushListener implements VirtualTerminalListener { private int flushCount; public FlushListener() { this.flushCount = 0; } public int getFlushCount() { return flushCount; } public void resetFlushCount() { flushCount = 0; } @Override public void onResized(Terminal terminal, TerminalSize newSize) {} @Override public synchronized void onFlush() { flushCount++; notify(); } @Override public void onBell() {} @Override public void onClose() {} }