DnDTabbedPane.java

1
package com.jsql.view.swing.tab.dnd;
2
3
import com.jsql.view.swing.action.ActionCloseTabResult;
4
import com.jsql.view.swing.ui.CustomMetalTabbedPaneUI;
5
import com.jsql.view.swing.util.UiUtil;
6
7
import javax.swing.*;
8
import java.awt.*;
9
import java.awt.dnd.DragSource;
10
import java.awt.event.MouseAdapter;
11
import java.awt.event.MouseEvent;
12
import java.beans.PropertyChangeEvent;
13
import java.beans.PropertyChangeListener;
14
import java.util.Objects;
15
import java.util.Optional;
16
17
public class DnDTabbedPane extends JTabbedPane {
18
    
19
    private static final int SCROLL_SIZE = 20;  // Test
20
    private static final int BUTTON_SIZE = 30;  // 30 is magic number of scroll button size
21
    private static final int LINE_WIDTH = 3;
22
    private static final Rectangle RECT_BACKWARD = new Rectangle();
23
    private static final Rectangle RECT_FORWARD = new Rectangle();
24
    protected static final Rectangle RECT_LINE = new Rectangle();
25
    protected int dragTabIndex = -1;
26
    private transient DnDDropLocation dropLocation;
27
28
    public static final class DnDDropLocation extends TransferHandler.DropLocation {
29
        
30
        private final int index;
31
        private boolean dropable = true;
32
        
33
        private DnDDropLocation(Point p, int index) {
34
            super(p);
35
            this.index = index;
36
        }
37
        
38
        public int getIndex() {
39 1 1. getIndex : replaced int return with 0 for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::getIndex → NO_COVERAGE
            return this.index;
40
        }
41
        
42
        public void setDroppable(boolean flag) {
43
            this.dropable = flag;
44
        }
45
        
46
        public boolean isDroppable() {
47 2 1. isDroppable : replaced boolean return with true for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::isDroppable → NO_COVERAGE
2. isDroppable : replaced boolean return with false for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::isDroppable → NO_COVERAGE
            return this.dropable;
48
        }
49
    }
50
    
51
    private void clickArrowButton(String actionKey) {
52
        
53
        JButton scrollForwardButton = null;
54
        JButton scrollBackwardButton = null;
55
        
56
        for (Component c: this.getComponents()) {
57 1 1. clickArrowButton : negated conditional → NO_COVERAGE
            if (c instanceof JButton) {
58 1 1. clickArrowButton : negated conditional → NO_COVERAGE
                if (scrollForwardButton == null) {
59
                    scrollForwardButton = (JButton) c;
60 1 1. clickArrowButton : negated conditional → NO_COVERAGE
                } else if (scrollBackwardButton == null) {
61
                    scrollBackwardButton = (JButton) c;
62
                }
63
            }
64
        }
65
        
66 1 1. clickArrowButton : negated conditional → NO_COVERAGE
        JButton button = "scrollTabsForwardAction".equals(actionKey) ? scrollForwardButton : scrollBackwardButton;
67
    
68
        Optional.ofNullable(button)
69
            .filter(JButton::isEnabled)
70 1 1. clickArrowButton : removed call to java/util/Optional::ifPresent → NO_COVERAGE
            .ifPresent(JButton::doClick);
71
    }
72
    
73
    public void autoScrollTest(Point pt) {
74
        
75
        Rectangle r = this.getTabAreaBounds();
76
        
77 1 1. autoScrollTest : negated conditional → NO_COVERAGE
        if (isTopBottomTabPlacement(this.getTabPlacement())) {
78
            
79 1 1. autoScrollTest : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
            RECT_BACKWARD.setBounds(r.x, r.y, SCROLL_SIZE, r.height);
80 4 1. autoScrollTest : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
2. autoScrollTest : Replaced integer addition with subtraction → NO_COVERAGE
3. autoScrollTest : Replaced integer subtraction with addition → NO_COVERAGE
4. autoScrollTest : Replaced integer subtraction with addition → NO_COVERAGE
            RECT_FORWARD.setBounds(r.x + r.width - SCROLL_SIZE - BUTTON_SIZE, r.y, SCROLL_SIZE + BUTTON_SIZE, r.height);
81
            
82
        } else {
83
            
84 1 1. autoScrollTest : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
            RECT_BACKWARD.setBounds(r.x, r.y, r.width, SCROLL_SIZE);
85 4 1. autoScrollTest : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
2. autoScrollTest : Replaced integer addition with subtraction → NO_COVERAGE
3. autoScrollTest : Replaced integer subtraction with addition → NO_COVERAGE
4. autoScrollTest : Replaced integer subtraction with addition → NO_COVERAGE
            RECT_FORWARD.setBounds(r.x, r.y + r.height - SCROLL_SIZE - BUTTON_SIZE, r.width, SCROLL_SIZE + BUTTON_SIZE);
86
        }
87
        
88 1 1. autoScrollTest : negated conditional → NO_COVERAGE
        if (RECT_BACKWARD.contains(pt)) {
89 1 1. autoScrollTest : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::clickArrowButton → NO_COVERAGE
            this.clickArrowButton("scrollTabsBackwardAction");
90 1 1. autoScrollTest : negated conditional → NO_COVERAGE
        } else if (RECT_FORWARD.contains(pt)) {
91 1 1. autoScrollTest : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::clickArrowButton → NO_COVERAGE
            this.clickArrowButton("scrollTabsForwardAction");
92
        }
93
    }
94
    
95
    protected DnDTabbedPane() {
96
        
97
        super();
98
        
99
        // UIManager.put() is not enough
100 1 1. <init> : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setUI → NO_COVERAGE
        this.setUI(new CustomMetalTabbedPaneUI());
101 1 1. <init> : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setBorder → NO_COVERAGE
        this.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, UiUtil.COLOR_COMPONENT_BORDER));
