Esempio n. 1
0
  /**
   * Should be called from EDT only
   *
   * @param frame
   */
  public static ITitledMonitor start(JFrame frame) {
    States.assertIsEDT();

    ProgressComponent content = new ProgressComponent();
    ProgressGlassPane.install(frame, content.getGui());
    return content.getController();
  }
Esempio n. 2
0
  public TokenPair next() throws IOException {
    States.assertTrue(hasNext(), "There is no next TokenPair");

    // TODO optimize? sort(410)
    Token titleToken = new Token(dis.readInt(), dis.readInt());
    Token bodyToken = new Token(dis.readInt(), dis.readInt());
    available -= 4 * 4; // 4 ints // TODO not good, make separate class with 'available' caching

    dataSource.getData(titleToken.getStart(), titleToken.getLength(), buffer);

    return new TokenPair(
        converter.getTitle(buffer.getBytes(), 0, buffer.getLength()), titleToken, bodyToken);
  }