From 464a284f7b76b93f4f1121fcbb7160ef25f0857e Mon Sep 17 00:00:00 2001 From: luukkainen Date: Thu, 31 Jan 2013 16:17:47 +0000 Subject: [PATCH] fixes #4044 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26718 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../org/simantics/jfreechart/chart/AbstractDataset.java | 3 ++- .../org/simantics/sysdyn/ui/trend/CategoryDataset.java | 8 +++----- .../src/org/simantics/sysdyn/ui/trend/PieDataset.java | 8 +++----- .../src/org/simantics/sysdyn/ui/trend/XYDataset.java | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/AbstractDataset.java b/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/AbstractDataset.java index 3ff63afb..22072597 100644 --- a/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/AbstractDataset.java +++ b/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/AbstractDataset.java @@ -13,6 +13,7 @@ package org.simantics.jfreechart.chart; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; /** @@ -25,7 +26,7 @@ public abstract class AbstractDataset implements IDataset { protected Resource resource; - public AbstractDataset(ReadGraph graph, Resource resource) { + public AbstractDataset(ReadGraph graph, Resource resource) throws DatabaseException { this.resource = resource; } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/CategoryDataset.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/CategoryDataset.java index d4c021c5..aaa0ec25 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/CategoryDataset.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/CategoryDataset.java @@ -56,10 +56,10 @@ public class CategoryDataset extends AbstractDataset implements org.simantics.jf private IRenderer renderer; private DefaultCategoryDataset dataset; - public CategoryDataset(ReadGraph graph, Resource resource) { + public CategoryDataset(ReadGraph graph, Resource resource) throws DatabaseException { super(graph, resource); - try { + Layer0 l0 = Layer0.getInstance(graph); ModelingResources mr = ModelingResources.getInstance(graph); JFreeChartResource jfree = JFreeChartResource.getInstance(graph); @@ -90,9 +90,7 @@ public class CategoryDataset extends AbstractDataset implements org.simantics.jf Resource rendererResource = graph.getPossibleObject(resource, jfree.Dataset_renderer); renderer = graph.adapt(rendererResource, IRenderer.class); - } catch (DatabaseException e) { - e.printStackTrace(); - } + } private DatasetListener listener; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/PieDataset.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/PieDataset.java index eb3d1cb2..0f2b57a6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/PieDataset.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/PieDataset.java @@ -57,10 +57,10 @@ public class PieDataset extends AbstractDataset implements org.simantics.jfreech private HashMap colorMap; private HashMap explodedMap; - public PieDataset(ReadGraph graph, Resource resource) { + public PieDataset(ReadGraph graph, Resource resource) throws DatabaseException { super(graph, resource); - try { + Layer0 l0 = Layer0.getInstance(graph); ModelingResources mr = ModelingResources.getInstance(graph); JFreeChartResource jfree = JFreeChartResource.getInstance(graph); @@ -88,9 +88,7 @@ public class PieDataset extends AbstractDataset implements org.simantics.jfreech if(seriesList != null) { this.seriesList = ListUtils.toList(graph, seriesList); } - } catch (DatabaseException e) { - e.printStackTrace(); - } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/XYDataset.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/XYDataset.java index 363669ce..f6a275c2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/XYDataset.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/XYDataset.java @@ -64,7 +64,7 @@ public class XYDataset extends AbstractDataset implements org.simantics.jfreecha private IRenderer renderer; - public XYDataset(ReadGraph graph, final Resource datasetResource) { + public XYDataset(ReadGraph graph, final Resource datasetResource) throws DatabaseException { super(graph, datasetResource); } -- 2.47.1