Skip to content

Package: TextfieldListener

TextfieldListener

nameinstructionbranchcomplexitylinemethod
TextfieldListener(ConfigurationGraph, IDetailBar)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
keyPressed(KeyEvent)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
keyReleased(KeyEvent)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
keyTyped(KeyEvent)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package networkconfigurator;
2:
3: import java.awt.event.KeyEvent;
4: import java.awt.event.KeyListener;
5:
6: /**
7: * Textfield Key Listener for the DevicesDetailBar.
8: *
9: * @author Erik Arand.
10: *
11: */
12: public class TextfieldListener implements KeyListener {
13:         /**
14:          * the detailbar for devices.
15:          */
16:         private final IDetailBar detailbar;
17:         /**
18:          * the graph which should be redrawn after keys were released.
19:          */
20:         private final ConfigurationGraph graph;
21:
22:         /**
23:          * The constructor.
24:          *
25:          * @param graph
26:          * the graph.
27:          * @param detailbar
28:          * the detailbar.
29:          */
30:         public TextfieldListener(final ConfigurationGraph graph, final IDetailBar detailbar) {
31:                 super();
32:                 this.graph = graph;
33:                 this.detailbar = detailbar;
34:         }
35:
36:         @Override
37:         public void keyTyped(final KeyEvent e) {
38:                 // everything is done in key released.
39:         }
40:
41:         @Override
42:         public void keyPressed(final KeyEvent e) {
43:                 // everything is done in key released.
44:         }
45:
46:         @Override
47:         public void keyReleased(final KeyEvent e) {
48:                 detailbar.reassignAttributes();
49:                 this.graph.repaint();
50:         }
51:
52: }