1 package org.simantics.jfreechart.chart.properties;
\r
3 import java.util.Collection;
\r
4 import java.util.Collections;
\r
6 import org.simantics.db.ReadGraph;
\r
7 import org.simantics.db.Resource;
\r
8 import org.simantics.db.exception.DatabaseException;
\r
9 import org.simantics.db.request.Read;
\r
11 public class AllVariablesOfModel implements Read<Collection<ChartVariable>> {
\r
13 public Resource res;
\r
15 public AllVariablesOfModel(Resource res) {
\r
20 public Collection<ChartVariable> perform(ReadGraph graph) throws DatabaseException {
\r
21 if(!graph.hasStatement(res))
\r
22 return Collections.emptyList();
\r
23 IAllVariablesOfModel query = graph.adapt(res, IAllVariablesOfModel.class);
\r
24 return graph.syncRequest(query.getVariablesQuery());
\r