PdfGraphics2D.java

1
/*
2
 * $Id: PdfGraphics2D.java 3611 2008-11-05 19:45:31Z blowagie $
3
 *
4
 * Copyright 2002 by Jim Moore <jim@scolamoore.com>.
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * (the "License"); you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the License.
13
 *
14
 * The Original Code is 'iText, a free JAVA-PDF library'.
15
 *
16
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
17
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
18
 * All Rights Reserved.
19
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
20
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
21
 *
22
 * Contributor(s): all the names of the contributors are added in the source code
23
 * where applicable.
24
 *
25
 * Alternatively, the contents of this file may be used under the terms of the
26
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
27
 * provisions of LGPL are applicable instead of those above.  If you wish to
28
 * allow use of your version of this file only under the terms of the LGPL
29
 * License and not to allow others to use your version of this file under
30
 * the MPL, indicate your decision by deleting the provisions above and
31
 * replace them with the notice and other provisions required by the LGPL.
32
 * If you do not delete the provisions above, a recipient may use your version
33
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
34
 *
35
 * This library is free software; you can redistribute it and/or modify it
36
 * under the terms of the MPL as stated above or under the terms of the GNU
37
 * Library General Public License as published by the Free Software Foundation;
38
 * either version 2 of the License, or any later version.
39
 *
40
 * This library is distributed in the hope that it will be useful, but WITHOUT
41
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
42
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
43
 * details.
44
 *
45
 * If you didn't download this code from the following link, you should check if
46
 * you aren't using an obsolete version:
47
 * http://www.lowagie.com/iText/
48
 */
49
50
package com.lowagie.text.pdf;
51
52
import java.awt.AlphaComposite;
53
import java.awt.BasicStroke;
54
import java.awt.Color;
55
import java.awt.Component;
56
import java.awt.Composite;
57
import java.awt.Font;
58
import java.awt.FontMetrics;
59
import java.awt.GradientPaint;
60
import java.awt.Graphics;
61
import java.awt.Graphics2D;
62
import java.awt.GraphicsConfiguration;
63
import java.awt.Image;
64
import java.awt.MediaTracker;
65
import java.awt.Paint;
66
import java.awt.Polygon;
67
import java.awt.Rectangle;
68
import java.awt.RenderingHints;
69
import java.awt.Shape;
70
import java.awt.Stroke;
71
import java.awt.TexturePaint;
72
import java.awt.Transparency;
73
import java.awt.RenderingHints.Key;
74
import java.awt.font.FontRenderContext;
75
import java.awt.font.GlyphVector;
76
import java.awt.font.TextAttribute;
77
import java.awt.geom.AffineTransform;
78
import java.awt.geom.Arc2D;
79
import java.awt.geom.Area;
80
import java.awt.geom.Ellipse2D;
81
import java.awt.geom.Line2D;
82
import java.awt.geom.NoninvertibleTransformException;
83
import java.awt.geom.PathIterator;
84
import java.awt.geom.Point2D;
85
import java.awt.geom.Rectangle2D;
86
import java.awt.geom.RoundRectangle2D;
87
import java.awt.image.BufferedImage;
88
import java.awt.image.BufferedImageOp;
89
import java.awt.image.ColorModel;
90
import java.awt.image.ImageObserver;
91
import java.awt.image.RenderedImage;
92
import java.awt.image.WritableRaster;
93
import java.awt.image.renderable.RenderableImage;
94
import java.io.ByteArrayOutputStream;
95
import java.text.AttributedCharacterIterator;
96
import java.util.ArrayList;
97
import java.util.HashMap;
98
import java.util.Hashtable;
99
import java.util.Map;
100
import java.util.Set;
101
102
import com.lowagie.text.pdf.internal.PolylineShape;
103
import java.util.Locale;
104
import javax.imageio.IIOImage;
105
import javax.imageio.ImageIO;
106
import javax.imageio.ImageWriteParam;
107
import javax.imageio.ImageWriter;
108
import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
109
import javax.imageio.stream.ImageOutputStream;
110
111
public class PdfGraphics2D extends Graphics2D {
112
    
113
    private static final int FILL = 1;
114
    private static final int STROKE = 2;
115
    private static final int CLIP = 3;
116
    private BasicStroke strokeOne = new BasicStroke(1);
117
    
118
    private static final AffineTransform IDENTITY = new AffineTransform();
119
    
120
    private Font font;
121
    private BaseFont baseFont;
122
    private float fontSize;
123
    private AffineTransform transform;
124
    private Paint paint;
125
    private Color background;
126
    private float width;
127
    private float height;
128
    
129
    private Area clip;
130
    
131
    private RenderingHints rhints = new RenderingHints(null);
132
    
133
    private Stroke stroke;
134
    private Stroke originalStroke;
135
    
136
    private PdfContentByte cb;
137
    
138
    /** Storage for BaseFont objects created. */
139
    private HashMap baseFonts;
140
    
141
    private boolean disposeCalled = false;
142
    
143
    private FontMapper fontMapper;
144
    
145
    private ArrayList kids;
146
    
147
    private boolean kid = false;
148
    
149
    private Graphics2D dg2 = new BufferedImage(2, 2, BufferedImage.TYPE_INT_RGB).createGraphics();
150
    
151
    private boolean onlyShapes = false;
152
    
153
    private Stroke oldStroke;
154
    private Paint paintFill;
155
    private Paint paintStroke;
156
    
157
    private MediaTracker mediaTracker;
158
159
    // Added by Jurij Bilas
160
    protected boolean underline;          // indicates if the font style is underlined
161
162
    protected PdfGState[] fillGState = new PdfGState[256];
163
    protected PdfGState[] strokeGState = new PdfGState[256];
164
    protected int currentFillGState = 255;
165
    protected int currentStrokeGState = 255;
166
    
167
    public static final int AFM_DIVISOR = 1000; // used to calculate coordinates
168
169
    private boolean convertImagesToJPEG = false;
170
    private float jpegQuality = .95f;
171
172
    // Added by Alexej Suchov
173
    private float alpha;
174
175
    // Added by Alexej Suchov
176
    private Composite composite;
177
178
    // Added by Alexej Suchov
179
    private Paint realPaint;
180
181
    private PdfGraphics2D() {
182 1 1. : removed call to java/awt/Graphics2D::setRenderingHint → NO_COVERAGE
        dg2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
183 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setRenderingHint → NO_COVERAGE
        setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
184 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setRenderingHint → NO_COVERAGE
        setRenderingHint(HyperLinkKey.KEY_INSTANCE, HyperLinkKey.VALUE_HYPERLINKKEY_OFF);
185
    }
186
    
187
    /**
188
     * Shortcut constructor for PDFGraphics2D.
189
     *
190
     */
191
    public PdfGraphics2D(PdfContentByte cb, float width, float height) {
192
        this(cb, width, height, null, false, false, 0);
193
    }
194
    
195
    /**
196
     * Constructor for PDFGraphics2D.
197
     *
198
     */
199
    public PdfGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, boolean onlyShapes, boolean convertImagesToJPEG, float quality) {
200
        super();
201 1 1. : removed call to java/awt/Graphics2D::setRenderingHint → NO_COVERAGE
        dg2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
202 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setRenderingHint → NO_COVERAGE
        setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
203 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setRenderingHint → NO_COVERAGE
        setRenderingHint(HyperLinkKey.KEY_INSTANCE, HyperLinkKey.VALUE_HYPERLINKKEY_OFF);
204
        this.convertImagesToJPEG = convertImagesToJPEG;
205
        this.jpegQuality = quality;
206
        this.onlyShapes = onlyShapes;
207
        this.transform = new AffineTransform();
208
        this.baseFonts = new HashMap();
209 1 1. : negated conditional → NO_COVERAGE
        if (!onlyShapes) {
210
            this.fontMapper = fontMapper;
211 1 1. : negated conditional → NO_COVERAGE
            if (this.fontMapper == null)
212
                this.fontMapper = new DefaultFontMapper();
213
        }
214
        paint = Color.black;
215
        background = Color.white;
216 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
        setFont(new Font("sanserif", Font.PLAIN, 12));
217
        this.cb = cb;
218 1 1. : removed call to com/lowagie/text/pdf/PdfContentByte::saveState → NO_COVERAGE
        cb.saveState();
219
        this.width = width;
220
        this.height = height;
221
        clip = new Area(new Rectangle2D.Float(0, 0, width, height));
222 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::clip → NO_COVERAGE
        clip(clip);
223
        originalStroke = stroke = oldStroke = strokeOne;
224 1 1. : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokeDiff → NO_COVERAGE
        setStrokeDiff(stroke, null);
225 1 1. : removed call to com/lowagie/text/pdf/PdfContentByte::saveState → NO_COVERAGE
        cb.saveState();
226
    }
227
    
228
    /**
229
     * @see Graphics2D#draw(Shape)
230
     */
231
    public void draw(Shape s) {
232 1 1. draw : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
        followPath(s, STROKE);
233
    }
234
    
235
    /**
236
     * @see Graphics2D#drawImage(Image, AffineTransform, ImageObserver)
237
     */
238
    public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
239 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, null, xform, null, obs);
240
    }
241
    
242
    /**
243
     * @see Graphics2D#drawImage(BufferedImage, BufferedImageOp, int, int)
244
     */
245
    public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
246
        BufferedImage result = img;
247 1 1. drawImage : negated conditional → NO_COVERAGE
        if (op != null) {
248
            result = op.createCompatibleDestImage(img, img.getColorModel());
249
            result = op.filter(img, result);
250
        }
251
        drawImage(result, x, y, null);
252
    }
253
    
254
    /**
255
     * @see Graphics2D#drawRenderedImage(RenderedImage, AffineTransform)
256
     */
257
    public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
258
        BufferedImage image = null;
259 1 1. drawRenderedImage : negated conditional → NO_COVERAGE
        if (img instanceof BufferedImage) {
260
            image = (BufferedImage)img;
261
        } else {
262
            ColorModel cm = img.getColorModel();
263
            int width = img.getWidth();
264
            int height = img.getHeight();
265
            WritableRaster raster = cm.createCompatibleWritableRaster(width, height);
266
            boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
267
            Hashtable properties = new Hashtable();
268
            String[] keys = img.getPropertyNames();
269 1 1. drawRenderedImage : negated conditional → NO_COVERAGE
            if (keys!=null) {
270
                for (String key : keys) {
271
                    properties.put(key, img.getProperty(key));
272
                }
273
            }
274
            BufferedImage result = new BufferedImage(cm, raster, isAlphaPremultiplied, properties);
275
            img.copyData(raster);
276
            image=result;
277
        }
278
        drawImage(image, xform, null);
279
    }
280
    
281
    /**
282
     * @see Graphics2D#drawRenderableImage(RenderableImage, AffineTransform)
283
     */
284
    public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
285 1 1. drawRenderableImage : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawRenderedImage → NO_COVERAGE
        drawRenderedImage(img.createDefaultRendering(), xform);
286
    }
287
    
288
    /**
289
     * @see Graphics#drawString(String, int, int)
290
     */
291
    public void drawString(String s, int x, int y) {
292 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawString → NO_COVERAGE
        drawString(s, (float)x, (float)y);
293
    }
294
    
295
    /**
296
     * Calculates position and/or stroke thickness depending on the font size
297
     * @param d value to be converted
298
     * @param i font size
299
     * @return position and/or stroke thickness depending on the font size
300
     */
301
    public static double asPoints(double d, int i) {
302 3 1. asPoints : Replaced double multiplication with division → NO_COVERAGE
2. asPoints : Replaced double division with multiplication → NO_COVERAGE
3. asPoints : replaced return of double value with -(x + 1) for com/lowagie/text/pdf/PdfGraphics2D::asPoints → NO_COVERAGE
        return d * i / AFM_DIVISOR;
303
    }
304
    /**
305
     * This routine goes through the attributes and sets the font
306
     * before calling the actual string drawing routine
307
     * @param iter
308
     */
