本文整理汇总了Java中com.googlecode.lanterna.screen.TerminalScreen类的典型用法代码示例。如果您正苦于以下问题:Java TerminalScreen类的具体用法?Java TerminalScreen怎么用?Java TerminalScreen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TerminalScreen类属于com.googlecode.lanterna.screen包,在下文中一共展示了TerminalScreen类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException, IOException {
SwingTerminalFrame terminal = new SwingTerminalFrame(SwingTerminalFrame.AutoCloseTrigger.CloseOnExitPrivateMode);
terminal.setCursorVisible(false);
Screen screen = new TerminalScreen(terminal);
screen.startScreen();
terminal.setTitle("Freedom: An arena-battle roguelike");
terminal.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
terminal.setResizable(false);
terminal.setVisible(true);
while(screen.pollInput() == null) {
if(screen.doResizeIfNecessary() != null) {
screen.refresh();
}
Thread.sleep(100);
}
screen.stopScreen();
}
示例2: FrontEnd
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public FrontEnd(TelnetTerminal terminal) throws IOException {
System.out.println("Creating a new frontEnd");
this.terminal = terminal;
this.screen = new TerminalScreen(terminal);
screen.startScreen();
this.gui = new MultiWindowTextGUI(this.screen, new DefaultWindowManager(), new EmptySpace(TextColor.ANSI.BLUE));
lang = ResourceBundle.getBundle("cnvtgTelnet/zh_CN");
}
示例3: main
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
Terminal t = new TestTerminalFactory(args).createTerminal();
t.enterPrivateMode();
TerminalScreen s = new TerminalScreen(t);
s.startScreen();
try {
Thread.sleep(1000);
}
catch(InterruptedException e) {}
s.stopScreen();
t.exitPrivateMode();
}
示例4: createScreen
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public Screen createScreen() throws IOException {
return new TerminalScreen(createTerminal());
}
示例5: LanternaToolkit
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public LanternaToolkit(final Terminal terminal) throws IOException {
screen = new TerminalScreen(terminal);
eventWorker = new EventWorker();
setDefaultToolkit(this);
}
示例6: SessionStatePrinter
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public SessionStatePrinter() {
try {
Terminal terminal = new DefaultTerminalFactory(System.out, System.in,
Charset.forName("UTF-8")).createTerminal();
terminal.setCursorVisible(false);
screen = new TerminalScreen(terminal);
graphics = screen.newTextGraphics();
screen.startScreen();
screen.clear();
started = System.currentTimeMillis();
this.torrent = Optional.empty();
printTorrentInfo();
} catch (IOException e) {
throw new RuntimeException("Failed to create terminal", e);
}
}
示例7: main
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Terminal terminal = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(terminal);
screen.startScreen();
Panel panel = new Panel(new BorderLayout());
Table<String> table = new Table<>("- Quotation -");
table.getTableModel().addRow("135.09");
table.getTableModel().addRow("134.56");
table.getTableModel().addRow("134.27");
table.getTableModel().addRow("133.90");
table.getTableModel().addRow("132.81");
table.setLayoutData(BorderLayout.Location.RIGHT);
panel.addComponent(table);
TextBox textBox = new TextBox("EMPTY", TextBox.Style.MULTI_LINE);
textBox.setLayoutData(BorderLayout.Location.CENTER);
panel.addComponent(textBox);
// Create window to hold the panel
BasicWindow window = new BasicWindow();
window.setComponent(panel);
window.setHints(Arrays.asList(Window.Hint.FULL_SCREEN));
// Create gui and start gui
MultiWindowTextGUI gui = new MultiWindowTextGUI(screen, new DefaultWindowManager(),
new EmptySpace(TextColor.ANSI.BLUE));
gui.addWindowAndWait(window);
}
示例8: main
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void main(String... args) throws IOException {
Terminal term = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(term);
WindowManager windowManager = new DefaultWindowManager();
Component background = new EmptySpace(TextColor.ANSI.DEFAULT);
final WindowBasedTextGUI gui = new MultiWindowTextGUI(screen, windowManager, background);
screen.startScreen();
gui.addWindowAndWait(new BasicWindow("Issue155") {{
setComponent(createUi(gui, this));
}});
screen.stopScreen();
}
示例9: main
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void main(String... args) throws IOException {
Terminal term = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(term);
WindowManager windowManager = new DefaultWindowManager();
Component background = new EmptySpace(TextColor.ANSI.DEFAULT);
final WindowBasedTextGUI gui = new MultiWindowTextGUI(screen, windowManager, background);
screen.startScreen();
gui.addWindowAndWait(new BasicWindow("Issue150") {{
setComponent(createUi());
}});
screen.stopScreen();
}
示例10: BasicTerminal
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public BasicTerminal(PredictionGenerator predictionGenerator, CommandExecutor commandExecutor) throws IOException {
this.predictionGenerator = predictionGenerator;
this.commandExecutor = commandExecutor;
TerminalFactory factory = new DefaultTerminalFactory();
screen = new TerminalScreen(factory.createTerminal());
}
示例11: start
import com.googlecode.lanterna.screen.TerminalScreen; //导入依赖的package包/类
public static void start() {
ModelTest.exitIfProblems();
Frontend.setInstance(new LanternaFrontend());
try {
Terminal terminal = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(terminal);
screen.startScreen();
new Lanterna(screen);
} catch (Exception x) {
throw new RuntimeException(x);
}
}