AdjusterTableColumn.java

1
package com.jsql.view.swing.table;
2
3
import javax.swing.*;
4
import javax.swing.event.TableModelEvent;
5
import javax.swing.event.TableModelListener;
6
import javax.swing.table.TableCellRenderer;
7
import javax.swing.table.TableColumn;
8
import javax.swing.table.TableColumnModel;
9
import javax.swing.table.TableModel;
10
import java.awt.*;
11
import java.awt.event.ActionEvent;
12
import java.beans.PropertyChangeEvent;
13
import java.beans.PropertyChangeListener;
14
import java.util.HashMap;
15
import java.util.Map;
16
17
/**
18
 * Class to manage the widths of columns in a table.
19
 *
20
 * Various properties control how the width of the column is calculated.
21
 * Another property controls whether column width calculation should be dynamic.
22
 * Finally, various Actions will be added to the table to allow the user
23
 * to customize the functionality.
24
 *
25
 * This class was designed to be used with tables that use an auto resize mode
26
 * of AUTO_RESIZE_OFF. With all other modes you are constrained as the width
27
 * of the columns must fit inside the table. So if you increase one column, one
28
 * or more of the other columns must decrease. Because of this the resize mode
29
 * of RESIZE_ALL_COLUMNS will work the best.
30
 */
