@@ -38,12 +38,12 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
38
38
39
39
/** Rollover titles for each button. */
40
40
static final String title [] = {
41
- _ ("Verify" ), _ ("Upload" ), _ ("New" ), _ ("Open" ), _ ("Save" ), _ ("Serial Monitor" ), _ ( "Serial Plotter" )
41
+ _ ("Verify" ), _ ("Upload" ), _ ("New" ), _ ("Open" ), _ ("Save" ), _ ("Serial Monitor" )
42
42
};
43
43
44
44
/** Titles for each button when the shift key is pressed. */
45
45
static final String titleShift [] = {
46
- _ ("Verify" ), _ ("Upload Using Programmer" ), _ ("New" ), _ ("Open in Another Window" ), _ ("Save As..." ), _ ("Serial Monitor" ), _ ( "Serial Plotter" )
46
+ _ ("Verify" ), _ ("Upload Using Programmer" ), _ ("New" ), _ ("Open in Another Window" ), _ ("Save As..." ), _ ("Serial Monitor" )
47
47
};
48
48
49
49
static final int BUTTON_COUNT = title .length ;
@@ -65,7 +65,6 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
65
65
static final int SAVE = 4 ;
66
66
67
67
static final int SERIAL = 5 ;
68
- static final int PLOTTER = 6 ;
69
68
70
69
static final int INACTIVE = 0 ;
71
70
static final int ROLLOVER = 1 ;
@@ -111,7 +110,6 @@ public EditorToolbar(Editor editor, JMenu menu) {
111
110
which [buttonCount ++] = OPEN ;
112
111
which [buttonCount ++] = SAVE ;
113
112
which [buttonCount ++] = SERIAL ;
114
- which [buttonCount ++] = PLOTTER ;
115
113
116
114
currentRollover = -1 ;
117
115
@@ -175,11 +173,8 @@ public void paintComponent(Graphics screen) {
175
173
}
176
174
177
175
// Serial button must be on the right
178
- x1 [SERIAL ] = width - 2 * BUTTON_WIDTH - 14 ;
179
- x2 [SERIAL ] = width - BUTTON_WIDTH - 14 ;
180
- // Plotter button too
181
- x1 [PLOTTER ] = width - BUTTON_WIDTH - 14 ;
182
- x2 [PLOTTER ] = width - 14 ;
176
+ x1 [SERIAL ] = width - BUTTON_WIDTH - 14 ;
177
+ x2 [SERIAL ] = width - 14 ;
183
178
}
184
179
Graphics g = offscreen .getGraphics ();
185
180
g .setColor (bgcolor ); //getBackground());
@@ -206,15 +201,12 @@ public void paintComponent(Graphics screen) {
206
201
if (currentRollover != -1 ) {
207
202
int statusY = (BUTTON_HEIGHT + g .getFontMetrics ().getAscent ()) / 2 ;
208
203
String status = shiftPressed ? titleShift [currentRollover ] : title [currentRollover ];
209
- switch (currentRollover ) {
210
- case SERIAL :
211
- case PLOTTER :
212
- int statusX = x1 [SERIAL ] - BUTTON_GAP ;
213
- statusX -= g .getFontMetrics ().stringWidth (status );
214
- g .drawString (status , statusX , statusY );
215
- break ;
216
- default :
217
- g .drawString (status , (buttonCount -1 ) * BUTTON_WIDTH + 3 * BUTTON_GAP , statusY );
204
+ if (currentRollover != SERIAL )
205
+ g .drawString (status , (buttonCount -1 ) * BUTTON_WIDTH + 3 * BUTTON_GAP , statusY );
206
+ else {
207
+ int statusX = x1 [SERIAL ] - BUTTON_GAP ;
208
+ statusX -= g .getFontMetrics ().stringWidth (status );
209
+ g .drawString (status , statusX , statusY );
218
210
}
219
211
}
220
212
@@ -364,10 +356,6 @@ public void mousePressed(MouseEvent e) {
364
356
case SERIAL :
365
357
editor .handleSerial ();
366
358
break ;
367
-
368
- case PLOTTER :
369
- editor .handlePlotter ();
370
- break ;
371
359
}
372
360
}
373
361
0 commit comments