309
    protected void doAttributes(AttributedCharacterIterator iter) {
310
        underline = false;
311
        Set set = iter.getAttributes().keySet();
312
        for (Object o : set) {
313
            AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute) o;
314 1 1. doAttributes : negated conditional → NO_COVERAGE
            if (!(attribute instanceof TextAttribute))
315
                continue;
316
            TextAttribute textattribute = (TextAttribute) attribute;
317 1 1. doAttributes : negated conditional → NO_COVERAGE
            if (textattribute.equals(TextAttribute.FONT)) {
318
                Font font = (Font) iter.getAttributes().get(textattribute);
319 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                setFont(font);
320 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.UNDERLINE)) {
321 1 1. doAttributes : negated conditional → NO_COVERAGE
                if (iter.getAttributes().get(textattribute) == TextAttribute.UNDERLINE_ON)
322
                    underline = true;
323 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.SIZE)) {
324
                Object obj = iter.getAttributes().get(textattribute);
325 1 1. doAttributes : negated conditional → NO_COVERAGE
                if (obj instanceof Integer) {
326
                    int i = (Integer) obj;
327 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                    setFont(getFont().deriveFont(getFont().getStyle(), i));
328 1 1. doAttributes : negated conditional → NO_COVERAGE
                } else if (obj instanceof Float) {
329
                    float f = (Float) obj;
330 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                    setFont(getFont().deriveFont(getFont().getStyle(), f));
331
                }
332 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.FOREGROUND)) {
333 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setColor → NO_COVERAGE
                setColor((Color) iter.getAttributes().get(textattribute));
334 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.FAMILY)) {
335
                Font font = getFont();
336
                Map fontAttributes = font.getAttributes();
337
                fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute));
338 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                setFont(font.deriveFont(fontAttributes));
339 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.POSTURE)) {
340
                Font font = getFont();
341
                Map fontAttributes = font.getAttributes();
342
                fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute));
343 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                setFont(font.deriveFont(fontAttributes));
344 1 1. doAttributes : negated conditional → NO_COVERAGE
            } else if (textattribute.equals(TextAttribute.WEIGHT)) {
345
                Font font = getFont();
346
                Map fontAttributes = font.getAttributes();
347
                fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute));
348 1 1. doAttributes : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
                setFont(font.deriveFont(fontAttributes));
349
            }
350
        }
351
    }
352
353
    /**
354
     * @see Graphics2D#drawString(String, float, float)
355
     */
356
    public void drawString(String s, float x, float y) {
357 1 1. drawString : negated conditional → NO_COVERAGE
        if (s.length() == 0)
358
            return;
359 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFillPaint → NO_COVERAGE
        setFillPaint();
360 1 1. drawString : negated conditional → NO_COVERAGE
        if (onlyShapes) {
361 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawGlyphVector → NO_COVERAGE
            drawGlyphVector(this.font.layoutGlyphVector(getFontRenderContext(), s.toCharArray(), 0, s.length(), java.awt.Font.LAYOUT_LEFT_TO_RIGHT), x, y);
362
//            Use the following line to compile in JDK 1.3    
363
//            drawGlyphVector(this.font.createGlyphVector(getFontRenderContext(), s), x, y);
364
        }
365
        else {
366
            boolean restoreTextRenderingMode = false;
367
            AffineTransform at = getTransform();
368
            AffineTransform at2 = getTransform();
369 1 1. drawString : removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE
            at2.translate(x, y);
370 1 1. drawString : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
            at2.concatenate(font.getTransform());
371 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::setTransform → NO_COVERAGE
            setTransform(at2);
372
            AffineTransform inverse = this.normalizeMatrix();
373
            AffineTransform flipper = AffineTransform.getScaleInstance(1,-1);
374 1 1. drawString : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
            inverse.concatenate(flipper);
375
            double[] mx = new double[6];
376 1 1. drawString : removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE
            inverse.getMatrix(mx);
377 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::beginText → NO_COVERAGE
            cb.beginText();
378 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setFontAndSize → NO_COVERAGE
            cb.setFontAndSize(baseFont, fontSize);
379
            // Check if we need to simulate an italic font.
380
            // When there are different fonts for italic, bold, italic bold
381
            // the font.getName() will be different from the font.getFontName()
382
            // value. When they are the same value then we are normally dealing
383
            // with a single font that has been made into an italic or bold
384
            // font.
385 2 1. drawString : negated conditional → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
            if (font.isItalic() && font.getFontName().equals(font.getName())) {
386
                float angle = baseFont.getFontDescriptor(BaseFont.ITALICANGLE, 1000);
387
                float angle2 = font.getItalicAngle();
388
                // We don't have an italic version of this font so we need
389
                // to set the font angle ourselves to produce an italic font.
390 1 1. drawString : negated conditional → NO_COVERAGE
                if (angle2 == 0) {
391
                    // The JavaVM didn't have an angle setting for making
392
                    // the font an italic font so use a default of
393
                    // italic angle of 15 degrees.
394
                    angle2 = 15.0f;
395
                } else {
396
                    // This sign of the angle for Java and PDF seams
397
                    // seams to be reversed.
398 1 1. drawString : removed negation → NO_COVERAGE
                    angle2 = -angle2;
399
                }
400 1 1. drawString : negated conditional → NO_COVERAGE
                if (angle == 0) {
401 1 1. drawString : Replaced float division with multiplication → NO_COVERAGE
                    mx[2] = angle2 / 100.0f;
402
                }
403
            } 
404 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setTextMatrix → NO_COVERAGE
            cb.setTextMatrix((float)mx[0], (float)mx[1], (float)mx[2], (float)mx[3], (float)mx[4], (float)mx[5]);
405
            Float fontTextAttributeWidth = (Float)font.getAttributes().get(TextAttribute.WIDTH);
406 1 1. drawString : negated conditional → NO_COVERAGE
            fontTextAttributeWidth = (fontTextAttributeWidth == null)
407
                                     ? TextAttribute.WIDTH_REGULAR
408
                                     : fontTextAttributeWidth;
409 1 1. drawString : negated conditional → NO_COVERAGE
            if (!TextAttribute.WIDTH_REGULAR.equals(fontTextAttributeWidth))
410 2 1. drawString : Replaced float division with multiplication → NO_COVERAGE
2. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setHorizontalScaling → NO_COVERAGE
                cb.setHorizontalScaling(100.0f / fontTextAttributeWidth);
411
            
412
            // Check if we need to simulate a bold font.
413
            // Do nothing if the BaseFont is already bold. This test is not foolproof but it will work most of the times.
414 1 1. drawString : negated conditional → NO_COVERAGE
            if (!baseFont.getPostscriptFontName().toLowerCase(Locale.ROOT).contains("bold")) {
415
                // Get the weight of the font so we can detect fonts with a weight
416
                // that makes them bold, but the Font.isBold() value is false.
417
                Float weight = (Float) font.getAttributes().get(TextAttribute.WEIGHT);
418 1 1. drawString : negated conditional → NO_COVERAGE
                if (weight == null) {
419 1 1. drawString : negated conditional → NO_COVERAGE
                    weight = (font.isBold()) ? TextAttribute.WEIGHT_BOLD
420
                                             : TextAttribute.WEIGHT_REGULAR;
421
                }
422 3 1. drawString : changed conditional boundary → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
3. drawString : negated conditional → NO_COVERAGE
                if ((font.isBold() || (weight >= TextAttribute.WEIGHT_SEMIBOLD))
423 1 1. drawString : negated conditional → NO_COVERAGE
                    && (font.getFontName().equals(font.getName()))) {
424
                    // Simulate a bold font.
425 3 1. drawString : Replaced float subtraction with addition → NO_COVERAGE
2. drawString : Replaced float multiplication with division → NO_COVERAGE
3. drawString : Replaced float division with multiplication → NO_COVERAGE
                    float strokeWidth = font.getSize2D() * (weight - TextAttribute.WEIGHT_REGULAR) / 30f;
426 1 1. drawString : negated conditional → NO_COVERAGE
                    if (strokeWidth != 1) {
427 1 1. drawString : negated conditional → NO_COVERAGE
                        if(realPaint instanceof Color){
428 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setTextRenderingMode → NO_COVERAGE
                            cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE);
429 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setLineWidth → NO_COVERAGE
                            cb.setLineWidth(strokeWidth);
430
                            Color color = (Color)realPaint;
431
                            int alpha = color.getAlpha();
432 1 1. drawString : negated conditional → NO_COVERAGE
                            if (alpha != currentStrokeGState) {
433
                                currentStrokeGState = alpha;
434
                                PdfGState gs = strokeGState[alpha];
435 1 1. drawString : negated conditional → NO_COVERAGE
                                if (gs == null) {
436
                                    gs = new PdfGState();
437 2 1. drawString : Replaced float division with multiplication → NO_COVERAGE
2. drawString : removed call to com/lowagie/text/pdf/PdfGState::setStrokeOpacity → NO_COVERAGE
                                    gs.setStrokeOpacity(alpha / 255f);
438
                                    strokeGState[alpha] = gs;
439
                                }
440 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
                                cb.setGState(gs);
441
                            }
442 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setColorStroke → NO_COVERAGE
                            cb.setColorStroke(color);
443
                            restoreTextRenderingMode = true;
444
                        }
445
                    }
446
                }
447
            }
448
449
            double width = 0;
450 2 1. drawString : changed conditional boundary → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
            if (font.getSize2D() > 0) {
451 1 1. drawString : Replaced float division with multiplication → NO_COVERAGE
                float scale = 1000 / font.getSize2D();
452
                Font derivedFont = font.deriveFont(AffineTransform.getScaleInstance(scale, scale));
453
                width = derivedFont.getStringBounds(s, getFontRenderContext()).getWidth();
454 1 1. drawString : negated conditional → NO_COVERAGE
                if (derivedFont.isTransformed())
455 1 1. drawString : Replaced double division with multiplication → NO_COVERAGE
                    width /= scale;
456
            }
457
            // if the hyperlink flag is set add an action to the text
458
            Object url = getRenderingHint(HyperLinkKey.KEY_INSTANCE);
459 2 1. drawString : negated conditional → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
            if (url != null && !url.equals(HyperLinkKey.VALUE_HYPERLINKKEY_OFF))
460
            {
461 1 1. drawString : Replaced float division with multiplication → NO_COVERAGE
                float scale = 1000 / font.getSize2D();
462
                Font derivedFont = font.deriveFont(AffineTransform.getScaleInstance(scale, scale));
463
                double height = derivedFont.getStringBounds(s, getFontRenderContext()).getHeight();
464 1 1. drawString : negated conditional → NO_COVERAGE
                if (derivedFont.isTransformed())
465 1 1. drawString : Replaced double division with multiplication → NO_COVERAGE
                    height /= scale;
466
                double leftX = cb.getXTLM();
467
                double leftY = cb.getYTLM();
468
                PdfAction action = new  PdfAction(url.toString());
469 3 1. drawString : Replaced double addition with subtraction → NO_COVERAGE
2. drawString : Replaced double addition with subtraction → NO_COVERAGE
3. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setAction → NO_COVERAGE
                cb.setAction(action, (float)leftX, (float)leftY, (float)(leftX+width), (float)(leftY+height));
470
            }
471 2 1. drawString : changed conditional boundary → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
            if (s.length() > 1) {
472 3 1. drawString : Replaced float subtraction with addition → NO_COVERAGE
2. drawString : Replaced integer subtraction with addition → NO_COVERAGE
3. drawString : Replaced float division with multiplication → NO_COVERAGE
                float adv = ((float)width - baseFont.getWidthPoint(s, fontSize)) / (s.length() - 1);
473 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setCharacterSpacing → NO_COVERAGE
                cb.setCharacterSpacing(adv);
474
            }
475 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::showText → NO_COVERAGE
            cb.showText(s);
476 2 1. drawString : changed conditional boundary → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
            if (s.length() > 1) {
477 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setCharacterSpacing → NO_COVERAGE
                cb.setCharacterSpacing(0);
478
            }
479 1 1. drawString : negated conditional → NO_COVERAGE
            if (!TextAttribute.WIDTH_REGULAR.equals(fontTextAttributeWidth))
480 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setHorizontalScaling → NO_COVERAGE
                cb.setHorizontalScaling(100);
481
                
482
            // Restore the original TextRenderingMode if needed.
483 1 1. drawString : negated conditional → NO_COVERAGE
            if (restoreTextRenderingMode) {
484 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::setTextRenderingMode → NO_COVERAGE
                cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
485
            } 
486
487 1 1. drawString : removed call to com/lowagie/text/pdf/PdfContentByte::endText → NO_COVERAGE
            cb.endText();
488 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::setTransform → NO_COVERAGE
            setTransform(at);
489 1 1. drawString : negated conditional → NO_COVERAGE
            if(underline)
490
            {
491
                // These two are supposed to be taken from the .AFM file
492
                //int UnderlinePosition = -100;
493
                int UnderlineThickness = 50;
494
                //
495
                double d = asPoints(UnderlineThickness, (int)fontSize);
496
                Stroke savedStroke = originalStroke;
497 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStroke → NO_COVERAGE
                setStroke(new BasicStroke((float)d));
498 1 1. drawString : Replaced double addition with subtraction → NO_COVERAGE
                y = (float)(y + asPoints(UnderlineThickness, (int)fontSize));
499 1 1. drawString : Replaced double addition with subtraction → NO_COVERAGE
                Line2D line = new Line2D.Double(x, y, width+x, y);
500 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
                draw(line);
501 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStroke → NO_COVERAGE
                setStroke(savedStroke);
502
            }
503
        }
