* @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;
}
}