From: luukkainen Date: Tue, 19 Jan 2016 14:33:00 +0000 (+0000) Subject: refs #6271 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fsimantics-1.18;p=simantics%2Fsysdyn.git refs #6271 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/simantics-1.18@32276 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.jfreechart.ontology/.classpath b/org.simantics.jfreechart.ontology/.classpath new file mode 100644 index 00000000..8a8f1668 --- /dev/null +++ b/org.simantics.jfreechart.ontology/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.jfreechart.ontology/.project b/org.simantics.jfreechart.ontology/.project new file mode 100644 index 00000000..36a196b0 --- /dev/null +++ b/org.simantics.jfreechart.ontology/.project @@ -0,0 +1,34 @@ + + + org.simantics.jfreechart.ontology + + + + + + org.simantics.graph.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.simantics.graph.nature + + diff --git a/org.simantics.jfreechart.ontology/.settings/org.eclipse.jdt.core.prefs b/org.simantics.jfreechart.ontology/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..8fdbeb77 --- /dev/null +++ b/org.simantics.jfreechart.ontology/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Nov 14 12:29:34 EET 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.simantics.jfreechart.ontology/META-INF/MANIFEST.MF b/org.simantics.jfreechart.ontology/META-INF/MANIFEST.MF new file mode 100644 index 00000000..a4fc1010 --- /dev/null +++ b/org.simantics.jfreechart.ontology/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: http://www.simantics.org/JFreeChart +Bundle-SymbolicName: org.simantics.jfreechart.ontology +Bundle-Version: 1.0.0.qualifier +Require-Bundle: org.simantics.layer0, + org.simantics.layer0x.ontology;bundle-version="1.0.0", + org.simantics.g2d.ontology;bundle-version="1.0.0", + org.simantics.diagram.ontology;bundle-version="2.1.0", + org.simantics.structural.ontology;bundle-version="1.1.0", + org.simantics.modeling.ontology;bundle-version="1.1.0", + org.simantics.project.ontology;bundle-version="1.2.0", + org.simantics.image2.ontology;bundle-version="1.2.0", + org.simantics.action.ontology;bundle-version="1.1.0", + org.simantics.viewpoint.ontology;bundle-version="1.2.0", + org.simantics.color.ontology;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Export-Package: org.simantics.sysdyn diff --git a/org.simantics.jfreechart.ontology/build.properties b/org.simantics.jfreechart.ontology/build.properties new file mode 100644 index 00000000..ecdc7c30 --- /dev/null +++ b/org.simantics.jfreechart.ontology/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + graph.tg diff --git a/org.simantics.jfreechart.ontology/graph.tg b/org.simantics.jfreechart.ontology/graph.tg new file mode 100644 index 00000000..5a57c746 Binary files /dev/null and b/org.simantics.jfreechart.ontology/graph.tg differ diff --git a/org.simantics.jfreechart.ontology/graph/ChartViewpoints.pgraph b/org.simantics.jfreechart.ontology/graph/ChartViewpoints.pgraph new file mode 100644 index 00000000..e0cb5e3a --- /dev/null +++ b/org.simantics.jfreechart.ontology/graph/ChartViewpoints.pgraph @@ -0,0 +1,117 @@ +L0 = +VP = +PROJECT = +MOD = +IMAGE = +COLOR = +ACT = +JFREE = + + +/////////////////////////////////////////////// +// XY Line axis: axis and variables viewpoint +/////////////////////////////////////////////// +CBC = JFREE.ChartAxisAndVariablesBrowseContext : VP.BrowseContext +CAC = JFREE.ChartAxisAndVariablesActionContext : VP.BrowseContext + +CBC.AxisChildRule : VP.ChildRule +CBC.VariableChildRule : VP.ChildRule +CBC.SeriesLabelRule : VP.LabelRule +CBC.AxisLabelRule : VP.LabelRule +CBC.SeriesLabelDecorationRule : VP.LabelDecorationRule + +CBC + @VP.customChildRule JFREE.Chart CBC.AxisChildRule + JFREE.Axis : VP.ResourceNodeType + @VP.customChildRule JFREE.Axis CBC.VariableChildRule + JFREE.Series : VP.ResourceNodeType + +CBC + @VP.customLabelRule JFREE.Axis CBC.AxisLabelRule + @VP.customLabelRule JFREE.Series CBC.SeriesLabelRule + +CBC + @VP.customLabelDecorationRule JFREE.Series CBC.SeriesLabelDecorationRule + +CBC + @VP.dropActionContribution JFREE.Axis CAC.Actions.SeriesDropAction 1.0 + @VP.dropActionContribution JFREE.Series CAC.Actions.SeriesDropAction 1.0 + @VP.dropActionContribution JFREE.Axis CAC.Actions.AxisDropAction 2.0 + @VP.dropActionContribution JFREE.Series CAC.Actions.AxisDropAction 2.0 + +CBC + VP.BrowseContext.HasVisualsContribution _ : VP.VisualsContribution + VP.VisualsContribution.HasNodeType JFREE.Chart + VP.VisualsContribution.HasRule VP.PassThruSorterRule + VP.BrowseContext.HasVisualsContribution _ : VP.VisualsContribution + VP.VisualsContribution.HasNodeType JFREE.Axis + VP.VisualsContribution.HasRule VP.PassThruSorterRule + + +CAC.Actions : L0.Library +CAC.Actions.SeriesDropAction : ACT.DropAction +CAC.Actions.AxisDropAction : ACT.DropAction + + +/////////////////////////////////////////////// +// Bar chart: Variables viewpoint +/////////////////////////////////////////////// +BSBC = JFREE.BarSeriesBrowseContext : VP.BrowseContext +BSAC = JFREE.BarSeriesActionContext : VP.BrowseContext + +BSBC.SeriesChildRule : VP.ChildRule +BSBC.SeriesLabelRule : VP.LabelRule +BSBC.SeriesLabelDecorationRule : VP.LabelDecorationRule + +BSBC + @VP.customChildRule JFREE.Chart BSBC.SeriesChildRule + JFREE.Series + +BSBC + @VP.customLabelRule JFREE.Series BSBC.SeriesLabelRule + +BSBC + @VP.customLabelDecorationRule JFREE.Series BSBC.SeriesLabelDecorationRule + +BSBC + @VP.dropActionContribution JFREE.Series BSAC.Actions.SeriesDropAction 1.0 + +BSBC + VP.BrowseContext.HasVisualsContribution _ : VP.VisualsContribution + VP.VisualsContribution.HasNodeType JFREE.Chart + VP.VisualsContribution.HasRule VP.PassThruSorterRule + +BSAC.Actions : L0.Library +BSAC.Actions.SeriesDropAction : ACT.DropAction + + +/////////////////////////////////////////////// +// Pie chart: Variables viewpoint +/////////////////////////////////////////////// +PSBC = JFREE.PieSeriesBrowseContext : VP.BrowseContext +PSAC = JFREE.PieSeriesActionContext : VP.BrowseContext + +PSBC.SeriesChildRule : VP.ChildRule +PSBC.SeriesLabelRule : VP.LabelRule +PSBC.SeriesLabelDecorationRule : VP.LabelDecorationRule + +PSBC + @VP.customChildRule JFREE.Chart PSBC.SeriesChildRule + JFREE.Series + +PSBC + @VP.customLabelRule JFREE.Series PSBC.SeriesLabelRule + +PSBC + @VP.customLabelDecorationRule JFREE.Series PSBC.SeriesLabelDecorationRule + +PSBC + @VP.dropActionContribution JFREE.Series PSAC.Actions.SeriesDropAction 1.0 + +PSBC + VP.BrowseContext.HasVisualsContribution _ : VP.VisualsContribution + VP.VisualsContribution.HasNodeType JFREE.Chart + VP.VisualsContribution.HasRule VP.PassThruSorterRule + +PSAC.Actions : L0.Library +PSAC.Actions.SeriesDropAction : ACT.DropAction diff --git a/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph b/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph new file mode 100644 index 00000000..f185b412 --- /dev/null +++ b/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph @@ -0,0 +1,141 @@ +L0 = +L0X = +G2D = +DIA = +MOD = +STR = + +//##################################################################### +// Ontology for defining JFreeChart charts +//##################################################################### + +JFREE = : L0.Ontology + @L0.new + L0.HasResourceClass "org.simantics.sysdyn.JFreeChartResource" + +//##################################################################### +// Charts +//##################################################################### +JFREE.Chart -- JFREE.title --> JFREE.Title -- JFREE.subtitles --> L0.List -- JFREE.Chart.borderColor --> G2D.Color -- JFREE.Chart.visibleBorder --> L0.Boolean -- JFREE.Chart.borderWidth --> L0.Double -- JFREE.Chart.visibleLegend --> L0.Boolean -- JFREE.Chart.time --> L0.Double -- JFREE.visible --> L0.Boolean -- JFREE.Title.position --> L0.Boolean -- JFREE.Plot.domainAxis --> JFREE.Axis -- JFREE.Plot.rangeAxis --> JFREE.Axis -- JFREE.backgroundColor --> G2D.Color -- JFREE.Plot.visibleGrid --> L0.Boolean -- JFREE.Plot.rangeAxisList --> L0.List -- JFREE.Plot.visibleLabels --> L0.Boolean -- JFREE.Plot.orientation --> L0.Boolean -- JFREE.color --> G2D.Color -- JFREE.Axis.min --> L0.Double -- JFREE.Axis.max --> L0.Double -- JFREE.Axis.visibleTickLabels --> L0.Boolean -- JFREE.Axis.visibleTickMarks --> L0.Boolean -- JFREE.Axis.visibleAxisLine --> L0.Boolean -- JFREE.Axis.visibleLabel --> L0.Boolean -- JFREE.Axis.rotateLabelDegrees --> L0.Double -- JFREE.Dataset.seriesList --> L0.List -- JFREE.Dataset.renderer --> JFREE.Renderer -- JFREE.Dataset.mapToDomainAxis --> JFREE.Axis -- JFREE.Dataset.mapToRangeAxis --> JFREE.Axis -- JFREE.color + >-- JFREE.variableRVI --> L0.String -- JFREE.variableFilter --> L0.StringArray -- JFREE.Series.rangeList --> L0.List -- JFREE.Series.lineWidth --> L0.Integer -- JFREE.Series.exploded --> L0.Boolean -- JFREE.Series.time --> L0.Double -- JFREE.ChartElement.component --> JFREE.Chart () { + public JFreeChartResource perform(ReadGraph graph) throws DatabaseException { + QueryControl qc = graph.getService(QueryControl.class); + return new JFreeChartResource(qc.getIndependentGraph(graph)); + } + }); + session.registerService(JFreeChartResource.class, ret); + } + return ret; + } + +} +