[Schmitzm-commits] r882 - trunk/src_junit/schmitzm/jfree/feature/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 2 14:43:53 CEST 2010
Author: alfonx
Date: 2010-06-02 14:43:53 +0200 (Wed, 02 Jun 2010)
New Revision: 882
Modified:
trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java
Log:
Updated the test to use setSeriesDeafultTitleAttname, which doesn't work. The test doesn't fail anyways, because the result can only be seen in the png. :-(
Modified: trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java
===================================================================
--- trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java 2010-05-31 15:48:02 UTC (rev 881)
+++ trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java 2010-06-02 12:43:53 UTC (rev 882)
@@ -125,23 +125,24 @@
ChartAxisStyle rangeAxisStyle = new ChartAxisStyle("deut. maenner",
Color.green, 0., 0.);
- FeatureBasicChartStyle lineChartStyle = new FeatureBasicChartStyle(
+ FeatureBasicChartStyle barChartStyle = new FeatureBasicChartStyle(
"testLineChart", ChartType.BAR);
- lineChartStyle.setAxisStyle(0, domainAxisStyle);
- lineChartStyle.setAxisStyle(1, rangeAxisStyle);
+
+ barChartStyle.setAxisStyle(0, domainAxisStyle);
+ barChartStyle.setAxisStyle(1, rangeAxisStyle);
// Jahreszahlen sollen nicht als zahlen interpretiert werden
- lineChartStyle.setForceCategories(true);
+ barChartStyle.setForceCategories(true);
- lineChartStyle.setAttributeName(0, domainAttribName);
- lineChartStyle.setAttributeName(1, variablenAttribName);
+ barChartStyle.setAttributeName(0, domainAttribName);
+ barChartStyle.setAttributeName(1, variablenAttribName);
- lineChartStyle.setTooltips(true);
+ barChartStyle.setTooltips(true);
- lineChartStyle.setSeriesAttributeName(groupAttribName);
+ barChartStyle.setSeriesAttributeName(groupAttribName);
assertNull("Wenn nicht explizit gesetzt wird null geliefert",
- lineChartStyle.getRendererStyle(0));
+ barChartStyle.getRendererStyle(0));
ChartRendererStyle chartRendererStyle = new ChartRendererStyle();
@@ -151,11 +152,11 @@
chartRendererStyle.setSeriesPaint(0, Color.green);
chartRendererStyle.setSeriesPaint(1, Color.red);
chartRendererStyle.setSeriesPaint(2, Color.GRAY);
- lineChartStyle.setRendererStyle(0, chartRendererStyle);
+ barChartStyle.setRendererStyle(0, chartRendererStyle);
assertEquals(3, chartRendererStyle.getSeriesCount());
- JFreeChart lineChart = lineChartStyle
+ JFreeChart lineChart = barChartStyle
.applyToFeatureCollection(testFeatures);
assertNotNull("applyToFeatureCollection liefte null!", lineChart);
@@ -221,6 +222,8 @@
lineChartStyle.setTooltips(true);
lineChartStyle.setSeriesAttributeName(groupAttribName);
+
+ lineChartStyle.setSeriesLegendTitleAttributeName(labelAttribName);
assertNull("Wenn nicht explizit gesetzt wird null geliefert",
lineChartStyle.getRendererStyle(0));
@@ -249,7 +252,7 @@
if (INTERACTIVE) {
ChartFrame chartFrame = new ChartFrame(
- "drei linien, forcedCategories", lineChart);
+ "drei linien, forcedCategories, mit series title kreisname", lineChart);
chartFrame.pack();
chartFrame.setVisible(true);
while (chartFrame.isVisible()) {
@@ -273,7 +276,6 @@
Thread.sleep(100);
}
}
-
File testFile = File.createTempFile("testLineChart", ".xml");
xmlFactory.writeStyleToFile(lineChartStyle, "testLineChart", testFile);
@@ -284,9 +286,9 @@
String writtenXML = IOUtil.readFileAsString(testFile);
System.out.println(writtenXML);
assertTrue(
- "<seriesAttr name=\"code\" nullAliases=\"06531;06532\" /> fehlt!",
+ "<seriesAttr name=\"code\" nullAliases=\"06531;06532\" fehlt!",
writtenXML
- .contains("<seriesAttr name=\"code\" nullAliases=\"06531;06532\" />"));
+ .contains("<seriesAttr name=\"code\" nullAliases=\"06531;06532\""));
assertTrue("Nodatawerte wurden mehr als einmal in das XML geschrieben",
writtenXML.indexOf("06531;06532") == writtenXML
@@ -349,6 +351,8 @@
lineChartStyle.setAttributeName(0, domainAttribName);
lineChartStyle.setAttributeName(1, variablenAttribName);
+
+ lineChartStyle.setSeriesLegendTitleAttributeName(labelAttribName);
lineChartStyle.setTooltips(true);
@@ -405,7 +409,7 @@
if (INTERACTIVE) {
ChartFrame chartFrame = new ChartFrame(
- "drei linien sein, NOT categories", lineChart);
+ "drei linien, NOT categories, KreisNamen series titles", lineChart);
chartFrame.pack();
chartFrame.setVisible(true);
while (chartFrame.isVisible()) {
More information about the Schmitzm-commits
mailing list