102
        
103
        var h = new Handler();
104 1 1. <init> : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addMouseListener → NO_COVERAGE
        this.addMouseListener(h);
105 1 1. <init> : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addMouseMotionListener → NO_COVERAGE
        this.addMouseMotionListener(h);
106 1 1. <init> : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addPropertyChangeListener → NO_COVERAGE
        this.addPropertyChangeListener(h);
107
    }
108
    
109
    public DnDDropLocation dropLocationForPointDnD(Point p) {
110
        
111 2 1. dropLocationForPointDnD : negated conditional → NO_COVERAGE
2. dropLocationForPointDnD : changed conditional boundary → NO_COVERAGE
        for (var i = 0; i < this.getTabCount(); i++) {
112 1 1. dropLocationForPointDnD : negated conditional → NO_COVERAGE
            if (this.getBoundsAt(i).contains(p)) {
113 1 1. dropLocationForPointDnD : replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE
                return new DnDDropLocation(p, i);
114
            }
115
        }
116
        
117 1 1. dropLocationForPointDnD : negated conditional → NO_COVERAGE
        if (this.getTabAreaBounds().contains(p)) {
118 1 1. dropLocationForPointDnD : replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE
            return new DnDDropLocation(p, this.getTabCount());
119
        }
120
        
121 1 1. dropLocationForPointDnD : replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE
        return new DnDDropLocation(p, -1);
122
    }
123
    
124
    public void setDropLocation(TransferHandler.DropLocation location, boolean forDrop) {
125
        
126
        DnDDropLocation old = this.dropLocation;
127
        
128 2 1. setDropLocation : negated conditional → NO_COVERAGE
2. setDropLocation : negated conditional → NO_COVERAGE
        if (Objects.isNull(location) || !forDrop) {
129
            this.dropLocation = new DnDDropLocation(new Point(), -1);
130 1 1. setDropLocation : negated conditional → NO_COVERAGE
        } else if (location instanceof DnDDropLocation) {
131
            this.dropLocation = (DnDDropLocation) location;
132
        }
133
        
134 1 1. setDropLocation : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::firePropertyChange → NO_COVERAGE
        this.firePropertyChange("dropLocation", old, this.dropLocation);
135
    }
