Resource rendererResource = graph.getPossibleObject(resource, jfree.Dataset_renderer);\r
if(rendererResource != null)\r
renderer = graph.adapt(rendererResource, IRenderer.class);\r
- \r
+\r
ArrayList<TempSeries> series = new ArrayList<TempSeries>();\r
\r
String realizationURI = getRealizationURI(graph);\r
\r
Resource c = graph.getPossibleObject(r, jfree.color);\r
Color color = c == null ? null : G2DUtils.getColor(graph, c);\r
+ \r
+ String label = graph.getPossibleRelatedValue(r, Layer0.getInstance(graph).HasLabel);\r
\r
// Get a variable for the series\r
Variable v = Variables.getVariable(graph, realizationURI + rvi);\r
-\r
+ if(v == null)\r
+ return new Pair<ArrayList<TempSeries>, IRenderer>(series, renderer);\r
\r
// Get values\r
Object object = v.getPossiblePropertyValue(graph, SysdynVariableProperties.ACTIVE_DATASETS , Bindings.VARIANT);\r
if(ta!=null && va!=null && (va.length == ta.length)) {\r
// Add series if everything OK\r
String name = dataset.name;\r
+ if(label != null)\r
+ name = label;\r
if(dataset.result != null && !dataset.result.isEmpty())\r
name = name + " : " + dataset.result;\r
series.add(new TempSeries(name, new double[][] {ta, va}, width, color));\r
try {\r
// Get a variable for the series\r
Variable v = Variables.getVariable(graph, realizationURI + rvi);\r
+ if(v == null)\r
+ return null;\r
Double time = v.getPossiblePropertyValue(graph, SysdynVariableProperties.TIME , Bindings.DOUBLE);\r
return time;\r
} catch (MissingVariableException e) {\r
@Override\r
public AbstractRenderer getRenderer() {\r
if(renderer == null) {\r
- XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);\r
- renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());\r
- return renderer;\r
+\r
+ try {\r
+ renderer = SimanticsUI.getSession().syncRequest(new Read<IRenderer>() {\r
+\r
+ @Override\r
+ public IRenderer perform(ReadGraph graph) throws DatabaseException {\r
+ JFreeChartResource jfree = JFreeChartResource.getInstance(graph);\r
+ IRenderer renderer = null;\r
+ Resource rendererResource = graph.getPossibleObject(resource, jfree.Dataset_renderer);\r
+ if(rendererResource != null)\r
+ renderer = graph.adapt(rendererResource, IRenderer.class);\r
+ return renderer;\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ }\r
+ if(renderer == null) {\r
+ XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);\r
+ renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());\r
+ return renderer;\r
+ } else {\r
+ return renderer.getRenderer();\r
+ }\r
} else {\r
return renderer.getRenderer();\r
}\r
private String getRealizationURI(ReadGraph graph) throws DatabaseException {\r
if(resource == null)\r
return null;\r
- \r
+\r
Layer0 l0 = Layer0.getInstance(graph);\r
ModelingResources mr = ModelingResources.getInstance(graph);\r
\r
\r
if(model == null)\r
return null;\r
- \r
+\r
// Find the variable realization of the current experiment\r
String realizationURI = null;\r
Resource realization = graph.syncRequest(new PossibleActiveExperiment(model));\r
\r
if (!graph.hasStatement(component) || !graph.hasStatement(component, l0.PartOf))\r
return Collections.emptyList();\r
-\r
- // Find all variables that are linked to component with arrows\r
- Set<String> dependencies = ValidationUtils.getDependencies(graph, component);\r
- Set<String> references = null;\r
-\r
+ \r
ArrayList<Issue> result = new ArrayList<Issue>();\r
-\r
+ Set<String> references = null;\r
\r
// Find all references in equations of component\r
try {\r
return result;\r
} \r
\r
+ // Find all variables that are linked to component with arrows\r
+ Set<String> dependencies = ValidationUtils.getDependencies(graph, component);\r
+\r
// Check that all arrow dependencies are used in equations\r
if (dependencies != null) {\r
for (String dependency : dependencies) {\r