Package fr.dz.swan.balises.types

Examples of fr.dz.swan.balises.types.SVGLength


  public BaliseGraphic(String name) {
    super(name);
    attributes.put("fill",new SVGColor((Color)null));// normalement pas svgcolor mais svgpaint
    attributes.put("stroke",new SVGColor(Color.black)); // idem
    attributes.put("stroke-width",new SVGLength(0.0));
   
  }
View Full Code Here


  public void paint(Graphics2D g) {

    Color oldColor = g.getColor();
    Stroke oldStroke = g.getStroke();
   
    SVGLength strokeWidth=(SVGLength)attributes.get("stroke-width");
    SVGColor stroke=(SVGColor)attributes.get("stroke");
    SVGColor fill=(SVGColor)attributes.get("fill");

    Shape s =getShape();
   
   

    if(fill.getValue()!=null){
      g.setColor(fill.getValue());
      g.fill(s);
    }
    if(stroke.getValue()!=null){
      Stroke bs = new BasicStroke(strokeWidth.getValue().floatValue(),BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER);
      g.setStroke(bs);
      g.setColor(stroke.getValue());
      g.draw(s);
    }
View Full Code Here

*/
public class Rect extends BaliseGraphic {

    public Rect() {
        super("rect");
        attributes.put("width", new SVGLength(0.0));
        attributes.put("height", new SVGLength(0.0));
        attributes.put("x", new SVGCoordinate(0.0));
        attributes.put("y", new SVGCoordinate(0.0));
        attributes.put("rx", new SVGLength(0.0));
        attributes.put("ry", new SVGLength(0.0));
    }
View Full Code Here

   
    @Override
    public Shape getShape() {
   
        SVGLength width =(SVGLength) attributes.get("width");
        SVGLength height =(SVGLength)attributes.get("height");
        SVGCoordinate x =(SVGCoordinate)attributes.get("x");
        SVGCoordinate y =(SVGCoordinate)attributes.get("y");
        SVGLength rx =(SVGLength)attributes.get("rx");
        SVGLength ry =(SVGLength)attributes.get("ry");
       
       
        return new RoundRectangle2D.Double(x.getValue(), y.getValue(), width.getValue(), height.getValue(),rx.getValue(),ry.getValue());
    }
View Full Code Here

TOP

Related Classes of fr.dz.swan.balises.types.SVGLength

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.