136
    
137
    public void exportTab(int dragIndex, JTabbedPane target, int targetIndex) {
138
        
139
        var cmp = this.getComponentAt(dragIndex);
140
        var tab = this.getTabComponentAt(dragIndex);
141
        String title = this.getTitleAt(dragIndex);
142
        var icon = this.getIconAt(dragIndex);
143
        String tip = this.getToolTipTextAt(dragIndex);
144
        boolean isEnabled = this.isEnabledAt(dragIndex);
145
        
146 1 1. exportTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::remove → NO_COVERAGE
        this.remove(dragIndex);
147 1 1. exportTab : removed call to javax/swing/JTabbedPane::insertTab → NO_COVERAGE
        target.insertTab(title, icon, cmp, tip, targetIndex);
148 1 1. exportTab : removed call to javax/swing/JTabbedPane::setEnabledAt → NO_COVERAGE
        target.setEnabledAt(targetIndex, isEnabled);
149
150 1 1. exportTab : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE
        target.setTabComponentAt(targetIndex, tab);
151 1 1. exportTab : removed call to javax/swing/JTabbedPane::setSelectedIndex → NO_COVERAGE
        target.setSelectedIndex(targetIndex);
152
        
153 1 1. exportTab : negated conditional → NO_COVERAGE
        if (tab instanceof JComponent) {
154 1 1. exportTab : removed call to javax/swing/JComponent::scrollRectToVisible → NO_COVERAGE
            ((JComponent) tab).scrollRectToVisible(tab.getBounds());
155
        }
156
    }
157
    
158
    public void convertTab(int prev, int next) {
159
        
160
        var cmp = this.getComponentAt(prev);
161
        var tab = this.getTabComponentAt(prev);
162
        String title = this.getTitleAt(prev);
163
        var icon = this.getIconAt(prev);
164
        String tip = this.getToolTipTextAt(prev);
165
        boolean isEnabled = this.isEnabledAt(prev);
166 3 1. convertTab : negated conditional → NO_COVERAGE
2. convertTab : Replaced integer subtraction with addition → NO_COVERAGE
3. convertTab : changed conditional boundary → NO_COVERAGE
        int tgtindex = prev > next ? next : next - 1;
167
        
168 1 1. convertTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::remove → NO_COVERAGE
        this.remove(prev);
169 1 1. convertTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::insertTab → NO_COVERAGE
        this.insertTab(title, icon, cmp, tip, tgtindex);
170 1 1. convertTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setEnabledAt → NO_COVERAGE
        this.setEnabledAt(tgtindex, isEnabled);
171
        
172
        // When you drag'n'drop a disabled tab, it finishes enabled and selected.
173
        // pointed out by dlorde
174 1 1. convertTab : negated conditional → NO_COVERAGE
        if (isEnabled) {
175 1 1. convertTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setSelectedIndex → NO_COVERAGE
            this.setSelectedIndex(tgtindex);
176
        }
177
        
178
        // I have a component in all tabs (jlabel with an X to close the tab) and when i move a tab the component disappear.
179
        // pointed out by Daniel Dario Morales Salas
180 1 1. convertTab : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setTabComponentAt → NO_COVERAGE
        this.setTabComponentAt(tgtindex, tab);
181
    }
182
    
