Пример #1
0
  // intentionlaly  not generic to avoid failue on systems without buffered image class
  private void waitForEnter(List l) {
    model.stop();
    System.out.println(SwingTranslator.R("TuiPause"));
    int i = 0;
    while (true) {
      try {
        String s = br.readLine().trim();
        s = s.toLowerCase();

        if (s.startsWith("s")) {
          skip();
          skip();
          break;
        }
        if (s.startsWith("b")) { // hm not working:(
          back();
          back();
          back();
          break;
        }

        if (s.startsWith("p")) {
          i--;
          if (i < 0) {
            i = 0;
          }
        }
        if (l != null && !l.isEmpty()) {
          if (s.startsWith("n")) {
            i++;
            if (i >= l.size()) {
              i = l.size() - 1;
            }
          }

          if (s.startsWith("n") || s.startsWith("p")) {
            ConsoleImageViewer.doJob((BufferedImage) l.get(i));
          }
        }
        if (s.isEmpty()) {
          break;
        }
      } catch (Exception ex) {
        System.out.println(ex);
        break;
      }
    }
    model.go();
  }
Пример #2
0
 void start() {
   model.go();
 }