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
                
19
                View v = super.create(e);
20
                
21 1 1. create : negated conditional → NO_COVERAGE
                if (v instanceof InlineView) {
22 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                    return this.getInlineView(e);
23 1 1. create : negated conditional → NO_COVERAGE
                } else if (v instanceof ParagraphView) {
24 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                    return this.getParagraphView(e);
25
                }
26
                
27 1 1. create : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::create → NO_COVERAGE
                return v;
28
            }
29
30
            private View getParagraphView(Element e) {
31 1 1. getParagraphView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getParagraphView → NO_COVERAGE
                return new ParagraphView(e) {
32
                    @Override
33
                    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sizeRequirements) {
34
                        
35
                        SizeRequirements r = sizeRequirements;
36
                        
37 1 1. calculateMinorAxisRequirements : negated conditional → NO_COVERAGE
                        if (r == null) {
38
                            r = new SizeRequirements();
39
                        }
40
                        
41
                        float pref = this.layoutPool.getPreferredSpan(axis);
42
                        float min = this.layoutPool.getMinimumSpan(axis);
43
                        
44
                        // Don't include insets, Box.getXXXSpan will include
45
                        // them.
46
                        r.minimum = (int) min;
47
                        r.preferred = Math.max(r.minimum, (int) pref);
48
                        r.maximum = Integer.MAX_VALUE;
49
                        r.alignment = 0.5f;
50
                        
51 1 1. calculateMinorAxisRequirements : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$1::calculateMinorAxisRequirements → NO_COVERAGE
                        return r;
52
                    }
53
                };
54
            }
55
56
            private View getInlineView(Element e) {
57 1 1. getInlineView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1::getInlineView → NO_COVERAGE
                return new InlineView(e) {
58
59
                    @Override
60
                    public int getBreakWeight(int axis, float pos, float len) {
61 1 1. getBreakWeight : replaced int return with 0 for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::getBreakWeight → NO_COVERAGE
                        return GoodBreakWeight;
62
                    }
63
64
                    @Override
65
                    public View breakView(int axis, int p0, float pos, float len) {
66
                        
67 1 1. breakView : negated conditional → NO_COVERAGE
                        if (axis == View.X_AXIS) {
68
                            
69 1 1. breakView : removed call to com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::checkPainter → NO_COVERAGE
                            this.checkPainter();
70
                            int p1 = this.getGlyphPainter().getBoundedPosition(this, p0, pos, len);
71
                            
72 2 1. breakView : negated conditional → NO_COVERAGE
2. breakView : negated conditional → NO_COVERAGE
                            if (p0 == this.getStartOffset() && p1 == this.getEndOffset()) {
73 1 1. breakView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE
                                return this;
74
                            }
75
                            
76 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);
77
                        }
78
                        
79 1 1. breakView : replaced return value with null for com/jsql/view/swing/panel/util/HTMLEditorKitTextPaneWrap$1$2::breakView → NO_COVERAGE
                        return this;
80
                    }
81
                };
82
            }
83
        };
84
    }
85
}

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

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

23

1.1
Location : create
Killed by : none
negated conditional → 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

27

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

31

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

37

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

51

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

57

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

61

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

67

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

69

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

72

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

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

73

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

76

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

79

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.16.1