コード例 #1
0
  public void readEvents() {
    if (currentEventFile == null) {
      eventFiles = getAvailableEventFiles(this.controller.getIterationsOutputDirectory());
      currentEventFile = eventFiles.get(0);

      // check if empty
      if (eventFiles.isEmpty()) {
        JOptionPane.showMessageDialog(
            this.controller.getParentComponent(),
            "Could not find any event files",
            "Event files unavailable",
            JOptionPane.ERROR_MESSAGE);
        return;
      } else this.toolBox.getOpenOTFVisBtn().setEnabled(true);
      ((EAToolBox) getToolBox()).setEventFileItems(eventFiles);
    }
    if ((graphPanel == null) || (keyPanel == null)) {
      graphPanel = ((EAToolBox) getToolBox()).getGraphPanel();
      keyPanel = ((EAToolBox) getToolBox()).getKeyPanel();
    }

    // run event reader
    runEventReader(currentEventFile);

    // get data from eventhandler (if not null)
    if (eventHandler != null) {
      eventHandler.setColorationMode(this.colorationMode);
      eventHandler.setTransparency(this.cellTransparency);
      eventHandler.setK(k);

      // get data
      EventData data = eventHandler.getData();

      // update data in both the map viewer and the graphs

      this.controller.setEventData(data);

      graphPanel.updateData(data);
      keyPanel.updateData(data);
    }

    ((EAToolBox) getToolBox()).setFirstLoad(false);
  }
コード例 #2
0
  public void setMode(Mode mode) {
    this.mode = mode;

    this.gridRenderer.setMode(mode);
    if (keyPanel != null) keyPanel.setMode(mode);
  }