BaseField.java

1
/*
2
 * Copyright 2005 by Paulo Soares.
3
 *
4
 * The contents of this file are subject to the Mozilla Public License Version 1.1
5
 * (the "License"); you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
7
 *
8
 * Software distributed under the License is distributed on an "AS IS" basis,
9
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10
 * for the specific language governing rights and limitations under the License.
11
 *
12
 * The Original Code is 'iText, a free JAVA-PDF library'.
13
 *
14
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
15
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
16
 * All Rights Reserved.
17
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
18
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
19
 *
20
 * Contributor(s): all the names of the contributors are added in the source code
21
 * where applicable.
22
 *
23
 * Alternatively, the contents of this file may be used under the terms of the
24
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
25
 * provisions of LGPL are applicable instead of those above.  If you wish to
26
 * allow use of your version of this file only under the terms of the LGPL
27
 * License and not to allow others to use your version of this file under
28
 * the MPL, indicate your decision by deleting the provisions above and
29
 * replace them with the notice and other provisions required by the LGPL.
30
 * If you do not delete the provisions above, a recipient may use your version
31
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
32
 *
33
 * This library is free software; you can redistribute it and/or modify it
34
 * under the terms of the MPL as stated above or under the terms of the GNU
35
 * Library General Public License as published by the Free Software Foundation;
36
 * either version 2 of the License, or any later version.
37
 *
38
 * This library is distributed in the hope that it will be useful, but WITHOUT
39
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
40
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
41
 * details.
42
 *
43
 * If you didn't download this code from the following link, you should check if
44
 * you aren't using an obsolete version:
45
 * http://www.lowagie.com/iText/
46
 */
47
48
package com.lowagie.text.pdf;
49
50
import java.awt.Color;
51
import java.io.IOException;
52
import java.util.*;
53
54
import com.lowagie.text.error_messages.MessageLocalization;
55
56
import com.lowagie.text.DocumentException;
57
import com.lowagie.text.Element;
58
import com.lowagie.text.Rectangle;
59
60
/** Common field variables.
61
 * @author Paulo Soares (psoares@consiste.pt)
62
 */
63
public abstract class BaseField {
64
65
    /** A thin border with 1 point width. */
66
    public static final float BORDER_WIDTH_THIN = 1;
67
    /** A medium border with 2 point width. */
68
    public static final float BORDER_WIDTH_MEDIUM = 2;
69
    /** A thick border with 3 point width. */
70
    public static final float BORDER_WIDTH_THICK = 3;
71
    /** The field is visible. */
72
    public static final int VISIBLE = 0;
73
    /** The field is hidden. */
74
    public static final int HIDDEN = 1;
75
    /** The field is visible but does not print. */
76
    public static final int VISIBLE_BUT_DOES_NOT_PRINT = 2;
77
    /** The field is hidden but is printable. */
78
    public static final int HIDDEN_BUT_PRINTABLE = 3;
79
    /** The user may not change the value of the field. */
80
    public static final int READ_ONLY = PdfFormField.FF_READ_ONLY;
81
    /** The field must have a value at the time it is exported by a submit-form
82
     * action.
83
     */
84
    public static final int REQUIRED = PdfFormField.FF_REQUIRED;
85
    /** The field may contain multiple lines of text.
86
     * This flag is only meaningful with text fields.
87
     */
88
    public static final int MULTILINE = PdfFormField.FF_MULTILINE;
89
    /** The field will not scroll (horizontally for single-line
90
     * fields, vertically for multiple-line fields) to accommodate more text
91
     * than will fit within its annotation rectangle. Once the field is full, no
92
     * further text will be accepted.
93
     */
94
    public static final int DO_NOT_SCROLL = PdfFormField.FF_DONOTSCROLL;
95
    /** The field is intended for entering a secure password that should
96
     * not be echoed visibly to the screen.
97
     */
98
    public static final int PASSWORD = PdfFormField.FF_PASSWORD;
99
    /** The text entered in the field represents the pathname of
100
     * a file whose contents are to be submitted as the value of the field.
101
     */
102
    public static final int FILE_SELECTION = PdfFormField.FF_FILESELECT;
103
    /** The text entered in the field will not be spell-checked.
104
     * This flag is meaningful only in text fields and in combo
105
     * fields with the <CODE>EDIT</CODE> flag set.
106
     */
107
    public static final int DO_NOT_SPELL_CHECK = PdfFormField.FF_DONOTSPELLCHECK;
108
    /** If set the combo box includes an editable text box as well as a drop list; if
109
     * clear, it includes only a drop list.
110
     * This flag is only meaningful with combo fields.
111
     */
112
    public static final int EDIT = PdfFormField.FF_EDIT;
113
114
    /** whether or not a list may have multiple selections.  Only applies to /CH LIST
115
     * fields, not combo boxes.
116
     */
117
    public static final int MULTISELECT = PdfFormField.FF_MULTISELECT;
118
119
    /**
120
     * combo box flag.
121
     */
122
    public static final int COMB = PdfFormField.FF_COMB;
123
124
    protected float borderWidth = BORDER_WIDTH_THIN;
125
    protected int borderStyle = PdfBorderDictionary.STYLE_SOLID;
126
    protected Color borderColor;
127
    protected Color backgroundColor;
128
    protected Color textColor;
129
    protected BaseFont font;
130
    protected float fontSize = 0;
131
    protected int alignment = Element.ALIGN_LEFT;
132
    protected PdfWriter writer;
133
    protected String text;
134
    protected Rectangle box;
135
136
    /** Holds value of property rotation. */
137
    protected int rotation = 0;
138
139
    /** Holds value of property visibility. */
140
    protected int visibility;
141
142
    /** Holds value of property fieldName. */
143
    protected String fieldName;
144
145
    /** Holds value of property options. */
146
    protected int options;
147
148
    /** Holds value of property maxCharacterLength. */
149
    protected int maxCharacterLength;
150
151
    private final static Map<PdfName, Integer> fieldKeys = new HashMap<>();
152
153
    static {
154
        fieldKeys.putAll(PdfCopyFieldsImp.fieldKeys);
155
        fieldKeys.put(PdfName.T, 1);
156
    }
157
    /** Creates a new <CODE>TextField</CODE>.
158
     * @param writer the document <CODE>PdfWriter</CODE>
159
     * @param box the field location and dimensions
160
     * @param fieldName the field name. If <CODE>null</CODE> only the widget keys
161
     * will be included in the field allowing it to be used as a kid field.
162
     */
163
    public BaseField(PdfWriter writer, Rectangle box, String fieldName) {
164
        this.writer = writer;
165 1 1. : removed call to com/lowagie/text/pdf/BaseField::setBox → NO_COVERAGE
        setBox(box);
166
        this.fieldName = fieldName;
167
    }
168
169
    protected BaseFont getRealFont() throws IOException, DocumentException {
170 1 1. getRealFont : negated conditional → NO_COVERAGE
        if (font == null)
171 1 1. getRealFont : mutated return of Object value for com/lowagie/text/pdf/BaseField::getRealFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, false);
172
        else
173 1 1. getRealFont : mutated return of Object value for com/lowagie/text/pdf/BaseField::getRealFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return font;
174
    }