183
    public Optional<Rectangle> getDropLineRect() {
184
        
185
        int index = Optional.ofNullable(this.getDropLocation())
186
            .filter(DnDDropLocation::isDroppable)
187
            .map(DnDDropLocation::getIndex)
188
            .orElse(-1);
189
        
190 2 1. getDropLineRect : negated conditional → NO_COVERAGE
2. getDropLineRect : changed conditional boundary → NO_COVERAGE
        if (index < 0) {
191
            
192 1 1. getDropLineRect : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
            RECT_LINE.setBounds(0, 0, 0, 0);
193
            return Optional.empty();
194
        }
195
        
196
        int a = Math.min(index, 1);
197 2 1. getDropLineRect : Replaced integer subtraction with addition → NO_COVERAGE
2. getDropLineRect : Replaced integer multiplication with division → NO_COVERAGE
        Rectangle r = this.getBoundsAt(a * (index - 1));
198
        
199 1 1. getDropLineRect : negated conditional → NO_COVERAGE
        if (isTopBottomTabPlacement(this.getTabPlacement())) {
200 4 1. getDropLineRect : Replaced integer subtraction with addition → NO_COVERAGE
2. getDropLineRect : Replaced integer addition with subtraction → NO_COVERAGE
3. getDropLineRect : Replaced integer multiplication with division → NO_COVERAGE
4. getDropLineRect : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
            RECT_LINE.setBounds(r.x - LINE_WIDTH / 2 + r.width * a, r.y, LINE_WIDTH, r.height);
201
        } else {
202 4 1. getDropLineRect : Replaced integer subtraction with addition → NO_COVERAGE
2. getDropLineRect : Replaced integer multiplication with division → NO_COVERAGE
3. getDropLineRect : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
4. getDropLineRect : Replaced integer addition with subtraction → NO_COVERAGE
            RECT_LINE.setBounds(r.x, r.y - LINE_WIDTH / 2 + r.height * a, r.width, LINE_WIDTH);
203
        }
204
        
205 1 1. getDropLineRect : replaced return value with Optional.empty for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getDropLineRect → NO_COVERAGE
        return Optional.of(RECT_LINE);
206
    }
207
    
208
    public Rectangle getTabAreaBounds() {
209
        
210
        Rectangle tabbedRect = this.getBounds();
211
        int xx = tabbedRect.x;
212
        int yy = tabbedRect.y;
213
        
214
        Rectangle compRect = Optional.ofNullable(this.getSelectedComponent())
215
            .map(Component::getBounds)
216
            .orElseGet(Rectangle::new);
217
218
        int tabPlacement = this.getTabPlacement();
219
        
220 1 1. getTabAreaBounds : negated conditional → NO_COVERAGE
        if (isTopBottomTabPlacement(tabPlacement)) {
221
            
222 1 1. getTabAreaBounds : Replaced integer subtraction with addition → NO_COVERAGE
            tabbedRect.height = tabbedRect.height - compRect.height;
223
            
224 1 1. getTabAreaBounds : negated conditional → NO_COVERAGE
            if (tabPlacement == BOTTOM) {
225 2 1. getTabAreaBounds : Replaced integer addition with subtraction → NO_COVERAGE
2. getTabAreaBounds : Replaced integer addition with subtraction → NO_COVERAGE
                tabbedRect.y += compRect.y + compRect.height;
226
            }
227
        } else {
228
            
229 1 1. getTabAreaBounds : Replaced integer subtraction with addition → NO_COVERAGE
            tabbedRect.width = tabbedRect.width - compRect.width;
230
            
231 1 1. getTabAreaBounds : negated conditional → NO_COVERAGE
            if (tabPlacement == RIGHT) {
232 2 1. getTabAreaBounds : Replaced integer addition with subtraction → NO_COVERAGE
2. getTabAreaBounds : Replaced integer addition with subtraction → NO_COVERAGE
                tabbedRect.x += compRect.x + compRect.width;
233
            }
234
        }
235
        
236 3 1. getTabAreaBounds : removed call to java/awt/Rectangle::translate → NO_COVERAGE
2. getTabAreaBounds : removed negation → NO_COVERAGE
3. getTabAreaBounds : removed negation → NO_COVERAGE
        tabbedRect.translate(-xx, -yy);
237
        
238 1 1. getTabAreaBounds : replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getTabAreaBounds → NO_COVERAGE
        return tabbedRect;
239
    }
