log.debug("restore screen partial");
   private void parseIncoming() {      boolean controlChars = false;      byte control0;      byte control1;      boolean done = false;      boolean error = false;      try {         while (bk.hasNext() && !done) {            byte b = bk.getNextByte();            switch (b) {               case 0:               case 1:                  break;               case CMD_SAVE_SCREEN:   // 0x02 2 Save Screen               case 3:   // 0x03 3 Save Partial Screen//                  System.out.println("save screen partial");                  saveScreen();                  break;               case ESC:    // ESCAPE                  break;               case 7:    // audible bell                  Toolkit.getDefaultToolkit().beep();                  bk.getNextByte();                  bk.getNextByte();                  break;               case CMD_WRITE_TO_DISPLAY:    // 0x11 17 write to display                  error = writeToDisplay(true);                  break;               case CMD_RESTORE_SCREEN:   // 0x12 18 Restore Screen               case 13:   // 0x13 19 Restore Partial Screen//                  System.out.println("restore screen partial");                  restoreScreen();                  break;               case CMD_CLEAR_UNIT_ALTERNATE:    // 0x20 32 clear unit alternate                  int param = bk.getNextByte();                  if (param != 0) {//                     System.out.println(" clear unit alternate error " + Integer.toHexString(param));                     sendNegResponse(NR_REQUEST_ERROR,03,01,05,                                    " clear unit alternate not supported");                     done = true;                  }                  else {                     if (screen52.getRows() != 27)                        screen52.setRowsCols(27,132);                     screen52.clearAll();                  }                  break;               case CMD_WRITE_ERROR_CODE:   // 0x21 33 Write Error Code                  writeErrorCode();                  error = writeToDisplay(false);                  break;               case CMD_WRITE_ERROR_CODE_TO_WINDOW:   // 0x22 34                                                      // Write Error Code to window                  writeErrorCodeToWindow();                  error = writeToDisplay(false);                  break;               case CMD_READ_SCREEN_IMMEDIATE:    // 0x62  98               case CMD_READ_SCREEN_TO_PRINT:    // 0x66  102 read screen to print                  readScreen();                  break;               case CMD_CLEAR_UNIT:    // 64 0x40 clear unit                  if (screen52.getRows() != 24)                     screen52.setRowsCols(24,80);                  screen52.clearAll();                  break;               case CMD_CLEAR_FORMAT_TABLE:  // 80 0x50 Clear format table                  screen52.clearTable();                  break;               case CMD_READ_INPUT_FIELDS:      //0x42 66 read input fields               case CMD_READ_MDT_FIELDS:    // 0x52 82 read MDT Fields                  bk.getNextByte();                  bk.getNextByte();                  readType = b;                  screen52.goHome();                  // do nothing with the cursor here it is taken care of                  //   in the main loop.////////////////                  screen52.setCursorOn();                  waitingForInput = true;                  pendingUnlock = true;//                  screen52.setKeyboardLocked(false);                  break;               case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83                  readType = b;//                  screen52.goHome();//                  waitingForInput = true;//                  screen52.setKeyboardLocked(false);                  readImmediate(readType);                  break;               case CMD_WRITE_STRUCTURED_FIELD:   // 243 0xF3 -13 Write structured field                  writeStructuredField();                  break;               case CMD_ROLL:   // 0x23 35 Roll Not sure what it does right now                  int updown = bk.getNextByte();                  int topline = bk.getNextByte();                  int bottomline = bk.getNextByte();                  screen52.rollScreen(updown,topline,bottomline);                  break;               default:                  done = true;                  sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming");                  break;            }            if (error)               done = true;         }      }      catch (Exception exc) {System.out.println("incoming " + exc.getMessage());};   }