let JV = require('../jpc_value_define');
let JpcCommonOutputHelper = require('./jpc_helper_common_output');
let JpcAreaHelper = require('./jpc_helper_area');

let JpcTextHelper = {
    outputText: function (textNode, band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx) {
        let rst = JpcCommonOutputHelper.createCommonOutput(textNode, textNode[JV.PROP_LABEL], null);
        //position
        rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(textNode[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx, false, false);
        return rst;
    },
    outputDirectValue: function (textNode, value, band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx) {
        let rst = JpcCommonOutputHelper.createCommonOutput(textNode, value, null);
        //position
        rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(textNode[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx, false, false);
        return rst;
    }
};

module.exports = JpcTextHelper;