2323import java .awt .GraphicsDevice ;
2424import java .awt .GraphicsEnvironment ;
2525import java .awt .Rectangle ;
26- import java .awt .event .ActionEvent ;
2726import java .awt .event .ComponentAdapter ;
2827import java .awt .event .ComponentEvent ;
2928import java .awt .event .InputEvent ;
8988
9089import static processing .mode .java .pdex .ASTUtils .*;
9190
91+
9292public class PDEX {
9393
9494 private static final boolean SHOW_DEBUG_TREE = false ;
@@ -188,7 +188,6 @@ public void documentChanged(Document newDoc) {
188188
189189
190190 private class InspectMode {
191-
192191 boolean inspectModeEnabled ;
193192
194193 boolean isMouse1Down ;
@@ -279,16 +278,17 @@ public void keyReleased(KeyEvent e) {
279278 inspectModeEnabled = inspectModeEnabled && isHotkeyDown ;
280279 }
281280 });
282-
283281 }
284282
283+
285284 void handleInspect () {
286285 int off = editor .getSelectionStart ();
287286 int tabIndex = editor .getSketch ().getCurrentCodeIndex ();
288287
289288 pps .whenDoneBlocking (ps -> handleInspect (ps , tabIndex , off ));
290289 }
291290
291+
292292 // Thread: EDT
293293 void handleInspect (MouseEvent evt ) {
294294 int off = editor .getJavaTextArea ().xyToOffset (evt .getX (), evt .getY ());
@@ -352,13 +352,10 @@ private void handleInspect(PreprocessedSketch ps, int tabIndex, int offset) {
352352 void dispose () {
353353 // Nothing to do
354354 }
355-
356355 }
357356
358357
359-
360- private static class ShowUsage {
361-
358+ static private class ShowUsage {
362359 final JDialog window ;
363360 final JTree tree ;
364361
@@ -595,12 +592,10 @@ void dispose() {
595592 window .dispose ();
596593 }
597594 }
598-
599595 }
600596
601597
602- private static class ShowUsageTreeNode {
603-
598+ static private class ShowUsageTreeNode {
604599 final int tabIndex ;
605600 final int startTabOffset ;
606601 final int stopTabOffset ;
@@ -902,7 +897,6 @@ void rename(PreprocessedSketch ps, IBinding binding, String newName) {
902897 int offsetDiff = precedingIntervals * intervalLengthDiff ;
903898
904899 editor .getTextArea ().setCaretPosition (currentOffset + offsetDiff );
905-
906900 }
907901
908902
@@ -911,16 +905,12 @@ void dispose() {
911905 window .dispose ();
912906 }
913907 }
914-
915908 }
916909
917910
918-
919- private static class DebugTree {
920-
911+ static private class DebugTree {
921912 final JDialog window ;
922913 final JTree tree ;
923-
924914 final Consumer <PreprocessedSketch > updateListener ;
925915
926916
@@ -1030,13 +1020,10 @@ public void postVisit(ASTNode node) {
10301020 }
10311021 });
10321022 }
1033-
10341023 }
10351024
10361025
1037-
1038- private static class ErrorChecker {
1039-
1026+ static private class ErrorChecker {
10401027 // Delay delivering error check result after last sketch change #2677
10411028 private final static long DELAY_BEFORE_UPDATE = 650 ;
10421029
@@ -1181,6 +1168,7 @@ static private boolean isUndefinedTypeProblem(IProblem iproblem) {
11811168 id == IProblem .UnresolvedVariable ;
11821169 }
11831170
1171+
11841172 static private boolean isMissingBraceProblem (IProblem iproblem ) {
11851173 switch (iproblem .getID ()) {
11861174 case IProblem .ParsingErrorInsertToComplete : {
@@ -1197,7 +1185,7 @@ static private boolean isMissingBraceProblem(IProblem iproblem) {
11971185 }
11981186
11991187
1200- public static String [] getImportSuggestions (ClassPath cp , String className ) {
1188+ static public String [] getImportSuggestions (ClassPath cp , String className ) {
12011189 RegExpResourceFilter regf = new RegExpResourceFilter (
12021190 Pattern .compile (".*" ),
12031191 Pattern .compile ("(.*\\ $)?" + className + "\\ .class" ,
@@ -1224,6 +1212,5 @@ public static String[] getImportSuggestions(ClassPath cp, String className) {
12241212 })
12251213 .toArray (String []::new );
12261214 }
1227-
12281215 }
12291216}
0 commit comments