504
    }
505
506
    /**
507
     * @see Graphics#drawString(AttributedCharacterIterator, int, int)
508
     */
509
    public void drawString(AttributedCharacterIterator iterator, int x, int y) {
510 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawString → NO_COVERAGE
        drawString(iterator, (float)x, (float)y);
511
    }
512
    
513
    /**
514
     * @see Graphics2D#drawString(AttributedCharacterIterator, float, float)
515
     */
516
    public void drawString(AttributedCharacterIterator iter, float x, float y) {
517
/*
518
        StringBuffer sb = new StringBuffer();
519
        for(char c = iter.first(); c != AttributedCharacterIterator.DONE; c = iter.next()) {
520
            sb.append(c);
521
        }
522
        drawString(sb.toString(),x,y);
523
*/
524
        StringBuilder stringbuffer = new StringBuilder(iter.getEndIndex());
525 1 1. drawString : negated conditional → NO_COVERAGE
        for(char c = iter.first(); c != '\uFFFF'; c = iter.next())
526
        {
527 1 1. drawString : negated conditional → NO_COVERAGE
            if(iter.getIndex() == iter.getRunStart())
528
            {
529 2 1. drawString : changed conditional boundary → NO_COVERAGE
2. drawString : negated conditional → NO_COVERAGE
                if(stringbuffer.length() > 0)
530
                {
531 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawString → NO_COVERAGE
                    drawString(stringbuffer.toString(), x, y);
532
                    FontMetrics fontmetrics = getFontMetrics();
533 1 1. drawString : Replaced double addition with subtraction → NO_COVERAGE
                    x = (float)(x + fontmetrics.getStringBounds(stringbuffer.toString(), this).getWidth());
534
                    stringbuffer.delete(0, stringbuffer.length());
535
                }
536 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::doAttributes → NO_COVERAGE
                doAttributes(iter);
537
            }
538
            stringbuffer.append(c);
539
        }
540
        
541 1 1. drawString : removed call to com/lowagie/text/pdf/PdfGraphics2D::drawString → NO_COVERAGE
        drawString(stringbuffer.toString(), x, y);
542
        underline = false;
543
    }
544
    
545
    /**
546
     * @see Graphics2D#drawGlyphVector(GlyphVector, float, float)
547
     */
548
    public void drawGlyphVector(GlyphVector g, float x, float y) {
549
        Shape s = g.getOutline(x, y);
550 1 1. drawGlyphVector : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(s);
551
    }
552
    
553
    /**
554
     * @see Graphics2D#fill(Shape)
555
     */
556
    public void fill(Shape s) {
557 1 1. fill : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
        followPath(s, FILL);
558
    }
559
    
560
    /**
561
     * @see Graphics2D#hit(Rectangle, Shape, boolean)
562
     */
563
    public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
564 1 1. hit : negated conditional → NO_COVERAGE
        if (onStroke) {
565
            s = stroke.createStrokedShape(s);
566
        }
567
        s = transform.createTransformedShape(s);
568
        Area area = new Area(s);
569 1 1. hit : negated conditional → NO_COVERAGE
        if (clip != null)
570 1 1. hit : removed call to java/awt/geom/Area::intersect → NO_COVERAGE
            area.intersect(clip);
571 1 1. hit : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return area.intersects(rect.x, rect.y, rect.width, rect.height);
572
    }
573
    
574
    /**
575
     * @see Graphics2D#getDeviceConfiguration()
576
     */
577
    public GraphicsConfiguration getDeviceConfiguration() {
578
        return dg2.getDeviceConfiguration();
579
    }
580
    
581
    /**
582
     * Method contributed by Alexej Suchov
583
     * @see Graphics2D#setComposite(Composite)
584
     */
585
    public void setComposite(Composite comp) {
586
        
587 1 1. setComposite : negated conditional → NO_COVERAGE
        if (comp instanceof AlphaComposite) {
588
589
            AlphaComposite composite = (AlphaComposite) comp;
590
591 1 1. setComposite : negated conditional → NO_COVERAGE
            if (composite.getRule() == 3) {
592
593
                alpha = composite.getAlpha();
594
                this.composite = composite;
595
596 2 1. setComposite : negated conditional → NO_COVERAGE
2. setComposite : negated conditional → NO_COVERAGE
                if (realPaint != null && (realPaint instanceof Color)) {
597
598
                    Color c = (Color) realPaint;
599
                    paint = new Color(c.getRed(), c.getGreen(), c.getBlue(),
600 1 1. setComposite : Replaced float multiplication with division → NO_COVERAGE
                            (int) (c.getAlpha() * alpha));
601
                }
602
                return;
603
            }
604
        }
605
606
        this.composite = comp;
607
        alpha = 1.0F;
608
609
    }
610
    
611
    /**
612
     * Method contributed by Alexej Suchov
613
     * @see Graphics2D#setPaint(Paint)
614
     */
615
    public void setPaint(Paint paint) {
616 1 1. setPaint : negated conditional → NO_COVERAGE
        if (paint == null)
617
            return;
618
        this.paint = paint;
619
        realPaint = paint;
620
621 2 1. setPaint : negated conditional → NO_COVERAGE
2. setPaint : negated conditional → NO_COVERAGE
        if ((composite instanceof AlphaComposite) && (paint instanceof Color)) {
622
            
623
            AlphaComposite co = (AlphaComposite) composite;
624
            
625 1 1. setPaint : negated conditional → NO_COVERAGE
            if (co.getRule() == 3) {
626
                Color c = (Color) paint;
627 1 1. setPaint : Replaced float multiplication with division → NO_COVERAGE
                this.paint = new Color(c.getRed(), c.getGreen(), c.getBlue(), (int) (c.getAlpha() * alpha));
628
                realPaint = paint;
629
            }
630
        }
631
632
    }
633
634
    private Stroke transformStroke(Stroke stroke) {
635 1 1. transformStroke : negated conditional → NO_COVERAGE
        if (!(stroke instanceof BasicStroke))
636 1 1. transformStroke : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::transformStroke to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return stroke;
637
        BasicStroke st = (BasicStroke)stroke;
638
        float scale = (float)Math.sqrt(Math.abs(transform.getDeterminant()));
639
        float[] dash = st.getDashArray();
640 1 1. transformStroke : negated conditional → NO_COVERAGE
        if (dash != null) {
641 2 1. transformStroke : changed conditional boundary → NO_COVERAGE
2. transformStroke : negated conditional → NO_COVERAGE
            for (int k = 0; k < dash.length; ++k)
642 1 1. transformStroke : Replaced float multiplication with division → NO_COVERAGE
                dash[k] *= scale;
643
        }
644 3 1. transformStroke : Replaced float multiplication with division → NO_COVERAGE
2. transformStroke : Replaced float multiplication with division → NO_COVERAGE
3. transformStroke : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::transformStroke to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash, st.getDashPhase() * scale);
645
    }
646
    
647
    private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
648 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
        if (newStroke == oldStroke)
649
            return;
650 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
        if (!(newStroke instanceof BasicStroke))
651
            return;
652
        BasicStroke nStroke = (BasicStroke)newStroke;
653
        boolean oldOk = (oldStroke instanceof BasicStroke);
654
        BasicStroke oStroke = null;
655 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
        if (oldOk)
656
            oStroke = (BasicStroke)oldStroke;
657 2 1. setStrokeDiff : negated conditional → NO_COVERAGE
2. setStrokeDiff : negated conditional → NO_COVERAGE
        if (!oldOk || nStroke.getLineWidth() != oStroke.getLineWidth())
658 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineWidth → NO_COVERAGE
            cb.setLineWidth(nStroke.getLineWidth());
659 2 1. setStrokeDiff : negated conditional → NO_COVERAGE
2. setStrokeDiff : negated conditional → NO_COVERAGE
        if (!oldOk || nStroke.getEndCap() != oStroke.getEndCap()) {
660
            switch (nStroke.getEndCap()) {
661
            case BasicStroke.CAP_BUTT:
662 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE
                cb.setLineCap(0);
663
                break;
664
            case BasicStroke.CAP_SQUARE:
665 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE
                cb.setLineCap(2);
666
                break;
667
            default:
668 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE
                cb.setLineCap(1);
669
            }
670
        }
671 2 1. setStrokeDiff : negated conditional → NO_COVERAGE
2. setStrokeDiff : negated conditional → NO_COVERAGE
        if (!oldOk || nStroke.getLineJoin() != oStroke.getLineJoin()) {
672
            switch (nStroke.getLineJoin()) {
673
            case BasicStroke.JOIN_MITER:
674 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE
                cb.setLineJoin(0);
675
                break;
676
            case BasicStroke.JOIN_BEVEL:
677 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE
                cb.setLineJoin(2);
678
                break;
679
            default:
680 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE
                cb.setLineJoin(1);
681
            }
682
        }
683 2 1. setStrokeDiff : negated conditional → NO_COVERAGE
2. setStrokeDiff : negated conditional → NO_COVERAGE
        if (!oldOk || nStroke.getMiterLimit() != oStroke.getMiterLimit())
684 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setMiterLimit → NO_COVERAGE
            cb.setMiterLimit(nStroke.getMiterLimit());
685
        boolean makeDash;
686 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
        if (oldOk) {
687 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
            if (nStroke.getDashArray() != null) {
688 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
                if (nStroke.getDashPhase() != oStroke.getDashPhase()) {
689
                    makeDash = true;
690
                }
691 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
                else makeDash = !java.util.Arrays.equals(nStroke.getDashArray(), oStroke.getDashArray());
692
            }
693 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
            else makeDash = oStroke.getDashArray() != null;
694
        }
695
        else {
696
            makeDash = true;
697
        }
698 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
        if (makeDash) {
699
            float[] dash = nStroke.getDashArray();
700 1 1. setStrokeDiff : negated conditional → NO_COVERAGE
            if (dash == null)
701 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                cb.setLiteral("[]0 d\n");
702
            else {
703 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                cb.setLiteral('[');
704
                int lim = dash.length;
705
                for (float dash1 : dash) {
706 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                    cb.setLiteral(dash1);
707 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                    cb.setLiteral(' ');
708
                }
709 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                cb.setLiteral(']');
710 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                cb.setLiteral(nStroke.getDashPhase());
711 1 1. setStrokeDiff : removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE
                cb.setLiteral(" d\n");
712
            }
713
        }
714
    }
715
    
716
    /**
717
     * @see Graphics2D#setStroke(Stroke)
718
     */
719
    public void setStroke(Stroke s) {
720
        originalStroke = s;
721
        this.stroke = transformStroke(s);
722
    }
723
    
724
    
725
    /**
726
     * Sets a rendering hint
727
     * @param arg0
728
     * @param arg1
729
     */
730
    public void setRenderingHint(Key arg0, Object arg1) {
731 1 1. setRenderingHint : negated conditional → NO_COVERAGE
         if (arg1 != null) {
732
             rhints.put(arg0, arg1);
733
         } else {
734 1 1. setRenderingHint : negated conditional → NO_COVERAGE
             if (arg0 instanceof HyperLinkKey)
735
             {
736
                 rhints.put(arg0, HyperLinkKey.VALUE_HYPERLINKKEY_OFF);
737
             }
738
             else
739
             {
740
                 rhints.remove(arg0);
741
             }
742
         }
743
    }
744
    
745
    /**
746
     * @param arg0 a key
747
     * @return the rendering hint
748
     */
749
    public Object getRenderingHint(Key arg0) {
750
        return rhints.get(arg0);
751
    }