240
241
    public static boolean isTopBottomTabPlacement(int tabPlacement) {
242 3 1. isTopBottomTabPlacement : replaced boolean return with true for com/jsql/view/swing/tab/dnd/DnDTabbedPane::isTopBottomTabPlacement → NO_COVERAGE
2. isTopBottomTabPlacement : negated conditional → NO_COVERAGE
3. isTopBottomTabPlacement : negated conditional → NO_COVERAGE
        return tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM;
243
    }
244
245
    private class Handler extends MouseAdapter implements PropertyChangeListener { // , BeforeDrag
246
        
247
        private Point startPt;
248
        private final int gestureMotionThreshold = DragSource.getDragThreshold();
249
250
        private void repaintDropLocation() {
251
            
252
            Component c = DnDTabbedPane.this.getRootPane().getGlassPane();
253
            
254 1 1. repaintDropLocation : negated conditional → NO_COVERAGE
            if (c instanceof GhostGlassPane) {
255
                
256
                GhostGlassPane glassPane = (GhostGlassPane) c;
257 1 1. repaintDropLocation : removed call to com/jsql/view/swing/tab/dnd/GhostGlassPane::setTargetTabbedPane → NO_COVERAGE
                glassPane.setTargetTabbedPane(DnDTabbedPane.this);
258 1 1. repaintDropLocation : removed call to com/jsql/view/swing/tab/dnd/GhostGlassPane::repaint → NO_COVERAGE
                glassPane.repaint();
259
            }
260
        }
261
        
262
        // PropertyChangeListener
263
        @Override
264
        public void propertyChange(PropertyChangeEvent e) {
265
            
266
            String propertyName = e.getPropertyName();
267 1 1. propertyChange : negated conditional → NO_COVERAGE
            if ("dropLocation".equals(propertyName)) {
268 1 1. propertyChange : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane$Handler::repaintDropLocation → NO_COVERAGE
                this.repaintDropLocation();
269
            }
270
        }
271
        
272
        // MouseListener
273
        @Override
274
        public void mousePressed(MouseEvent e) {
275
            
276
            DnDTabbedPane src = (DnDTabbedPane) e.getComponent();
277 2 1. mousePressed : negated conditional → NO_COVERAGE
2. mousePressed : changed conditional boundary → NO_COVERAGE
            boolean isOnlyOneTab = src.getTabCount() <= 1;
278
            
279 1 1. mousePressed : negated conditional → NO_COVERAGE
            if (isOnlyOneTab) {
280
                
281
                this.startPt = null;
282
                return;
283
            }
284
            
285
            var tabPt = e.getPoint();
286
            int idx = src.indexAtLocation(tabPt.x, tabPt.y);
287
            
288
            // disabled tab, null component problem.
289
            // pointed out by daryl. NullPointerException: i.e. addTab("Tab", null)
290 4 1. mousePressed : negated conditional → NO_COVERAGE
2. mousePressed : negated conditional → NO_COVERAGE
3. mousePressed : negated conditional → NO_COVERAGE
4. mousePressed : changed conditional boundary → NO_COVERAGE
            boolean flag = idx < 0 || !src.isEnabledAt(idx) || Objects.isNull(src.getComponentAt(idx));
291
            
292 1 1. mousePressed : negated conditional → NO_COVERAGE
            this.startPt = flag ? null : tabPt;
293
        }
294
        
295
        @Override
296
        public void mouseDragged(MouseEvent e) {
297
            
298
            var tabPt = e.getPoint();
299
            
300 3 1. mouseDragged : negated conditional → NO_COVERAGE
2. mouseDragged : negated conditional → NO_COVERAGE
3. mouseDragged : changed conditional boundary → NO_COVERAGE
            if (Objects.nonNull(this.startPt) && this.startPt.distance(tabPt) > this.gestureMotionThreshold) {
301
                
302
                DnDTabbedPane src = (DnDTabbedPane) e.getComponent();
303
                var th = src.getTransferHandler();
304
                DnDTabbedPane.this.dragTabIndex = src.indexAtLocation(tabPt.x, tabPt.y);
305
                
306
                // Unhandled NoClassDefFoundError #56620: Could not initialize class java.awt.dnd.DragSource
307 1 1. mouseDragged : removed call to javax/swing/TransferHandler::exportAsDrag → NO_COVERAGE
                th.exportAsDrag(src, e, TransferHandler.MOVE);
308
                
309 1 1. mouseDragged : removed call to java/awt/Rectangle::setBounds → NO_COVERAGE
                RECT_LINE.setBounds(0, 0, 0, 0);
310 1 1. mouseDragged : removed call to java/awt/Component::setVisible → NO_COVERAGE
                src.getRootPane().getGlassPane().setVisible(true);
311 1 1. mouseDragged : removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setDropLocation → NO_COVERAGE
                src.setDropLocation(new DnDDropLocation(tabPt, -1), true);
312
                
313
                this.startPt = null;
314
            }
315
        }
316
317
        @Override
318
        public void mouseClicked(MouseEvent e) {
319
            
320
            var tabPt = e.getPoint();
321
            JTabbedPane src = (JTabbedPane) e.getSource();
322
            
323
            int i = src.indexAtLocation(tabPt.x, tabPt.y);
324
            
325 3 1. mouseClicked : negated conditional → NO_COVERAGE
2. mouseClicked : negated conditional → NO_COVERAGE
3. mouseClicked : changed conditional boundary → NO_COVERAGE
            if (-1 < i && e.getButton() == MouseEvent.BUTTON2) {
326 1 1. mouseClicked : removed call to com/jsql/view/swing/action/ActionCloseTabResult::perform → NO_COVERAGE
                ActionCloseTabResult.perform(i);
327
            }
328
        }
329
    }
