From 2bc58cc1c62bed841877dd3471993be493008a91 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Thu, 31 Jan 2013 14:24:43 +0000 Subject: [PATCH] refs #4043 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26717 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.jfreechart.ontology/graph.tg | Bin 12294 -> 12460 bytes .../graph/JFreeChart.pgraph | 1 + .../simantics/sysdyn/JFreeChartResource.java | 6 + .../jfreechart/chart/CategoryPlot.java | 11 ++ .../simantics/jfreechart/chart/XYPlot.java | 9 ++ .../bar/BarGeneralPropertiesTab.java | 113 ++++++++++++++++-- 6 files changed, 130 insertions(+), 10 deletions(-) diff --git a/org.simantics.jfreechart.ontology/graph.tg b/org.simantics.jfreechart.ontology/graph.tg index 37f5a6f49db12c8ef6e53ee46fb1f1f2c293a651..5cc13db42534db0cc86f976efc7ecbc3a92498b4 100644 GIT binary patch literal 12460 zcmai)2YXay7RM=RGwFb|-BmiGLtd+)8h*Bbw^?QOm zrH1)Rq`H44CGBBY*r%=}@AdoKM@eCLAZb-Bq#;CkFSk!-*?<>O|Exb!Rk3may(GD% z6)pLZ%F=XP@CtrE6(s}a(z4B7uK53FP|9gMZyNkR-2~o|nb2bLYSs@94mQL=zefv` zi5tSGmomx`8l7qib73@dPQx6c5_VO#Md1cNQy}MDayGKFeDU07m(>YJV<{I>tBm96 zmVU3-pX+KCBtp%BN4wfTb1nWzE%6%P+n5_}$GrV)XGj$*IaEpAi!3>Jvoqa9r=N6V?&v7?mA3}n zkr!csDwCv^Je{w6CYkR~i5jmi4l-9>!p^deLKNh2Fcvb8&HIA{OBpJf!+tMFHsT+N z292oMD|nrxLTPR69Ji>L&m;$(=RkW$u`Z64F9^e&@4?ZWXs*l`=^hu{@t35Ub3HGwWPtXOP*r+>17%tB(A%(pDTFejAb=)^uAiF4o>PRI0=`m|j9n0yZ3IjXx0IH{)J8|V!ANp<`3 z75o>d#B({3uKB$i`2{@Zs+99Nr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j)%FTKN)kijJbk;62|+3w7)1pKkO&i?kCvp=g~$#D(#~TV?U3S;P|M4>5u(fYZ&{v z#xVACwPEb%5fb!+7npw7&s7rK&tC@S{$cK@lYiy-*MYqs$HQFFpNzR$#$3VN&)-P< z^AhyKeuC|Og1Mi)(*CT3)q|}bO#L!xA7b>Q(mvSnL56WX4m1q?3daW+hJJqut`}aG zp#^ikxSsn-P=CGS>l|O}_?p1<+y1HJT41|==s7>E-!k>A(~r#Y$ea(E^CfdVWUkll2hQBR5+6yNEn#`P z<86-5ay%TEXrN{i4P_4*%ZwCtxwwXC3wD3Ym+#+S$@p> z(!cOi{~e-Dvtmb@t*9jVR5hBFznfT5#-GvVE0UTd k_3ylM5g+Y6PF0VU@;B$^FVOSZyfRx`HTT!J{6E|O0fltHIRF3v diff --git a/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph b/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph index 0b9fdbb1..c83c6743 100644 --- a/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph +++ b/org.simantics.jfreechart.ontology/graph/JFreeChart.pgraph @@ -50,6 +50,7 @@ JFREE.Plot -- JFREE.Plot.visibleGrid --> L0.Boolean -- JFREE.Plot.rangeAxisList --> L0.List -- JFREE.Plot.visibleLabels --> L0.Boolean -- JFREE.Plot.orientation --> L0.Boolean + * + */ + private class OrientationSelectionFactory extends ReadFactoryImpl { + @Override + public String perform(ReadGraph graph, Resource chart) throws DatabaseException { + JFreeChartResource jfree = JFreeChartResource.getInstance(graph); + Layer0 l0 = Layer0.getInstance(graph); + + Resource plot = graph.syncRequest(new PossibleObjectWithType(chart, l0.ConsistsOf, jfree.CategoryPlot)); + if(plot != null) { + Boolean orientation = graph.getPossibleRelatedValue(plot, jfree.Plot_orientation); + if (orientation != null) { + if (orientation) + return "Horizontal"; + return "Vertical"; + } + } + return "Vertical"; + } + } + + /** + * + * @author Marko Luukkainen + * + */ + private class OrientationItemFactory extends ReadFactoryImpl> { + @Override + public Map perform(ReadGraph graph, Resource series) throws DatabaseException { + LinkedHashMap result = new LinkedHashMap(); + result.put("Vertical", "Vertical"); + result.put("Horizontal", "Horizontal"); + return result; + } + } + + /** + * + * @author Marko Luukkainen + * + */ + private class OrientationModifyListener extends ComboModifyListenerImpl { + @Override + public void applyText(WriteGraph graph, Resource chart, String text) throws DatabaseException { + JFreeChartResource jfree = JFreeChartResource.getInstance(graph); + Layer0 l0 = Layer0.getInstance(graph); + + Resource plot = graph.syncRequest(new PossibleObjectWithType(chart, l0.ConsistsOf, jfree.CategoryPlot)); + if(plot == null) + return; + + + if(text.equals("Horizontal")) + graph.claimLiteral(plot, jfree.Plot_orientation,true); + else + graph.claimLiteral(plot, jfree.Plot_orientation,false); + + + } + } } -- 2.47.1