31
public class AdjusterTableColumn implements PropertyChangeListener, TableModelListener {
32
    
33
    private final JTable tableAdjust;
34
    private final int spacing;
35
    private boolean isColumnHeaderIncluded;
36
    private boolean isColumnDataIncluded;
37
    private boolean isOnlyAdjustLarger;
38
    private boolean isDynamicAdjustment;
39
    private final Map<TableColumn, Integer> columnSizes = new HashMap<>();
40
41
    /**
42
     * Specify the table and use default spacing
43
     */
44
    public AdjusterTableColumn(JTable table) {
45
        this(table, 6);
46
    }
47
48
    /**
49
     * Specify the table and spacing
50
     */
51
    public AdjusterTableColumn(JTable tableAdjust, int spacing) {
52
        
53
        this.tableAdjust = tableAdjust;
54
        
55
        final TableCellRenderer tcrOs = tableAdjust.getTableHeader().getDefaultRenderer();
56 1 1. <init> : removed call to javax/swing/table/JTableHeader::setDefaultRenderer → NO_COVERAGE
        tableAdjust.getTableHeader().setDefaultRenderer(
57
            (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) -> {
58
                    
59
                JLabel label = (JLabel) tcrOs.getTableCellRendererComponent(
60
                    table, value, isSelected, hasFocus, row, column
61
                );
62
                
63 1 1. lambda$new$0 : removed call to javax/swing/JLabel::setBackground → NO_COVERAGE
                label.setBackground(new Color(230, 230, 230));
64
                
65 1 1. lambda$new$0 : replaced return value with null for com/jsql/view/swing/table/AdjusterTableColumn::lambda$new$0 → NO_COVERAGE
                return label;
66
            }
67
        );
68
        
69
        this.spacing = spacing;
70 1 1. <init> : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setColumnHeaderIncluded → NO_COVERAGE
        this.setColumnHeaderIncluded(true);
71 1 1. <init> : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setColumnDataIncluded → NO_COVERAGE
        this.setColumnDataIncluded(true);
72 1 1. <init> : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setOnlyAdjustLarger → NO_COVERAGE
        this.setOnlyAdjustLarger(true);
73 1 1. <init> : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setDynamicAdjustment → NO_COVERAGE
        this.setDynamicAdjustment(false);
74 1 1. <init> : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installActions → NO_COVERAGE
        this.installActions();
75
    }
76
77
    /**
78
     * Adjust the widths of all the columns in the table
79
     */
80
    public void adjustColumns() {
81
        
82
        TableColumnModel tcm = this.tableAdjust.getColumnModel();
83
84 2 1. adjustColumns : changed conditional boundary → NO_COVERAGE
2. adjustColumns : negated conditional → NO_COVERAGE
        for (var i = 0 ; i < tcm.getColumnCount() ; i++) {
85 1 1. adjustColumns : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE
            this.adjustColumn(i);
86
        }
87
    }
88
89
    /**
90
     * Adjust the width of the specified column in the table
91
     */
92
    public void adjustColumn(final int column) {
93
        
94
        var tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
95
96 1 1. adjustColumn : negated conditional → NO_COVERAGE
        if (!tableColumn.getResizable()) {
97
            return;
98
        }
99
100
        int columnHeaderWidth = this.getColumnHeaderWidth(column);
101
        int columnDataWidth   = this.getColumnDataWidth(column);
102
        int preferredWidth    = Math.max(columnHeaderWidth, columnDataWidth);
103
104 1 1. adjustColumn : removed call to com/jsql/view/swing/table/AdjusterTableColumn::updateTableColumn → NO_COVERAGE
        this.updateTableColumn(column, preferredWidth);
105
    }
106
107
    /**
108
     * Calculated the width based on the column name
109
     */
110
    private int getColumnHeaderWidth(int column) {
111
        
112 1 1. getColumnHeaderWidth : negated conditional → NO_COVERAGE
        if (!this.isColumnHeaderIncluded) {
113
            return 0;
114
        }
115
116
        var tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
117
        Object value = tableColumn.getHeaderValue();
118
        TableCellRenderer renderer = tableColumn.getHeaderRenderer();
119
120 1 1. getColumnHeaderWidth : negated conditional → NO_COVERAGE
        if (renderer == null) {
121
            renderer = this.tableAdjust.getTableHeader().getDefaultRenderer();
122
        }
123
124
        var c = renderer.getTableCellRendererComponent(this.tableAdjust, value, false, false, -1, column);
125
        
126 1 1. getColumnHeaderWidth : replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getColumnHeaderWidth → NO_COVERAGE
        return c.getPreferredSize().width;
127
    }
128
129
    /**
130
     * Calculate the width based on the widest cell renderer for the
131
     * given column.
132
     */
133
    private int getColumnDataWidth(int column) {
134
        
135 1 1. getColumnDataWidth : negated conditional → NO_COVERAGE
        if (!this.isColumnDataIncluded) {
136
            return 0;
137
        }
138
139
        var preferredWidth = 0;
140
        int maxWidth = this.tableAdjust.getColumnModel().getColumn(column).getMaxWidth();
141
142 2 1. getColumnDataWidth : changed conditional boundary → NO_COVERAGE
2. getColumnDataWidth : negated conditional → NO_COVERAGE
        for (var row = 0 ; row < this.tableAdjust.getRowCount() ; row++) {
143
            
144
            preferredWidth = Math.max(preferredWidth, this.getCellDataWidth(row, column));
145
146
            // We've exceeded the maximum width, no need to check other rows
147 2 1. getColumnDataWidth : changed conditional boundary → NO_COVERAGE
2. getColumnDataWidth : negated conditional → NO_COVERAGE
            if (preferredWidth >= maxWidth) {
148
                break;
149
            }
150
        }
151
152 1 1. getColumnDataWidth : replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getColumnDataWidth → NO_COVERAGE
        return preferredWidth;
153
    }
154
155
    /**
156
     * Get the preferred width for the specified cell
157
     */
158
    private int getCellDataWidth(int row, int column) {
159
        
160
        // Invoke the renderer for the cell to calculate the preferred width
161
        TableCellRenderer cellRenderer = this.tableAdjust.getCellRenderer(row, column);
162
        Component c = this.tableAdjust.prepareRenderer(cellRenderer, row, column);
163
        
164 2 1. getCellDataWidth : Replaced integer addition with subtraction → NO_COVERAGE
2. getCellDataWidth : replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getCellDataWidth → NO_COVERAGE
        return c.getPreferredSize().width + this.tableAdjust.getIntercellSpacing().width;
165
    }
166
167
    /**
168
     * Update the TableColumn with the newly calculated width
169
     */
170
    private void updateTableColumn(int column, int width) {
171
        
172
        final var tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
173
174 1 1. updateTableColumn : negated conditional → NO_COVERAGE
        if (!tableColumn.getResizable()) {
175
            return;
176
        }
177
178
        int calculatedWidth = width;
179 1 1. updateTableColumn : Replaced integer addition with subtraction → NO_COVERAGE
        calculatedWidth += this.spacing;
180
181
        // Don't shrink the column width
182 1 1. updateTableColumn : negated conditional → NO_COVERAGE
        if (this.isOnlyAdjustLarger) {
183
            calculatedWidth = Math.max(calculatedWidth, tableColumn.getPreferredWidth());
184
        }
185
186
        this.columnSizes.put(tableColumn, tableColumn.getWidth());
187 1 1. updateTableColumn : removed call to javax/swing/table/JTableHeader::setResizingColumn → NO_COVERAGE
        this.tableAdjust.getTableHeader().setResizingColumn(tableColumn);
188 1 1. updateTableColumn : removed call to javax/swing/table/TableColumn::setWidth → NO_COVERAGE
        tableColumn.setWidth(calculatedWidth);
189
    }
190
191
    /**
192
     * Restore the widths of the columns in the table to its previous width
193
     */
194
    public void restoreColumns() {
195
        
196
        TableColumnModel tableColumnModel = this.tableAdjust.getColumnModel();
197
198 2 1. restoreColumns : changed conditional boundary → NO_COVERAGE
2. restoreColumns : negated conditional → NO_COVERAGE
        for (var i = 0 ; i < tableColumnModel.getColumnCount() ; i++) {
199 1 1. restoreColumns : removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumn → NO_COVERAGE
            this.restoreColumn(i);
200
        }
201
    }
202
203
    /**
204
     * Restore the width of the specified column to its previous width
205
     */
206
    private void restoreColumn(int column) {
207
        
208
        var tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
209
        Integer width = this.columnSizes.get(tableColumn);
210
211 1 1. restoreColumn : negated conditional → NO_COVERAGE
        if (width != null) {
212
            
213 1 1. restoreColumn : removed call to javax/swing/table/JTableHeader::setResizingColumn → NO_COVERAGE
            this.tableAdjust.getTableHeader().setResizingColumn(tableColumn);
214 1 1. restoreColumn : removed call to javax/swing/table/TableColumn::setWidth → NO_COVERAGE
            tableColumn.setWidth(width);
215
        }
216
    }
217
218
    /**
219
     * Indicates whether to include the header in the width calculation
220
     */
221
    public void setColumnHeaderIncluded(boolean isColumnHeaderIncluded) {
222
        this.isColumnHeaderIncluded = isColumnHeaderIncluded;
223
    }
224
225
    /**
226
     * Indicates whether to include the model data in the width calculation
227
     */
228
    public void setColumnDataIncluded(boolean isColumnDataIncluded) {
229
        this.isColumnDataIncluded = isColumnDataIncluded;
230
    }
231
232
    /**
233
     * Indicates whether columns can only be increased in size
234
     */
235
    public void setOnlyAdjustLarger(boolean isOnlyAdjustLarger) {
236
        this.isOnlyAdjustLarger = isOnlyAdjustLarger;
237
    }
238
239
    /**
240
     * Indicate whether changes to the model should cause the width to be
241
     * dynamically recalculated.
242
     */
243
    public void setDynamicAdjustment(boolean isDynamicAdjustment) {
244
        
245
        // May need to add or remove the TableModelListener when changed
246 1 1. setDynamicAdjustment : negated conditional → NO_COVERAGE
        if (this.isDynamicAdjustment != isDynamicAdjustment) {
247 1 1. setDynamicAdjustment : negated conditional → NO_COVERAGE
            if (isDynamicAdjustment) {
248
                
249 1 1. setDynamicAdjustment : removed call to javax/swing/JTable::addPropertyChangeListener → NO_COVERAGE
                this.tableAdjust.addPropertyChangeListener(this);
250 1 1. setDynamicAdjustment : removed call to javax/swing/table/TableModel::addTableModelListener → NO_COVERAGE
                this.tableAdjust.getModel().addTableModelListener(this);
251
                
252
            } else {
253
                
254 1 1. setDynamicAdjustment : removed call to javax/swing/JTable::removePropertyChangeListener → NO_COVERAGE
                this.tableAdjust.removePropertyChangeListener(this);
255 1 1. setDynamicAdjustment : removed call to javax/swing/table/TableModel::removeTableModelListener → NO_COVERAGE
                this.tableAdjust.getModel().removeTableModelListener(this);
256
            }
257
        }
258
259
        this.isDynamicAdjustment = isDynamicAdjustment;
260
    }
261
    
262
    /**
263
     * Implement the PropertyChangeListener
264
     */
265
    @Override
266
    public void propertyChange(PropertyChangeEvent e) {
267
        // When the TableModel changes we need to update the listeners
268
        // and column widths
269 1 1. propertyChange : negated conditional → NO_COVERAGE
        if ("model".equals(e.getPropertyName())) {
270
            
271
            TableModel model = (TableModel)e.getOldValue();
272 1 1. propertyChange : removed call to javax/swing/table/TableModel::removeTableModelListener → NO_COVERAGE
            model.removeTableModelListener(this);
273
274
            model = (TableModel)e.getNewValue();
275 1 1. propertyChange : removed call to javax/swing/table/TableModel::addTableModelListener → NO_COVERAGE
            model.addTableModelListener(this);
276 1 1. propertyChange : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE
            this.adjustColumns();
277
        }
278
    }
279
    
280
    /**
281
     * Implement the TableModelListener
282
     */
283
    @Override
284
    public void tableChanged(TableModelEvent e) {
285
        
286 1 1. tableChanged : negated conditional → NO_COVERAGE
        if (!this.isColumnDataIncluded) {
287
            return;
288
        }
289
290
        // A cell has been updated
291 1 1. tableChanged : negated conditional → NO_COVERAGE
        if (e.getType() == TableModelEvent.UPDATE) {
292
            
293
            int column = this.tableAdjust.convertColumnIndexToView(e.getColumn());
294
295
            // Only need to worry about an increase in width for this cell
296 1 1. tableChanged : negated conditional → NO_COVERAGE
            if (this.isOnlyAdjustLarger) {
297
                
298
                int row = e.getFirstRow();
299
                var tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
300
301 1 1. tableChanged : negated conditional → NO_COVERAGE
                if (tableColumn.getResizable()) {
302
                    
303
                    int width = this.getCellDataWidth(row, column);
304 1 1. tableChanged : removed call to com/jsql/view/swing/table/AdjusterTableColumn::updateTableColumn → NO_COVERAGE
                    this.updateTableColumn(column, width);
305
                }
306
            } else {
307 1 1. tableChanged : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE
                this.adjustColumn(column);  // Could be an increase of decrease so check all rows
308
            }
309
        } else {
310 1 1. tableChanged : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE
            this.adjustColumns();  // The update affected more than one column so adjust all columns
311
        }
312
    }
313
314
    /**
315
     * Install Actions to give user control of certain functionality.
316
     */
317
    private void installActions() {
318
        
319 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE
        this.installColumnAction(true,  true,  "adjustColumn",   "control ADD");
320 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE
        this.installColumnAction(false, true,  "adjustColumns",  "control shift ADD");
321 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE
        this.installColumnAction(true,  false, "restoreColumn",  "control SUBTRACT");
322 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE
        this.installColumnAction(false, false, "restoreColumns", "control shift SUBTRACT");
323
324 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installToggleAction → NO_COVERAGE
        this.installToggleAction(true,  false, "toggleDynamic",  "control MULTIPLY");
325 1 1. installActions : removed call to com/jsql/view/swing/table/AdjusterTableColumn::installToggleAction → NO_COVERAGE
        this.installToggleAction(false, true,  "toggleLarger",   "control DIVIDE");
326
    }
327
328
    /**
329
     * Update the input and action maps with a new ColumnAction
330
     */
331
    private void installColumnAction(boolean isSelectedColumn, boolean isAdjust, String key, String keyStroke) {
332
        
333
        Action action = new ColumnAction(isSelectedColumn, isAdjust);
334
        var ks = KeyStroke.getKeyStroke(keyStroke);
335
        
336 1 1. installColumnAction : removed call to javax/swing/InputMap::put → NO_COVERAGE
        this.tableAdjust.getInputMap().put(ks, key);
337 1 1. installColumnAction : removed call to javax/swing/ActionMap::put → NO_COVERAGE
        this.tableAdjust.getActionMap().put(key, action);
338
    }
339
340
    /**
341
     * Update the input and action maps with new ToggleAction
342
     */
343
    private void installToggleAction(boolean isToggleDynamic, boolean isToggleLarger, String key, String keyStroke) {
344
        
345
        Action action = new ToggleAction(isToggleDynamic, isToggleLarger);
346
        var ks = KeyStroke.getKeyStroke(keyStroke);
347
        
348 1 1. installToggleAction : removed call to javax/swing/InputMap::put → NO_COVERAGE
        this.tableAdjust.getInputMap().put(ks, key);
349 1 1. installToggleAction : removed call to javax/swing/ActionMap::put → NO_COVERAGE
        this.tableAdjust.getActionMap().put(key, action);
350
    }
351
352
    /**
353
     * Action to adjust or restore the width of a single column or all columns
354
     */
355
    class ColumnAction extends AbstractAction {
356
        
357
        private final boolean isSelectedColumn;
358
        private final boolean isAdjust;
359
360
        public ColumnAction(boolean isSelectedColumn, boolean isAdjust) {
361
            
362
            this.isSelectedColumn = isSelectedColumn;
363
            this.isAdjust = isAdjust;
364
        }
365
366
        @Override
367
        public void actionPerformed(ActionEvent e) {
368
            // Handle selected column(s) width change actions
369 1 1. actionPerformed : negated conditional → NO_COVERAGE
            if (this.isSelectedColumn) {
370
                
371
                int[] columns = AdjusterTableColumn.this.tableAdjust.getSelectedColumns();
372
373
                for (int column: columns) {
374 1 1. actionPerformed : negated conditional → NO_COVERAGE
                    if (this.isAdjust) {
375 1 1. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE
                        AdjusterTableColumn.this.adjustColumn(column);
376
                    } else {
377 1 1. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumn → NO_COVERAGE
                        AdjusterTableColumn.this.restoreColumn(column);
378
                    }
379
                }
380
            } else {
381 1 1. actionPerformed : negated conditional → NO_COVERAGE
                if (this.isAdjust) {
382 1 1. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE
                    AdjusterTableColumn.this.adjustColumns();
383
                } else {
384 1 1. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumns → NO_COVERAGE
                    AdjusterTableColumn.this.restoreColumns();
385
                }
386
            }
387
        }
388
    }
389
390
    /**
391
     * Toggle properties of the TableColumnAdjuster so the user can
392
     * customize the functionality to their preferences
393
     */
394
    class ToggleAction extends AbstractAction {
395
        
396
        private final boolean isToggleDynamic;
397
        private final boolean isToggleLarger;
398
399
        public ToggleAction(boolean isToggleDynamic, boolean isToggleLarger) {
400
            
401
            this.isToggleDynamic = isToggleDynamic;
402
            this.isToggleLarger = isToggleLarger;
403
        }
404
405
        @Override
406
        public void actionPerformed(ActionEvent e) {
407 1 1. actionPerformed : negated conditional → NO_COVERAGE
            if (this.isToggleDynamic) {
408 2 1. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setDynamicAdjustment → NO_COVERAGE
2. actionPerformed : negated conditional → NO_COVERAGE
                AdjusterTableColumn.this.setDynamicAdjustment(!AdjusterTableColumn.this.isDynamicAdjustment);
409 1 1. actionPerformed : negated conditional → NO_COVERAGE
            } else if (this.isToggleLarger) {
410 2 1. actionPerformed : negated conditional → NO_COVERAGE
2. actionPerformed : removed call to com/jsql/view/swing/table/AdjusterTableColumn::setOnlyAdjustLarger → NO_COVERAGE
                AdjusterTableColumn.this.setOnlyAdjustLarger(!AdjusterTableColumn.this.isOnlyAdjustLarger);
411
            }
412
        }
413
    }
414
}

