X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Fraster%2Fshapes%2Fcomposite%2FGraph.java;h=cc37b85cc0340af265b4c4d71d6aa57a330a167f;hb=197ac1b87328bb5b06ba52d3768af04b2007b087;hp=674c1e33475f01346e02b5239aba1ca74436bc93;hpb=baab2e2c2ad89695293f3136311c585c9a5afed1;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java index 674c1e3..cc37b85 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java @@ -1,10 +1,8 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. + * Sixth 3D engine. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. * +* */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite; @@ -17,7 +15,6 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.Line; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas; -import java.io.IOException; import java.util.List; public class Graph extends AbstractCompositeShape { @@ -32,7 +29,7 @@ public class Graph extends AbstractCompositeShape { private final Color plotColor; public Graph(final double scale, final List data, - final String label, final Point3D location) throws IOException { + final String label, final Point3D location) { super(location); width = 20; @@ -49,7 +46,7 @@ public class Graph extends AbstractCompositeShape { plotColor = new Color(255, 0, 0, 100); addVerticalLines(scale); - addXlabels(scale); + addXLabels(scale); addHorizontalLinesAndLabels(scale); plotData(scale, data); @@ -62,8 +59,7 @@ public class Graph extends AbstractCompositeShape { addShape(labelCanvas); } - public void addHorizontalLinesAndLabels(final double scale) - throws IOException { + private void addHorizontalLinesAndLabels(final double scale) { for (double y = yMin; y <= yMax; y += verticalStep) { final Point3D p1 = new Point3D(0, y, 0).scaleUp(scale); @@ -86,7 +82,7 @@ public class Graph extends AbstractCompositeShape { } } - public void addVerticalLines(final double scale) { + private void addVerticalLines(final double scale) { for (double x = 0; x <= width; x += horizontalStep) { final Point3D p1 = new Point3D(x, yMin, 0).scaleUp(scale); @@ -99,7 +95,7 @@ public class Graph extends AbstractCompositeShape { } } - public void addXlabels(final double scale) throws IOException { + private void addXLabels(final double scale) { for (double x = 0; x <= width; x += horizontalStep * 2) { final Point3D labelLocation = new Point3D(x, yMin - 0.4, 0) .scaleUp(scale); @@ -112,7 +108,7 @@ public class Graph extends AbstractCompositeShape { } } - public void plotData(final double scale, final List data) { + private void plotData(final double scale, final List data) { Point3D previousPoint = null; for (final Point2D point : data) {