Example #1
0
  public void resetCaseStudy() throws ThinklabException {

    storylineViews.clear();
    currentStoryline = null;

    /*
     * reset ROI and all modules
     */
    userModel.clearAnalysis();

    /*
     * ask the user model to give us all the modules we have access to.
     */
    userModel.initializeModules();

    moduleViews.clear();
    sidebar.resetModules();
    createModuleViews();

    /*
     * restore interface
     */
    selectionBar.setVisible(true);
    selectionBar.idle(false);
    gazetteer.setValue("");
    getBanner().setStoryline(null);

    ZK.resetComponent(this.storyline);

    this.storyline.setVisible(false);
    this.mapwindow.setVisible(true);

    browserState = 0;
    sidebar.redisplay();
  }
Example #2
0
  public void onClick$run(Event e) {

    getVectorLayer().clearFeatures();
    shapeShown = false;

    selectionBar.setVisible(false);

    /*
     * 	1. prepare info page for case study with area picture, list of possible storylines with explanations,
     * 	   instructions for use, and pointers to web site where it counts. Also: form to save area for later,
     * 	   disabled if not logged in.
     *
     *  2. Fill in enabled modules with storylines. Only show enabled ones with option to show those that are
     *     not enabled.
     *
     *  3. Each storyline badge should bring up main page for storyline when clicked. That should have a main area
     *     for the ES and one for the storyline-specific info. Model should look for the components and get
     *     the descriptions from the concepts. Links to web site wherever necessary. Page has "start" etc on
     *     it. Instead of list of pages, have "Computation is ongoing" or "Computation is waiting" or
     *     "Computation is not active (activate)". When computed. the area becomes the index for the result
     *     pages.
     *
     *  4. All possible downloads should be clearly marked on storyline page.
     */

    try {
      userModel.startAnalysis();
    } catch (ThinklabException e1) {
      throw new ThinklabRuntimeException(e1);
    }

    browserState = 1;

    /*
     * create view for all storylines and collect in storylineViews map
     *
     * show all module storylines in their modules, activate those with > 0 storylines,
     * and show each model storyline in each module.
     */
    getBanner().setStoryline(userModel.getStoryline());

    for (SidebarModule view : moduleViews) {
      view.display();
    }

    /*
     * create view for user storyline and display it. The map window becomes invisible until
     * session reset.
     */
    ZK.resetComponent(this.storyline);
    storylineViews.clear();
    currentStoryline = null;

    addStorylineView(
        userModel.getStoryline(), new UserStorylineView(userModel.getStoryline(), this));

    this.mapwindow.setVisible(false);
    this.storyline.setVisible(true);
    showStoryline(userModel.getStoryline(), null);
  }
Example #3
0
  /**
   * Called by other components to show, and if necessary create, a view for the storyline
   * corresponding to a given concept.
   *
   * @param storyline
   */
  public void showStoryline(Storyline storyline, StorylineControlPanel badge) {

    if (currentStoryline != null && storyline.equals(currentStoryline)) {
      return;
    }

    if (currentStoryline != null) storylineViews.get(currentStoryline).setVisible(false);

    if (!storylineViews.containsKey(storyline)) {
      createStorylineView(storyline, badge);
    }

    storylineViews.get(storyline).setVisible(true);
    currentStoryline = storyline;
    ZK.resetComponent(this.storyline);
    this.storyline.appendChild(storylineViews.get(storyline));
  }