"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabarXform = void 0;
const composite_xform_1 = require("../../composite-xform.js");
const color_xform_1 = require("../../style/color-xform.js");
const cfvo_xform_1 = require("./cfvo-xform.js");
class DatabarXform extends composite_xform_1.CompositeXform {
    constructor() {
        super();
        this.map = {
            cfvo: (this.cfvoXform = new cfvo_xform_1.CfvoXform()),
            color: (this.colorXform = new color_xform_1.ColorXform())
        };
    }
    get tag() {
        return "dataBar";
    }
    render(xmlStream, model) {
        xmlStream.openNode(this.tag);
        model.cfvo.forEach((cfvo) => {
            this.cfvoXform.render(xmlStream, cfvo);
        });
        this.colorXform.render(xmlStream, model.color);
        xmlStream.closeNode();
    }
    createNewModel() {
        return {
            cfvo: []
        };
    }
    onParserClose(name, parser) {
        switch (name) {
            case "cfvo":
                this.model.cfvo.push(parser.model);
                break;
            case "color":
                this.model.color = parser.model;
                break;
        }
    }
}
exports.DatabarXform = DatabarXform;