752
    
753
    /**
754
     * @see Graphics2D#setRenderingHints(Map)
755
     */
756
    public void setRenderingHints(Map hints) {
757 1 1. setRenderingHints : removed call to java/awt/RenderingHints::clear → NO_COVERAGE
        rhints.clear();
758 1 1. setRenderingHints : removed call to java/awt/RenderingHints::putAll → NO_COVERAGE
        rhints.putAll(hints);
759
    }
760
    
761
    /**
762
     * @see Graphics2D#addRenderingHints(Map)
763
     */
764
    public void addRenderingHints(Map hints) {
765
        rhints.putAll(hints);
766
    }
767
    
768
    /**
769
     * @see Graphics2D#getRenderingHints()
770
     */
771
    public RenderingHints getRenderingHints() {
772
        return rhints;
773
    }
774
    
775
    /**
776
     * @see Graphics#translate(int, int)
777
     */
778
    public void translate(int x, int y) {
779 1 1. translate : removed call to com/lowagie/text/pdf/PdfGraphics2D::translate → NO_COVERAGE
        translate((double)x, (double)y);
780
    }
781
    
782
    /**
783
     * @see Graphics2D#translate(double, double)
784
     */
785
    public void translate(double tx, double ty) {
786
        transform.translate(tx,ty);
787
    }
788
    
789
    /**
790
     * @see Graphics2D#rotate(double)
791
     */
792
    public void rotate(double theta) {
793
        transform.rotate(theta);
794
    }
795
    
796
    /**
797
     * @see Graphics2D#rotate(double, double, double)
798
     */
799
    public void rotate(double theta, double x, double y) {
800
        transform.rotate(theta, x, y);
801
    }
802
    
803
    /**
804
     * @see Graphics2D#scale(double, double)
805
     */
806
    public void scale(double sx, double sy) {
807 1 1. scale : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
        transform.scale(sx, sy);
808
        this.stroke = transformStroke(originalStroke);
809
    }
810
    
811
    /**
812
     * @see Graphics2D#shear(double, double)
813
     */
814
    public void shear(double shx, double shy) {
815
        transform.shear(shx, shy);
816
    }
817
    
818
    /**
819
     * @see Graphics2D#transform(AffineTransform)
820
     */
821
    public void transform(AffineTransform tx) {
822 1 1. transform : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
        transform.concatenate(tx);
823
        this.stroke = transformStroke(originalStroke);
824
    }
825
    
826
    /**
827
     * @see Graphics2D#setTransform(AffineTransform)
828
     */
829
    public void setTransform(AffineTransform t) {
830
        transform = new AffineTransform(t);
831
        this.stroke = transformStroke(originalStroke);
832
    }
833
    
834
    /**
835
     * @see Graphics2D#getTransform()
836
     */
837
    public AffineTransform getTransform() {
838 1 1. getTransform : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getTransform to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new AffineTransform(transform);
839
    }
840
    
841
    /**
842
     * Method contributed by Alexej Suchov
843
     * @see Graphics2D#getPaint()
844
     */
845
    public Paint getPaint() {
846 1 1. getPaint : negated conditional → NO_COVERAGE
        if (realPaint != null) {
847 1 1. getPaint : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getPaint to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return realPaint;
848
        } else {
849 1 1. getPaint : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getPaint to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return paint;
850
        }
851
    }
852
    
853
    /**
854
     * @see Graphics2D#getComposite()
855
     */
856
    public Composite getComposite() {
857
        return composite;
858
    }
859
    
860
    /**
861
     * @see Graphics2D#setBackground(Color)
862
     */
863
    public void setBackground(Color color) {
864
        background = color;
865
    }
866
    
867
    /**
868
     * @see Graphics2D#getBackground()
869
     */
870
    public Color getBackground() {
871
        return background;
872
    }
873
    
874
    /**
875
     * @see Graphics2D#getStroke()
876
     */
877
    public Stroke getStroke() {
878
        return originalStroke;
879
    }
880
    
881
    
882
    /**
883
     * @see Graphics2D#getFontRenderContext()
884
     */
885
    public FontRenderContext getFontRenderContext() {
886
        boolean antialias = RenderingHints.VALUE_TEXT_ANTIALIAS_ON.equals(getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING));
887
        boolean fractions = RenderingHints.VALUE_FRACTIONALMETRICS_ON.equals(getRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS));
888 1 1. getFontRenderContext : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getFontRenderContext to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new FontRenderContext(new AffineTransform(), antialias, fractions);
889
    }
890
    
891
    /**
892
     * @see Graphics#create()
893
     */
894
    public Graphics create() {
895
        PdfGraphics2D g2 = new PdfGraphics2D();
896 1 1. create : removed call to java/awt/RenderingHints::putAll → NO_COVERAGE
        g2.rhints.putAll( this.rhints );
897
        g2.onlyShapes = this.onlyShapes;
898
        g2.transform = new AffineTransform(this.transform);
899
        g2.baseFonts = this.baseFonts;
900
        g2.fontMapper = this.fontMapper;
901
        g2.paint = this.paint;
902
        g2.fillGState = this.fillGState;
903
        g2.currentFillGState = this.currentFillGState;
904
        g2.currentStrokeGState = this.currentStrokeGState;
905
        g2.strokeGState = this.strokeGState;
906
        g2.background = this.background;
907
        g2.mediaTracker = this.mediaTracker;
908
        g2.convertImagesToJPEG = this.convertImagesToJPEG;
909
        g2.jpegQuality = this.jpegQuality;
910 1 1. create : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE
        g2.setFont(this.font);
911
        g2.cb = this.cb.getDuplicate();
912 1 1. create : removed call to com/lowagie/text/pdf/PdfContentByte::saveState → NO_COVERAGE
        g2.cb.saveState();
913
        g2.width = this.width;
914
        g2.height = this.height;
915 1 1. create : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
        g2.followPath(new Area(new Rectangle2D.Float(0, 0, width, height)), CLIP);
916 1 1. create : negated conditional → NO_COVERAGE
        if (this.clip != null)
917
            g2.clip = new Area(this.clip);
918
        g2.composite = composite;
919
        g2.stroke = stroke;
920
        g2.originalStroke = originalStroke;
921
        g2.strokeOne = (BasicStroke)g2.transformStroke(g2.strokeOne);
922
        g2.oldStroke = g2.strokeOne;
923 1 1. create : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokeDiff → NO_COVERAGE
        g2.setStrokeDiff(g2.oldStroke, null);
924 1 1. create : removed call to com/lowagie/text/pdf/PdfContentByte::saveState → NO_COVERAGE
        g2.cb.saveState();
925 1 1. create : negated conditional → NO_COVERAGE
        if (g2.clip != null)
926 1 1. create : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
            g2.followPath(g2.clip, CLIP);
927
        g2.kid = true;
928 1 1. create : negated conditional → NO_COVERAGE
        if (this.kids == null)
929
            this.kids = new ArrayList();
930
        this.kids.add(cb.getInternalBuffer().size());
931
        this.kids.add(g2);
932 1 1. create : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::create to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return g2;
933
    }
934
    
935
    public PdfContentByte getContent() {
936
        return this.cb;
937
    }
938
    /**
939
     * @see Graphics#getColor()
940
     */
941
    public Color getColor() {
942 1 1. getColor : negated conditional → NO_COVERAGE
        if (paint instanceof Color) {
943 1 1. getColor : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return (Color)paint;
944
        } else {
945 1 1. getColor : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return Color.black;
946
        }
947
    }
948
    
949
    /**
950
     * @see Graphics#setColor(Color)
951
     */
952
    public void setColor(Color color) {
953
        setPaint(color);
954
    }
955
    
956
    /**
957
     * @see Graphics#setPaintMode()
958
     */
959
    public void setPaintMode() {}
960
    
961
    /**
962
     * @see Graphics#setXORMode(Color)
963
     */
964
    public void setXORMode(Color c1) {
965
        
966
    }
967
    
968
    /**
969
     * @see Graphics#getFont()
970
     */
971
    public Font getFont() {
972
        return font;
973
    }
974
    
975
    /**
976
     * @see Graphics#setFont(Font)
977
     */
978
    /**
979
     * Sets the current font.
980
     */
981
    public void setFont(Font f) {
982 1 1. setFont : negated conditional → NO_COVERAGE
        if (f == null)
983
            return;
984 1 1. setFont : negated conditional → NO_COVERAGE
        if (onlyShapes) {
985
            font = f;
986
            return;
987
        }
988 1 1. setFont : negated conditional → NO_COVERAGE
        if (f == font)
989
            return;
990
        font = f;
991
        fontSize = f.getSize2D();
992
        baseFont = getCachedBaseFont(f);
993
    }
994
    
995
    private BaseFont getCachedBaseFont(Font f) {
996
        synchronized (baseFonts) {
997
            BaseFont bf = (BaseFont)baseFonts.get(f.getFontName());
998 1 1. getCachedBaseFont : negated conditional → NO_COVERAGE
            if (bf == null) {
999
                bf = fontMapper.awtToPdf(f);
1000
                baseFonts.put(f.getFontName(), bf);
1001
            }
1002 1 1. getCachedBaseFont : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getCachedBaseFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return bf;
1003
        }
1004
    }
1005
    
1006
    /**
1007
     * @see Graphics#getFontMetrics(Font)
1008
     */
1009
    public FontMetrics getFontMetrics(Font f) {
1010
        return dg2.getFontMetrics(f);
1011
    }
1012
    
1013
    /**
1014
     * @see Graphics#getClipBounds()
1015
     */
1016
    public Rectangle getClipBounds() {
1017 1 1. getClipBounds : negated conditional → NO_COVERAGE
        if (clip == null)
1018 1 1. getClipBounds : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getClipBounds to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
1019 1 1. getClipBounds : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getClipBounds to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return getClip().getBounds();
1020
    }
1021
    
1022
    /**
1023
     * @see Graphics#clipRect(int, int, int, int)
1024
     */
1025
    public void clipRect(int x, int y, int width, int height) {
1026
        Rectangle2D rect = new Rectangle2D.Double(x,y,width,height);
1027 1 1. clipRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::clip → NO_COVERAGE
        clip(rect);
1028
    }
1029
    
1030
    /**
1031
     * @see Graphics#setClip(int, int, int, int)
1032
     */
1033
    public void setClip(int x, int y, int width, int height) {
1034
        Rectangle2D rect = new Rectangle2D.Double(x,y,width,height);
1035 1 1. setClip : removed call to com/lowagie/text/pdf/PdfGraphics2D::setClip → NO_COVERAGE
        setClip(rect);
1036
    }
1037
    
1038
    /**
1039
     * @see Graphics2D#clip(Shape)
1040
     */
1041
    public void clip(Shape s) {
1042 1 1. clip : negated conditional → NO_COVERAGE
        if (s == null) {
1043 1 1. clip : removed call to com/lowagie/text/pdf/PdfGraphics2D::setClip → NO_COVERAGE
            setClip(null);
1044
            return;
1045
        }
1046
        s = transform.createTransformedShape(s);
1047 1 1. clip : negated conditional → NO_COVERAGE
        if (clip == null)
1048
            clip = new Area(s);
1049
        else
1050 1 1. clip : removed call to java/awt/geom/Area::intersect → NO_COVERAGE
            clip.intersect(new Area(s));
1051 1 1. clip : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
        followPath(s, CLIP);
1052
    }
1053
    
1054
    /**
1055
     * @see Graphics#getClip()
1056
     */
1057
    public Shape getClip() {
1058
        try {
1059 1 1. getClip : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getClip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return transform.createInverse().createTransformedShape(clip);
1060
        }
1061
        catch (NoninvertibleTransformException e) {
1062 1 1. getClip : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::getClip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
1063
        }
1064
    }
1065
    
1066
    /**
1067
     * @see Graphics#setClip(Shape)
1068
     */
1069
    public void setClip(Shape s) {
1070 1 1. setClip : removed call to com/lowagie/text/pdf/PdfContentByte::restoreState → NO_COVERAGE
        cb.restoreState();
1071 1 1. setClip : removed call to com/lowagie/text/pdf/PdfContentByte::saveState → NO_COVERAGE
        cb.saveState();
1072 1 1. setClip : negated conditional → NO_COVERAGE
        if (s != null)
1073
            s = transform.createTransformedShape(s);
1074 1 1. setClip : negated conditional → NO_COVERAGE
        if (s == null) {
1075
            clip = null;
1076
        }
1077
        else {
1078
            clip = new Area(s);
1079 1 1. setClip : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
            followPath(s, CLIP);
1080
        }
1081
        paintFill = paintStroke = null;
1082
        currentFillGState = currentStrokeGState = -1;
1083
        oldStroke = strokeOne;
1084
    }