Mutations

56

1.1
Location : <init>
Killed by : none
removed call to javax/swing/table/JTableHeader::setDefaultRenderer → NO_COVERAGE

63

1.1
Location : lambda$new$0
Killed by : none
removed call to javax/swing/JLabel::setBackground → NO_COVERAGE

65

1.1
Location : lambda$new$0
Killed by : none
replaced return value with null for com/jsql/view/swing/table/AdjusterTableColumn::lambda$new$0 → NO_COVERAGE

70

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setColumnHeaderIncluded → NO_COVERAGE

71

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setColumnDataIncluded → NO_COVERAGE

72

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setOnlyAdjustLarger → NO_COVERAGE

73

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setDynamicAdjustment → NO_COVERAGE

74

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installActions → NO_COVERAGE

84

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

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

85

1.1
Location : adjustColumns
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE

96

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

104

1.1
Location : adjustColumn
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::updateTableColumn → NO_COVERAGE

112

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

120

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

126

1.1
Location : getColumnHeaderWidth
Killed by : none
replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getColumnHeaderWidth → NO_COVERAGE

135

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

142

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

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

147

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

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

152

1.1
Location : getColumnDataWidth
Killed by : none
replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getColumnDataWidth → NO_COVERAGE

164

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

2.2
Location : getCellDataWidth
Killed by : none
replaced int return with 0 for com/jsql/view/swing/table/AdjusterTableColumn::getCellDataWidth → NO_COVERAGE

