コード例 #1
0
  @Override
  public void ioReceived(IOInstance inst, int ret, Log... out) {
    if (inst == robot) {

      // Deal with streaming...
      LogSearching.Criteria criteria =
          LogSearching.criteriaAt(display.streamComboBox.getSelectedIndex());

      if (criteria != null) {
        Log pass = null;

        for (Log l : out) {
          if (criteria.fits(l.getFullDescription())) pass = l;
        }

        if (pass != null) displayLog(pass);
      }

      // Deal with adding to groups (i.e. keeping)...
      assert (lastGroup != null);
      for (Log l : out) {
        if (shouldKeep(l.jvm_unique_id)) lastGroup.add(LogReference.referenceFromLog(l));
      }

      Events.GLogsFound.generate(this, out);
    } else {
      Debug.error("%s got %d surprising logs from %s", this, out.length, inst);
    }
  }
コード例 #2
0
  private ArrayList<LogReference> currentlyDisplayedFrom(Group group) {
    ArrayList<LogReference> refs = new ArrayList<>((group).logs);
    LogSearching.Criteria criteria =
        LogSearching.criteriaAt(display.sasStreamProfile.getSelectedIndex());
    if (criteria != null) {
      for (int i = 0; i < refs.size(); ) {
        if (!criteria.fits(refs.get(i).description)) refs.remove(i);
        else ++i;
      }
    }

    LogSorting.Sort sort = (LogSorting.Sort) display.sasOrderBox.getSelectedItem();
    if (sort != null) {
      Collections.sort(refs, sort.comparator);
    }

    return refs;
  }