From 872431f4b72ea0a1adf5e48489bcaa92bbd57788 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Tue, 19 Jan 2016 14:33:00 +0000 Subject: [PATCH] refs #6271 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/simantics-1.18@32276 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.jfreechart.ontology/.classpath | 7 + org.simantics.jfreechart.ontology/.project | 34 ++ .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 18 + .../build.properties | 5 + org.simantics.jfreechart.ontology/graph.tg | Bin 0 -> 12857 bytes .../graph/ChartViewpoints.pgraph | 117 +++++ .../graph/JFreeChart.pgraph | 141 ++++++ .../simantics/sysdyn/JFreeChartResource.java | 442 ++++++++++++++++++ 9 files changed, 772 insertions(+) create mode 100644 org.simantics.jfreechart.ontology/.classpath create mode 100644 org.simantics.jfreechart.ontology/.project create mode 100644 org.simantics.jfreechart.ontology/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.simantics.jfreechart.ontology/META-INF/MANIFEST.MF create mode 100644 org.simantics.jfreechart.ontology/build.properties create mode 100644 org.simantics.jfreechart.ontology/graph.tg create mode 100644 org.simantics.jfreechart.ontology/graph/ChartViewpoints.pgraph create mode 100644 org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph create mode 100644 org.simantics.jfreechart.ontology/src/org/simantics/sysdyn/JFreeChartResource.java 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 0000000000000000000000000000000000000000..5a57c746c0774f4bfe84830680f528209574867a GIT binary patch literal 12857 zcmai*_j?s(7RM=RH$8x~-BmyJGLXm)#%tKiECrGw&gX^RO<@bIAKS<@?ro=U$#r+!cAf-NS|r8%{Q?6o0ut z#Z{3XhlMEZH-v>;egxd*{y^T(#X*>hQ{WQ(Rf)gKgN&cc2l>E{%fMP`M42chA{oCk z$WdyTt3ayzQ&iL%hWTCUigI3$&wUi-2YZuN**qFTl=HH?WR~=L5%tgdLsex%cWkMmyM@1de(z+76==Vc53e+I>z#`C7Z|InpMqQLqiqP;>LzoStsWa+l5EZejq9qDX_0xHB&Lrm?c9t%f+32#`;h0m*h14qH zczIKg*X7T2HFFc8#=xUp?U_20g|3EkZt1)%PnOyvlFDXp(2u4&@gLwDQPWoF^`pqo zdRVrlo#bocK*>Dp?I7{0gd4*`N7g6)HQ^R7%5(lgW?JfQKML|OWjxECR8y|ck7A#b znvEBm${wD?z*OUrSGlH4z^<6ex^O7ilrQ?pzcMMoHw$wyn#+X>BijALF_AS z4mu()!U9z!NliIAU%7NL-=7mTUR@kyt~`&OC2jdA$l+kjV;-6F`w12?lr@GuUXX0W zKN1ZZQKOgl+DV1dTG%;iej%4m4m!_)_KspJI9570470umM`NP7G?%Bd*M+hE#GVv1 zxg&C2kW}GO>GC6TT*HoPmvA5)vH#|iF~is&t?3GdmGRGqB#QrwmJ_QU)dML0iCvHufxxh<0E+U zs^^%~YFrv>n}Zyd=R*Wyl^Jnnt;=i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5!Z6<0bIJ@hq;>?Zf`QBOLS zIQl|d7=39*U*P>*J=Q|=Q-+^*{D8}U#<8p?#`kwJVXP-uuP0cq=bv@P`tmnas zv7TU=4{~R!IM#E9Vyx$M#aPd2iZNcW=s~-lOxE*J#}Y?hhzp}H&FBj(>xsE)e$4RW zj%7Wca4hSG@%@cV80!hv>j{?i98c}PlIeV~&Ie2WIBM^!^0EH=7@n*c`?0rT1jlm!h-{x zlQ`~X&C3k88D4I9rQy|v*EqKQ%YH~)Sn7pEUs(DV#`wmN$$IZW?a_)yQM=A?t>PML zR~xQUjOQOL{oz?DCzJc>cEfi#mVAs2`N9~RW{gcU#-6r;l+k=Kk5A0hG!X`X1Lxk-fdbBcd_PihVks{IG#1Ioc~5@4=0oJfmj*Y z(Z%%Fuw(v>zxmI#CHQfG`+cTKonbU76U4n)Z;*Z`Wl|cyH62e1a^&P+>yIgUU)DGl qb;+N7tYdH6%OvYK)H)XMIHu5lQ&9hDAs&n~gSq;lU*MMCJoqn{IX|-i literal 0 HcmV?d00001 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; + } + +} + -- 2.47.1