|
24 | 24 |
|
25 | 25 | import java.awt.BorderLayout;
|
26 | 26 | import java.awt.GridLayout;
|
27 |
| -import java.awt.event.ActionEvent; |
28 |
| -import java.awt.event.ActionListener; |
29 | 27 |
|
30 | 28 | import javax.swing.JButton;
|
31 | 29 | import javax.swing.JFrame;
|
|
37 | 35 | import javax.swing.SwingUtilities;
|
38 | 36 |
|
39 | 37 | /**
|
40 |
| - * The Client class is responsible for handling the input and running them through filters inside |
41 |
| - * the {@link FilterManager}. |
| 38 | + * The Client class is responsible for handling the input and running them through filters inside the |
| 39 | + * {@link FilterManager}. |
42 | 40 | *
|
43 |
| - * This is where {@link Filter}s come to play as the client pre-processes the request before being |
44 |
| - * displayed in the {@link Target}. |
| 41 | + * This is where {@link Filter}s come to play as the client pre-processes the request before being displayed in the |
| 42 | + * {@link Target}. |
45 | 43 | *
|
46 | 44 | * @author joshzambales
|
47 | 45 | *
|
48 | 46 | */
|
49 |
| -public class Client extends JFrame { |
| 47 | +public class Client extends JFrame { // NOSONAR |
50 | 48 |
|
51 | 49 | private static final long serialVersionUID = 1L;
|
52 | 50 |
|
53 |
| - private FilterManager filterManager; |
| 51 | + private transient FilterManager filterManager; |
54 | 52 | private JLabel jl;
|
55 | 53 | private JTextField[] jtFields;
|
56 | 54 | private JTextArea[] jtAreas;
|
@@ -98,26 +96,19 @@ private void setup() {
|
98 | 96 | panel.add(clearButton);
|
99 | 97 | panel.add(processButton);
|
100 | 98 |
|
101 |
| - clearButton.addActionListener(new ActionListener() { |
102 |
| - @Override |
103 |
| - public void actionPerformed(ActionEvent e) { |
104 |
| - for (JTextArea i : jtAreas) { |
105 |
| - i.setText(""); |
106 |
| - } |
107 |
| - for (JTextField i : jtFields) { |
108 |
| - i.setText(""); |
109 |
| - } |
| 99 | + clearButton.addActionListener(e -> { |
| 100 | + for (JTextArea i : jtAreas) { |
| 101 | + i.setText(""); |
| 102 | + } |
| 103 | + for (JTextField i : jtFields) { |
| 104 | + i.setText(""); |
110 | 105 | }
|
111 | 106 | });
|
112 | 107 |
|
113 |
| - processButton.addActionListener(new ActionListener() { |
114 |
| - @Override |
115 |
| - public void actionPerformed(ActionEvent e) { |
116 |
| - Order order = |
117 |
| - new Order(jtFields[0].getText(), jtFields[1].getText(), jtAreas[0].getText(), |
118 |
| - jtFields[2].getText(), jtAreas[1].getText()); |
119 |
| - jl.setText(sendRequest(order)); |
120 |
| - } |
| 108 | + processButton.addActionListener(e -> { |
| 109 | + Order order = new Order(jtFields[0].getText(), jtFields[1].getText(), jtAreas[0].getText(), jtFields[2].getText(), |
| 110 | + jtAreas[1].getText()); |
| 111 | + jl.setText(sendRequest(order)); |
121 | 112 | });
|
122 | 113 |
|
123 | 114 | JRootPane rootPane = SwingUtilities.getRootPane(processButton);
|
|
0 commit comments