175
176
    protected PdfAppearance getBorderAppearance() {
177
        PdfAppearance app = PdfAppearance.createAppearance(writer, box.getWidth(), box.getHeight());
178
        switch (rotation) {
179
            case 90:
180 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE
                app.setMatrix(0, 1, -1, 0, box.getHeight(), 0);
181
                break;
182
            case 180:
183 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE
                app.setMatrix(-1, 0, 0, -1, box.getWidth(), box.getHeight());
184
                break;
185
            case 270:
186 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE
                app.setMatrix(0, -1, 1, 0, 0, box.getWidth());
187
                break;
188
        }
189 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::saveState → NO_COVERAGE
        app.saveState();
190
        // background
191 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
        if (backgroundColor != null) {
192 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE
            app.setColorFill(backgroundColor);
193 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE
            app.rectangle(0, 0, box.getWidth(), box.getHeight());
194 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE
            app.fill();
195
        }
196
        // border
197 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
        if (borderStyle == PdfBorderDictionary.STYLE_UNDERLINE) {
198 2 1. getBorderAppearance : negated conditional → NO_COVERAGE
2. getBorderAppearance : negated conditional → NO_COVERAGE
            if (borderWidth != 0 && borderColor != null) {
199 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE
                app.setColorStroke(borderColor);
200 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE
                app.setLineWidth(borderWidth);
201 2 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE
                app.moveTo(0, borderWidth / 2);
202 2 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
                app.lineTo(box.getWidth(), borderWidth / 2);
203 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE
                app.stroke();
204
            }
205
        }
206 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
        else if (borderStyle == PdfBorderDictionary.STYLE_BEVELED) {
207 2 1. getBorderAppearance : negated conditional → NO_COVERAGE
2. getBorderAppearance : negated conditional → NO_COVERAGE
            if (borderWidth != 0 && borderColor != null) {
208 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE
                app.setColorStroke(borderColor);
209 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE
                app.setLineWidth(borderWidth);
210 5 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
3. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
4. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
5. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE
                app.rectangle(borderWidth / 2, borderWidth / 2, box.getWidth() - borderWidth, box.getHeight() - borderWidth);
211 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE
                app.stroke();
212
            }
213
            // beveled
214
            Color actual = backgroundColor;
215 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
            if (actual == null)
216
                actual = Color.white;
217 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE
            app.setGrayFill(1);
218 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/BaseField::drawTopFrame → NO_COVERAGE
            drawTopFrame(app);
219 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE
            app.setColorFill(actual.darker());
220 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/BaseField::drawBottomFrame → NO_COVERAGE
            drawBottomFrame(app);
221
        }
222 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
        else if (borderStyle == PdfBorderDictionary.STYLE_INSET) {
223 2 1. getBorderAppearance : negated conditional → NO_COVERAGE
2. getBorderAppearance : negated conditional → NO_COVERAGE
            if (borderWidth != 0 && borderColor != null) {
224 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE
                app.setColorStroke(borderColor);
225 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE
                app.setLineWidth(borderWidth);
226 5 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
3. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
4. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
5. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE
                app.rectangle(borderWidth / 2, borderWidth / 2, box.getWidth() - borderWidth, box.getHeight() - borderWidth);
227 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE
                app.stroke();
228
            }
229
            // inset
230 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE
            app.setGrayFill(0.5f);
231 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/BaseField::drawTopFrame → NO_COVERAGE
            drawTopFrame(app);
232 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE
            app.setGrayFill(0.75f);
233 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/BaseField::drawBottomFrame → NO_COVERAGE
            drawBottomFrame(app);
234
        }
235
        else {
236 2 1. getBorderAppearance : negated conditional → NO_COVERAGE
2. getBorderAppearance : negated conditional → NO_COVERAGE
            if (borderWidth != 0 && borderColor != null) {
237 1 1. getBorderAppearance : negated conditional → NO_COVERAGE
                if (borderStyle == PdfBorderDictionary.STYLE_DASHED)
238 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setLineDash → NO_COVERAGE
                    app.setLineDash(3, 0);
239 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE
                app.setColorStroke(borderColor);
240 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE
                app.setLineWidth(borderWidth);
241 5 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
3. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
4. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
5. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE
                app.rectangle(borderWidth / 2, borderWidth / 2, box.getWidth() - borderWidth, box.getHeight() - borderWidth);
242 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE
                app.stroke();
243 4 1. getBorderAppearance : changed conditional boundary → NO_COVERAGE
2. getBorderAppearance : Replaced bitwise AND with OR → NO_COVERAGE
3. getBorderAppearance : negated conditional → NO_COVERAGE
4. getBorderAppearance : negated conditional → NO_COVERAGE
                if ((options & COMB) != 0 && maxCharacterLength > 1) {
244 1 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
                    float step = box.getWidth() / maxCharacterLength;
245 1 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
                    float yb = borderWidth / 2;
246 2 1. getBorderAppearance : Replaced float division with multiplication → NO_COVERAGE
2. getBorderAppearance : Replaced float subtraction with addition → NO_COVERAGE
                    float yt = box.getHeight() - borderWidth / 2;
247 3 1. getBorderAppearance : changed conditional boundary → NO_COVERAGE
2. getBorderAppearance : Changed increment from 1 to -1 → NO_COVERAGE
3. getBorderAppearance : negated conditional → NO_COVERAGE
                    for (int k = 1; k < maxCharacterLength; ++k) {
248 1 1. getBorderAppearance : Replaced float multiplication with division → NO_COVERAGE
                        float x = step * k;
249 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE
                        app.moveTo(x, yb);
250 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
                        app.lineTo(x, yt);
251
                    }
252 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE
                    app.stroke();
253
                }
254
            }
255
        }
256 1 1. getBorderAppearance : removed call to com/lowagie/text/pdf/PdfAppearance::restoreState → NO_COVERAGE
        app.restoreState();
257 1 1. getBorderAppearance : mutated return of Object value for com/lowagie/text/pdf/BaseField::getBorderAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return app;
258
    }
