| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -778,9 +778,9 @@ protected boolean exportApplication() throws IOException, SketchException { | |||
| 778 | 778 | // if name != exportSketchName, then that's weirdness | |
| 779 | 779 | // BUG unfortunately, that can also be a bug in the preproc :( | |
| 780 | 780 | if (!sketch.getName().equals(foundName)) { | |
| 781 | - Base.showWarning("Error during export", | ||
| 782 | - "Sketch name is " + sketch.getName() + " but the sketch\n" + | ||
| 783 | - "name in the code was " + foundName, null); | ||
| 781 | + Messages.showWarning("Error during export", | ||
| 782 | + "Sketch name is " + sketch.getName() + " but the sketch\n" + | ||
| 783 | + "name in the code was " + foundName, null); | ||
| 784 | 784 | return false; | |
| 785 | 785 | } | |
| 786 | 786 | ||
@@ -862,11 +862,11 @@ protected boolean exportApplication(File destFolder, | |||
| 862 | 862 | for (Library library : importedLibraries) { | |
| 863 | 863 | if (!library.supportsArch(exportPlatform, exportVariant)) { | |
| 864 | 864 | String pn = PConstants.platformNames[exportPlatform]; | |
| 865 | - Base.showWarning("Quibbles 'n Bits", | ||
| 866 | - "The application." + pn + exportVariant + | ||
| 867 | - " folder will not be created\n" + | ||
| 868 | - "because no " + exportVariant + " version of " + | ||
| 869 | - library.getName() + " is available for " + pn, null); | ||
| 865 | + Messages.showWarning("Quibbles 'n Bits", | ||
| 866 | + "The application." + pn + exportVariant + | ||
| 867 | + " folder will not be created\n" + | ||
| 868 | + "because no " + exportVariant + " version of " + | ||
| 869 | + library.getName() + " is available for " + pn, null); | ||
| 870 | 870 | return true; // don't cancel all exports for this, just move along | |
| 871 | 871 | } | |
| 872 | 872 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -360,9 +360,9 @@ public void actionPerformed(ActionEvent e) { | |||
| 360 | 360 | try { | |
| 361 | 361 | new Welcome(base, Preferences.getSketchbookPath().equals(Preferences.getOldSketchbookPath())); | |
| 362 | 362 | } catch (IOException ioe) { | |
| 363 | - Base.showWarning("Unwelcome Error", | ||
| 364 | - "Please report this error to\n" + | ||
| 365 | - "https://github.com/processing/processing/issues", ioe); | ||
| 363 | + Messages.showWarning("Unwelcome Error", | ||
| 364 | + "Please report this error to\n" + | ||
| 365 | + "https://github.com/processing/processing/issues", ioe); | ||
| 366 | 366 | } | |
| 367 | 367 | } | |
| 368 | 368 | }); | |
@@ -1101,15 +1101,15 @@ public void actionPerformed(ActionEvent e) { | |||
| 1101 | 1101 | protected boolean handleExportCheckModified() { | |
| 1102 | 1102 | if (sketch.isReadOnly()) { | |
| 1103 | 1103 | // if the files are read-only, need to first do a "save as". | |
| 1104 | - Base.showMessage(Language.text("export.messages.is_read_only"), | ||
| 1105 | - Language.text("export.messages.is_read_only.description")); | ||
| 1104 | + Messages.showMessage(Language.text("export.messages.is_read_only"), | ||
| 1105 | + Language.text("export.messages.is_read_only.description")); | ||
| 1106 | 1106 | return false; | |
| 1107 | 1107 | } | |
| 1108 | 1108 | ||
| 1109 | 1109 | // don't allow if untitled | |
| 1110 | 1110 | if (sketch.isUntitled()) { | |
| 1111 | - Base.showMessage(Language.text("export.messages.cannot_export"), | ||
| 1112 | - Language.text("export.messages.cannot_export.description")); | ||
| 1111 | + Messages.showMessage(Language.text("export.messages.cannot_export"), | ||
| 1112 | + Language.text("export.messages.cannot_export.description")); | ||
| 1113 | 1113 | return false; | |
| 1114 | 1114 | } | |
| 1115 | 1115 | ||
@@ -1753,7 +1753,7 @@ protected void addBreakpointComments(String tabFilename) { | |||
| 1753 | 1753 | // this method gets called twice when saving sketch for the first time | |
| 1754 | 1754 | // once with new name and another with old(causing NPE). Keep an eye out | |
| 1755 | 1755 | // for potential issues. See #2675. TODO: | |
| 1756 | - Base.loge("Illegal tab name to addBreakpointComments() " + tabFilename); | ||
| 1756 | + Messages.loge("Illegal tab name to addBreakpointComments() " + tabFilename); | ||
| 1757 | 1757 | return; | |
| 1758 | 1758 | } | |
| 1759 | 1759 | List<LineBreakpoint> bps = debugger.getBreakpoints(tab.getFileName()); | |
@@ -1988,7 +1988,7 @@ protected void downloadImports() { | |||
| 1988 | 1988 | for (AvailableContribution ac : installLibsHeaders) { | |
| 1989 | 1989 | libList.append("\n • " + ac.getName()); | |
| 1990 | 1990 | } | |
| 1991 | - int option = Base.showYesNoQuestion(this, | ||
| 1991 | + int option = Messages.showYesNoQuestion(this, | ||
| 1992 | 1992 | Language.text("contrib.import.dialog.title"), | |
| 1993 | 1993 | Language.text("contrib.import.dialog.primary_text"), | |
| 1994 | 1994 | libList.toString()); | |
@@ -2624,14 +2624,14 @@ public void updateErrorToggle() { | |||
| 2624 | 2624 | ||
| 2625 | 2625 | /** Handle refactor operation */ | |
| 2626 | 2626 | private void handleRefactor() { | |
| 2627 | - Base.log("Caret at:" + textarea.getLineText(textarea.getCaretLine())); | ||
| 2627 | + Messages.log("Caret at:" + textarea.getLineText(textarea.getCaretLine())); | ||
| 2628 | 2628 | errorCheckerService.getASTGenerator().handleRefactor(); | |
| 2629 | 2629 | } | |
| 2630 | 2630 | ||
| 2631 | 2631 | ||
| 2632 | 2632 | /** Handle show usage operation */ | |
| 2633 | 2633 | private void handleShowUsage() { | |
| 2634 | - Base.log("Caret at:" + textarea.getLineText(textarea.getCaretLine())); | ||
| 2634 | + Messages.log("Caret at:" + textarea.getLineText(textarea.getCaretLine())); | ||
| 2635 | 2635 | errorCheckerService.getASTGenerator().handleShowUsage(); | |
| 2636 | 2636 | } | |
| 2637 | 2637 | ||
@@ -2667,7 +2667,7 @@ protected void applyPreferences() { | |||
| 2667 | 2667 | super.applyPreferences(); | |
| 2668 | 2668 | if (jmode != null) { | |
| 2669 | 2669 | jmode.loadPreferences(); | |
| 2670 | - Base.log("Applying prefs"); | ||
| 2670 | + Messages.log("Applying prefs"); | ||
| 2671 | 2671 | // trigger it once to refresh UI | |
| 2672 | 2672 | errorCheckerService.runManualErrorCheck(); | |
| 2673 | 2673 | } | |
@@ -2703,9 +2703,9 @@ protected void stopTweakMode(List<List<Handle>> handles) { | |||
| 2703 | 2703 | ||
| 2704 | 2704 | if (modified) { | |
| 2705 | 2705 | // ask to keep the values | |
| 2706 | - if (Base.showYesNoQuestion(this, Language.text("tweak_mode"), | ||
| 2707 | - Language.text("tweak_mode.keep_changes.line1"), | ||
| 2708 | - Language.text("tweak_mode.keep_changes.line2")) == JOptionPane.YES_OPTION) { | ||
| 2706 | + if (Messages.showYesNoQuestion(this, Language.text("tweak_mode"), | ||
| 2707 | + Language.text("tweak_mode.keep_changes.line1"), | ||
| 2708 | + Language.text("tweak_mode.keep_changes.line2")) == JOptionPane.YES_OPTION) { | ||
| 2709 | 2709 | for (int i = 0; i < sketch.getCodeCount(); i++) { | |
| 2710 | 2710 | if (tweakedTabs[i]) { | |
| 2711 | 2711 | sketch.getCode(i).setModified(true); | |
@@ -2729,7 +2729,7 @@ protected void stopTweakMode(List<List<Handle>> handles) { | |||
| 2729 | 2729 | try { | |
| 2730 | 2730 | sketch.save(); | |
| 2731 | 2731 | } catch (IOException e) { | |
| 2732 | - Base.showWarning("Error", "Could not save the modified sketch.", e); | ||
| 2732 | + Messages.showWarning("Error", "Could not save the modified sketch.", e); | ||
| 2733 | 2733 | } | |
| 2734 | 2734 | ||
| 2735 | 2735 | // repaint the editor header (show the modified tabs) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,8 +162,8 @@ public Runner handleTweak(Sketch sketch, | |||
| 162 | 162 | ||
| 163 | 163 | if (isSketchModified(sketch)) { | |
| 164 | 164 | editor.deactivateRun(); | |
| 165 | - Base.showMessage(Language.text("menu.file.save"), | ||
| 166 | - Language.text("tweak_mode.save_before_tweak")); | ||
| 165 | + Messages.showMessage(Language.text("menu.file.save"), | ||
| 166 | + Language.text("tweak_mode.save_before_tweak")); | ||
| 167 | 167 | return null; | |
| 168 | 168 | } | |
| 169 | 169 | ||
@@ -327,7 +327,7 @@ void initLogger() { | |||
| 327 | 327 | ||
| 328 | 328 | ||
| 329 | 329 | public void loadPreferences() { | |
| 330 | - Base.log("Load PDEX prefs"); | ||
| 330 | + Messages.log("Load PDEX prefs"); | ||
| 331 | 331 | ensurePrefsExist(); | |
| 332 | 332 | errorCheckEnabled = Preferences.getBoolean(prefErrorCheck); | |
| 333 | 333 | warningsEnabled = Preferences.getBoolean(prefWarnings); | |
@@ -345,7 +345,7 @@ public void loadPreferences() { | |||
| 345 | 345 | ||
| 346 | 346 | ||
| 347 | 347 | public void savePreferences() { | |
| 348 | - Base.log("Saving PDEX prefs"); | ||
| 348 | + Messages.log("Saving PDEX prefs"); | ||
| 349 | 349 | Preferences.setBoolean(prefErrorCheck, errorCheckEnabled); | |
| 350 | 350 | Preferences.setBoolean(prefWarnings, warningsEnabled); | |
| 351 | 351 | Preferences.setBoolean(prefCodeCompletionEnabled, codeCompletionsEnabled); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ | |||
| 24 | 24 | import java.util.logging.Level; | |
| 25 | 25 | import java.util.logging.Logger; | |
| 26 | 26 | ||
| 27 | - import processing.app.Base; | ||
| 27 | + import processing.app.Messages; | ||
| 28 | 28 | import processing.mode.java.Debugger; | |
| 29 | 29 | ||
| 30 | 30 | import com.sun.jdi.AbsentInformationException; | |
@@ -220,13 +220,13 @@ protected String className() { | |||
| 220 | 220 | @Override | |
| 221 | 221 | public void classLoaded(ReferenceType theClass) { | |
| 222 | 222 | // check if our class is being loaded | |
| 223 | - Base.log("Class Loaded: " + theClass.name()); | ||
| 223 | + Messages.log("Class Loaded: " + theClass.name()); | ||
| 224 | 224 | if (theClass.name().equals(className())) { | |
| 225 | 225 | this.theClass = theClass; | |
| 226 | 226 | attach(); | |
| 227 | 227 | } | |
| 228 | 228 | for (ReferenceType ct : theClass.nestedTypes()) { | |
| 229 | - Base.log("Nested " + ct.name()); | ||
| 229 | + Messages.log("Nested " + ct.name()); | ||
| 230 | 230 | } | |
| 231 | 231 | } | |
| 232 | 232 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,8 +106,8 @@ | |||
| 106 | 106 | import org.jsoup.nodes.Document; | |
| 107 | 107 | import org.jsoup.select.Elements; | |
| 108 | 108 | ||
| 109 | - import processing.app.Base; | ||
| 110 | 109 | import processing.app.Library; | |
| 110 | + import processing.app.Messages; | ||
| 111 | 111 | import processing.app.Platform; | |
| 112 | 112 | import processing.app.SketchCode; | |
| 113 | 113 | import processing.app.Util; | |
@@ -243,7 +243,7 @@ protected DefaultMutableTreeNode buildAST(String source, CompilationUnit cu) { | |||
| 243 | 243 | .types().get(0))); | |
| 244 | 244 | //log("Total CU " + compilationUnit.types().size()); | |
| 245 | 245 | if(compilationUnit.types() == null || compilationUnit.types().isEmpty()){ | |
| 246 | - Base.loge("No CU found!"); | ||
| 246 | + Messages.loge("No CU found!"); | ||
| 247 | 247 | } | |
| 248 | 248 | visitRecur((ASTNode) compilationUnit.types().get(0), codeTree); | |
| 249 | 249 | SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() { | |
@@ -869,7 +869,7 @@ public void preparePredictions(final String word, final int line, | |||
| 869 | 869 | ASTNode testnode = parser.createAST(null); | |
| 870 | 870 | //Base.loge("PREDICTION PARSER PROBLEMS: " + parser); | |
| 871 | 871 | // Find closest ASTNode of the document to this word | |
| 872 | - Base.loge("Typed: " + word2 + "|" + " temp Node type: " + testnode.getClass().getSimpleName()); | ||
| 872 | + Messages.loge("Typed: " + word2 + "|" + " temp Node type: " + testnode.getClass().getSimpleName()); | ||
| 873 | 873 | if(testnode instanceof MethodInvocation){ | |
| 874 | 874 | MethodInvocation mi = (MethodInvocation)testnode; | |
| 875 | 875 | log(mi.getName() + "," + mi.getExpression() + "," + mi.typeArguments().size()); | |
@@ -882,15 +882,15 @@ public void preparePredictions(final String word, final int line, | |||
| 882 | 882 | // Make sure nearestNode is not NULL if couldn't find a closeset node | |
| 883 | 883 | nearestNode = (ASTNode) errorCheckerService.getLastCorrectCU().types().get(0); | |
| 884 | 884 | } | |
| 885 | - Base.loge(lineNumber + " Nearest ASTNode to PRED " | ||
| 885 | + Messages.loge(lineNumber + " Nearest ASTNode to PRED " | ||
| 886 | 886 | + getNodeAsString(nearestNode)); | |
| 887 | 887 | ||
| 888 | 888 | candidates = new ArrayList<CompletionCandidate>(); | |
| 889 | 889 | lastPredictedWord = word2; | |
| 890 | 890 | // Determine the expression typed | |
| 891 | 891 | ||
| 892 | 892 | if (testnode instanceof SimpleName && !noCompare) { | |
| 893 | - Base.loge("One word expression " + getNodeAsString(testnode)); | ||
| 893 | + Messages.loge("One word expression " + getNodeAsString(testnode)); | ||
| 894 | 894 | //==> Simple one word exprssion - so is just an identifier | |
| 895 | 895 | ||
| 896 | 896 | // Bottom up traversal of the AST to look for possible definitions at | |
@@ -974,7 +974,7 @@ public void preparePredictions(final String word, final int line, | |||
| 974 | 974 | ||
| 975 | 975 | // ==> Complex expression of type blah.blah2().doIt,etc | |
| 976 | 976 | // Have to resolve it by carefully traversing AST of testNode | |
| 977 | - Base.loge("Complex expression " + getNodeAsString(testnode)); | ||
| 977 | + Messages.loge("Complex expression " + getNodeAsString(testnode)); | ||
| 978 | 978 | log("candidates empty"); | |
| 979 | 979 | ASTNode childExpr = getChildExpression(testnode); | |
| 980 | 980 | log("Parent expression : " + getParentExpression(testnode)); | |
@@ -1236,7 +1236,7 @@ public String getJavaSourceCodeLine(int javaLineNumber) { | |||
| 1236 | 1236 | - lineElement.getStartOffset()); | |
| 1237 | 1237 | return javaLine; | |
| 1238 | 1238 | } catch (BadLocationException e) { | |
| 1239 | - Base.loge(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); | ||
| 1239 | + Messages.loge(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); | ||
| 1240 | 1240 | } | |
| 1241 | 1241 | return null; | |
| 1242 | 1242 | } | |
@@ -1263,7 +1263,7 @@ public Element getJavaSourceCodeElement(int javaLineNumber) { | |||
| 1263 | 1263 | // - lineElement.getStartOffset()); | |
| 1264 | 1264 | return lineElement; | |
| 1265 | 1265 | } catch (BadLocationException e) { | |
| 1266 | - Base.loge(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); | ||
| 1266 | + Messages.loge(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); | ||
| 1267 | 1267 | } | |
| 1268 | 1268 | return null; | |
| 1269 | 1269 | } | |
@@ -1744,7 +1744,7 @@ public ASTNodeWrapper getASTNodeAt(int lineNumber, String name, int offset, | |||
| 1744 | 1744 | ASTNodeWrapper declWrap = new ASTNodeWrapper(simpName2, nodeLabel); | |
| 1745 | 1745 | //errorCheckerService.highlightNode(declWrap); | |
| 1746 | 1746 | if (!declWrap.highlightNode(this)) { | |
| 1747 | - Base.loge("Highlighting failed."); | ||
| 1747 | + Messages.loge("Highlighting failed."); | ||
| 1748 | 1748 | } | |
| 1749 | 1749 | } | |
| 1750 | 1750 | ||
@@ -1859,7 +1859,7 @@ protected void addListeners(){ | |||
| 1859 | 1859 | ||
| 1860 | 1860 | @Override | |
| 1861 | 1861 | public void valueChanged(TreeSelectionEvent e) { | |
| 1862 | - Base.log(e.toString()); | ||
| 1862 | + Messages.log(e.toString()); | ||
| 1863 | 1863 | SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() { | |
| 1864 | 1864 | ||
| 1865 | 1865 | @Override | |
@@ -2159,8 +2159,7 @@ protected DefaultMutableTreeNode findAllOccurrences(){ | |||
| 2159 | 2159 | if(wnode.getNode() == null){ | |
| 2160 | 2160 | return null; | |
| 2161 | 2161 | } | |
| 2162 | - Base.loge("Gonna find all occurrences of " | ||
| 2163 | - + getNodeAsString(wnode.getNode())); | ||
| 2162 | + Messages.loge("Gonna find all occurrences of " + getNodeAsString(wnode.getNode())); | ||
| 2164 | 2163 | ||
| 2165 | 2164 | //If wnode is a constructor, find the TD instead. | |
| 2166 | 2165 | if (wnode.getNodeType() == ASTNode.METHOD_DECLARATION) { | |
@@ -2176,7 +2175,7 @@ protected DefaultMutableTreeNode findAllOccurrences(){ | |||
| 2176 | 2175 | if(node != null && node instanceof TypeDeclaration){ | |
| 2177 | 2176 | TypeDeclaration td = (TypeDeclaration) node; | |
| 2178 | 2177 | if(td.getName().toString().equals(md.getName().toString())){ | |
| 2179 | - Base.loge("Renaming constructor of " + getNodeAsString(td)); | ||
| 2178 | + Messages.loge("Renaming constructor of " + getNodeAsString(td)); | ||
| 2180 | 2179 | wnode = new ASTNodeWrapper(td); | |
| 2181 | 2180 | } | |
| 2182 | 2181 | } | |
@@ -2414,7 +2413,7 @@ protected boolean isInstanceOfType(ASTNode node,ASTNode decl, String name){ | |||
| 2414 | 2413 | } | |
| 2415 | 2414 | log("Visiting: " + getNodeAsString(node)); | |
| 2416 | 2415 | ASTNode decl2 = findDeclaration(sn); | |
| 2417 | - Base.loge("It's decl: " + getNodeAsString(decl2)); | ||
| 2416 | + Messages.loge("It's decl: " + getNodeAsString(decl2)); | ||
| 2418 | 2417 | log("But we need: "+getNodeAsString(decl)); | |
| 2419 | 2418 | for (ASTNode astNode : nodesToBeMatched) { | |
| 2420 | 2419 | if(astNode.equals(decl2)){ | |
@@ -3714,7 +3713,7 @@ else if (className.endsWith("Type")) | |||
| 3714 | 3713 | ||
| 3715 | 3714 | ||
| 3716 | 3715 | static private void log(Object object) { | |
| 3717 | - Base.log(object == null ? "null" : object.toString()); | ||
| 3716 | + Messages.log(object == null ? "null" : object.toString()); | ||
| 3718 | 3717 | } | |
| 3719 | 3718 | ||
| 3720 | 3719 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments