1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-17 06:52:18 +01:00

Code cleanup

This commit is contained in:
Federico Fissore 2015-09-17 16:52:22 +02:00
parent 01735420ee
commit a295fbbc36

View File

@ -1,23 +1,15 @@
package processing.app;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import cc.arduino.packages.BoardPort;
import processing.app.legacy.PApplet;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.AbstractAction;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
import javax.swing.Timer;
import cc.arduino.packages.BoardPort;
import processing.app.legacy.PApplet;
@SuppressWarnings("serial")
public abstract class AbstractMonitor extends JFrame implements ActionListener {
@ -28,7 +20,7 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
private Timer updateTimer;
private BoardPort boardPort;
protected String[] serialRateStrings = {"300", "1200", "2400", "4800", "9600", "19200", "38400", "57600", "74880", "115200", "230400", "250000"};
public AbstractMonitor(BoardPort boardPort) {
@ -89,14 +81,14 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
monitorEnabled = true;
closed = false;
}
protected abstract void onCreateWindow(Container mainPane);
public void enableWindow(boolean enable) {
onEnableWindow(enable);
monitorEnabled = enable;
}
protected abstract void onEnableWindow(boolean enable);
// Puts the window in suspend state, closing the serial port
@ -181,7 +173,7 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
updateBuffer.setLength(0);
return s;
}
public void actionPerformed(ActionEvent e) {
String s = consumeUpdateBuffer();
if (s.isEmpty()) {