From 13e7d40e62bdf50ff8cffa6e7000c3ab781f3244 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 6 Aug 2016 12:40:55 -0400 Subject: [PATCH] removing some dead code, other cleaning --- java/src/processing/mode/java/JavaEditor.java | 76 +------------------ 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index 12ab253ea..3504c2485 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -2210,7 +2210,6 @@ public class JavaEditor extends Editor { */ @Override public void setCode(SketchCode code) { - Document oldDoc = code.getDocument(); //System.out.println("tab switch: " + code.getFileName()); @@ -2254,14 +2253,13 @@ public class JavaEditor extends Editor { /** * Get a tab by its file name. - * @param fileName the filename to search for. - * @return the {@link SketchCode} object representing the tab, or null if - * not found + * @param filename the filename to search for. + * @return the {@link SketchCode} object for the tab, or null if not found */ - public SketchCode getTab(String fileName) { + public SketchCode getTab(String filename) { Sketch s = getSketch(); for (SketchCode c : s.getCode()) { - if (c.getFileName().equals(fileName)) { + if (c.getFileName().equals(filename)) { return c; } } @@ -2297,72 +2295,6 @@ public class JavaEditor extends Editor { } - public void statusMessage(String message, int type) { - if (EventQueue.isDispatchThread()) { - status.message(message, type); - } else { - EventQueue.invokeLater(() -> statusMessage(message, type)); - } - } - - - /* - static final int STATUS_EMPTY = 100; - static final int STATUS_COMPILER_ERR = 200; - static final int STATUS_WARNING = 300; - static final int STATUS_INFO = 400; - static final int STATUS_ERR = 500; - - int statusMessageType = STATUS_EMPTY; - String statusMessage; - - public void statusMessage(final String what, int type){ - // Don't re-display the old message again - if (type != STATUS_EMPTY) { - if (what.equals(statusMessage) && type == statusMessageType) { - return; - } - } - statusMessage = new String(what); - statusMessageType = type; - switch (type) { - case STATUS_COMPILER_ERR: - case STATUS_ERR: - super.statusError(what); - break; - case STATUS_INFO: - case STATUS_WARNING: - statusNotice(what); - break; - } - // Don't need to clear compiler error messages - if (type == STATUS_COMPILER_ERR) return; - - // Clear the message after a delay - SwingWorker s = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - try { - Thread.sleep(2 * 1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - statusEmpty(); - return null; - } - }; - s.execute(); - } - - - public void statusEmpty(){ - statusMessage = null; - statusMessageType = STATUS_EMPTY; - super.statusEmpty(); - } - */ - - /** * Updates the error table in the Error Window. * Overridden to handle the fugly import suggestions text.