259
260
    protected static List<String> getHardBreaks(String text) {
261
        List<String> arr = new ArrayList<>();
262
        char[] cs = text.toCharArray();
263
        int len = cs.length;
264
        StringBuffer buf = new StringBuffer();
265 3 1. getHardBreaks : changed conditional boundary → NO_COVERAGE
2. getHardBreaks : Changed increment from 1 to -1 → NO_COVERAGE
3. getHardBreaks : negated conditional → NO_COVERAGE
        for (int k = 0; k < len; ++k) {
266
            char c = cs[k];
267 1 1. getHardBreaks : negated conditional → NO_COVERAGE
            if (c == '\r') {
268 5 1. getHardBreaks : changed conditional boundary → NO_COVERAGE
2. getHardBreaks : Replaced integer addition with subtraction → NO_COVERAGE
3. getHardBreaks : Replaced integer addition with subtraction → NO_COVERAGE
4. getHardBreaks : negated conditional → NO_COVERAGE
5. getHardBreaks : negated conditional → NO_COVERAGE
                if (k + 1 < len && cs[k + 1] == '\n')
269 1 1. getHardBreaks : Changed increment from 1 to -1 → NO_COVERAGE
                    ++k;
270
                arr.add(buf.toString());
271
                buf = new StringBuffer();
272
            }
273 1 1. getHardBreaks : negated conditional → NO_COVERAGE
            else if (c == '\n') {
274
                arr.add(buf.toString());
275
                buf = new StringBuffer();
276
            }
277
            else
278
                buf.append(c);
279
        }
280
        arr.add(buf.toString());
281 1 1. getHardBreaks : mutated return of Object value for com/lowagie/text/pdf/BaseField::getHardBreaks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return arr;
282
    }
