Esempio n. 1
0
 private RendererModel getModel() {
   RendererModel model = new RendererModel();
   for (IGenerator<IAtomContainer> gen : gens) model.registerParameters(gen);
   for (IGeneratorParameter<?> param : params.values())
     model.set(param.getClass(), param.getValue());
   return model;
 }
Esempio n. 2
0
  /**
   * Create a depiction generator that will render atom labels using the specified AWT font.
   *
   * @param font the font to use to display
   */
  public DepictionGenerator(Font font) {
    gens.add(new BasicSceneGenerator());
    gens.add(new StandardGenerator(this.font = font));

    for (IGenerator<IAtomContainer> gen : gens) {
      for (IGeneratorParameter<?> param : gen.getParameters()) {
        params.put(param.getClass(), param);
      }
    }
    for (IGeneratorParameter<?> param : new RendererModel().getRenderingParameters()) {
      params.put(param.getClass(), param);
    }

    // default margin and separation is automatic
    // since it depends on raster (px) vs vector (mm)
    setParam(BasicSceneGenerator.Margin.class, AUTOMATIC);
    setParam(RendererModel.Padding.class, AUTOMATIC);
  }