Example #1
0
  public Image testScatterPlot() {
    Connection c = null;
    try {
      initDatasource();
      c = datasource.getConnection();
      SourceDataset q = new SourceDataset();
      q.setId(78);
      PropertiesChartGenerator gen = new PropertiesChartGenerator();
      gen.setConnection(c);
      Property p = Property.getInstance("XLogP", "");
      p.setId(13993);
      gen.setPropertyX(p);
      p = Property.getInstance("LLNA EC3 %", "");
      p.setId(13995);
      gen.setPropertyY(p);

      return gen.process(q);

    } catch (Exception x) {
      x.printStackTrace();
      return null;
    } finally {
      try {
        c.close();
      } catch (Exception x) {
      }
    }
  }
Example #2
0
  public Image test() {
    Connection c = null;
    try {
      initDatasource();
      c = datasource.getConnection();
      // IStoredQuery q = new StoredQuery(6);
      SourceDataset dataset = new SourceDataset();
      dataset.setId(6);
      PieChartGenerator gen = new PieChartGenerator();
      gen.setConnection(c);
      Property p = Property.getInstance("toxTree.tree.cramer.CramerRules", "");
      p.setId(12361);
      gen.setProperty(p);

      return gen.process(dataset);

    } catch (Exception x) {
      x.printStackTrace();
      return null;
    } finally {
      try {
        c.close();
      } catch (Exception x) {
      }
    }
  }
  @Override
  protected IQueryRetrieval<IStructureRecord> createQuery() {
    Profile<Property> profile = new Profile<Property>();

    for (int i = 1; i < 5; i++) {
      // for the test only id matters
      Property p = Property.getInstance(String.format("test%d", i), String.format("test%d", i));
      p.setId(i);
      p.setEnabled(true);
      profile.add(p);
    }

    RetrieveProfileValuesAsRow q = new RetrieveProfileValuesAsRow();
    q.setChemicalsOnly(false);
    q.setFieldname(profile);
    q.setValue(new int[] {100211, 100214, 100215, 129345});
    return q;
  }