From c13bb289ed4f89a1a9b9b7855148e5cd23b51c5e Mon Sep 17 00:00:00 2001 From: Lycano Date: Wed, 8 Apr 2026 16:00:42 +0200 Subject: [PATCH] JavaDoc --- src/ecoparasite/poisson/Poisson.java | 9 +++++ src/ecoparasite/svg/SVGFactory.java | 58 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/src/ecoparasite/poisson/Poisson.java b/src/ecoparasite/poisson/Poisson.java index f0deeee..97ef6ea 100644 --- a/src/ecoparasite/poisson/Poisson.java +++ b/src/ecoparasite/poisson/Poisson.java @@ -77,6 +77,13 @@ public class Poisson{ this.infestation = infestation; } + /** + * Setter de l'attribut length + * @param length le Double de la nouvelle valeur de la length + */ + public void setLength(Double length) { + this.length = length; + } /** * Setter de l'attribut des parties de poisson. @@ -95,4 +102,6 @@ public class Poisson{ String result = "[ %5s : %4f mm, %4f g, %4f taux d'infestation ]"; return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation() ); } + + } diff --git a/src/ecoparasite/svg/SVGFactory.java b/src/ecoparasite/svg/SVGFactory.java index 0c695d5..d65e2e2 100644 --- a/src/ecoparasite/svg/SVGFactory.java +++ b/src/ecoparasite/svg/SVGFactory.java @@ -1,10 +1,13 @@ package ecoparasite.svg; +import ecoparasite.representation.ValeursXY; import ecoparasite.svg.elements.Element; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.UUID; public class SVGFactory { @@ -73,4 +76,59 @@ public class SVGFactory { } + public static HashMap< String ,HashSet> PointAXES(HashSet h){ + + //Définition initial + HashSet x = new HashSet<>(); + HashSet y = new HashSet<>(); + HashSet offset = new HashSet<>(); + HashMap< String, HashSet > map = new HashMap<>(); + + //Définition des min et max + double max_x = Double.MIN_VALUE; + double min_x = Double.MAX_VALUE; + double max_y = Double.MIN_VALUE; + double min_y = Double.MAX_VALUE; + + //Trouvé les min et max + for (ValeursXY var : h) { + + if (max_x < var.getX()){ + max_x = var.getX(); + } else if (min_x > var.getX()){ + min_x = var.getX(); + } + + if (max_y < var.getY()){ + max_y = var.getY(); + } else if (min_y > var.getY()){ + min_y = var.getY(); + } + + } + + double step_x = (max_x - min_x); //TODO + double step_y = (max_y - min_y); //TODO + + + //TODO + + + return null; + } + + /** + * retourne une valeur arrondi "joli" adapter à un graphique + * @param value + * @param step + * @return + */ + public static double roundMin(double value, double step) { + return Math.floor(value / step) * step; + } + + public static double roundMax(double value, double step) { + return Math.ceil(value / step) * step; + } + }