Package de.lmu.ifi.dbs.elki.visualization.visualizers

Examples of de.lmu.ifi.dbs.elki.visualization.visualizers.Visualization


      }
      if(!VisualizerUtil.isVisible(task)) {
        continue;
      }
      try {
        Visualization v = task.getFactory().makeVisualization(task.clone(svgp, context, item.proj, width, height));
        layers.add(v);
      }
      catch(Exception e) {
        if(Logging.getLogger(task.getFactory().getClass()).isDebugging()) {
          LoggingUtil.exception("Visualization failed.", e);
View Full Code Here


      plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 " + task.getWidth() + " " + task.getHeight());

      // Work on a clone
      VisualizationTask clone = task.clone(plot, context);
      clone.put(VisualizationTask.THUMBNAIL, false);
      Visualization vis = visFactory.makeVisualization(clone);

      plot.getRoot().appendChild(vis.getLayer());
      plot.updateStyleElement();
      final int tw = (int) (task.getWidth() * tresolution);
      final int th = (int) (task.getHeight() * tresolution);
      thumb = t.thumbnail(plot, tw, th);
      // The visualization will not be used anymore.
      vis.destroy();
      synchronizedRedraw();
    }
    catch(Exception e) {
      final Logging logger = Logging.getLogger(task.getFactory().getClass());
      if(logger != null && logger.isDebugging()) {
View Full Code Here

    // TODO: center/arrange visualizations?
    for(Iterator<VisualizationTask> tit = visi.tasks.iterator(); tit.hasNext();) {
      VisualizationTask task = tit.next();
      if(VisualizerUtil.isVisible(task)) {
        try {
          Visualization v = task.getFactory().makeVisualization(task.clone(this, context, visi.proj, width, height));
          layers.add(v);
          layermap.put(task, v);
        }
        catch(Exception e) {
          if(Logging.getLogger(task.getFactory().getClass()).isDebugging()) {
View Full Code Here

    if(!(current instanceof VisualizationTask)) {
      return;
    }
    // Get the layer
    final VisualizationTask task = (VisualizationTask) current;
    Visualization vis = layermap.get(task);
    if(vis != null) {
      // Ensure visibility is as expected
      boolean isHidden = vis.getLayer().getAttribute(SVGConstants.CSS_VISIBILITY_PROPERTY) == SVGConstants.CSS_HIDDEN_VALUE;
      if(VisualizerUtil.isVisible(task)) {
        if(isHidden) {
          this.scheduleUpdate(new AttributeModifier(vis.getLayer(), SVGConstants.CSS_VISIBILITY_PROPERTY, SVGConstants.CSS_VISIBLE_VALUE));
        }
      }
      else {
        if(!isHidden) {
          this.scheduleUpdate(new AttributeModifier(vis.getLayer(), SVGConstants.CSS_VISIBILITY_PROPERTY, SVGConstants.CSS_HIDDEN_VALUE));
        }
      }
    }
    else {
      // Only materialize when becoming visible
View Full Code Here

   * @param parent Parent element to draw to
   */
  private Visualization embedOrThumbnail(final int thumbsize, PlotItem it, VisualizationTask task, Element parent) {
    if(single) {
      VisualizationTask thumbtask = task.clone(this, context, it.proj, it.w, it.h);
      final Visualization vis = thumbtask.getFactory().makeVisualization(thumbtask);
      if(vis.getLayer() == null) {
        LoggingUtil.warning("Visualization returned empty layer: " + vis);
      }
      else {
        parent.appendChild(vis.getLayer());
      }
      return vis;
    }
    else {
      VisualizationTask thumbtask = task.clone(this, context, it.proj, it.w, it.h);
      thumbtask.put(VisualizationTask.THUMBNAIL, true);
      thumbtask.put(VisualizationTask.THUMBNAIL_RESOLUTION, thumbsize);
      final Visualization vis = thumbtask.getFactory().makeVisualizationOrThumbnail(thumbtask);
      if(vis.getLayer() == null) {
        LoggingUtil.warning("Visualization returned empty layer: " + vis);
      }
      else {
        parent.appendChild(vis.getLayer());
      }
      return vis;
    }
  }
View Full Code Here

                  pair.first.removeAttribute(SVGConstants.CSS_VISIBILITY_PROPERTY);
                }
                // if not yet rendered, add a thumbnail
                if(!pair.first.hasChildNodes()) {
                  logger.warning("This codepath should no longer be needed.");
                  Visualization visualization = embedOrThumbnail(thumbsize, it, task, pair.first);
                  vistoelem.put(it, task, pair.first, visualization);
                  refreshcss = true;
                }
              }
              else {
View Full Code Here

      plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 " + task.getWidth() + " " + task.getHeight());

      // Work on a clone
      VisualizationTask clone = task.clone(plot, context);
      clone.put(VisualizationTask.THUMBNAIL, false);
      Visualization vis = visFactory.makeVisualization(clone);

      plot.getRoot().appendChild(vis.getLayer());
      plot.updateStyleElement();
      final int tw = (int) (task.getWidth() * tresolution);
      final int th = (int) (task.getHeight() * tresolution);
      thumb = plot.makeAWTImage(tw, th);
      thumbid = ThumbnailRegistryEntry.registerImage(thumb);
      // The visualization will not be used anymore.
      vis.destroy();
      synchronizedRedraw();
    }
    catch(Exception e) {
      final Logging logger = Logging.getLogger(task.getFactory().getClass());
      if(logger != null && logger.isDebugging()) {
View Full Code Here

  private void makeThumbnail(final int thumbsize, PlotItem it, VisualizationTask task, Element parent) {
    if(VisualizerUtil.isVisible(task) && VisualizerUtil.thumbnailEnabled(task)) {
      VisualizationTask thumbtask = task.clone(this, context, it.proj, it.w, it.h);
      thumbtask.put(VisualizationTask.THUMBNAIL, true);
      thumbtask.put(VisualizationTask.THUMBNAIL_RESOLUTION, thumbsize);
      Visualization vis = thumbtask.getFactory().makeVisualizationOrThumbnail(thumbtask);
      if(vis.getLayer() == null) {
        LoggingUtil.warning("Visualization returned empty layer: " + vis);
      }
      else {
        parent.appendChild(vis.getLayer());
      }
    }
  }
View Full Code Here

    ArrayList<Visualization> layers = new ArrayList<Visualization>();
    // TODO: center/arrange visualizations?
    for(VisualizationTask task : IterableUtil.fromIterator(visi.visIterator())) {
      if(VisualizerUtil.isVisible(task)) {
        try {
          Visualization v = task.getFactory().makeVisualization(task.clone(this, context, visi.proj, width, height));
          layers.add(v);
          layermap.put(task, v);
        }
        catch(Exception e) {
          if(Logging.getLogger(task.getFactory().getClass()).isDebugging()) {
View Full Code Here

    if(!(current instanceof VisualizationTask)) {
      return;
    }
    // Get the layer
    final VisualizationTask task = (VisualizationTask) current;
    Visualization vis = layermap.get(task);
    if(vis != null) {
      // Ensure visibility is as expected
      boolean isHidden = vis.getLayer().getAttribute(SVGConstants.CSS_VISIBILITY_PROPERTY) == SVGConstants.CSS_HIDDEN_VALUE;
      if(VisualizerUtil.isVisible(task)) {
        if(isHidden) {
          this.scheduleUpdate(new AttributeModifier(vis.getLayer(), SVGConstants.CSS_VISIBILITY_PROPERTY, SVGConstants.CSS_VISIBLE_VALUE));
        }
      }
      else {
        if(!isHidden) {
          this.scheduleUpdate(new AttributeModifier(vis.getLayer(), SVGConstants.CSS_VISIBILITY_PROPERTY, SVGConstants.CSS_HIDDEN_VALUE));
        }
      }
    }
    else {
      // Only materialize when becoming visible
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.visualization.visualizers.Visualization

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.