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 |
|
35 |
1.1 |
|
36 |
1.1 |
|
37 |
1.1 |
|
40 |
1.1 |
|
41 |
1.1 |
|
42 |
1.1 |
|
43 |
1.1 |
|
52 |
1.1 |
|
55 |
1.1 |
|
56 |
1.1 |
|
57 |
1.1 |
|
58 |
1.1 |
|
67 |
1.1 |
|
70 |
1.1 |
|
71 |
1.1 |
|
72 |
1.1 |
|
73 |
1.1 |
|
85 |
1.1 |
|
86 |
1.1 |
|
87 |
1.1 |
|
95 |
1.1 |