"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ColorScaleXform = 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 ColorScaleXform 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 "colorScale";
    }
    render(xmlStream, model) {
        xmlStream.openNode(this.tag);
        model.cfvo.forEach((cfvo) => {
            this.cfvoXform.render(xmlStream, cfvo);
        });
        model.color.forEach((color) => {
            this.colorXform.render(xmlStream, color);
        });
        xmlStream.closeNode();
    }
    createNewModel(node) {
        return {
            cfvo: [],
            color: []
        };
    }
    onParserClose(name, parser) {
        this.model[name].push(parser.model);
    }
}
exports.ColorScaleXform = ColorScaleXform;
