@@ -38,12 +38,12 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
3838
3939 /** Rollover titles for each button. */
4040 static final String title [] = {
41- _ ("Verify" ), _ ("Upload" ), _ ("New" ), _ ("Open" ), _ ("Save" ), _ ("Serial Monitor" ), _ ( "Serial Plotter" )
41+ _ ("Verify" ), _ ("Upload" ), _ ("New" ), _ ("Open" ), _ ("Save" ), _ ("Serial Monitor" )
4242 };
4343
4444 /** Titles for each button when the shift key is pressed. */
4545 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" )
4747 };
4848
4949 static final int BUTTON_COUNT = title .length ;
@@ -65,7 +65,6 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
6565 static final int SAVE = 4 ;
6666
6767 static final int SERIAL = 5 ;
68- static final int PLOTTER = 6 ;
6968
7069 static final int INACTIVE = 0 ;
7170 static final int ROLLOVER = 1 ;
@@ -111,7 +110,6 @@ public EditorToolbar(Editor editor, JMenu menu) {
111110 which [buttonCount ++] = OPEN ;
112111 which [buttonCount ++] = SAVE ;
113112 which [buttonCount ++] = SERIAL ;
114- which [buttonCount ++] = PLOTTER ;
115113
116114 currentRollover = -1 ;
117115
@@ -175,11 +173,8 @@ public void paintComponent(Graphics screen) {
175173 }
176174
177175 // 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 ;
183178 }
184179 Graphics g = offscreen .getGraphics ();
185180 g .setColor (bgcolor ); //getBackground());
@@ -206,15 +201,12 @@ public void paintComponent(Graphics screen) {
206201 if (currentRollover != -1 ) {
207202 int statusY = (BUTTON_HEIGHT + g .getFontMetrics ().getAscent ()) / 2 ;
208203 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 );
218210 }
219211 }
220212
@@ -364,10 +356,6 @@ public void mousePressed(MouseEvent e) {
364356 case SERIAL :
365357 editor .handleSerial ();
366358 break ;
367-
368- case PLOTTER :
369- editor .handlePlotter ();
370- break ;
371359 }
372360 }
373361
0 commit comments