283
284
    protected static void trimRight(StringBuffer buf) {
285
        int len = buf.length();
286
        while (true) {
287 1 1. trimRight : negated conditional → NO_COVERAGE
            if (len == 0)
288
                return;
289 2 1. trimRight : Changed increment from -1 to 1 → NO_COVERAGE
2. trimRight : negated conditional → NO_COVERAGE
            if (buf.charAt(--len) != ' ')
290
                return;
291 1 1. trimRight : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
            buf.setLength(len);
292
        }
293
    }
294
295
    protected static List<String> breakLines(ArrayList breaks, BaseFont font, float fontSize, float width) {
296
        List<String> lines = new ArrayList<>();
297
        StringBuffer buf = new StringBuffer();
298
        for (Object aBreak : breaks) {
299 1 1. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
            buf.setLength(0);
300
            float w = 0;
301
            char[] cs = ((String) aBreak).toCharArray();
302
            int len = cs.length;
303
            // 0 inline first, 1 inline, 2 spaces
304
            int state = 0;
305
            int lastspace = -1;
306
            char c = 0;
307
            int refk = 0;
308 3 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : Changed increment from 1 to -1 → NO_COVERAGE
3. breakLines : negated conditional → NO_COVERAGE
            for (int k = 0; k < len; ++k) {
309
                c = cs[k];
310
                switch (state) {
311
                    case 0:
312 1 1. breakLines : Replaced float addition with subtraction → NO_COVERAGE
                        w += font.getWidthPoint(c, fontSize);
313
                        buf.append(c);
314 2 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : negated conditional → NO_COVERAGE
                        if (w > width) {
315
                            w = 0;
316 2 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : negated conditional → NO_COVERAGE
                            if (buf.length() > 1) {
317 1 1. breakLines : Changed increment from -1 to 1 → NO_COVERAGE
                                --k;
318 2 1. breakLines : Replaced integer subtraction with addition → NO_COVERAGE
2. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                                buf.setLength(buf.length() - 1);
319
                            }
320
                            lines.add(buf.toString());
321 1 1. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                            buf.setLength(0);
322
                            refk = k;
323 1 1. breakLines : negated conditional → NO_COVERAGE
                            if (c == ' ')
324
                                state = 2;
325
                            else
326
                                state = 1;
327
                        } else {
328 1 1. breakLines : negated conditional → NO_COVERAGE
                            if (c != ' ')
329
                                state = 1;
330
                        }
331
                        break;
332
                    case 1:
333 1 1. breakLines : Replaced float addition with subtraction → NO_COVERAGE
                        w += font.getWidthPoint(c, fontSize);
334
                        buf.append(c);
335 1 1. breakLines : negated conditional → NO_COVERAGE
                        if (c == ' ')
336
                            lastspace = k;
337 2 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : negated conditional → NO_COVERAGE
                        if (w > width) {
338
                            w = 0;
339 2 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : negated conditional → NO_COVERAGE
                            if (lastspace >= 0) {
340
                                k = lastspace;
341 2 1. breakLines : Replaced integer subtraction with addition → NO_COVERAGE
2. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                                buf.setLength(lastspace - refk);
342 1 1. breakLines : removed call to com/lowagie/text/pdf/BaseField::trimRight → NO_COVERAGE
                                trimRight(buf);
343
                                lines.add(buf.toString());
344 1 1. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                                buf.setLength(0);
345
                                refk = k;
346
                                lastspace = -1;
347
                                state = 2;
348
                            } else {
349 2 1. breakLines : changed conditional boundary → NO_COVERAGE
2. breakLines : negated conditional → NO_COVERAGE
                                if (buf.length() > 1) {
350 1 1. breakLines : Changed increment from -1 to 1 → NO_COVERAGE
                                    --k;
351 2 1. breakLines : Replaced integer subtraction with addition → NO_COVERAGE
2. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                                    buf.setLength(buf.length() - 1);
352
                                }
353
                                lines.add(buf.toString());
354 1 1. breakLines : removed call to java/lang/StringBuffer::setLength → NO_COVERAGE
                                buf.setLength(0);
355
                                refk = k;
356 1 1. breakLines : negated conditional → NO_COVERAGE
                                if (c == ' ')
357
                                    state = 2;
358
                            }
359
                        }
360
                        break;
361
                    case 2:
362 1 1. breakLines : negated conditional → NO_COVERAGE
                        if (c != ' ') {
363
                            w = 0;
364 1 1. breakLines : Changed increment from -1 to 1 → NO_COVERAGE
                            --k;
365
                            state = 1;
366
                        }
367
                        break;
368
                }
369
            }
370 1 1. breakLines : removed call to com/lowagie/text/pdf/BaseField::trimRight → NO_COVERAGE
            trimRight(buf);
371
            lines.add(buf.toString());
372
        }
373 1 1. breakLines : mutated return of Object value for com/lowagie/text/pdf/BaseField::breakLines to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return lines;
374
    }
