Package org.tools.xml

Examples of org.tools.xml.Node.addAttribute()


        JTextComponent[] components = {importmapTextField, scenarioTextField, titleTextField, nationNamesTextField, nationColorsTextField, provinceReplacementsTextField};

        for (JTextComponent component : components) {
            Node child = new Node("Component-" + component.getName());
            // child.appendChild(component.getText());
            child.addAttribute("content", component.getText());
            parent.appendChild(child);
        }
        try {
            XMLHelper.write(resource, parent);
        } catch (IOException ex) {
View Full Code Here


     *
     * @return
     */
    public static Node createUnits() {
        Node parent = new Node("Unit-Overlays");
        parent.addAttribute("base", "units");
        parent.appendChild(addUnitTile("infantry", "stand", "infantry.stand.png"));
        parent.appendChild(addUnitTile("infantry", "shoot", "infantry.shoot.png"));
        parent.appendChild(addUnitTile("infantry", "charge", "infantry.charge.png"));
        return parent;
    }
View Full Code Here

     * @param location
     * @return
     */
    public static Node addUnitTile(String type, String action, String location) {
        Node child = new Node("Unit");
        child.addAttribute("type", type);
        child.addAttribute("action", action);
        child.addAttribute("location", location);
        return child;
    }

View Full Code Here

     * @return
     */
    public static Node addUnitTile(String type, String action, String location) {
        Node child = new Node("Unit");
        child.addAttribute("type", type);
        child.addAttribute("action", action);
        child.addAttribute("location", location);
        return child;
    }

    /**
 
View Full Code Here

     */
    public static Node addUnitTile(String type, String action, String location) {
        Node child = new Node("Unit");
        child.addAttribute("type", type);
        child.addAttribute("action", action);
        child.addAttribute("location", location);
        return child;
    }

    /**
     *
 
View Full Code Here

     * @param location
     * @return
     */
    public static Node addMiscTile(String id, String location) {
        Node child = new Node("Overlay");
        child.addAttribute("id", id);
        child.addAttribute("location", location);
        return child;
    }

    /**
 
View Full Code Here

     * @return
     */
    public static Node addMiscTile(String id, String location) {
        Node child = new Node("Overlay");
        child.addAttribute("id", id);
        child.addAttribute("location", location);
        return child;
    }

    /**
     *
 
View Full Code Here

     *
     * @throws IOException
     */
    public static Node createResources() {
        Node parent = new Node("Resource-Overlays");
        parent.addAttribute("base", "resources");
        parent.appendChild(addResourceOverlay(1, "resource.grain.inner.png", "resource.grain.outer.png"));
        parent.appendChild(addResourceOverlay(2, "resource.orchard.inner.png", "resource.orchard.outer.png"));
        parent.appendChild(addResourceOverlay(3, "resource.buffalo.inner.png", "resource.buffalo.outer.png"));
        parent.appendChild(addResourceOverlay(4, "resource.cotton.inner.png", "resource.cotton.outer.png"));
        parent.appendChild(addResourceOverlay(5, "resource.sheep.inner.png", "resource.sheep.outer.png"));
View Full Code Here

     * @param visible
     * @return
     */
    public static Node addResourceOverlay(int id, String inner, String outer) {
        Node child = new Node("Overlay");
        child.addAttribute("id", String.valueOf(id));
        child.addAttribute("inner", inner);
        if (outer != null) {
            child.addAttribute("outer", outer);
        }
        return child;
View Full Code Here

     * @return
     */
    public static Node addResourceOverlay(int id, String inner, String outer) {
        Node child = new Node("Overlay");
        child.addAttribute("id", String.valueOf(id));
        child.addAttribute("inner", inner);
        if (outer != null) {
            child.addAttribute("outer", outer);
        }
        return child;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.