174

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

179

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

182

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

187

1.1
Location : updateTableColumn
Killed by : none
removed call to javax/swing/table/JTableHeader::setResizingColumn → NO_COVERAGE

188

1.1
Location : updateTableColumn
Killed by : none
removed call to javax/swing/table/TableColumn::setWidth → NO_COVERAGE

198

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

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

199

1.1
Location : restoreColumns
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumn → NO_COVERAGE

211

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

213

1.1
Location : restoreColumn
Killed by : none
removed call to javax/swing/table/JTableHeader::setResizingColumn → NO_COVERAGE

214

1.1
Location : restoreColumn
Killed by : none
removed call to javax/swing/table/TableColumn::setWidth → NO_COVERAGE

246

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

247

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

249

1.1
Location : setDynamicAdjustment
Killed by : none
removed call to javax/swing/JTable::addPropertyChangeListener → NO_COVERAGE

250

1.1
Location : setDynamicAdjustment
Killed by : none
removed call to javax/swing/table/TableModel::addTableModelListener → NO_COVERAGE

254

1.1
Location : setDynamicAdjustment
Killed by : none
removed call to javax/swing/JTable::removePropertyChangeListener → NO_COVERAGE

255

1.1
Location : setDynamicAdjustment
Killed by : none
removed call to javax/swing/table/TableModel::removeTableModelListener → NO_COVERAGE

