| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -631,13 +631,14 @@ public Segment getCurrentLine() { | |||
| 631 | 631 | } | |
| 632 | 632 | ||
| 633 | 633 | ||
| 634 | - /** Old paintLine() method with kooky args order, kept around for X Mode. */ | ||
| 635 | - @Deprecated | ||
| 636 | - protected void paintLine(Graphics gfx, TokenMarker tokenMarker, | ||
| 637 | - int line, int x) { | ||
| 634 | + // /** Old paintLine() method with kooky args order, kept around for X Mode. */ | ||
| 635 | + // @Deprecated | ||
| 636 | + // protected void paintLine(Graphics gfx, TokenMarker tokenMarker, | ||
| 637 | + // int line, int x) { | ||
| 638 | 638 | // Font defaultFont = getFont(); | |
| 639 | 639 | // Color defaultColor = getForeground(); | |
| 640 | - | ||
| 640 | + protected void paintLine(Graphics gfx, int line, int x, | ||
| 641 | + TokenMarker tokenMarker) { | ||
| 641 | 642 | currentLineIndex = line; | |
| 642 | 643 | int y = textArea.lineToY(line); | |
| 643 | 644 | ||
@@ -651,10 +652,10 @@ protected void paintLine(Graphics gfx, TokenMarker tokenMarker, | |||
| 651 | 652 | } | |
| 652 | 653 | ||
| 653 | 654 | ||
| 654 | - protected void paintLine(Graphics gfx, int line, int x, | ||
| 655 | - TokenMarker tokenMarker) { | ||
| 656 | - paintLine(gfx, tokenMarker, line, x); | ||
| 657 | - } | ||
| 655 | + // protected void paintLine(Graphics gfx, int line, int x, | ||
| 656 | + // TokenMarker tokenMarker) { | ||
| 657 | + // paintLine(gfx, tokenMarker, line, x); | ||
| 658 | + // } | ||
| 658 | 659 | ||
| 659 | 660 | ||
| 660 | 661 | // protected void paintPlainLine(Graphics gfx, int line, Font defaultFont, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,7 +66,7 @@ public class PresentMode { | |||
| 66 | 66 | names.add(name); | |
| 67 | 67 | } | |
| 68 | 68 | ||
| 69 | - selector = new JComboBox(names); | ||
| 69 | + selector = new JComboBox<String>(names); | ||
| 70 | 70 | selector.addActionListener(new ActionListener() { | |
| 71 | 71 | public void actionPerformed(ActionEvent e) { | |
| 72 | 72 | int index = selector.getSelectedIndex(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | import java.io.*; | |
| 24 | 24 | import java.lang.reflect.Method; | |
| 25 | + | ||
| 25 | 26 | import processing.app.Base; | |
| 26 | 27 | import processing.app.SketchException; | |
| 27 | 28 | import processing.core.PApplet; | |
@@ -121,6 +122,7 @@ public void close() { } | |||
| 121 | 122 | Class.forName("org.eclipse.jdt.core.compiler.CompilationProgress", false, loader); | |
| 122 | 123 | Class[] compileArgs = | |
| 123 | 124 | new Class[] { String[].class, PrintWriter.class, PrintWriter.class, progressClass }; | |
| 125 | + @SuppressWarnings("unchecked") | ||
| 124 | 126 | Method compileMethod = batchClass.getMethod("compile", compileArgs); | |
| 125 | 127 | success = (Boolean) | |
| 126 | 128 | compileMethod.invoke(null, new Object[] { command, outWriter, writer, null }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,7 +81,6 @@ | |||
| 81 | 81 | import processing.app.syntax.PdeTextAreaDefaults; | |
| 82 | 82 | import processing.core.PApplet; | |
| 83 | 83 | import processing.mode.java.JavaEditor; | |
| 84 | - import processing.mode.java.pdex.AutoSaveUtil; | ||
| 85 | 84 | import processing.mode.java.pdex.ErrorBar; | |
| 86 | 85 | import processing.mode.java.pdex.ErrorCheckerService; | |
| 87 | 86 | import processing.mode.java.pdex.ErrorMessageSimplifier; | |
@@ -103,8 +102,6 @@ | |||
| 103 | 102 | * | |
| 104 | 103 | * @author Martin Leopold <m@martinleopold.com> | |
| 105 | 104 | * @author Manindra Moharana <me@mkmoharana.com> | |
| 106 | - * | ||
| 107 | - * | ||
| 108 | 105 | */ | |
| 109 | 106 | public class DebugEditor extends JavaEditor implements ActionListener { | |
| 110 | 107 | // important fields from superclass | |
@@ -212,11 +209,7 @@ public class DebugEditor extends JavaEditor implements ActionListener { | |||
| 212 | 209 | */ | |
| 213 | 210 | public boolean hasJavaTabs; | |
| 214 | 211 | ||
| 215 | - /** | ||
| 216 | - * UNUSED. Disbaled for now. | ||
| 217 | - */ | ||
| 218 | - protected AutoSaveUtil autosaver; | ||
| 219 | - | ||
| 212 | + | ||
| 220 | 213 | public DebugEditor(Base base, String path, EditorState state, Mode mode) { | |
| 221 | 214 | super(base, path, state, mode); | |
| 222 | 215 | ||
@@ -1025,38 +1018,6 @@ public boolean handleSaveAs() { | |||
| 1025 | 1018 | ||
| 1026 | 1019 | private boolean viewingAutosaveBackup; | |
| 1027 | 1020 | ||
| 1028 | - /** | ||
| 1029 | - * Loads and starts the auto save service | ||
| 1030 | - * Also handles the case where an auto save backup is found. | ||
| 1031 | - * The user is asked to save the sketch to a new location | ||
| 1032 | - */ | ||
| 1033 | - private void loadAutoSaver(){ | ||
| 1034 | - log("Load Auto Saver()"); | ||
| 1035 | - autosaver = new AutoSaveUtil(this, ExperimentalMode.autoSaveInterval); | ||
| 1036 | - if(!autosaver.checkForPastSave()) { | ||
| 1037 | - autosaver.init(); | ||
| 1038 | - return; | ||
| 1039 | - } | ||
| 1040 | - File pastSave = autosaver.getPastSave(); | ||
| 1041 | - int response = Base | ||
| 1042 | - .showYesNoQuestion(this, | ||
| 1043 | - "Unsaved backup found!", | ||
| 1044 | - "An automatic backup of \"" | ||
| 1045 | - + pastSave.getParentFile().getName() | ||
| 1046 | - + "\" sketch has been found. This may mean Processing " + | ||
| 1047 | - "was closed unexpectedly last time.", | ||
| 1048 | - "Select YES to view it or NO to delete the backup."); | ||
| 1049 | - if(response == JOptionPane.YES_OPTION){ | ||
| 1050 | - handleOpenInternal(pastSave.getAbsolutePath()); | ||
| 1051 | - // Base.showMessage("Save it..", "Remember to save the backup sketch to a specific location if you want to."); | ||
| 1052 | - //log(getSketch().getMainFilePath()); | ||
| 1053 | - log("loadAutoSaver, viewing autosave? " + viewingAutosaveBackup); | ||
| 1054 | - return; | ||
| 1055 | - } | ||
| 1056 | - else{ | ||
| 1057 | - autosaver.init(); | ||
| 1058 | - } | ||
| 1059 | - } | ||
| 1060 | 1021 | ||
| 1061 | 1022 | /** | |
| 1062 | 1023 | * Set text contents of a specific tab. Updates underlying document and text | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,6 +121,7 @@ | |||
| 121 | 121 | import com.google.classpath.ClassPathFactory; | |
| 122 | 122 | import com.google.classpath.RegExpResourceFilter; | |
| 123 | 123 | ||
| 124 | + @SuppressWarnings({ "deprecation", "unchecked" }) | ||
| 124 | 125 | public class ASTGenerator { | |
| 125 | 126 | ||
| 126 | 127 | protected ErrorCheckerService errorCheckerService; | |
@@ -1512,7 +1513,6 @@ public void run() { | |||
| 1512 | 1513 | */ | |
| 1513 | 1514 | } | |
| 1514 | 1515 | ||
| 1515 | - @SuppressWarnings("unchecked") | ||
| 1516 | 1516 | protected static ASTNode findClosestParentNode(int lineNumber, ASTNode node) { | |
| 1517 | 1517 | Iterator<StructuralPropertyDescriptor> it = node | |
| 1518 | 1518 | .structuralPropertiesForType().iterator(); | |
@@ -2248,7 +2248,7 @@ protected DefaultMutableTreeNode findAllOccurrences(){ | |||
| 2248 | 2248 | return defCU; | |
| 2249 | 2249 | } | |
| 2250 | 2250 | ||
| 2251 | - @SuppressWarnings({ "unchecked" }) | ||
| 2251 | + | ||
| 2252 | 2252 | /** | |
| 2253 | 2253 | * Generates AST Swing component | |
| 2254 | 2254 | * @param node | |
@@ -2280,23 +2280,23 @@ public static void visitRecur(ASTNode node, DefaultMutableTreeNode tnode) { | |||
| 2280 | 2280 | .getStructuralProperty(prop))); | |
| 2281 | 2281 | } | |
| 2282 | 2282 | } | |
| 2283 | - } | ||
| 2284 | - | ||
| 2285 | - else if (prop.isChildListProperty()) { | ||
| 2286 | - List<ASTNode> nodelist = (List<ASTNode>) node | ||
| 2287 | - .getStructuralProperty(prop); | ||
| 2283 | + } else if (prop.isChildListProperty()) { | ||
| 2284 | + List<ASTNode> nodelist = (List<ASTNode>) | ||
| 2285 | + node.getStructuralProperty(prop); | ||
| 2288 | 2286 | for (ASTNode cnode : nodelist) { | |
| 2289 | 2287 | if (isAddableASTNode(cnode)) { | |
| 2290 | 2288 | ctnode = new DefaultMutableTreeNode(new ASTNodeWrapper(cnode)); | |
| 2291 | 2289 | tnode.add(ctnode); | |
| 2292 | 2290 | visitRecur(cnode, ctnode); | |
| 2293 | - } else | ||
| 2291 | + } else { | ||
| 2294 | 2292 | visitRecur(cnode, tnode); | |
| 2293 | + } | ||
| 2295 | 2294 | } | |
| 2296 | 2295 | } | |
| 2297 | 2296 | } | |
| 2298 | 2297 | } | |
| 2299 | 2298 | ||
| 2299 | + | ||
| 2300 | 2300 | public void dfsNameOnly(DefaultMutableTreeNode tnode,ASTNode decl, String name) { | |
| 2301 | 2301 | Stack<DefaultMutableTreeNode> temp = new Stack<DefaultMutableTreeNode>(); | |
| 2302 | 2302 | temp.push(codeTree); | |
@@ -2356,8 +2356,8 @@ public ASTNode dfsLookForASTNode(ASTNode root, String name, int startOffset, | |||
| 2356 | 2356 | } | |
| 2357 | 2357 | } | |
| 2358 | 2358 | else if (prop.isChildListProperty()) { | |
| 2359 | - List<ASTNode> nodelist = (List<ASTNode>) node | ||
| 2360 | - .getStructuralProperty(prop); | ||
| 2359 | + List<ASTNode> nodelist = | ||
| 2360 | + (List<ASTNode>) node.getStructuralProperty(prop); | ||
| 2361 | 2361 | for (ASTNode temp : nodelist) { | |
| 2362 | 2362 | if (temp.getStartPosition() <= startOffset | |
| 2363 | 2363 | && (temp.getStartPosition() + temp.getLength()) >= endOffset) { | |
@@ -2552,7 +2552,7 @@ else if (prop.isChildListProperty()) { | |||
| 2552 | 2552 | } | |
| 2553 | 2553 | } | |
| 2554 | 2554 | ||
| 2555 | - @SuppressWarnings("unchecked") | ||
| 2555 | + | ||
| 2556 | 2556 | protected static ASTNode findLineOfNode(ASTNode node, int lineNumber, | |
| 2557 | 2557 | int offset, String name) { | |
| 2558 | 2558 | ||
@@ -2610,7 +2610,6 @@ protected static ASTNode findLineOfNode(ASTNode node, int lineNumber, | |||
| 2610 | 2610 | * @param root | |
| 2611 | 2611 | * @return | |
| 2612 | 2612 | */ | |
| 2613 | - @SuppressWarnings("unchecked") | ||
| 2614 | 2613 | public static ASTNode pinpointOnLine(ASTNode node, int offset, | |
| 2615 | 2614 | int lineStartOffset, String name) { | |
| 2616 | 2615 | //log("pinpointOnLine node class: " + node.getClass().getSimpleName()); | |
@@ -2669,7 +2668,6 @@ public static ASTNode pinpointOnLine(ASTNode node, int offset, | |||
| 2669 | 2668 | * @param findMe | |
| 2670 | 2669 | * @return | |
| 2671 | 2670 | */ | |
| 2672 | - @SuppressWarnings("unchecked") | ||
| 2673 | 2671 | protected static ASTNode findDeclaration(Name findMe) { | |
| 2674 | 2672 | ||
| 2675 | 2673 | // WARNING: You're entering the Rube Goldberg territory of Experimental Mode. | |
@@ -3224,7 +3222,8 @@ public static SimpleType extracTypeInfo(ASTNode node) { | |||
| 3224 | 3222 | return (SimpleType) t; | |
| 3225 | 3223 | } | |
| 3226 | 3224 | ||
| 3227 | - public static Type extracTypeInfo2(ASTNode node) { | ||
| 3225 | + | ||
| 3226 | + static public Type extracTypeInfo2(ASTNode node) { | ||
| 3228 | 3227 | if (node == null) | |
| 3229 | 3228 | return null; | |
| 3230 | 3229 | switch (node.getNodeType()) { | |
@@ -3245,8 +3244,8 @@ public static Type extracTypeInfo2(ASTNode node) { | |||
| 3245 | 3244 | return null; | |
| 3246 | 3245 | } | |
| 3247 | 3246 | ||
| 3248 | - @SuppressWarnings("unchecked") | ||
| 3249 | - protected static ASTNode definedIn(ASTNode node, String name, | ||
| 3247 | + | ||
| 3248 | + static protected ASTNode definedIn(ASTNode node, String name, | ||
| 3250 | 3249 | ArrayList<Integer> constrains, | |
| 3251 | 3250 | ASTNode declaringClass) { | |
| 3252 | 3251 | if (node == null) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,19 +48,17 @@ | |||
| 48 | 48 | import org.eclipse.jdt.core.dom.Type; | |
| 49 | 49 | import org.eclipse.jdt.core.dom.TypeDeclaration; | |
| 50 | 50 | ||
| 51 | + | ||
| 51 | 52 | /** | |
| 52 | 53 | * Wrapper class for ASTNode objects | |
| 53 | 54 | * @author Manindra Moharana <me@mkmoharana.com> | |
| 54 | 55 | * | |
| 55 | 56 | */ | |
| 56 | 57 | public class ASTNodeWrapper { | |
| 57 | 58 | private ASTNode Node; | |
| 58 | - | ||
| 59 | 59 | private String label; | |
| 60 | - | ||
| 61 | 60 | private int lineNumber; | |
| 62 | - | ||
| 63 | - //private int apiLevel; | ||
| 61 | + | ||
| 64 | 62 | ||
| 65 | 63 | /* | |
| 66 | 64 | * TODO: Every ASTNode object in ASTGenerator.codetree is stored as a | |
@@ -168,6 +166,7 @@ public int[] getJavaCodeOffsets(ErrorCheckerService ecs) { | |||
| 168 | 166 | while (it.hasNext()) { | |
| 169 | 167 | StructuralPropertyDescriptor prop = it.next(); | |
| 170 | 168 | if (prop.isChildListProperty()) { | |
| 169 | + @SuppressWarnings("unchecked") | ||
| 171 | 170 | List<ASTNode> nodelist = (List<ASTNode>) | |
| 172 | 171 | thisNode.getStructuralProperty(prop); | |
| 173 | 172 | log("prop " + prop); | |
@@ -218,6 +217,7 @@ public int[] getJavaCodeOffsets(ErrorCheckerService ecs) { | |||
| 218 | 217 | * @return | |
| 219 | 218 | */ | |
| 220 | 219 | private int getJavadocOffset(FieldDeclaration fd){ | |
| 220 | + @SuppressWarnings("unchecked") | ||
| 221 | 221 | List<ASTNode> list = fd.modifiers(); | |
| 222 | 222 | SimpleName sn = (SimpleName) getNode(); | |
| 223 | 223 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments