* @param deviceType DeviceType.VT100, DeviceType, XTERM, etc.
* @param baseLang a base language without UTF-8 flag such as "C" or
* "en_US"
- * @return "LANG=en_US", "LANG=en_US.UTF-8", etc.
+ * @return "en_US", "en_US.UTF-8", etc.
*/
public static String deviceTypeLang(final DeviceType deviceType,
final String baseLang) {
*
* @return if true, the cursor is visible
*/
- public final boolean visibleCursor() {
+ public final boolean isCursorVisible() {
return cursorVisible;
}
private boolean columns132 = false;
/**
+ * Get 132 columns value.
+ *
+ * @return if true, the terminal is in 132 column mode
+ */
+ public final boolean isColumns132() {
+ return columns132;
+ }
+
+ /**
* true = reverse video. Set by DECSCNM.
*/
private boolean reverseVideo = false;
* @param type one of the DeviceType constants to select VT100, VT102,
* VT220, or XTERM
* @param inputStream an InputStream connected to the remote side. For
- * type == XTERM, inputStrem is converted to a Reader with UTF-8
+ * type == XTERM, inputStream is converted to a Reader with UTF-8
* encoding.
* @param outputStream an OutputStream connected to the remote user. For
* type == XTERM, outputStream is converted to a Writer with UTF-8
* Handle a linefeed.
*/
private void linefeed() {
- int i;
if (currentState.cursorY < scrollRegionBottom) {
// Increment screen y
* have a button down (i.e. drag-and-drop).
*/
if (mouse.getType() == TMouseEvent.Type.MOUSE_MOTION) {
- if (!mouse.getMouse1()
- && !mouse.getMouse2()
- && !mouse.getMouse3()
- && !mouse.getMouseWheelUp()
- && !mouse.getMouseWheelDown()
+ if (!mouse.isMouse1()
+ && !mouse.isMouse2()
+ && !mouse.isMouse3()
+ && !mouse.isMouseWheelUp()
+ && !mouse.isMouseWheelDown()
) {
return;
}
sb.append('M');
if (mouse.getType() == TMouseEvent.Type.MOUSE_UP) {
sb.append((char) (0x03 + 32));
- } else if (mouse.getMouse1()) {
+ } else if (mouse.isMouse1()) {
sb.append((char) (0x00 + 32));
- } else if (mouse.getMouse2()) {
+ } else if (mouse.isMouse2()) {
sb.append((char) (0x01 + 32));
- } else if (mouse.getMouse3()) {
+ } else if (mouse.isMouse3()) {
sb.append((char) (0x02 + 32));
- } else if (mouse.getMouseWheelUp()) {
+ } else if (mouse.isMouseWheelUp()) {
sb.append((char) (0x04 + 64));
- } else if (mouse.getMouseWheelDown()) {
+ } else if (mouse.isMouseWheelDown()) {
sb.append((char) (0x05 + 64));
} else {
sb.append((char) (0x03 + 32));
*/
private String keypressToString(final TKeypress keypress) {
- if ((fullDuplex == false) && (!keypress.getIsKey())) {
+ if ((fullDuplex == false) && (!keypress.isFnKey())) {
/*
* If this is a control character, process it like it came from
* the remote side.
*/
- if (keypress.getCh() < 0x20) {
- handleControlChar(keypress.getCh());
+ if (keypress.getChar() < 0x20) {
+ handleControlChar(keypress.getChar());
} else {
// Local echo for everything else
- printCharacter(keypress.getCh());
+ printCharacter(keypress.getChar());
}
}
}
// Handle control characters
- if ((keypress.getCtrl()) && (!keypress.getIsKey())) {
+ if ((keypress.isCtrl()) && (!keypress.isFnKey())) {
StringBuilder sb = new StringBuilder();
- char ch = keypress.getCh();
+ char ch = keypress.getChar();
ch -= 0x40;
sb.append(ch);
return sb.toString();
}
// Handle alt characters
- if ((keypress.getAlt()) && (!keypress.getIsKey())) {
+ if ((keypress.isAlt()) && (!keypress.isFnKey())) {
StringBuilder sb = new StringBuilder("\033");
- char ch = keypress.getCh();
+ char ch = keypress.getChar();
sb.append(ch);
return sb.toString();
}
}
// Non-alt, non-ctrl characters
- if (!keypress.getIsKey()) {
+ if (!keypress.isFnKey()) {
StringBuilder sb = new StringBuilder();
- sb.append(keypress.getCh());
+ sb.append(keypress.getChar());
return sb.toString();
}
return "";
for (int i = start; i <= end; i++) {
DisplayLine line = display.get(currentState.cursorY);
if ((!honorProtected)
- || ((honorProtected) && (!line.charAt(i).getProtect()))) {
+ || ((honorProtected) && (!line.charAt(i).isProtect()))) {
switch (type) {
case VT100:
*
* @param ch character from the remote side
*/
- public void consume(char ch) {
+ private void consume(char ch) {
// DEBUG
// System.err.printf("%c", ch);