1085
    
1086
    /**
1087
     * @see Graphics#copyArea(int, int, int, int, int, int)
1088
     */
1089
    public void copyArea(int x, int y, int width, int height, int dx, int dy) {
1090
        
1091
    }
1092
    
1093
    /**
1094
     * @see Graphics#drawLine(int, int, int, int)
1095
     */
1096
    public void drawLine(int x1, int y1, int x2, int y2) {
1097
        Line2D line = new Line2D.Double(x1, y1, x2, y2);
1098 1 1. drawLine : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(line);
1099
    }
1100
    
1101
    /**
1102
     * @see Graphics#fillRect(int, int, int, int)
1103
     */
1104
    public void drawRect(int x, int y, int width, int height) {
1105 1 1. drawRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(new Rectangle(x, y, width, height));
1106
    }
1107
    
1108
    /**
1109
     * @see Graphics#fillRect(int, int, int, int)
1110
     */
1111
    public void fillRect(int x, int y, int width, int height) {
1112 1 1. fillRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(new Rectangle(x,y,width,height));
1113
    }
1114
    
1115
    /**
1116
     * @see Graphics#clearRect(int, int, int, int)
1117
     */
1118
    public void clearRect(int x, int y, int width, int height) {
1119
        Paint temp = paint;
1120 1 1. clearRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE
        setPaint(background);
1121 1 1. clearRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::fillRect → NO_COVERAGE
        fillRect(x,y,width,height);
1122 1 1. clearRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE
        setPaint(temp);
1123
    }
1124
    
1125
    /**
1126
     * @see Graphics#drawRoundRect(int, int, int, int, int, int)
1127
     */
1128
    public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
1129
        RoundRectangle2D rect = new RoundRectangle2D.Double(x,y,width,height,arcWidth, arcHeight);
1130 1 1. drawRoundRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(rect);
1131
    }
1132
    
1133
    /**
1134
     * @see Graphics#fillRoundRect(int, int, int, int, int, int)
1135
     */
1136
    public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
1137
        RoundRectangle2D rect = new RoundRectangle2D.Double(x,y,width,height,arcWidth, arcHeight);
1138 1 1. fillRoundRect : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(rect);
1139
    }
1140
    
1141
    /**
1142
     * @see Graphics#drawOval(int, int, int, int)
1143
     */
1144
    public void drawOval(int x, int y, int width, int height) {
1145
        Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
1146 1 1. drawOval : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(oval);
1147
    }
1148
    
1149
    /**
1150
     * @see Graphics#fillOval(int, int, int, int)
1151
     */
1152
    public void fillOval(int x, int y, int width, int height) {
1153
        Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
1154 1 1. fillOval : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(oval);
1155
    }
1156
    
1157
    /**
1158
     * @see Graphics#drawArc(int, int, int, int, int, int)
1159
     */
1160
    public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
1161
        Arc2D arc = new Arc2D.Double(x,y,width,height,startAngle, arcAngle, Arc2D.OPEN);
1162 1 1. drawArc : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(arc);
1163
1164
    }
1165
    
1166
    /**
1167
     * @see Graphics#fillArc(int, int, int, int, int, int)
1168
     */
1169
    public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
1170
        Arc2D arc = new Arc2D.Double(x,y,width,height,startAngle, arcAngle, Arc2D.PIE);
1171 1 1. fillArc : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(arc);
1172
    }
1173
    
1174
    /**
1175
     * @see Graphics#drawPolyline(int[], int[], int)
1176
     */
1177
    public void drawPolyline(int[] x, int[] y, int nPoints) {
1178
        PolylineShape polyline = new PolylineShape(x, y, nPoints);
1179 1 1. drawPolyline : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(polyline);
1180
    }
1181
    
1182
    /**
1183
     * @see Graphics#drawPolygon(int[], int[], int)
1184
     */
1185
    public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
1186
        Polygon poly = new Polygon(xPoints, yPoints, nPoints);
1187 1 1. drawPolygon : removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE
        draw(poly);
1188
    }
1189
    
1190
    /**
1191
     * @see Graphics#fillPolygon(int[], int[], int)
1192
     */
1193
    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
1194
        Polygon poly = new Polygon();
1195 3 1. fillPolygon : changed conditional boundary → NO_COVERAGE
2. fillPolygon : Changed increment from 1 to -1 → NO_COVERAGE
3. fillPolygon : negated conditional → NO_COVERAGE
        for (int i = 0; i < nPoints; i++) {
1196 1 1. fillPolygon : removed call to java/awt/Polygon::addPoint → NO_COVERAGE
            poly.addPoint(xPoints[i], yPoints[i]);
1197
        }
1198 1 1. fillPolygon : removed call to com/lowagie/text/pdf/PdfGraphics2D::fill → NO_COVERAGE
        fill(poly);
1199
    }
1200
    
1201
    /**
1202
     * @see Graphics#drawImage(Image, int, int, ImageObserver)
1203
     */
1204
    public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
1205 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, x, y, null, observer);
1206
    }
1207
    
1208
    /**
1209
     * @see Graphics#drawImage(Image, int, int, int, int, ImageObserver)
1210
     */
1211
    public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
1212 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, x, y, width, height, null, observer);
1213
    }
1214
    
1215
    /**
1216
     * @see Graphics#drawImage(Image, int, int, Color, ImageObserver)
1217
     */
1218
    public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
1219 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE
        waitForImage(img);
1220 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, x, y, img.getWidth(observer), img.getHeight(observer), bgcolor, observer);
1221
    }
1222
    
1223
    /**
1224
     * @see Graphics#drawImage(Image, int, int, int, int, Color, ImageObserver)
1225
     */
1226
    public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
1227 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE
        waitForImage(img);
1228 1 1. drawImage : Replaced double division with multiplication → NO_COVERAGE
        double scalex = width/(double)img.getWidth(observer);
1229 1 1. drawImage : Replaced double division with multiplication → NO_COVERAGE
        double scaley = height/(double)img.getHeight(observer);
1230
        AffineTransform tx = AffineTransform.getTranslateInstance(x,y);
1231 1 1. drawImage : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
        tx.scale(scalex,scaley);
1232 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, null, tx, bgcolor, observer);
1233
    }
1234
    
1235
    /**
1236
     * @see Graphics#drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
1237
     */
1238
    public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
1239 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer);
1240
    }
1241
    
1242
    /**
1243
     * @see Graphics#drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)
1244
     */
1245
    public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) {
1246 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE
        waitForImage(img);
1247 1 1. drawImage : Replaced double subtraction with addition → NO_COVERAGE
        double dwidth = (double)dx2-dx1;
1248 1 1. drawImage : Replaced double subtraction with addition → NO_COVERAGE
        double dheight = (double)dy2-dy1;
1249 1 1. drawImage : Replaced double subtraction with addition → NO_COVERAGE
        double swidth = (double)sx2-sx1;
1250 1 1. drawImage : Replaced double subtraction with addition → NO_COVERAGE
        double sheight = (double)sy2-sy1;
1251
        
1252
        //if either width or height is 0, then there is nothing to draw
1253 5 1. drawImage : negated conditional → NO_COVERAGE
2. drawImage : negated conditional → NO_COVERAGE
3. drawImage : negated conditional → NO_COVERAGE
4. drawImage : negated conditional → NO_COVERAGE
5. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        if (dwidth == 0 || dheight == 0 || swidth == 0 || sheight == 0) return true;
1254
        
1255 1 1. drawImage : Replaced double division with multiplication → NO_COVERAGE
        double scalex = dwidth/swidth;
1256 1 1. drawImage : Replaced double division with multiplication → NO_COVERAGE
        double scaley = dheight/sheight;
1257
        
1258 1 1. drawImage : Replaced double multiplication with division → NO_COVERAGE
        double transx = sx1*scalex;
1259 1 1. drawImage : Replaced double multiplication with division → NO_COVERAGE
        double transy = sy1*scaley;
1260 2 1. drawImage : Replaced double subtraction with addition → NO_COVERAGE
2. drawImage : Replaced double subtraction with addition → NO_COVERAGE
        AffineTransform tx = AffineTransform.getTranslateInstance(dx1-transx,dy1-transy);
1261 1 1. drawImage : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
        tx.scale(scalex,scaley);
1262
        
1263
        BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer), BufferedImage.TYPE_BYTE_BINARY);
1264
        Graphics g = mask.getGraphics();
1265 1 1. drawImage : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
        g.fillRect(sx1,sy1, (int)swidth, (int)sheight);
1266
        drawImage(img, mask, tx, null, observer);
1267 1 1. drawImage : removed call to java/awt/Graphics::dispose → NO_COVERAGE
        g.dispose();
1268 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
1269
    }
1270
    
1271
    /**
1272
     * @see Graphics#dispose()
1273
     */
1274
    public void dispose() {
1275 1 1. dispose : negated conditional → NO_COVERAGE
        if (kid)
1276
            return;
1277 1 1. dispose : negated conditional → NO_COVERAGE
        if (!disposeCalled) {
1278
            disposeCalled = true;
1279 1 1. dispose : removed call to com/lowagie/text/pdf/PdfContentByte::restoreState → NO_COVERAGE
            cb.restoreState();
1280 1 1. dispose : removed call to com/lowagie/text/pdf/PdfContentByte::restoreState → NO_COVERAGE
            cb.restoreState();
1281 1 1. dispose : removed call to java/awt/Graphics2D::dispose → NO_COVERAGE
            dg2.dispose();
1282
            dg2 = null;
1283 1 1. dispose : negated conditional → NO_COVERAGE
            if (kids != null) {
1284
                ByteBuffer buf = new ByteBuffer();
1285 1 1. dispose : removed call to com/lowagie/text/pdf/PdfGraphics2D::internalDispose → NO_COVERAGE
                internalDispose(buf);
1286
                ByteBuffer buf2 = cb.getInternalBuffer();
1287 1 1. dispose : removed call to com/lowagie/text/pdf/ByteBuffer::reset → NO_COVERAGE
                buf2.reset();
1288
                buf2.append(buf);
1289
            }
1290
        }
1291
    }
1292
    
1293
    private void internalDispose(ByteBuffer buf) {
1294
        int last = 0;
1295
        int pos = 0;
1296
        ByteBuffer buf2 = cb.getInternalBuffer();
1297 1 1. internalDispose : negated conditional → NO_COVERAGE
        if (kids != null) {
1298 3 1. internalDispose : changed conditional boundary → NO_COVERAGE
2. internalDispose : Changed increment from 2 to -2 → NO_COVERAGE
3. internalDispose : negated conditional → NO_COVERAGE
            for (int k = 0; k < kids.size(); k += 2) {
1299
                pos = (Integer) kids.get(k);
1300 1 1. internalDispose : Replaced integer addition with subtraction → NO_COVERAGE
                PdfGraphics2D g2 = (PdfGraphics2D)kids.get(k + 1);
1301 1 1. internalDispose : removed call to com/lowagie/text/pdf/PdfContentByte::restoreState → NO_COVERAGE
                g2.cb.restoreState();
1302 1 1. internalDispose : removed call to com/lowagie/text/pdf/PdfContentByte::restoreState → NO_COVERAGE
                g2.cb.restoreState();
1303 1 1. internalDispose : Replaced integer subtraction with addition → NO_COVERAGE
                buf.append(buf2.getBuffer(), last, pos - last);
1304 1 1. internalDispose : removed call to java/awt/Graphics2D::dispose → NO_COVERAGE
                g2.dg2.dispose();
1305
                g2.dg2 = null;
1306 1 1. internalDispose : removed call to com/lowagie/text/pdf/PdfGraphics2D::internalDispose → NO_COVERAGE
                g2.internalDispose(buf);
1307
                last = pos;
1308
            }
1309
        }
1310 1 1. internalDispose : Replaced integer subtraction with addition → NO_COVERAGE
        buf.append(buf2.getBuffer(), last, buf2.size() - last);
1311
    }
