51
51
import javax .swing .event .ListSelectionListener ;
52
52
53
53
import cc .arduino .plugins .wifi101 .flashers .Flasher ;
54
+ import processing .app .Base ;
54
55
55
56
@ SuppressWarnings ("serial" )
56
57
public class UpdaterJFrame extends JFrame {
@@ -72,6 +73,7 @@ public class UpdaterJFrame extends JFrame {
72
73
private JButton addCertificateButton ;
73
74
private JButton updateFirmwareButton ;
74
75
private JButton testConnectionButton ;
76
+ private JButton openFirmwareUpdaterSketchButton ;
75
77
76
78
public static void main (String [] args ) {
77
79
EventQueue .invokeLater (new Runnable () {
@@ -130,13 +132,13 @@ public UpdaterJFrame() {
130
132
131
133
serialPortList = new JList <String >();
132
134
JScrollPane sp = new JScrollPane (serialPortList );
133
- serialPortList .setMaximumSize (new Dimension (300 , 50 ));
135
+ serialPortList .setMaximumSize (new Dimension (300 , 100 ));
134
136
GridBagConstraints gbc_serialPortList = new GridBagConstraints ();
135
137
gbc_serialPortList .insets = new Insets (5 , 5 , 5 , 5 );
136
138
gbc_serialPortList .fill = GridBagConstraints .BOTH ;
137
139
gbc_serialPortList .gridx = 0 ;
138
140
gbc_serialPortList .gridy = 1 ;
139
- gbc_serialPortList .gridheight = 2 ;
141
+ gbc_serialPortList .gridheight = 5 ;
140
142
panel_1 .add (sp , gbc_serialPortList );
141
143
serialPortList .addListSelectionListener (new ListSelectionListener () {
142
144
public void valueChanged (ListSelectionEvent e ) {
@@ -153,9 +155,9 @@ public void actionPerformed(ActionEvent e) {
153
155
});
154
156
GridBagConstraints gbc_refreshListButton = new GridBagConstraints ();
155
157
gbc_refreshListButton .fill = GridBagConstraints .HORIZONTAL ;
156
- gbc_refreshListButton .insets = new Insets (5 , 5 , 5 , 5 );
158
+ gbc_refreshListButton .insets = new Insets (0 , 0 , 0 , 0 );
157
159
gbc_refreshListButton .gridx = 1 ;
158
- gbc_refreshListButton .gridy = 1 ;
160
+ gbc_refreshListButton .gridy = 2 ;
159
161
panel_1 .add (refreshListButton , gbc_refreshListButton );
160
162
161
163
testConnectionButton = new JButton ("Test connection" );
@@ -166,11 +168,24 @@ public void actionPerformed(ActionEvent e) {
166
168
});
167
169
168
170
GridBagConstraints gbc_testConnectionButton = new GridBagConstraints ();
169
- gbc_testConnectionButton .insets = new Insets (5 , 5 , 5 , 5 );
171
+ gbc_testConnectionButton .insets = new Insets (0 , 0 , 0 , 0 );
170
172
gbc_testConnectionButton .gridx = 1 ;
171
- gbc_testConnectionButton .gridy = 2 ;
173
+ gbc_testConnectionButton .gridy = 3 ;
172
174
panel_1 .add (testConnectionButton , gbc_testConnectionButton );
173
175
176
+ openFirmwareUpdaterSketchButton = new JButton ("Open Updater sketch" );
177
+ openFirmwareUpdaterSketchButton .addActionListener (new ActionListener () {
178
+ public void actionPerformed (ActionEvent e ) {
179
+ openFirmwareUpdaterSketch ();
180
+ }
181
+ });
182
+
183
+ GridBagConstraints gbc_openFirmwareUpdaterSketchButton = new GridBagConstraints ();
184
+ gbc_openFirmwareUpdaterSketchButton .insets = new Insets (0 ,0 ,0 ,0 );
185
+ gbc_openFirmwareUpdaterSketchButton .gridx = 1 ;
186
+ gbc_openFirmwareUpdaterSketchButton .gridy = 1 ;
187
+ panel_1 .add (openFirmwareUpdaterSketchButton , gbc_openFirmwareUpdaterSketchButton );
188
+
174
189
panel = new JPanel ();
175
190
panel .setBorder (new TitledBorder (new LineBorder (new Color (184 , 207 , 229 )), "2. Update firmware" , TitledBorder .LEADING , TitledBorder .TOP , null , new Color (51 , 51 , 51 )));
176
191
panel .setMinimumSize (new Dimension (500 , 150 ));
@@ -367,6 +382,10 @@ protected void testConnection() {
367
382
// To be overridden
368
383
}
369
384
385
+ protected void openFirmwareUpdaterSketch () {
386
+ // To be overridden
387
+ }
388
+
370
389
protected void refreshSerialPortList () {
371
390
// To be overridden
372
391
}
0 commit comments