@Override
 public void onStateManagerDatabaseObjectsSelected(
     List<Event> path, Pathway pathway, DatabaseObject databaseObject) {
   Pathway toSelect = databaseObject instanceof Pathway ? (Pathway) databaseObject : pathway;
   if (!toSelect.equals(selected)) {
     selected = toSelect;
     this.view.selectPathway(toSelect);
   }
 }
Beispiel #2
0
 public Pathway getLastPathwayWithDiagram() {
   for (int i = this.path.size() - 1; i >= 0; i--) {
     Event event = this.path.get(i);
     if (event instanceof Pathway) {
       Pathway pathway = (Pathway) event;
       if (pathway.getHasDiagram()) return pathway;
     }
   }
   return null;
 }
  @Override
  public void onPathwaySelected(Long dbId) {
    if (selected != null && dbId.equals(selected.getDbId())) return;

    new StableIdentifierLoader(
        dbId.toString(),
        new StableIdentifierLoader.StableIdentifierLoadedHandler() {
          @Override
          public void onStableIdentifierLoaded(AdvancedState advancedState) {
            AnalysisTabPathwaySelected sel =
                new AnalysisTabPathwaySelected(
                    advancedState.getSpecies(),
                    advancedState.getPathway(),
                    (Pathway) advancedState.getInstance());
            selected = (sel.getPathway() != null) ? sel.getPathway() : sel.getDiagram();
            eventBus.fireELVEvent(ELVEventType.ANALYSIS_TAB_PATHWAY_SELECTED, sel);
          }
        });
  }