1312
    
1313
    ///////////////////////////////////////////////
1314
    //
1315
    //
1316
    //        implementation specific methods
1317
    //
1318
    //
1319
    
1320
    
1321
    private void followPath(Shape s, int drawType) {
1322 1 1. followPath : negated conditional → NO_COVERAGE
        if (s==null) return;
1323 1 1. followPath : negated conditional → NO_COVERAGE
        if (drawType==STROKE) {
1324 1 1. followPath : negated conditional → NO_COVERAGE
            if (!(stroke instanceof BasicStroke)) {
1325
                s = stroke.createStrokedShape(s);
1326 1 1. followPath : removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE
                followPath(s, FILL);
1327
                return;
1328
            }
1329
        }
1330 1 1. followPath : negated conditional → NO_COVERAGE
        if (drawType==STROKE) {
1331 1 1. followPath : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokeDiff → NO_COVERAGE
            setStrokeDiff(stroke, oldStroke);
1332
            oldStroke = stroke;
1333 1 1. followPath : removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokePaint → NO_COVERAGE
            setStrokePaint();
1334
        }
1335 1 1. followPath : negated conditional → NO_COVERAGE
        else if (drawType==FILL)
1336 1 1. followPath : removed call to com/lowagie/text/pdf/PdfGraphics2D::setFillPaint → NO_COVERAGE
            setFillPaint();
1337
        PathIterator points;
1338
        int traces = 0;
1339 1 1. followPath : negated conditional → NO_COVERAGE
        if (drawType == CLIP)
1340
            points = s.getPathIterator(IDENTITY);
1341
        else
1342
            points = s.getPathIterator(transform);
1343
        float[] coords = new float[6];
1344 1 1. followPath : negated conditional → NO_COVERAGE
        while(!points.isDone()) {
1345 1 1. followPath : Changed increment from 1 to -1 → NO_COVERAGE
            ++traces;
1346
            int segtype = points.currentSegment(coords);
1347 1 1. followPath : removed call to com/lowagie/text/pdf/PdfGraphics2D::normalizeY → NO_COVERAGE
            normalizeY(coords);
1348
            switch(segtype) {
1349
                case PathIterator.SEG_CLOSE:
1350 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::closePath → NO_COVERAGE
                    cb.closePath();
1351
                    break;
1352
1353
                case PathIterator.SEG_CUBICTO:
1354 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::curveTo → NO_COVERAGE
                    cb.curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]);
1355
                    break;
1356
1357
                case PathIterator.SEG_LINETO:
1358 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::lineTo → NO_COVERAGE
                    cb.lineTo(coords[0], coords[1]);
1359
                    break;
1360
1361
                case PathIterator.SEG_MOVETO:
1362 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::moveTo → NO_COVERAGE
                    cb.moveTo(coords[0], coords[1]);
1363
                    break;
1364
1365
                case PathIterator.SEG_QUADTO:
1366 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::curveTo → NO_COVERAGE
                    cb.curveTo(coords[0], coords[1], coords[2], coords[3]);
1367
                    break;
1368
            }
1369 1 1. followPath : removed call to java/awt/geom/PathIterator::next → NO_COVERAGE
            points.next();
1370
        }
1371
        switch (drawType) {
1372
        case FILL:
1373 2 1. followPath : changed conditional boundary → NO_COVERAGE
2. followPath : negated conditional → NO_COVERAGE
            if (traces > 0) {
1374 1 1. followPath : negated conditional → NO_COVERAGE
                if (points.getWindingRule() == PathIterator.WIND_EVEN_ODD)
1375 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::eoFill → NO_COVERAGE
                    cb.eoFill();
1376
                else
1377 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::fill → NO_COVERAGE
                    cb.fill();
1378
            }
1379
            break;
1380
        case STROKE:
1381 2 1. followPath : changed conditional boundary → NO_COVERAGE
2. followPath : negated conditional → NO_COVERAGE
            if (traces > 0)
1382 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::stroke → NO_COVERAGE
                cb.stroke();
1383
            break;
1384
        default: //drawType==CLIP
1385 1 1. followPath : negated conditional → NO_COVERAGE
            if (traces == 0)
1386 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::rectangle → NO_COVERAGE
                cb.rectangle(0, 0, 0, 0);
1387 1 1. followPath : negated conditional → NO_COVERAGE
            if (points.getWindingRule() == PathIterator.WIND_EVEN_ODD)
1388 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::eoClip → NO_COVERAGE
                cb.eoClip();
1389
            else
1390 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::clip → NO_COVERAGE
                cb.clip();
1391 1 1. followPath : removed call to com/lowagie/text/pdf/PdfContentByte::newPath → NO_COVERAGE
            cb.newPath();
1392
        }
1393
    }
1394
    
1395
    private float normalizeY(float y) {
1396 2 1. normalizeY : Replaced float subtraction with addition → NO_COVERAGE
2. normalizeY : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/PdfGraphics2D::normalizeY → NO_COVERAGE
        return this.height - y;
1397
    }
1398
    
1399
    private void normalizeY(float[] coords) {
1400
        coords[1] = normalizeY(coords[1]);
1401
        coords[3] = normalizeY(coords[3]);
1402
        coords[5] = normalizeY(coords[5]);
1403
    }
1404
    
1405
    private AffineTransform normalizeMatrix() {
1406
        double[] mx = new double[6];
1407
        AffineTransform result = AffineTransform.getTranslateInstance(0,0);
1408 1 1. normalizeMatrix : removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE
        result.getMatrix(mx);
1409
        mx[3]=-1;
1410
        mx[5]=height;
1411
        result = new AffineTransform(mx);
1412 1 1. normalizeMatrix : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
        result.concatenate(transform);
1413 1 1. normalizeMatrix : mutated return of Object value for com/lowagie/text/pdf/PdfGraphics2D::normalizeMatrix to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return result;
1414
    }
1415
    
1416
    private boolean drawImage(Image img, Image mask, AffineTransform xform, Color bgColor, ImageObserver obs) {
1417 1 1. drawImage : negated conditional → NO_COVERAGE
        if (xform==null)
1418
            xform = new AffineTransform();
1419
        else
1420
            xform = new AffineTransform(xform);
1421 1 1. drawImage : removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE
        xform.translate(0, img.getHeight(obs));
1422 1 1. drawImage : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
        xform.scale(img.getWidth(obs), img.getHeight(obs));
1423
        
1424
        AffineTransform inverse = this.normalizeMatrix();
1425
        AffineTransform flipper = AffineTransform.getScaleInstance(1,-1);
1426 1 1. drawImage : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
        inverse.concatenate(xform);
1427 1 1. drawImage : removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE
        inverse.concatenate(flipper);
1428
        
1429
        double[] mx = new double[6];
1430 1 1. drawImage : removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE
        inverse.getMatrix(mx);
1431 1 1. drawImage : negated conditional → NO_COVERAGE
        if (currentFillGState != 255) {
1432
            PdfGState gs = fillGState[255];
1433 1 1. drawImage : negated conditional → NO_COVERAGE
            if (gs == null) {
1434
                gs = new PdfGState();
1435 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE
                gs.setFillOpacity(1);
1436
                fillGState[255] = gs;
1437
            }
1438 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
            cb.setGState(gs);
1439
        }
1440
        
1441
        try {
1442
            com.lowagie.text.Image image = null;
1443 1 1. drawImage : negated conditional → NO_COVERAGE
            if(!convertImagesToJPEG){
1444
                image = com.lowagie.text.Image.getInstance(img, bgColor);
1445
            }
1446
            else{
1447
                BufferedImage scaled = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
1448
                Graphics2D g3 = scaled.createGraphics();
1449
                g3.drawImage(img, 0, 0, img.getWidth(null), img.getHeight(null), null);
1450 1 1. drawImage : removed call to java/awt/Graphics2D::dispose → NO_COVERAGE
                g3.dispose();
1451
                
1452
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
1453
                ImageWriteParam iwparam = new JPEGImageWriteParam(Locale.getDefault());
1454 1 1. drawImage : removed call to javax/imageio/ImageWriteParam::setCompressionMode → NO_COVERAGE
                iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
1455 1 1. drawImage : removed call to javax/imageio/ImageWriteParam::setCompressionQuality → NO_COVERAGE
                iwparam.setCompressionQuality(jpegQuality);//Set here your compression rate
1456
                ImageWriter iw = ImageIO.getImageWritersByFormatName("jpg").next();
1457
                ImageOutputStream ios = ImageIO.createImageOutputStream(baos);
1458 1 1. drawImage : removed call to javax/imageio/ImageWriter::setOutput → NO_COVERAGE
                iw.setOutput(ios);
1459 1 1. drawImage : removed call to javax/imageio/ImageWriter::write → NO_COVERAGE
                iw.write(null, new IIOImage(scaled, null, null), iwparam);
1460 1 1. drawImage : removed call to javax/imageio/ImageWriter::dispose → NO_COVERAGE
                iw.dispose();
1461 1 1. drawImage : removed call to javax/imageio/stream/ImageOutputStream::close → NO_COVERAGE
                ios.close();
1462
1463 1 1. drawImage : removed call to java/awt/image/BufferedImage::flush → NO_COVERAGE
                scaled.flush();
1464
                scaled = null;
1465
                image = com.lowagie.text.Image.getInstance(baos.toByteArray());
1466
                
1467
            }
1468 1 1. drawImage : negated conditional → NO_COVERAGE
            if (mask!=null) {
1469
                com.lowagie.text.Image msk = com.lowagie.text.Image.getInstance(mask, null, true);
1470 1 1. drawImage : removed call to com/lowagie/text/Image::makeMask → NO_COVERAGE
                msk.makeMask();
1471 1 1. drawImage : removed call to com/lowagie/text/Image::setInverted → NO_COVERAGE
                msk.setInverted(true);
1472 1 1. drawImage : removed call to com/lowagie/text/Image::setImageMask → NO_COVERAGE
                image.setImageMask(msk);
1473
            }
1474 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfContentByte::addImage → NO_COVERAGE
            cb.addImage(image, (float)mx[0], (float)mx[1], (float)mx[2], (float)mx[3], (float)mx[4], (float)mx[5]);
1475
            Object url = getRenderingHint(HyperLinkKey.KEY_INSTANCE);
1476 2 1. drawImage : negated conditional → NO_COVERAGE
2. drawImage : negated conditional → NO_COVERAGE
            if (url != null && !url.equals(HyperLinkKey.VALUE_HYPERLINKKEY_OFF)) {
1477
                PdfAction action = new  PdfAction(url.toString());
1478 3 1. drawImage : Replaced double addition with subtraction → NO_COVERAGE
2. drawImage : Replaced double addition with subtraction → NO_COVERAGE
3. drawImage : removed call to com/lowagie/text/pdf/PdfContentByte::setAction → NO_COVERAGE
                cb.setAction(action, (float)mx[4], (float)mx[5], (float)(mx[0]+mx[4]), (float)(mx[3]+mx[5]));
1479
            }
1480
        } catch (Exception ex) {
1481
            throw new IllegalArgumentException();
1482
        }
1483 2 1. drawImage : negated conditional → NO_COVERAGE
2. drawImage : negated conditional → NO_COVERAGE
        if (currentFillGState != 255 && currentFillGState != -1) {
1484
            PdfGState gs = fillGState[currentFillGState];
1485 1 1. drawImage : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
            cb.setGState(gs);
1486
        }        
1487 1 1. drawImage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
1488
    }
1489
    
1490
    private boolean checkNewPaint(Paint oldPaint) {
1491 1 1. checkNewPaint : negated conditional → NO_COVERAGE
        if (paint == oldPaint)
1492 1 1. checkNewPaint : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
1493 3 1. checkNewPaint : negated conditional → NO_COVERAGE
2. checkNewPaint : negated conditional → NO_COVERAGE
3. checkNewPaint : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return !((paint instanceof Color) && paint.equals(oldPaint));
1494
    }
1495
    
1496
    private void setFillPaint() {
1497 1 1. setFillPaint : negated conditional → NO_COVERAGE
        if (checkNewPaint(paintFill)) {
1498
            paintFill = paint;
1499 1 1. setFillPaint : removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE
            setPaint(false, 0, 0, true);
1500
        }
1501
    }
1502
    
