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=7af3eab57bfaeba18756b0e862f573e29746ab81;hb=a3ff3683bd0a025061667b26b6fcf56fe20f0afc;hp=38dbf2745692498d4c4979e89ccfa104ae2aab08;hpb=6213716671ccab6b7256de41838e1f5401ce173c;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 38dbf27..7af3eab 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,23 +1,17 @@ /* - * Sixth - System for data storage, computation, exploration and interaction. - * Copyright ©2012-2016, 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; import eu.svjatoslav.sixth.e3d.geometry.Point2D; import eu.svjatoslav.sixth.e3d.geometry.Point3D; -import eu.svjatoslav.sixth.e3d.geometry.Transform; +import eu.svjatoslav.sixth.e3d.math.Transform; import eu.svjatoslav.sixth.e3d.renderer.raster.Color; 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 +26,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 +43,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 +56,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 +79,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 +92,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 +105,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) {