375
376
    private void drawTopFrame(PdfAppearance app) {
377 1 1. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE
        app.moveTo(borderWidth, borderWidth);
378 2 1. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
2. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(borderWidth, box.getHeight() - borderWidth);
379 3 1. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
2. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
3. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth);
380 5 1. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
3. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
4. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
5. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth);
381 4 1. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
3. drawTopFrame : Replaced float subtraction with addition → NO_COVERAGE
4. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(2 * borderWidth, box.getHeight() - 2 * borderWidth);
382 3 1. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawTopFrame : Replaced float multiplication with division → NO_COVERAGE
3. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(2 * borderWidth, 2 * borderWidth);
383 1 1. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(borderWidth, borderWidth);
384 1 1. drawTopFrame : removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE
        app.fill();
385
    }
386
387
    private void drawBottomFrame(PdfAppearance app) {
388 1 1. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE
        app.moveTo(borderWidth, borderWidth);
389 2 1. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
2. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - borderWidth, borderWidth);
390 3 1. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
2. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
3. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth);
391 5 1. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
3. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
4. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
5. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth);
392 4 1. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawBottomFrame : Replaced float subtraction with addition → NO_COVERAGE
3. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
4. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(box.getWidth() - 2 * borderWidth, 2 * borderWidth);
393 3 1. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
2. drawBottomFrame : Replaced float multiplication with division → NO_COVERAGE
3. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(2 * borderWidth, 2 * borderWidth);
394 1 1. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE
        app.lineTo(borderWidth, borderWidth);
395 1 1. drawBottomFrame : removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE
        app.fill();
396
    }
397
    /** Gets the border width in points.
398
     * @return the border width in points
399
     */
400
    public float getBorderWidth() {
401
        return this.borderWidth;
402
    }
403
404
    /** Sets the border width in points. To eliminate the border
405
     * set the border color to <CODE>null</CODE>.
406
     * @param borderWidth the border width in points
407
     */
408
    public void setBorderWidth(float borderWidth) {
409
        this.borderWidth = borderWidth;
410
    }
411
412
    /** Gets the border style.
413
     * @return the border style
414
     */
415
    public int getBorderStyle() {
416
        return this.borderStyle;
417
    }
418
419
    /** Sets the border style. The styles are found in <CODE>PdfBorderDictionary</CODE>
420
     * and can be <CODE>STYLE_SOLID</CODE>, <CODE>STYLE_DASHED</CODE>,
421
     * <CODE>STYLE_BEVELED</CODE>, <CODE>STYLE_INSET</CODE> and
422
     * <CODE>STYLE_UNDERLINE</CODE>.
423
     * @param borderStyle the border style
424
     */
425
    public void setBorderStyle(int borderStyle) {
426
        this.borderStyle = borderStyle;
427
    }
428
429
    /** Gets the border color.
430
     * @return the border color
431
     */
432
    public Color getBorderColor() {
433
        return this.borderColor;
434
    }
435
436
    /** Sets the border color. Set to <CODE>null</CODE> to remove
437
     * the border.
438
     * @param borderColor the border color
439
     */
440
    public void setBorderColor(Color borderColor) {
441
        this.borderColor = borderColor;
442
    }
443
444
    /** Gets the background color.
445
     * @return the background color
446
     */
447
    public Color getBackgroundColor() {
448
        return this.backgroundColor;
449
    }
450
451
    /** Sets the background color. Set to <CODE>null</CODE> for
452
     * transparent background.
453
     * @param backgroundColor the background color
454
     */
455
    public void setBackgroundColor(Color backgroundColor) {
456
        this.backgroundColor = backgroundColor;
457
    }
458
459
    /** Gets the text color.
460
     * @return the text color
461
     */
462
    public Color getTextColor() {
463
        return this.textColor;
464
    }
465
466
    /** Sets the text color. If <CODE>null</CODE> the color used
467
     * will be black.
468
     * @param textColor the text color
469
     */
470
    public void setTextColor(Color textColor) {
471
        this.textColor = textColor;
472
    }
473
474
    /** Gets the text font.
475
     * @return the text font
476
     */
477
    public BaseFont getFont() {
478
        return this.font;
479
    }
480
481
    /** Sets the text font. If <CODE>null</CODE> then Helvetica
482
     * will be used.
483
     * @param font the text font
484
     */
485
    public void setFont(BaseFont font) {
486
        this.font = font;
487
    }
488
489
    /** Gets the font size.
490
     * @return the font size
491
     */
492
    public float getFontSize() {
493
        return this.fontSize;
494
    }
495
496
    /** Sets the font size. If 0 then auto-sizing will be used but
497
     * only for text fields.
498
     * @param fontSize the font size
499
     */
500
    public void setFontSize(float fontSize) {
501
        this.fontSize = fontSize;
502
    }
503
504
    /** Gets the text horizontal alignment.
505
     * @return the text horizontal alignment
506
     */
507
    public int getAlignment() {
508
        return this.alignment;
509
    }
510
511
    /** Sets the text horizontal alignment. It can be <CODE>Element.ALIGN_LEFT</CODE>,
512
     * <CODE>Element.ALIGN_CENTER</CODE> and <CODE>Element.ALIGN_RIGHT</CODE>.
513
     * @param alignment the text horizontal alignment
514
     */
515
    public void setAlignment(int alignment) {
516
        this.alignment = alignment;
517
    }
518
519
    /** Gets the text.
520
     * @return the text
521
     */
522
    public String getText() {
523
        return this.text;
524
    }
525
526
    /** Sets the text for text fields.
527
     * @param text the text
528
     */
529
    public void setText(String text) {
530
        this.text = text;
531
    }
532
533
    /** Gets the field dimension and position.
534
     * @return the field dimension and position
535
     */
536
    public Rectangle getBox() {
537
        return this.box;
538
    }
539
540
    /** Sets the field dimension and position.
541
     * @param box the field dimension and position
542
     */
543
    public void setBox(Rectangle box) {
544 1 1. setBox : negated conditional → NO_COVERAGE
        if (box == null) {
545
            this.box = null;
546
        }
547
        else {
548
            this.box = new Rectangle(box);
549 1 1. setBox : removed call to com/lowagie/text/Rectangle::normalize → NO_COVERAGE
            this.box.normalize();
550
        }
551
    }
552
553
    /** Gets the field rotation.
554
     * @return the field rotation
555
     */
556
    public int getRotation() {
557
        return this.rotation;
558
    }
559
560
    /** Sets the field rotation. This value should be the same as
561
     * the page rotation where the field will be shown.
562
     * @param rotation the field rotation
563
     */
564
    public void setRotation(int rotation) {
565 2 1. setRotation : Replaced integer modulus with multiplication → NO_COVERAGE
2. setRotation : negated conditional → NO_COVERAGE
        if (rotation % 90 != 0)
566
            throw new IllegalArgumentException(MessageLocalization.getComposedMessage("rotation.must.be.a.multiple.of.90"));
567 1 1. setRotation : Replaced integer modulus with multiplication → NO_COVERAGE
        rotation %= 360;
568 2 1. setRotation : changed conditional boundary → NO_COVERAGE
2. setRotation : negated conditional → NO_COVERAGE
        if (rotation < 0)
569 1 1. setRotation : Changed increment from 360 to -360 → NO_COVERAGE
            rotation += 360;
570
        this.rotation = rotation;
571
    }
572
573
    /** Convenience method to set the field rotation the same as the
574
     * page rotation.
575
     * @param page the page
576
     */
577
    public void setRotationFromPage(Rectangle page) {
578 1 1. setRotationFromPage : removed call to com/lowagie/text/pdf/BaseField::setRotation → NO_COVERAGE
        setRotation(page.getRotation());
579
    }
580
581
    /** Gets the field visibility flag.
582
     * @return the field visibility flag
583
     */
584
    public int getVisibility() {
585
        return this.visibility;
586
    }
587
588
    /** Sets the field visibility flag. This flags can be one of
589
     * <CODE>VISIBLE</CODE>, <CODE>HIDDEN</CODE>, <CODE>VISIBLE_BUT_DOES_NOT_PRINT</CODE>
590
     * and <CODE>HIDDEN_BUT_PRINTABLE</CODE>.
591
     * @param visibility field visibility flag
592
     */