1503
    private void setStrokePaint() {
1504 1 1. setStrokePaint : negated conditional → NO_COVERAGE
        if (checkNewPaint(paintStroke)) {
1505
            paintStroke = paint;
1506 1 1. setStrokePaint : removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE
            setPaint(false, 0, 0, false);
1507
        }
1508
    }
1509
    
1510
    private void setPaint(boolean invert, double xoffset, double yoffset, boolean fill) {
1511 1 1. setPaint : negated conditional → NO_COVERAGE
        if (paint instanceof Color) {
1512
            Color color = (Color)paint;
1513
            int alpha = color.getAlpha();
1514 1 1. setPaint : negated conditional → NO_COVERAGE
            if (fill) {
1515 1 1. setPaint : negated conditional → NO_COVERAGE
                if (alpha != currentFillGState) {
1516
                    currentFillGState = alpha;
1517
                    PdfGState gs = fillGState[alpha];
1518 1 1. setPaint : negated conditional → NO_COVERAGE
                    if (gs == null) {
1519
                        gs = new PdfGState();
1520 2 1. setPaint : Replaced float division with multiplication → NO_COVERAGE
2. setPaint : removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE
                        gs.setFillOpacity(alpha / 255f);
1521
                        fillGState[alpha] = gs;
1522
                    }
1523 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
                    cb.setGState(gs);
1524
                }
1525 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorFill → NO_COVERAGE
                cb.setColorFill(color);
1526
            }
1527
            else {
1528 1 1. setPaint : negated conditional → NO_COVERAGE
                if (alpha != currentStrokeGState) {
1529
                    currentStrokeGState = alpha;
1530
                    PdfGState gs = strokeGState[alpha];
1531 1 1. setPaint : negated conditional → NO_COVERAGE
                    if (gs == null) {
1532
                        gs = new PdfGState();
1533 2 1. setPaint : Replaced float division with multiplication → NO_COVERAGE
2. setPaint : removed call to com/lowagie/text/pdf/PdfGState::setStrokeOpacity → NO_COVERAGE
                        gs.setStrokeOpacity(alpha / 255f);
1534
                        strokeGState[alpha] = gs;
1535
                    }
1536 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
                    cb.setGState(gs);
1537
                }
1538 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorStroke → NO_COVERAGE
                cb.setColorStroke(color);
1539
            }
1540
        }
1541 1 1. setPaint : negated conditional → NO_COVERAGE
        else if (paint instanceof GradientPaint) {
1542
            GradientPaint gp = (GradientPaint)paint;
1543
            Point2D p1 = gp.getPoint1();
1544
            transform.transform(p1, p1);
1545
            Point2D p2 = gp.getPoint2();
1546
            transform.transform(p2, p2);
1547
            Color c1 = gp.getColor1();
1548
            Color c2 = gp.getColor2();
1549
            PdfShading shading = PdfShading.simpleAxial(cb.getPdfWriter(), (float)p1.getX(), normalizeY((float)p1.getY()), (float)p2.getX(), normalizeY((float)p2.getY()), c1, c2);
1550
            PdfShadingPattern pat = new PdfShadingPattern(shading);
1551 1 1. setPaint : negated conditional → NO_COVERAGE
            if (fill)
1552 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setShadingFill → NO_COVERAGE
                cb.setShadingFill(pat);
1553
            else
1554 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setShadingStroke → NO_COVERAGE
                cb.setShadingStroke(pat);
1555
        }
1556 1 1. setPaint : negated conditional → NO_COVERAGE
        else if (paint instanceof TexturePaint) {
1557
            try {
1558
                TexturePaint tp = (TexturePaint)paint;
1559
                BufferedImage img = tp.getImage();
1560
                Rectangle2D rect = tp.getAnchorRect();
1561
                com.lowagie.text.Image image = com.lowagie.text.Image.getInstance(img, null);
1562
                PdfPatternPainter pattern = cb.createPattern(image.getWidth(), image.getHeight());
1563
                AffineTransform inverse = this.normalizeMatrix();
1564 1 1. setPaint : removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE
                inverse.translate(rect.getX(), rect.getY());
1565 4 1. setPaint : removed negation → NO_COVERAGE
2. setPaint : Replaced double division with multiplication → NO_COVERAGE
3. setPaint : Replaced double division with multiplication → NO_COVERAGE
4. setPaint : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
                inverse.scale(rect.getWidth() / image.getWidth(), -rect.getHeight() / image.getHeight());
1566
                double[] mx = new double[6];
1567 1 1. setPaint : removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE
                inverse.getMatrix(mx);
1568 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfPatternPainter::setPatternMatrix → NO_COVERAGE
                pattern.setPatternMatrix((float)mx[0], (float)mx[1], (float)mx[2], (float)mx[3], (float)mx[4], (float)mx[5]) ;
1569 1 1. setPaint : removed call to com/lowagie/text/Image::setAbsolutePosition → NO_COVERAGE
                image.setAbsolutePosition(0,0);
1570 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfPatternPainter::addImage → NO_COVERAGE
                pattern.addImage(image);
1571 1 1. setPaint : negated conditional → NO_COVERAGE
                if (fill)
1572 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setPatternFill → NO_COVERAGE
                    cb.setPatternFill(pattern);
1573
                else
1574 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setPatternStroke → NO_COVERAGE
                    cb.setPatternStroke(pattern);
1575
            } catch (Exception ex) {
1576 1 1. setPaint : negated conditional → NO_COVERAGE
                if (fill)
1577 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorFill → NO_COVERAGE
                    cb.setColorFill(Color.gray);
1578
                else
1579 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorStroke → NO_COVERAGE
                    cb.setColorStroke(Color.gray);
1580
            }
1581
        }
1582
        else {
1583
            try {
1584
                BufferedImage img = null;
1585
                int type = BufferedImage.TYPE_4BYTE_ABGR;
1586 1 1. setPaint : negated conditional → NO_COVERAGE
                if (paint.getTransparency() == Transparency.OPAQUE) {
1587
                    type = BufferedImage.TYPE_3BYTE_BGR;
1588
                }
1589
                img = new BufferedImage((int)width, (int)height, type);
1590
                Graphics2D g = (Graphics2D)img.getGraphics();
1591 1 1. setPaint : removed call to java/awt/Graphics2D::transform → NO_COVERAGE
                g.transform(transform);
1592
                AffineTransform inv = transform.createInverse();
1593
                Shape fillRect = new Rectangle2D.Double(0,0,img.getWidth(),img.getHeight());
1594
                fillRect = inv.createTransformedShape(fillRect);
1595 1 1. setPaint : removed call to java/awt/Graphics2D::setPaint → NO_COVERAGE
                g.setPaint(paint);
1596 1 1. setPaint : removed call to java/awt/Graphics2D::fill → NO_COVERAGE
                g.fill(fillRect);
1597 1 1. setPaint : negated conditional → NO_COVERAGE
                if (invert) {
1598
                    AffineTransform tx = new AffineTransform();
1599 1 1. setPaint : removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE
                    tx.scale(1,-1);
1600 3 1. setPaint : removed negation → NO_COVERAGE
2. setPaint : removed negation → NO_COVERAGE
3. setPaint : removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE
                    tx.translate(-xoffset,-yoffset);
1601
                    g.drawImage(img,tx,null);
1602
                }
1603 1 1. setPaint : removed call to java/awt/Graphics2D::dispose → NO_COVERAGE
                g.dispose();
1604
                g = null;
1605
                com.lowagie.text.Image image = com.lowagie.text.Image.getInstance(img, null);
1606
                PdfPatternPainter pattern = cb.createPattern(width, height);
1607 1 1. setPaint : removed call to com/lowagie/text/Image::setAbsolutePosition → NO_COVERAGE
                image.setAbsolutePosition(0,0);
1608 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfPatternPainter::addImage → NO_COVERAGE
                pattern.addImage(image);
1609
1610 1 1. setPaint : negated conditional → NO_COVERAGE
                if (fill) {
1611 1 1. setPaint : negated conditional → NO_COVERAGE
                    if (currentFillGState != 255){
1612
                        currentFillGState = 255;
1613
                        PdfGState gs = fillGState[255];
1614 1 1. setPaint : negated conditional → NO_COVERAGE
                        if (gs == null) {
1615
                            gs = new PdfGState();
1616 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE
                            gs.setFillOpacity(1);
1617
                            fillGState[255] = gs;
1618
                        }
1619 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE
                        cb.setGState(gs);
1620
                    }
1621 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setPatternFill → NO_COVERAGE
                    cb.setPatternFill(pattern);
1622
                }
1623
                else {
1624 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setPatternStroke → NO_COVERAGE
                    cb.setPatternStroke(pattern);
1625
                }
1626
            } catch (Exception ex) {
1627 1 1. setPaint : negated conditional → NO_COVERAGE
                if (fill)
1628 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorFill → NO_COVERAGE
                    cb.setColorFill(Color.gray);
1629
                else
1630 1 1. setPaint : removed call to com/lowagie/text/pdf/PdfContentByte::setColorStroke → NO_COVERAGE
                    cb.setColorStroke(Color.gray);
1631
            }
1632
        }
1633
    }
1634
    
1635
    private synchronized void waitForImage(java.awt.Image image) {
1636 1 1. waitForImage : negated conditional → NO_COVERAGE
        if (mediaTracker == null)
1637
            mediaTracker = new MediaTracker(new PdfGraphics2D.FakeComponent());
1638 1 1. waitForImage : removed call to java/awt/MediaTracker::addImage → NO_COVERAGE
        mediaTracker.addImage(image, 0);
1639
        try {
1640 1 1. waitForImage : removed call to java/awt/MediaTracker::waitForID → NO_COVERAGE
            mediaTracker.waitForID(0);
1641
        }
1642
        catch (InterruptedException e) {
1643
            // empty on purpose
1644
        }
1645 1 1. waitForImage : removed call to java/awt/MediaTracker::removeImage → NO_COVERAGE
        mediaTracker.removeImage(image);
1646
    }
1647
        
1648
    static private class FakeComponent extends Component {
1649
1650
        private static final long serialVersionUID = 6450197945596086638L;
1651
    }
1652
1653
    /**
1654
     * @since 2.0.8
1655
     */
1656
    public static class HyperLinkKey extends RenderingHints.Key
1657
    {
1658
         public static final HyperLinkKey KEY_INSTANCE = new HyperLinkKey(9999);
1659
         public static final Object VALUE_HYPERLINKKEY_OFF = "0";
1660
         
1661
        protected HyperLinkKey(int arg0) {
1662
            super(arg0);
1663
        }
1664
        
1665
        public boolean isCompatibleValue(Object val)
1666
        {
1667
            return true;
1668
        }
1669
        public String toString()
1670
        {
1671
            return "HyperLinkKey";
1672
        }
1673
    }
1674
1675
}

Mutations

182

1.1
Location :
Killed by : none
removed call to java/awt/Graphics2D::setRenderingHint → NO_COVERAGE

183

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

184

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

201

1.1
Location :
Killed by : none
removed call to java/awt/Graphics2D::setRenderingHint → NO_COVERAGE

202

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

203

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

209

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

211

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

216

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

218

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

222

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

224

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

225

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

232

1.1
Location : draw
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE

239

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

247

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

259

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

269

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

285

1.1
Location : drawRenderableImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::drawRenderedImage → NO_COVERAGE

292

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

302

1.1
Location : asPoints
Killed by : none
Replaced double multiplication with division → NO_COVERAGE

2.2
Location : asPoints
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

3.3
Location : asPoints
Killed by : none
replaced return of double value with -(x + 1) for com/lowagie/text/pdf/PdfGraphics2D::asPoints → NO_COVERAGE

314

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

317

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

319

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

320

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

321

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

323

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

325

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

327

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

328

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

330

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

332

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

333

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setColor → NO_COVERAGE

334

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

338

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

339

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

343

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

344

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

348

1.1
Location : doAttributes
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

357

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

359

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFillPaint → NO_COVERAGE

360

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

361

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::drawGlyphVector → NO_COVERAGE

369

1.1
Location : drawString
Killed by : none
removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE

370

1.1
Location : drawString
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

371

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setTransform → NO_COVERAGE

374

1.1
Location : drawString
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

376

1.1
Location : drawString
Killed by : none
removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE

377

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::beginText → NO_COVERAGE

378

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setFontAndSize → NO_COVERAGE

385

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

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

390

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

