all files / graphics/figures/base/ element-layouter.js

74.29% Statements 52/70
30% Branches 3/10
73.33% Functions 22/30
74.29% Lines 52/70
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154       1781×                                                                                             28×     28×               12×                             49×               28×                                              
define(["require", "exports", "./../../../drawing/pdf-drawing"], function (require, exports, pdf_drawing_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ElementLayouter = (function () {
        function ElementLayouter(element) {
            this.layoutElement = element;
        }
        Object.defineProperty(ElementLayouter.prototype, "elements", {
            get: function () {
                return this.layoutElement;
            },
            enumerable: true,
            configurable: true
        });
        ElementLayouter.prototype.getElement = function () {
            return this.layoutElement;
        };
        ElementLayouter.prototype.layout = function (param) {
            return this.layoutInternal(param);
        };
        ElementLayouter.prototype.Layouter = function (param) {
            return this.layoutInternal(param);
        };
        ElementLayouter.prototype.getNextPage = function (currentPage) {
            var section = currentPage.section;
            var nextPage = section.add();
            return nextPage;
        };
        ElementLayouter.prototype.getPaginateBounds = function (param) {
            if ((param == null)) {
                throw new Error('ArgumentNullException : param');
            }
            var result = param.format.usePaginateBounds ? param.format.paginateBounds
                : new pdf_drawing_1.RectangleF(param.bounds.x, 0, param.bounds.width, param.bounds.height);
            return result;
        };
        return ElementLayouter;
    }());
    exports.ElementLayouter = ElementLayouter;
    var PdfLayoutFormat = (function () {
        function PdfLayoutFormat(baseFormat) {
            Eif (typeof baseFormat === 'undefined') {
            }
            else {
                this.break = baseFormat.break;
                this.layout = baseFormat.layout;
                this.paginateBounds = baseFormat.paginateBounds;
                this.boundsSet = baseFormat.usePaginateBounds;
            }
        }
        Object.defineProperty(PdfLayoutFormat.prototype, "layout", {
            get: function () {
                return this.layoutType;
            },
            set: function (value) {
                this.layoutType = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutFormat.prototype, "break", {
            get: function () {
                return this.breakType;
            },
            set: function (value) {
                this.breakType = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutFormat.prototype, "paginateBounds", {
            get: function () {
                Iif (typeof this.layoutPaginateBounds === 'undefined' && this.layoutPaginateBounds == null) {
                    this.layoutPaginateBounds = new pdf_drawing_1.RectangleF(0, 0, 0, 0);
                }
                return this.layoutPaginateBounds;
            },
            set: function (value) {
                this.layoutPaginateBounds = value;
                this.boundsSet = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutFormat.prototype, "usePaginateBounds", {
            get: function () {
                return this.boundsSet;
            },
            enumerable: true,
            configurable: true
        });
        return PdfLayoutFormat;
    }());
    exports.PdfLayoutFormat = PdfLayoutFormat;
    var PdfLayoutParams = (function () {
        function PdfLayoutParams() {
        }
        Object.defineProperty(PdfLayoutParams.prototype, "page", {
            get: function () {
                return this.pdfPage;
            },
            set: function (value) {
                this.pdfPage = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutParams.prototype, "bounds", {
            get: function () {
                return new pdf_drawing_1.RectangleF(this.layoutBounds.x, this.layoutBounds.y, this.layoutBounds.width, this.layoutBounds.height);
            },
            set: function (value) {
                this.layoutBounds = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutParams.prototype, "format", {
            get: function () {
                return this.layoutFormat;
            },
            set: function (value) {
                this.layoutFormat = value;
            },
            enumerable: true,
            configurable: true
        });
        return PdfLayoutParams;
    }());
    exports.PdfLayoutParams = PdfLayoutParams;
    var PdfLayoutResult = (function () {
        function PdfLayoutResult(page, bounds) {
            this.pdfPage = page;
            this.layoutBounds = bounds;
        }
        Object.defineProperty(PdfLayoutResult.prototype, "page", {
            get: function () {
                return this.pdfPage;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfLayoutResult.prototype, "bounds", {
            get: function () {
                return this.layoutBounds;
            },
            enumerable: true,
            configurable: true
        });
        return PdfLayoutResult;
    }());
    exports.PdfLayoutResult = PdfLayoutResult;
});