HTMLEditorKitTextPaneWrap.java

1
package com.jsql.view.swing.panel.util;
2
3
import javax.swing.*;
4
import javax.swing.text.Element;
5
import javax.swing.text.View;
6
import javax.swing.text.ViewFactory;
7
import javax.swing.text.html.HTMLEditorKit;
8
import javax.swing.text.html.InlineView;
9
import javax.swing.text.html.ParagraphView;
10
11
public class HTMLEditorKitTextPaneWrap extends HTMLEditorKit {
12
    @Override
13
    public ViewFactory getViewFactory() {
14 1 1. getViewFactory : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap::getViewFactory → NO_COVERAGE
        return new HTMLFactory() {
15
16
            @Override
17
            public View create(Element e) {
18
                View v = super.create(e);
19 1 1. create : negated conditional → NO_COVERAGE
                if (v instanceof InlineView) {
20 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                    return this.getInlineView(e);
21 1 1. create : negated conditional → NO_COVERAGE
                } else if (v instanceof ParagraphView) {
22 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                    return this.getParagraphView(e);
23
                }
24 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                return v;
25
            }
26
27
            private View getParagraphView(Element e) {
28 1 1. getParagraphView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getParagraphView → NO_COVERAGE
                return new ParagraphView(e) {
29
                    @Override
30
                    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sizeRequirements) {
31
                        SizeRequirements r = sizeRequirements;
32 1 1. calculateMinorAxisRequirements : negated conditional → NO_COVERAGE
                        if (r == null) {
33
                            r = new SizeRequirements();
34
                        }
35
                        
36
                        float pref = this.layoutPool.getPreferredSpan(axis);
37
                        float min = this.layoutPool.getMinimumSpan(axis);
38
                        
39
                        // Don't include insets, Box.getXXXSpan will include
40
                        // them.
41
                        r.minimum = (int) min;
42
                        r.preferred = Math.max(r.minimum, (int) pref);
43
                        r.maximum = Integer.MAX_VALUE;
44
                        r.alignment = 0.5f;
45 1 1. calculateMinorAxisRequirements : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$1::calculateMinorAxisRequirements → NO_COVERAGE
                        return r;
46
                    }
47
                };
48
            }
49
50
            private View getInlineView(Element e) {
51 1 1. getInlineView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getInlineView → NO_COVERAGE
                return new InlineView(e) {
52
53
                    @Override
54
                    public int getBreakWeight(int axis, float pos, float len) {
55 1 1. getBreakWeight : replaced int return with 0 for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::getBreakWeight → NO_COVERAGE
                        return View.GoodBreakWeight;
56
                    }
57
58
                    @Override
59
                    public View breakView(int axis, int p0, float pos, float len) {
60 1 1. breakView : negated conditional → NO_COVERAGE
                        if (axis == View.X_AXIS) {
61 1 1. breakView : removed call to com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::checkPainter → NO_COVERAGE
                            this.checkPainter();
62
                            int p1 = this.getGlyphPainter().getBoundedPosition(this, p0, pos, len);
63 2 1. breakView : negated conditional → NO_COVERAGE
2. breakView : negated conditional → NO_COVERAGE
                            if (p0 == this.getStartOffset() && p1 == this.getEndOffset()) {
64 1 1. breakView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE
                                return this;
65
                            }
66 1 1. breakView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE
                            return this.createFragment(p0, p1);
67
                        }
68 1 1. breakView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE
                        return this;
69
                    }
70
                };
71
            }
72
        };
73
    }
74
}

Mutations

14

1.1
Location : getViewFactory
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap::getViewFactory → NO_COVERAGE

19

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

20

1.1
Location : create
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE

21

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

22

1.1
Location : create
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE

24

1.1
Location : create
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE

28

1.1
Location : getParagraphView
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getParagraphView → NO_COVERAGE

32

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

45

1.1
Location : calculateMinorAxisRequirements
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$1::calculateMinorAxisRequirements → NO_COVERAGE

51

1.1
Location : getInlineView
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getInlineView → NO_COVERAGE

55

1.1
Location : getBreakWeight
Killed by : none
replaced int return with 0 for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::getBreakWeight → NO_COVERAGE

60

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

61

1.1
Location : breakView
Killed by : none
removed call to com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::checkPainter → NO_COVERAGE

63

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

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

64

1.1
Location : breakView
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE

66

1.1
Location : breakView
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE

68

1.1
Location : breakView
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.22.1