330
    
331
    public final DnDDropLocation getDropLocation() {
332 1 1. getDropLocation : replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getDropLocation → NO_COVERAGE
        return this.dropLocation;
333
    }
334
}

Mutations

39

1.1
Location : getIndex
Killed by : none
replaced int return with 0 for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::getIndex → NO_COVERAGE

47

1.1
Location : isDroppable
Killed by : none
replaced boolean return with true for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::isDroppable → NO_COVERAGE

2.2
Location : isDroppable
Killed by : none
replaced boolean return with false for com/jsql/view/swing/tab/dnd/DnDTabbedPane$DnDDropLocation::isDroppable → NO_COVERAGE

57

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

58

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

60

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

66

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

70

1.1
Location : clickArrowButton
Killed by : none
removed call to java/util/Optional::ifPresent → NO_COVERAGE

77

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

79

1.1
Location : autoScrollTest
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

80

1.1
Location : autoScrollTest
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

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

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

4.4
Location : autoScrollTest
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

84

1.1
Location : autoScrollTest
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

85

1.1
Location : autoScrollTest
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

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

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

4.4
Location : autoScrollTest
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

88

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

89

1.1
Location : autoScrollTest
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::clickArrowButton → NO_COVERAGE

90

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

91

1.1
Location : autoScrollTest
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::clickArrowButton → NO_COVERAGE

100

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setUI → NO_COVERAGE

101

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setBorder → NO_COVERAGE

104

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addMouseListener → NO_COVERAGE

105

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addMouseMotionListener → NO_COVERAGE

106

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::addPropertyChangeListener → NO_COVERAGE

111

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

2.2
Location : dropLocationForPointDnD
Killed by : none
changed conditional boundary → NO_COVERAGE

112

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

113

1.1
Location : dropLocationForPointDnD
Killed by : none
replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE

117

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

118

1.1
Location : dropLocationForPointDnD
Killed by : none
replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE

121

1.1
Location : dropLocationForPointDnD
Killed by : none
replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::dropLocationForPointDnD → NO_COVERAGE

128

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

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

130

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

134

1.1
Location : setDropLocation
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::firePropertyChange → NO_COVERAGE

146

1.1
Location : exportTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::remove → NO_COVERAGE

147

1.1
Location : exportTab
Killed by : none
removed call to javax/swing/JTabbedPane::insertTab → NO_COVERAGE

148