269

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

272

1.1
Location : propertyChange
Killed by : none
removed call to javax/swing/table/TableModel::removeTableModelListener → NO_COVERAGE

275

1.1
Location : propertyChange
Killed by : none
removed call to javax/swing/table/TableModel::addTableModelListener → NO_COVERAGE

276

1.1
Location : propertyChange
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE

286

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

291

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

296

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

301

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

304

1.1
Location : tableChanged
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::updateTableColumn → NO_COVERAGE

307

1.1
Location : tableChanged
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE

310

1.1
Location : tableChanged
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE

319

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE

320

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE

321

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE

322

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installColumnAction → NO_COVERAGE

324

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installToggleAction → NO_COVERAGE

325

1.1
Location : installActions
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::installToggleAction → NO_COVERAGE

336

1.1
Location : installColumnAction
Killed by : none
removed call to javax/swing/InputMap::put → NO_COVERAGE

337

1.1
Location : installColumnAction
Killed by : none
removed call to javax/swing/ActionMap::put → NO_COVERAGE

348

1.1
Location : installToggleAction
Killed by : none
removed call to javax/swing/InputMap::put → NO_COVERAGE

349

1.1
Location : installToggleAction
Killed by : none
removed call to javax/swing/ActionMap::put → NO_COVERAGE

369

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

374

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

375

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumn → NO_COVERAGE

377

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumn → NO_COVERAGE

381

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

382

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::adjustColumns → NO_COVERAGE

384

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::restoreColumns → NO_COVERAGE

407

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

408

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setDynamicAdjustment → NO_COVERAGE

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

409

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

410

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

2.2
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/table/AdjusterTableColumn::setOnlyAdjustLarger → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1