Package de.lmu.ifi.dbs.elki.result

Examples of de.lmu.ifi.dbs.elki.result.ResultHierarchy


  /**
   * Update the visualizer menus.
   */
  private void updateVisualizerMenus() {
    visualizersMenu.removeAll();
    ResultHierarchy hier = context.getHierarchy();
    for(Result child : hier.getChildren(result)) {
      recursiveBuildMenu(visualizersMenu, child);
    }
  }
View Full Code Here


      recursiveBuildMenu(visualizersMenu, child);
    }
  }

  private boolean recursiveBuildMenu(JMenu parent, Result r) {
    ResultHierarchy hier = context.getHierarchy();

    // Skip "adapter" results that do not have visualizers
    if(r instanceof ResultAdapter) {
      if(hier.getChildren(r).size() <= 0) {
        return false;
      }
    }
    // Make a submenu for this element
    boolean nochildren = true;
    JMenu submenu = new JMenu((r.getLongName() != null) ? r.getLongName() : "unnamed");
    // Add menus for any children
    for(Result child : hier.getChildren(r)) {
      if(recursiveBuildMenu(submenu, child)) {
        nochildren = false;
      }
    }
View Full Code Here

          plotmap.put(it.w, it.h, it);
        }
      }
    }

    ResultHierarchy hier = context.getHierarchy();
    ArrayList<VisualizationTask> tasks = ResultUtil.filterResults(context.getResult(), VisualizationTask.class);
    nextTask: for(VisualizationTask task : tasks) {
      for(Result parent : hier.getParents(task)) {
        if(parent instanceof Projector) {
          continue nextTask;
        }
      }
      if(task.getWidth() <= 0.0 || task.getHeight() <= 0.0) {
View Full Code Here

      Collection<PlotItem> items = proj.arrange();
      for(PlotItem item : items) {
        processItem(item);
      }
    }
    ResultHierarchy hier = baseResult.getHierarchy();
    ArrayList<VisualizationTask> tasks = ResultUtil.filterResults(baseResult, VisualizationTask.class);
    for(VisualizationTask task : tasks) {
      boolean isprojected = false;
      for(Result parent : hier.getParents(task)) {
        if(parent instanceof Projector) {
          isprojected = true;
          break;
        }
      }
View Full Code Here

   * @param re Buffer to serialize to
   * @param name Result requested
   */
  // TODO: refactor
  protected void resultToJSON(JSONBuffer re, String name) {
    ResultHierarchy hier = result.getHierarchy();
    // Find requested result
    String[] parts = name.split("/");
    Result cur = result;
    int partpos = 0;
    {
      for(; partpos < parts.length; partpos++) {
        // FIXME: handle name collisions. E.g. type_123?
        boolean found = false;
        for(Result child : hier.getChildren(cur)) {
          // logger.debug("Testing result: " + child.getShortName() + " <-> " +
          // parts[partpos]);
          if(child.getLongName().equals(parts[partpos]) || child.getShortName().equals(parts[partpos])) {
            cur = child;
            found = true;
            break;
          }
        }
        if(!found) {
          break;
        }
      }
      if(cur == null) {
        re.appendKeyValue("error", "result not found.");
        return;
      }
    }
    // logger.debug(FormatUtil.format(parts, ",") + " " + partpos + " " + cur);

    // Result structure discovery via "children" parameter.
    if(parts.length == partpos + 1) {
      if("children".equals(parts[partpos])) {
        re.appendKeyArray("children");
        Iterator<Result> iter = hier.getChildren(cur).iterator();
        while(iter.hasNext()) {
          Result child = iter.next();
          re.startHash();
          re.appendKeyValue("name", child.getShortName());
          re.appendKeyValue("type", child.getClass().getSimpleName());
View Full Code Here

   * @param re Buffer to serialize to
   * @param name Result requested
   */
  // TODO: refactor
  protected void resultToJSON(JSONBuffer re, String name) {
    ResultHierarchy hier = result.getHierarchy();
    // Find requested result
    String[] parts = name.split("/");
    Result cur = result;
    int partpos = 0;
    {
      for(; partpos < parts.length; partpos++) {
        // FIXME: handle name collisions. E.g. type_123?
        boolean found = false;
        for(Result child : hier.getChildren(cur)) {
          // logger.debug("Testing result: " + child.getShortName() + " <-> " +
          // parts[partpos]);
          if(child.getLongName().equals(parts[partpos]) || child.getShortName().equals(parts[partpos])) {
            cur = child;
            found = true;
            break;
          }
        }
        if(!found) {
          break;
        }
      }
      if(cur == null) {
        re.appendKeyValue("error", "result not found.");
        return;
      }
    }
    // logger.debug(FormatUtil.format(parts, ",") + " " + partpos + " " + cur);

    // Result structure discovery via "children" parameter.
    if(parts.length == partpos + 1) {
      if("children".equals(parts[partpos])) {
        re.appendKeyArray("children");
        Iterator<Result> iter = hier.getChildren(cur).iterator();
        while(iter.hasNext()) {
          Result child = iter.next();
          re.startHash();
          re.appendKeyValue("name", child.getShortName());
          re.appendKeyValue("type", child.getClass().getSimpleName());
View Full Code Here

      for(PlotItem it : projs) {
        plotmap.put(it.w, it.h, it);
      }
    }

    ResultHierarchy hier = result.getHierarchy();
    ArrayList<VisualizationTask> tasks = ResultUtil.filterResults(result, VisualizationTask.class);
    for(VisualizationTask task : tasks) {
      boolean isprojected = false;
      for(Result parent : hier.getParents(task)) {
        if(parent instanceof Projector) {
          isprojected = true;
          break;
        }
      }
View Full Code Here

  /**
   * Update the visualizer menus.
   */
  private void updateVisualizerMenus() {
    visualizersMenu.removeAll();
    ResultHierarchy hier = context.getHierarchy();
    for(Result child : hier.getChildren(result)) {
      recursiveBuildMenu(visualizersMenu, child);
    }
  }
View Full Code Here

      recursiveBuildMenu(visualizersMenu, child);
    }
  }

  private boolean recursiveBuildMenu(JMenu parent, Result r) {
    ResultHierarchy hier = context.getHierarchy();

    // Skip "adapter" results that do not have visualizers
    if(r instanceof ResultAdapter) {
      if(hier.getChildren(r).size() <= 0) {
        return false;
      }
    }
    // Make a submenu for this element
    boolean nochildren = true;
    JMenu submenu = new JMenu((r.getLongName() != null) ? r.getLongName() : "unnamed");
    // Add menus for any children
    for(Result child : hier.getChildren(r)) {
      if(recursiveBuildMenu(submenu, child)) {
        nochildren = false;
      }
    }
    // Item for a visualizer
View Full Code Here

   *
   * @param database Database
   * @param discardresult Result to discard.
   */
  void detachResult(Database database, OutlierResult discardresult) {
    final ResultHierarchy hier = database.getHierarchy();
    for(Result parent : hier.getParents(discardresult)) {
      hier.remove(parent, discardresult);
    }
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.result.ResultHierarchy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.