ButtonAddressBar.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2020.
3
 * This program and the accompanying materials
4
 * are made available under no term at all, use it like
5
 * you want, but share and discuss about it
6
 * every time possible with every body.
7
 *
8
 * Contributors:
9
 *      ron190 at ymail dot com - initial implementation
10
 *******************************************************************************/
11
package com.jsql.view.swing.panel.util;
12
13
import com.jsql.view.swing.manager.util.StateButton;
14
import com.jsql.view.swing.util.UiUtil;
15
16
import javax.swing.*;
17
import java.awt.*;
18
19
/**
20
 * A button displayed in address.
21
 */
22
public class ButtonAddressBar extends JButton {
23
    
24
    /**
25
     * State of current injection.
26
     */
27
    private StateButton state = StateButton.STARTABLE;
28
    
29
    /**
30
     * Create a button in address bar.
31
     */
32
    public ButtonAddressBar() {
33
        
34 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPreferredSize → NO_COVERAGE
        this.setPreferredSize(new Dimension(18, 16));
35 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setOpaque → NO_COVERAGE
        this.setOpaque(false);
36 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setContentAreaFilled → NO_COVERAGE
        this.setContentAreaFilled(false);
37 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setBorderPainted → NO_COVERAGE
        this.setBorderPainted(false);
38
        
39
        // turn on before rollovers work
40 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE
        this.setRolloverEnabled(true);
41 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE
        this.setIcon(UiUtil.ICON_ARROW_DEFAULT);
42 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE
        this.setRolloverIcon(UiUtil.ICON_ARROW_ROLLOVER);
43 1 1. <init> : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE
        this.setPressedIcon(UiUtil.ICON_ARROW_PRESSED);
44
    }
45
46
    /**
47
     * Replace button with Stop icon ; user can stop current process.
48
     */
49
    public void setInjectionReady() {
50
        
51
        this.state = StateButton.STARTABLE;
52 1 1. setInjectionReady : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE
        this.setEnabled(true);
53
        
54
        // turn on before rollovers work
55 1 1. setInjectionReady : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE
        this.setRolloverEnabled(true);
56 1 1. setInjectionReady : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE
        this.setIcon(UiUtil.ICON_ARROW_DEFAULT);
57 1 1. setInjectionReady : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE
        this.setRolloverIcon(UiUtil.ICON_ARROW_ROLLOVER);
58 1 1. setInjectionReady : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE
        this.setPressedIcon(UiUtil.ICON_ARROW_PRESSED);
59
    }
60
61
    /**
62
     * Replace button with Stop icon ; user can stop current process.
63
     */
64
    public void setInjectionRunning() {
65
        
66
        this.state = StateButton.STOPPABLE;
67 1 1. setInjectionRunning : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE
        this.setEnabled(true);
68
        
69
        // turn on before rollovers work
70 1 1. setInjectionRunning : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE
        this.setRolloverEnabled(true);
71 1 1. setInjectionRunning : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE
        this.setIcon(UiUtil.IMG_STOP_DEFAULT);
72 1 1. setInjectionRunning : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE
        this.setRolloverIcon(UiUtil.IMG_STOP_ROLLOVER);
73 1 1. setInjectionRunning : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE
        this.setPressedIcon(UiUtil.IMG_STOP_PPRESSED);
74
    }
75
76
    /**
77
     * Replace button with an animated GIF until injection process
78
     * is finished ; user waits the end of process.
79
     */
80
    public void setInjectionStopping() {
81
        
82
        this.state = StateButton.STOPPING;
83
        
84
        // turn on before rollovers work
85 1 1. setInjectionStopping : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE
        this.setRolloverEnabled(false);
86 1 1. setInjectionStopping : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE
        this.setIcon(UiUtil.ICON_LOADER_GIF);
87 1 1. setInjectionStopping : removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE
        this.setEnabled(false);
88
    }
89
90
    /**
91
     * Return the current state of current process.
92
     * @return State of process
93
     */
94
    public StateButton getState() {
95 1 1. getState : replaced return value with null for com/jsql/view/swing/panel/util/ButtonAddressBar::getState → NO_COVERAGE
        return this.state;
96
    }
97
}

Mutations

34

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPreferredSize → NO_COVERAGE

35

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setOpaque → NO_COVERAGE

36

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setContentAreaFilled → NO_COVERAGE

37

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setBorderPainted → NO_COVERAGE

40

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE

41

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE

42

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE

43

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE

52

1.1
Location : setInjectionReady
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE

55

1.1
Location : setInjectionReady
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE

56

1.1
Location : setInjectionReady
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE

57

1.1
Location : setInjectionReady
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE

58

1.1
Location : setInjectionReady
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE

67

1.1
Location : setInjectionRunning
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE

70

1.1
Location : setInjectionRunning
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE

71

1.1
Location : setInjectionRunning
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE

72

1.1
Location : setInjectionRunning
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverIcon → NO_COVERAGE

73

1.1
Location : setInjectionRunning
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setPressedIcon → NO_COVERAGE

85

1.1
Location : setInjectionStopping
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setRolloverEnabled → NO_COVERAGE

86

1.1
Location : setInjectionStopping
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setIcon → NO_COVERAGE

87

1.1
Location : setInjectionStopping
Killed by : none
removed call to com/jsql/view/swing/panel/util/ButtonAddressBar::setEnabled → NO_COVERAGE

95

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

Active mutators

Tests examined


Report generated by PIT 1.16.1