593
    public void setVisibility(int visibility) {
594
        this.visibility = visibility;
595
    }
596
597
    /** Gets the field name.
598
     * @return the field name
599
     */
600
    public String getFieldName() {
601
        return this.fieldName;
602
    }
603
604
    /** Sets the field name.
605
     * @param fieldName the field name. If <CODE>null</CODE> only the widget keys
606
     * will be included in the field allowing it to be used as a kid field.
607
     */
608
    public void setFieldName(String fieldName) {
609
        this.fieldName = fieldName;
610
    }
611
612
    /** Gets the option flags.
613
     * @return the option flags
614
     */
615
    public int getOptions() {
616
        return this.options;
617
    }
618
619
    /** Sets the option flags. The option flags can be a combination by oring of
620
     * <CODE>READ_ONLY</CODE>, <CODE>REQUIRED</CODE>,
621
     * <CODE>MULTILINE</CODE>, <CODE>DO_NOT_SCROLL</CODE>,
622
     * <CODE>PASSWORD</CODE>, <CODE>FILE_SELECTION</CODE>,
623
     * <CODE>DO_NOT_SPELL_CHECK</CODE> and <CODE>EDIT</CODE>.
624
     * @param options the option flags
625
     */
626
    public void setOptions(int options) {
627
        this.options = options;
628
    }
629
630
    /** Gets the maximum length of the field's text, in characters.
631
     * @return the maximum length of the field's text, in characters.
632
     */
633
    public int getMaxCharacterLength() {
634
        return this.maxCharacterLength;
635
    }
636
637
    /** Sets the maximum length of the field's text, in characters.
638
     * It is only meaningful for text fields.
639
     * @param maxCharacterLength the maximum length of the field's text, in characters
640
     */
641
    public void setMaxCharacterLength(int maxCharacterLength) {
642
        this.maxCharacterLength = maxCharacterLength;
643
    }
644
645
    /**
646
     * Getter for property writer.
647
     * @return Value of property writer.
648
     */
649
    public PdfWriter getWriter() {
650
        return writer;
651
    }
652
653
    /**
654
     * Setter for property writer.
655
     * @param writer New value of property writer.
656
     */
657
    public void setWriter(PdfWriter writer) {
658
        this.writer = writer;
659
    }
660
661
    /**
662
     * Moves the field keys from <CODE>from</CODE> to <CODE>to</CODE>. The moved keys
663
     * are removed from <CODE>from</CODE>.
664
     * @param from the source
665
     * @param to the destination. It may be <CODE>null</CODE>
666
     */
667
    public static void moveFields(PdfDictionary from, PdfDictionary to) {
668 1 1. moveFields : negated conditional → NO_COVERAGE
        for (Iterator i = from.getKeys().iterator(); i.hasNext();) {
669
            PdfName key = (PdfName)i.next();
670 1 1. moveFields : negated conditional → NO_COVERAGE
            if (fieldKeys.containsKey(key)) {
671 1 1. moveFields : negated conditional → NO_COVERAGE
                if (to != null)
672 1 1. moveFields : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                    to.put(key, from.get(key));
673 1 1. moveFields : removed call to java/util/Iterator::remove → NO_COVERAGE
                i.remove();
674
            }
675
        }
676
    }
677
}

Mutations

165

1.1
Location :
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBox → NO_COVERAGE

170

1.1
Location : getRealFont
Killed by : none
negated conditional → NO_COVERAGE

171

1.1
Location : getRealFont
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/BaseField::getRealFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

173

1.1
Location : getRealFont
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/BaseField::getRealFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

180

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE

183

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE

186

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setMatrix → NO_COVERAGE

189

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::saveState → NO_COVERAGE

191

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

192

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE

193

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE

194

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE

197

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

198

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

199

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE

200

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE

201

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE

202

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

203

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE

206

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

207

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

208

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE

209

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE

210

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

4.4
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

5.5
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE

211

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE

215

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

217

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE

218

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::drawTopFrame → NO_COVERAGE

219

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE

220

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::drawBottomFrame → NO_COVERAGE

222

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

223

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

224

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE

225

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE

226

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

4.4
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

5.5
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE

227

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE

230

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE

231

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::drawTopFrame → NO_COVERAGE

232

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setGrayFill → NO_COVERAGE

233

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::drawBottomFrame → NO_COVERAGE

236

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

237

1.1
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

238

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setLineDash → NO_COVERAGE

239

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorStroke → NO_COVERAGE

240

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setLineWidth → NO_COVERAGE

