This is an automated email from the git hooks/post-receive script. New change to branch develop in repository izi-eval. See http://git.codelutin.com/izi-eval.git from 050595b fix config new fb387e7 fixes #7565: échelle dans les graphiques The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit fb387e778334071a5d7e4ebc317b8d2ed5631bd6 Author: Eric Chatellier <chatellier@codelutin.com> Date: Wed Jan 20 18:41:10 2016 +0100 fixes #7565: échelle dans les graphiques Summary of changes: .../inra/masc/services/ImageGeneratorService.java | 2 +- .../fr/inra/masc/services/MascSpiderWebPlot.java | 85 +++++++++++++--------- .../src/main/java/fr/inra/masc/utils/MascUtil.java | 2 +- 3 files changed, 51 insertions(+), 38 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository izi-eval. See http://git.codelutin.com/izi-eval.git commit fb387e778334071a5d7e4ebc317b8d2ed5631bd6 Author: Eric Chatellier <chatellier@codelutin.com> Date: Wed Jan 20 18:41:10 2016 +0100 fixes #7565: échelle dans les graphiques --- .../inra/masc/services/ImageGeneratorService.java | 2 +- .../fr/inra/masc/services/MascSpiderWebPlot.java | 85 +++++++++++++--------- .../src/main/java/fr/inra/masc/utils/MascUtil.java | 2 +- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/masc-api/src/main/java/fr/inra/masc/services/ImageGeneratorService.java b/masc-api/src/main/java/fr/inra/masc/services/ImageGeneratorService.java index 0589e8e..c0e1aa6 100644 --- a/masc-api/src/main/java/fr/inra/masc/services/ImageGeneratorService.java +++ b/masc-api/src/main/java/fr/inra/masc/services/ImageGeneratorService.java @@ -316,7 +316,7 @@ public class ImageGeneratorService extends MascService { for (OptionValue optionValue : optionValuesForCriteria) { if (optionValue != null && optionValue.getValue() != null) { - Double value = (double) (optionValue.getValue() + 1); + Double value = (double) optionValue.getValue(); // FIXME sletellier 20110125: its a hack to solve JFreeChart bug, if we add value 0, no criteria name is displayed... if (value == 0) { diff --git a/masc-api/src/main/java/fr/inra/masc/services/MascSpiderWebPlot.java b/masc-api/src/main/java/fr/inra/masc/services/MascSpiderWebPlot.java index 91ff9c9..f029aed 100644 --- a/masc-api/src/main/java/fr/inra/masc/services/MascSpiderWebPlot.java +++ b/masc-api/src/main/java/fr/inra/masc/services/MascSpiderWebPlot.java @@ -1,5 +1,36 @@ package fr.inra.masc.services; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Composite; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Paint; +import java.awt.Polygon; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.LineMetrics; +import java.awt.geom.Arc2D; +import java.awt.geom.Ellipse2D; +import java.awt.geom.Line2D; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.jfree.chart.plot.DrawingSupplier; +import org.jfree.chart.plot.PlotRenderingInfo; +import org.jfree.chart.plot.PlotState; +import org.jfree.chart.plot.SpiderWebPlot; +import org.jfree.data.category.CategoryDataset; +import org.jfree.data.general.DatasetUtilities; +import org.jfree.ui.RectangleInsets; +import org.jfree.util.TableOrder; + /* * #%L * Masc :: API @@ -33,33 +64,6 @@ import fr.inra.masc.model.Scale; import fr.inra.masc.model.ScaleValue; import fr.inra.masc.utils.MascUtil; -import java.awt.AlphaComposite; -import java.awt.BasicStroke; -import java.awt.Composite; -import java.awt.Font; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Polygon; -import java.awt.Stroke; -import java.awt.font.FontRenderContext; -import java.awt.font.LineMetrics; -import java.awt.geom.Arc2D; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; -import org.jfree.chart.plot.DrawingSupplier; -import org.jfree.chart.plot.PlotRenderingInfo; -import org.jfree.chart.plot.SpiderWebPlot; -import org.jfree.data.category.CategoryDataset; -import org.jfree.util.TableOrder; - public class MascSpiderWebPlot extends SpiderWebPlot { private static final long serialVersionUID = 1L; @@ -145,8 +149,8 @@ public class MascSpiderWebPlot extends SpiderWebPlot { Criteria criteria = criterias.get(cat); Scale scale = criteria.getScale(); Collection<ScaleValue> scaleValues = scale.getScaleValue(); + int size = scaleValues.size() - 1; - int size = scaleValues.size(); Point2D point = this.getWebPoint(plotArea, angle, value / size); @@ -207,8 +211,7 @@ public class MascSpiderWebPlot extends SpiderWebPlot { } // Plot the polygon - int width = 2; - Stroke lineStroke = new BasicStroke(width); + Stroke lineStroke = this.getSeriesOutlineStroke(series); g2.setStroke(lineStroke); Paint paint = this.getSeriesPaint(series); @@ -217,6 +220,16 @@ public class MascSpiderWebPlot extends SpiderWebPlot { } /** + * izi-eval : increase default width to 2 + */ + @Override + public Stroke getSeriesOutlineStroke(int series) { + int width = 2; + Stroke lineStroke = new BasicStroke(width); + return lineStroke; + } + + /** * Draws the label for one axis. * * @param g2 the graphics device. @@ -234,14 +247,14 @@ public class MascSpiderWebPlot extends SpiderWebPlot { String label; if (this.getDataExtractOrder() == TableOrder.BY_ROW) { // if series are in rows, then the categories are the column keys - label = this.getLabelGenerator().generateColumnLabel(this.getDataset(), cat); + label = getLabelGenerator().generateColumnLabel(this.getDataset(), cat); } else { // if series are in columns, then the categories are the row keys - label = this.getLabelGenerator().generateRowLabel(this.getDataset(), cat); + label = getLabelGenerator().generateRowLabel(this.getDataset(), cat); } - Rectangle2D labelBounds = this.getLabelFont().getStringBounds(label, frc); - LineMetrics lm = this.getLabelFont().getLineMetrics(label, frc); + Rectangle2D labelBounds = getLabelFont().getStringBounds(label, frc); + LineMetrics lm = getLabelFont().getLineMetrics(label, frc); double ascent = lm.getAscent(); Arc2D arc1 = new Arc2D.Double(plotArea, startAngle, 0, Arc2D.OPEN); @@ -287,8 +300,8 @@ public class MascSpiderWebPlot extends SpiderWebPlot { g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f)); - g2.setPaint(this.getLabelPaint()); - g2.setFont(this.getLabelFont()); + g2.setPaint(getLabelPaint()); + g2.setFont(getLabelFont()); for (String lbl : labels) { g2.drawString(lbl, (float) labelX, diff --git a/masc-api/src/main/java/fr/inra/masc/utils/MascUtil.java b/masc-api/src/main/java/fr/inra/masc/utils/MascUtil.java index e0f3457..03ff1ac 100644 --- a/masc-api/src/main/java/fr/inra/masc/utils/MascUtil.java +++ b/masc-api/src/main/java/fr/inra/masc/utils/MascUtil.java @@ -389,7 +389,7 @@ public class MascUtil { Collection<ScaleValue> scaleValues = scale.getScaleValue(); int valueMax = 0; if (scaleValues != null) { - valueMax = scaleValues.size(); + valueMax = scaleValues.size() - 1; } return " " + ((int) value) + "/" + valueMax; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm