2121*/
2222package processing .app ;
2323
24+ import java .awt .EventQueue ;
2425import java .io .BufferedReader ;
2526import java .io .IOException ;
2627import java .io .PrintWriter ;
2728import java .net .InetAddress ;
2829import java .net .ServerSocket ;
2930import java .net .Socket ;
3031
31- import javax .swing .SwingUtilities ;
32-
3332import processing .core .PApplet ;
3433
3534
3837 * Processing from running simultaneously. If there's already an instance
3938 * running, it'll handle opening a new empty sketch, or any files that had
4039 * been passed in on the command line.
41- *
42- * @author Peter Kalauskas, Ben Fry
4340 */
4441public class SingleInstance {
4542 static final String SERVER_PORT = "instance_server.port" ;
@@ -58,7 +55,6 @@ static boolean alreadyRunning(String[] args) {
5855 }
5956
6057
61- // static void startServer(final Platform platform) {
6258 static void startServer (final Base base ) {
6359 try {
6460 final ServerSocket ss = new ServerSocket (0 , 0 , InetAddress .getByName (null ));
@@ -75,11 +71,9 @@ public void run() {
7571 final BufferedReader reader = PApplet .createReader (s .getInputStream ());
7672 String receivedKey = reader .readLine ();
7773 Messages .log (this , "key is " + key + ", received is " + receivedKey );
78- // Base.log(this, "platform base is " + platform.base);
7974
80- // if (platform.base != null) {
8175 if (key .equals (receivedKey )) {
82- SwingUtilities .invokeLater (new Runnable () {
76+ EventQueue .invokeLater (new Runnable () {
8377 public void run () {
8478 try {
8579 Messages .log (this , "about to read line" );
0 commit comments