|
Description
Lanterna (or "lantern") is a Java library allowing you to write easy semi-graphical user interfaces in a text-only environment, very similar to curses. Lanterna is supporting xterm compatible terminals and terminal emulators such as konsole, gnome-terminal, putty, xterm and many more. One of the main benefits of lantern is that it's not dependent on any native library but runs 100% in pure Java.
Also, when running Lanterna on computers with a graphical environment (such as Windows or Xorg), a terminal emulator written in Swing will be used rather than standard output. This way, you can develop as usual from your IDE (most of them doesn't support ANSI control characters in their output window) and then deploy to your headless server without changing anything.
Lanterna is structured into three layers, each built on top of the other and you are free to choose which one you want to use.
1. The first is a low level terminal interface which allows you to move around the text cursor as well as changing output colors and such. You will find these classes in package lantern.terminal. 2. The second level is a full screen buffer, the whole screen in memory and allowing you to write there before flushing the changes to the screen. A screen refresh will then only update the modified characters. You will find these classes in package lantern.screen. 3. The third level is a full GUI toolkit with windows, buttons, labels and some other components. It's using a very simple window management system (basically all windows are modal) that is quick and easy to use. Syntactically, Lanterna's GUI system tries to stay close to AWT and Swing. You will find these classes in package lantern.gui.
|