Tracé des axes

This commit is contained in:
2026-04-27 12:56:24 +02:00
parent 8ac87e9edb
commit 82901f623b
9 changed files with 284 additions and 17 deletions

View File

@@ -16,10 +16,7 @@ public class ElementsFactory {
final public static String COLOR_BLUE = "blue";
final public static String COLOR_BLACK = "black";
/**
* Permet de générer les éléments axes du fichier SVG.
* @return
*/
/*
public static ArrayList<Element> SVGAxes(String HName, String VName ){
final int begin = SVG_OFFSET + AXES_TEXT_SIZE + (AXES_TEXT_SIZE / 2);
@@ -65,4 +62,5 @@ public class ElementsFactory {
return SVGAxes( "None", "None" );
}
*/
}

View File

@@ -2,6 +2,8 @@ package ecoparasite.svg.elements;
import ecoparasite.svg.Coordonnees;
import java.util.Locale;
public class Line extends Element {
private Coordonnees coordonneesB;
@@ -59,7 +61,7 @@ public class Line extends Element {
StringBuilder svg = new StringBuilder();
svg.append("<line ");
String params = String.format( "x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" style=\"stroke:%s;stroke-width:%d\"",
String params = String.format( Locale.US,"x1=\"%f\" y1=\"%f\" x2=\"%f\" y2=\"%f\" style=\"stroke:%s;stroke-width:%d\"",
this.coordonnees.getX(),
this.coordonnees.getY(),
this.coordonneesB.getX(),

View File

@@ -2,6 +2,8 @@ package ecoparasite.svg.elements;
import ecoparasite.svg.Coordonnees;
import java.util.Locale;
public class Text extends Element {
private String text;
@@ -51,7 +53,7 @@ public class Text extends Element {
StringBuilder svg = new StringBuilder();
svg.append("<text ");
String params = String.format( "x=\"%d\" y=\"%d\" fill=\"%s\" font-size=\"%s\"", coordonnees.getX(), coordonnees.getY(), color, size);
String params = String.format(Locale.US,"x=\"%f\" y=\"%f\" fill=\"%s\" font-size=\"%s\"", coordonnees.getX(), coordonnees.getY(), color, size);
svg.append(params);
svg.append(" >");
svg.append( this.text );