241

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

4.4
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

5.5
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::rectangle → NO_COVERAGE

242

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE

243

1.1
Location : getBorderAppearance
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

244

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

245

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

246

1.1
Location : getBorderAppearance
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

247

1.1
Location : getBorderAppearance
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getBorderAppearance
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : getBorderAppearance
Killed by : none
negated conditional → NO_COVERAGE

248

1.1
Location : getBorderAppearance
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

249

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE

250

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

252

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::stroke → NO_COVERAGE

256

1.1
Location : getBorderAppearance
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::restoreState → NO_COVERAGE

257

1.1
Location : getBorderAppearance
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/BaseField::getBorderAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

265

1.1
Location : getHardBreaks
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getHardBreaks
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : getHardBreaks
Killed by : none
negated conditional → NO_COVERAGE

267

1.1
Location : getHardBreaks
Killed by : none
negated conditional → NO_COVERAGE

268

1.1
Location : getHardBreaks
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getHardBreaks
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : getHardBreaks
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : getHardBreaks
Killed by : none
negated conditional → NO_COVERAGE

5.5
Location : getHardBreaks
Killed by : none
negated conditional → NO_COVERAGE

269

1.1
Location : getHardBreaks
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

273

1.1
Location : getHardBreaks
Killed by : none
negated conditional → NO_COVERAGE

281

1.1
Location : getHardBreaks
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/BaseField::getHardBreaks to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

287

1.1
Location : trimRight
Killed by : none
negated conditional → NO_COVERAGE

289

1.1
Location : trimRight
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

2.2
Location : trimRight
Killed by : none
negated conditional → NO_COVERAGE

291

1.1
Location : trimRight
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

299

1.1
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

308

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

312

1.1
Location : breakLines
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

314

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

316

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

317

1.1
Location : breakLines
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

318

1.1
Location : breakLines
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

321

1.1
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

323

1.1
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

328

1.1
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

333

1.1
Location : breakLines
Killed by : none
Replaced float addition with subtraction → NO_COVERAGE

335

1.1
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

337

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

339

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

341

1.1
Location : breakLines
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

342

1.1
Location : breakLines
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::trimRight → NO_COVERAGE

344

1.1
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

349

1.1
Location : breakLines
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

350

1.1
Location : breakLines
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

351

1.1
Location : breakLines
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

354

1.1
Location : breakLines
Killed by : none
removed call to java/lang/StringBuffer::setLength → NO_COVERAGE

356

1.1
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

362

1.1
Location : breakLines
Killed by : none
negated conditional → NO_COVERAGE

364

1.1
Location : breakLines
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

370

1.1
Location : breakLines
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::trimRight → NO_COVERAGE

373

1.1
Location : breakLines
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/BaseField::breakLines to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

377

1.1
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE

378

1.1
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

379

1.1
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

380

1.1
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

4.4
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

5.5
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

381

1.1
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : drawTopFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

4.4
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

382

1.1
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawTopFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

383

1.1
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

384

1.1
Location : drawTopFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE

388

1.1
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::moveTo → NO_COVERAGE

389

1.1
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

390

1.1
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

2.2
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

391

1.1
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

4.4
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

5.5
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

392

1.1
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawBottomFrame
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

3.3
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

4.4
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

393

1.1
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : drawBottomFrame
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

394

1.1
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::lineTo → NO_COVERAGE

395

1.1
Location : drawBottomFrame
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::fill → NO_COVERAGE

544

1.1
Location : setBox
Killed by : none
negated conditional → NO_COVERAGE

549

1.1
Location : setBox
Killed by : none
removed call to com/lowagie/text/Rectangle::normalize → NO_COVERAGE

565

1.1
Location : setRotation
Killed by : none
Replaced integer modulus with multiplication → NO_COVERAGE

2.2
Location : setRotation
Killed by : none
negated conditional → NO_COVERAGE

567

1.1
Location : setRotation
Killed by : none
Replaced integer modulus with multiplication → NO_COVERAGE

568

1.1
Location : setRotation
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : setRotation
Killed by : none
negated conditional → NO_COVERAGE

569

1.1
Location : setRotation
Killed by : none
Changed increment from 360 to -360 → NO_COVERAGE

578

1.1
Location : setRotationFromPage
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setRotation → NO_COVERAGE

668

1.1
Location : moveFields
Killed by : none
negated conditional → NO_COVERAGE

670

1.1
Location : moveFields
Killed by : none
negated conditional → NO_COVERAGE

671

1.1
Location : moveFields
Killed by : none
negated conditional → NO_COVERAGE

672

1.1
Location : moveFields
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

673

1.1
Location : moveFields
Killed by : none
removed call to java/util/Iterator::remove → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2