Tracé des axes
This commit is contained in:
@@ -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" );
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
@@ -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(),
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user