Package nu.xom

Examples of nu.xom.Attribute


      try {
        FileSaveService save = (FileSaveService) ServiceManager
            .lookup("javax.jnlp.FileSaveService");

        Element root = new Element("SketchChairDoc");
        root.addAttribute(new Attribute("version", String
            .valueOf(SETTINGS.version)));
        root.appendChild(GLOBAL.sketchChairs.getCurChair().toXML());

        Document doc = new Document(root);
        //   outXML = ;// new FileOutputStream(name+".xml");
View Full Code Here


    String result = "";
    GLOBAL.sketchChairs.getCurChair().cloudID = sharedChairID;
   
   
    Element root = new Element("SketchChairDoc");
    root.addAttribute(new Attribute("version", String
        .valueOf(SETTINGS.version)));

    root.appendChild(GLOBAL.sketchChairs.getCurChair().toXML());
    OutputStream outXML = new ByteArrayOutputStream();
   
View Full Code Here

          .getAttributeValue("materialWidth"));

    if (element.getAttributeValue("scale") != null)
      SETTINGS.scale = Float.valueOf(element.getAttributeValue("scale"));

    element.addAttribute(new Attribute("materialWidth", String
        .valueOf(SETTINGS.materialThickness)));

    element.addAttribute(new Attribute("scale", String
        .valueOf(SETTINGS.scale)));

    for (int i = 0; i < element.getChildCount(); i++) {
      Element child = (Element) element.getChild(i);
View Full Code Here

  public Element toXML() {
    Element element = new Element("SketchChair");

    //cloudID
    // set slat spacing
    element.addAttribute(new Attribute("cloudID", String.valueOf(cloudID)));

    // set slat spacing
    element.addAttribute(new Attribute("slatSpacingX", String
        .valueOf(slatSpacingX)));

    element.addAttribute(new Attribute("materialWidth", String
        .valueOf(SETTINGS.materialThickness)));

    element.addAttribute(new Attribute("scale", String
        .valueOf(SETTINGS.scale)));

    element.appendChild(this.getSlicePlanesY().toXML());
    element.appendChild(crossSliceSelections.toXML());
View Full Code Here

  }

  public nu.xom.Element toXML() {
   
    Element element = new Element("CrossSliceSelection");
    element.addAttribute(new Attribute("path", String.valueOf(this.path
        .getId())));
    element.addAttribute(new Attribute("start", String.valueOf(this.start)));
    element.addAttribute(new Attribute("end", String.valueOf(this.end)));
    element.addAttribute(new Attribute("spacing", String
        .valueOf(this.spacing)));
    element.addAttribute(new Attribute("type", String.valueOf(this.type)));
    element.addAttribute(new Attribute("boarderX", String
        .valueOf(this.boarderX)));
    element.addAttribute(new Attribute("boarderY", String
        .valueOf(this.boarderY)));
    element.addAttribute(new Attribute("slatHeight", String
        .valueOf(this.slatHeight)));
    element.addAttribute(new Attribute("capType", String
        .valueOf(this.capType)));

    if (type == CrossSliceSelection.PLANE
        || type == CrossSliceSelection.PLANE_ON_EDGE
        || type == CrossSliceSelection.SLATSLICES)
      element.addAttribute(new Attribute("teethCount", String
          .valueOf(this.teethCount)));

   
    if(extendLegSliceToTopOfLeg)
      element.addAttribute(new Attribute("extendLegSliceToTopOfLeg", String
          .valueOf(this.extendLegSliceToTopOfLeg)));
   
    if (this.tieToLeg) {
     
     
      element.addAttribute(new Attribute("tieToLeg", String
          .valueOf(this.tieToLeg)));
     
     
      element.addAttribute(new Attribute("legId", String
          .valueOf(this.legSpline.getId())));
     
     
      Element planeElement = new Element("legPlanes");
      for (int i = 0; i < this.tiedToPlanes.size(); i++) {
        SlicePlane curSlice = (SlicePlane)this.tiedToPlanes.get(i);
        Element legPlane = new Element("legPlane");
       
        legPlane.addAttribute(new Attribute("planeId", String
            .valueOf(curSlice.getId())));
       
        planeElement.appendChild(legPlane);

      }
     
      element.appendChild(planeElement);
    }
    if (this.cropToCurrentShape)
      element.addAttribute(new Attribute("constrainToShape", String
          .valueOf(this.cropToCurrentShape)));

    if (this.flipSide)
      element.addAttribute(new Attribute("flipSide", String
          .valueOf(this.flipSide)));

    if (this.generateFlushTops)
      element.addAttribute(new Attribute("generateFlushTops", String
          .valueOf(this.generateFlushTops)));

    if (this.smooth)
      element.addAttribute(new Attribute("smooth", String
          .valueOf(this.smooth)));

    return element;
  }
View Full Code Here



    public Element toXML() {
    Element element = new Element("g","http://www.w3.org/2000/svg");
    element.addAttribute(new Attribute("id","outlines"));       
   
    for (int i = 0; i < this.l.size(); i++) {
      spOutline outline = (spOutline) l.get(i);
      element.appendChild(outline.toXML_SVG());
    }
View Full Code Here

  }
 
  public Element getSVG(PApplet a){
   
    Element patternInfo = new Element("skchptrn","http://www.sketchchair.cc/formats/skchptrn");
    patternInfo.addAttribute(new Attribute("version","0.9"));
    patternInfo.addAttribute(new Attribute("width",materialWidth+"px"));
    patternInfo.addAttribute(new Attribute("height",materialHeight+"px"));
    patternInfo.addAttribute(new Attribute("scale",this.scale+""));
    patternInfo.addAttribute(new Attribute("mm_px","1"));
    patternInfo.addAttribute(new Attribute("designID","0"));
    patternInfo.addAttribute(new Attribute("notes",""));
    patternInfo.addAttribute(new Attribute("materialWidth",""));
    patternInfo.addAttribute(new Attribute("dogbonesAdded",""));
    patternInfo.addAttribute(new Attribute("user",""));

   
    Element root = new Element("svg","http://www.w3.org/2000/svg");
    root.appendChild(patternInfo);

   
   
    root.addAttribute(new Attribute("version","1.1"));
    root.addAttribute(new Attribute("width",materialWidth+"px"));
    root.addAttribute(new Attribute("height",materialHeight+"px"));
    root.addAttribute(new Attribute("style","fill:rgb(0,0,0)"));
    root.appendChild(this.pages.toXML());
   
   
    return root;
   
View Full Code Here

  }

  public nu.xom.Element toXML() {
    Element element = new Element("SlicePlane");

    element.addAttribute(new Attribute("id", String.valueOf(this.getId())));

   
    if (this.guide)
      element.addAttribute(new Attribute("guide", String
          .valueOf(this.guide)));

    Element plane = new Element("Plane");
   

    plane.addAttribute(new Attribute("x", String.valueOf(this.getPlane().x)));
    plane.addAttribute(new Attribute("y", String.valueOf(this.getPlane().y)));
    plane.addAttribute(new Attribute("z", String.valueOf(this.getPlane().z)));

    plane.addAttribute(new Attribute("nx",
        String.valueOf(this.getPlane().normal.x)));
    plane.addAttribute(new Attribute("ny",
        String.valueOf(this.getPlane().normal.y)));
    plane.addAttribute(new Attribute("nz",
        String.valueOf(this.getPlane().normal.z)));

    element.appendChild(plane);
    element.appendChild(getSketch().toXML());
View Full Code Here

  }

  public Element toXML() {
    Element element = new Element("SketchPath");

    element.addAttribute(new Attribute("id", String.valueOf(this.getId())));

    if (isConstructionLine())
      element.addAttribute(new Attribute("isConstructionLine", "true"));

    if (this.getClosed())
      element.addAttribute(new Attribute("closed", "true"));
    else
      element.addAttribute(new Attribute("closed", "false"));

    element.addAttribute(new Attribute("isConstructionLine", "true"));

    element.addAttribute(new Attribute("union", String.valueOf(this.union)));

    for (int i = 0; i < this.l.size(); i++) {
      SketchPoint point = this.l.get(i);
      element.appendChild(point.toXML());
    }
View Full Code Here

     
    }
   
    svgString += " Z";
   
    element.addAttribute(new Attribute("d", svgString));


    return element;
  }
View Full Code Here

TOP

Related Classes of nu.xom.Attribute

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.