1.1
Location : exportTab
Killed by : none
removed call to javax/swing/JTabbedPane::setEnabledAt → NO_COVERAGE

150

1.1
Location : exportTab
Killed by : none
removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE

151

1.1
Location : exportTab
Killed by : none
removed call to javax/swing/JTabbedPane::setSelectedIndex → NO_COVERAGE

153

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

154

1.1
Location : exportTab
Killed by : none
removed call to javax/swing/JComponent::scrollRectToVisible → NO_COVERAGE

166

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

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

3.3
Location : convertTab
Killed by : none
changed conditional boundary → NO_COVERAGE

168

1.1
Location : convertTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::remove → NO_COVERAGE

169

1.1
Location : convertTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::insertTab → NO_COVERAGE

170

1.1
Location : convertTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setEnabledAt → NO_COVERAGE

174

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

175

1.1
Location : convertTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setSelectedIndex → NO_COVERAGE

180

1.1
Location : convertTab
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setTabComponentAt → NO_COVERAGE

190

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

2.2
Location : getDropLineRect
Killed by : none
changed conditional boundary → NO_COVERAGE

192

1.1
Location : getDropLineRect
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

197

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

2.2
Location : getDropLineRect
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

199

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

200

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

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

3.3
Location : getDropLineRect
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

4.4
Location : getDropLineRect
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

202

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

2.2
Location : getDropLineRect
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

3.3
Location : getDropLineRect
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

4.4
Location : getDropLineRect
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

205

1.1
Location : getDropLineRect
Killed by : none
replaced return value with Optional.empty for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getDropLineRect → NO_COVERAGE

220

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

222

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

224

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

225

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

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

229

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

231

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

232

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

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

236

1.1
Location : getTabAreaBounds
Killed by : none
removed call to java/awt/Rectangle::translate → NO_COVERAGE

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

3.3
Location : getTabAreaBounds
Killed by : none
removed negation → NO_COVERAGE

238

1.1
Location : getTabAreaBounds
Killed by : none
replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getTabAreaBounds → NO_COVERAGE

242

1.1
Location : isTopBottomTabPlacement
Killed by : none
replaced boolean return with true for com/jsql/view/swing/tab/dnd/DnDTabbedPane::isTopBottomTabPlacement → NO_COVERAGE

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

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

254

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

257

1.1
Location : repaintDropLocation
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/GhostGlassPane::setTargetTabbedPane → NO_COVERAGE

258

1.1
Location : repaintDropLocation
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/GhostGlassPane::repaint → NO_COVERAGE

267

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

268

1.1
Location : propertyChange
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane$Handler::repaintDropLocation → NO_COVERAGE

277

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

2.2
Location : mousePressed
Killed by : none
changed conditional boundary → NO_COVERAGE

279

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

290

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

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

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

4.4
Location : mousePressed
Killed by : none
changed conditional boundary → NO_COVERAGE

292

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

300

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

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

3.3
Location : mouseDragged
Killed by : none
changed conditional boundary → NO_COVERAGE

307

1.1
Location : mouseDragged
Killed by : none
removed call to javax/swing/TransferHandler::exportAsDrag → NO_COVERAGE

309

1.1
Location : mouseDragged
Killed by : none
removed call to java/awt/Rectangle::setBounds → NO_COVERAGE

310

1.1
Location : mouseDragged
Killed by : none
removed call to java/awt/Component::setVisible → NO_COVERAGE

311

1.1
Location : mouseDragged
Killed by : none
removed call to com/jsql/view/swing/tab/dnd/DnDTabbedPane::setDropLocation → NO_COVERAGE

325

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

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

3.3
Location : mouseClicked
Killed by : none
changed conditional boundary → NO_COVERAGE

326

1.1
Location : mouseClicked
Killed by : none
removed call to com/jsql/view/swing/action/ActionCloseTabResult::perform → NO_COVERAGE

332

1.1
Location : getDropLocation
Killed by : none
replaced return value with null for com/jsql/view/swing/tab/dnd/DnDTabbedPane::getDropLocation → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1