398

1.1
Location : drawString
Killed by : none
removed negation → NO_COVERAGE

400

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

401

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

404

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setTextMatrix → NO_COVERAGE

406

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

409

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

410

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

2.2
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setHorizontalScaling → NO_COVERAGE

414

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

418

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

419

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

422

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

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

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

423

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

425

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

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

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

426

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

427

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

428

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setTextRenderingMode → NO_COVERAGE

429

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

432

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

435

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

437

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

2.2
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGState::setStrokeOpacity → NO_COVERAGE

440

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

442

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

450

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

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

451

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

454

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

455

1.1
Location : drawString
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

459

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

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

461

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

464

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

465

1.1
Location : drawString
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

469

1.1
Location : drawString
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

2.2
Location : drawString
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

3.3
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setAction → NO_COVERAGE

471

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

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

472

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

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

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

473

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setCharacterSpacing → NO_COVERAGE

475

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::showText → NO_COVERAGE

476

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

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

477

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setCharacterSpacing → NO_COVERAGE

479

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

480

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setHorizontalScaling → NO_COVERAGE

483

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

484

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setTextRenderingMode → NO_COVERAGE

487

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::endText → NO_COVERAGE

488

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setTransform → NO_COVERAGE

489

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

497

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setStroke → NO_COVERAGE

498

1.1
Location : drawString
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

499

1.1
Location : drawString
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

500

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

501

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setStroke → NO_COVERAGE

510

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

525

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

527

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

529

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

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

531

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

533

1.1
Location : drawString
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

536

1.1
Location : drawString
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::doAttributes → NO_COVERAGE

541

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

550

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

557

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

564

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

569

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

570

1.1
Location : hit
Killed by : none
removed call to java/awt/geom/Area::intersect → NO_COVERAGE

571

1.1
Location : hit
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

587

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

591

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

596

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

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

600

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

616

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

621

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

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

625

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

627

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

635

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

636

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

640

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

641

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

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

642

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

644

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

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

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

648

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

650

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

655

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

657

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

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

658

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

659

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

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

662

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE

665

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE

668

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineCap → NO_COVERAGE

671

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

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

674

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE

677

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE

680

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLineJoin → NO_COVERAGE

683

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

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

684

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setMiterLimit → NO_COVERAGE

686

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

687

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

688

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

691

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

693

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

698

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

700

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

701

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

703

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

706

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

707

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

709

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

710

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

711

1.1
Location : setStrokeDiff
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setLiteral → NO_COVERAGE

731

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

734

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

757

1.1
Location : setRenderingHints
Killed by : none
removed call to java/awt/RenderingHints::clear → NO_COVERAGE

758

1.1
Location : setRenderingHints
Killed by : none
removed call to java/awt/RenderingHints::putAll → NO_COVERAGE

779

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

807

1.1
Location : scale
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

822

1.1
Location : transform
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

838

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

846

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

847

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

849

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

888

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

896

1.1
Location : create
Killed by : none
removed call to java/awt/RenderingHints::putAll → NO_COVERAGE

910

1.1
Location : create
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFont → NO_COVERAGE

912

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

915

1.1
Location : create
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE

916

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

923

1.1
Location : create
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokeDiff → NO_COVERAGE

924

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

925

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

926

1.1
Location : create
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE

928

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

932

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

942

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

943

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

945

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

982

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

984

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

988

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

998

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

1002

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

1017

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

1018

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

1019

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

1027

1.1
Location : clipRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::clip → NO_COVERAGE

1035

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

1042

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

1043

1.1
Location : clip
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setClip → NO_COVERAGE

1047

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

1050

1.1
Location : clip
Killed by : none
removed call to java/awt/geom/Area::intersect → NO_COVERAGE

1051

1.1
Location : clip
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE

1059

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

1062

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

1070

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

1071

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

1072

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

1074

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

1079

1.1
Location : setClip
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::followPath → NO_COVERAGE

1098

1.1
Location : drawLine
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1105

1.1
Location : drawRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1112

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

1120

1.1
Location : clearRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE

1121

1.1
Location : clearRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::fillRect → NO_COVERAGE

1122

1.1
Location : clearRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE

1130

1.1
Location : drawRoundRect
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1138

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

1146

1.1
Location : drawOval
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1154

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

1162

1.1
Location : drawArc
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1171

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

1179

1.1
Location : drawPolyline
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1187

1.1
Location : drawPolygon
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::draw → NO_COVERAGE

1195

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

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

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

1196

1.1
Location : fillPolygon
Killed by : none
removed call to java/awt/Polygon::addPoint → NO_COVERAGE

1198

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

1205

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1212

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1219

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE

1220

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1227

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE

1228

1.1
Location : drawImage
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

1229

1.1
Location : drawImage
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

1231

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

1232

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1239

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1246

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::waitForImage → NO_COVERAGE

1247

1.1
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

1248

1.1
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

1249

1.1
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

1250

1.1
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

1253

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

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

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

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

5.5
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1255

1.1
Location : drawImage
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

1256

1.1
Location : drawImage
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

1258

1.1
Location : drawImage
Killed by : none
Replaced double multiplication with division → NO_COVERAGE

1259

1.1
Location : drawImage
Killed by : none
Replaced double multiplication with division → NO_COVERAGE

1260

1.1
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

2.2
Location : drawImage
Killed by : none
Replaced double subtraction with addition → NO_COVERAGE

1261

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

1265

1.1
Location : drawImage
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

1267

1.1
Location : drawImage
Killed by : none
removed call to java/awt/Graphics::dispose → NO_COVERAGE

1268

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1275

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

1277

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

1279

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

1280

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

1281

1.1
Location : dispose
Killed by : none
removed call to java/awt/Graphics2D::dispose → NO_COVERAGE

1283

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

1285

1.1
Location : dispose
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::internalDispose → NO_COVERAGE

1287

1.1
Location : dispose
Killed by : none
removed call to com/lowagie/text/pdf/ByteBuffer::reset → NO_COVERAGE

1297

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

1298

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

2.2
Location : internalDispose
Killed by : none
Changed increment from 2 to -2 → NO_COVERAGE

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

1300

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

1301

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

1302

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

1303

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

1304

1.1
Location : internalDispose
Killed by : none
removed call to java/awt/Graphics2D::dispose → NO_COVERAGE

1306

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

1310

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

1322

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

1323

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

1324

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

1326

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

1330

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

1331

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokeDiff → NO_COVERAGE

1333

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setStrokePaint → NO_COVERAGE

1335

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

1336

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setFillPaint → NO_COVERAGE

1339

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

1344

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

1345

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

1347

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::normalizeY → NO_COVERAGE

1350

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::closePath → NO_COVERAGE

1354

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::curveTo → NO_COVERAGE

1358

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

1362

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

1366

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::curveTo → NO_COVERAGE

1369

1.1
Location : followPath
Killed by : none
removed call to java/awt/geom/PathIterator::next → NO_COVERAGE

1373

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

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

1374

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

1375

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::eoFill → NO_COVERAGE

1377

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

1381

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

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

1382

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

1385

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

1386

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

1387

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

1388

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::eoClip → NO_COVERAGE

1390

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::clip → NO_COVERAGE

1391

1.1
Location : followPath
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::newPath → NO_COVERAGE

1396

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

2.2
Location : normalizeY
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/PdfGraphics2D::normalizeY → NO_COVERAGE

1408

1.1
Location : normalizeMatrix
Killed by : none
removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE

1412

1.1
Location : normalizeMatrix
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

1413

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

1417

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

1421

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE

1422

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

1426

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

1427

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::concatenate → NO_COVERAGE

1430

1.1
Location : drawImage
Killed by : none
removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE

1431

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

1433

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

1435

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE

1438

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

1443

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

1450

1.1
Location : drawImage
Killed by : none
removed call to java/awt/Graphics2D::dispose → NO_COVERAGE

1454

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/ImageWriteParam::setCompressionMode → NO_COVERAGE

1455

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/ImageWriteParam::setCompressionQuality → NO_COVERAGE

1458

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/ImageWriter::setOutput → NO_COVERAGE

1459

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/ImageWriter::write → NO_COVERAGE

1460

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/ImageWriter::dispose → NO_COVERAGE

1461

1.1
Location : drawImage
Killed by : none
removed call to javax/imageio/stream/ImageOutputStream::close → NO_COVERAGE

1463

1.1
Location : drawImage
Killed by : none
removed call to java/awt/image/BufferedImage::flush → NO_COVERAGE

1468

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

1470

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/Image::makeMask → NO_COVERAGE

1471

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/Image::setInverted → NO_COVERAGE

1472

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/Image::setImageMask → NO_COVERAGE

1474

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::addImage → NO_COVERAGE

1476

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

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

1478

1.1
Location : drawImage
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

2.2
Location : drawImage
Killed by : none
Replaced double addition with subtraction → NO_COVERAGE

3.3
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setAction → NO_COVERAGE

1483

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

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

1485

1.1
Location : drawImage
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

1487

1.1
Location : drawImage
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1491

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

1492

1.1
Location : checkNewPaint
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1493

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

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

3.3
Location : checkNewPaint
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

1497

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

1499

1.1
Location : setFillPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE

1504

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

1506

1.1
Location : setStrokePaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfGraphics2D::setPaint → NO_COVERAGE

1511

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

1514

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

1515

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

1518

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

1520

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

2.2
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE

1523

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

1525

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

1528

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

1531

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

1533

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

2.2
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfGState::setStrokeOpacity → NO_COVERAGE

1536

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

1538

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

1541

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

1551

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

1552

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setShadingFill → NO_COVERAGE

1554

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setShadingStroke → NO_COVERAGE

1556

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

1564

1.1
Location : setPaint
Killed by : none
removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE

1565

1.1
Location : setPaint
Killed by : none
removed negation → NO_COVERAGE

2.2
Location : setPaint
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

3.3
Location : setPaint
Killed by : none
Replaced double division with multiplication → NO_COVERAGE

4.4
Location : setPaint
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

1567

1.1
Location : setPaint
Killed by : none
removed call to java/awt/geom/AffineTransform::getMatrix → NO_COVERAGE

1568

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfPatternPainter::setPatternMatrix → NO_COVERAGE

1569

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/Image::setAbsolutePosition → NO_COVERAGE

1570

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfPatternPainter::addImage → NO_COVERAGE

1571

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

1572

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setPatternFill → NO_COVERAGE

1574

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setPatternStroke → NO_COVERAGE

1576

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

1577

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

1579

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

1586

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

1591

1.1
Location : setPaint
Killed by : none
removed call to java/awt/Graphics2D::transform → NO_COVERAGE

1595

1.1
Location : setPaint
Killed by : none
removed call to java/awt/Graphics2D::setPaint → NO_COVERAGE

1596

1.1
Location : setPaint
Killed by : none
removed call to java/awt/Graphics2D::fill → NO_COVERAGE

1597

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

1599

1.1
Location : setPaint
Killed by : none
removed call to java/awt/geom/AffineTransform::scale → NO_COVERAGE

1600

1.1
Location : setPaint
Killed by : none
removed negation → NO_COVERAGE

2.2
Location : setPaint
Killed by : none
removed negation → NO_COVERAGE

3.3
Location : setPaint
Killed by : none
removed call to java/awt/geom/AffineTransform::translate → NO_COVERAGE

1603

1.1
Location : setPaint
Killed by : none
removed call to java/awt/Graphics2D::dispose → NO_COVERAGE

1607

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/Image::setAbsolutePosition → NO_COVERAGE

1608

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfPatternPainter::addImage → NO_COVERAGE

1610

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

1611

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

1614

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

1616

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfGState::setFillOpacity → NO_COVERAGE

1619

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setGState → NO_COVERAGE

1621

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setPatternFill → NO_COVERAGE

1624

1.1
Location : setPaint
Killed by : none
removed call to com/lowagie/text/pdf/PdfContentByte::setPatternStroke → NO_COVERAGE

1627

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

1628

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

1630

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

1636

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

1638

1.1
Location : waitForImage
Killed by : none
removed call to java/awt/MediaTracker::addImage → NO_COVERAGE

1640

1.1
Location : waitForImage
Killed by : none
removed call to java/awt/MediaTracker::waitForID → NO_COVERAGE

1645

1.1
Location : waitForImage
Killed by : none
removed call to java/awt/MediaTracker::removeImage → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2