4040import processing .app .Sketch ;
4141import processing .app .SketchCode ;
4242import processing .app .Util ;
43- import processing .mode .java .pdex .ErrorCheckerService ;
4443import processing .mode .java .pdex .LineMarker ;
4544import processing .mode .java .pdex .Problem ;
4645import processing .app .Language ;
5756 */
5857public class MarkerColumn extends JPanel {
5958 protected JavaEditor editor ;
60- protected ErrorCheckerService errorCheckerService ;
6159
6260 static final int WIDE = 12 ;
63- // protected int preferredHeight;
64- // protected int preferredWidth = 12;
65-
66- // static final int errorMarkerHeight = 4;
6761
6862 private Color errorColor ;
6963 private Color warningColor ;
@@ -73,13 +67,9 @@ public class MarkerColumn extends JPanel {
7367 private List <LineMarker > errorPoints =
7468 Collections .synchronizedList (new ArrayList <LineMarker >());
7569
76- // /** Stores previous list of error markers. */
77- // private List<LineMarker> errorPointsOld = new ArrayList<LineMarker>();
78-
7970
8071 public MarkerColumn (JavaEditor editor , int height ) {
8172 this .editor = editor ;
82- this .errorCheckerService = editor .errorCheckerService ;
8373
8474 Mode mode = editor .getMode ();
8575 errorColor = mode .getColor ("editor.column.error.color" );
@@ -121,10 +111,9 @@ public List<LineMarker> getErrorPoints() {
121111
122112
123113 synchronized public void updateErrorPoints (final List <Problem > problems ) {
124- // NOTE TO SELF: ErrorMarkers are calculated for the present tab only
125- // Error Marker index in the arraylist is LOCALIZED for current tab.
126- // Also, need to do the update in the UI thread via SwingWorker to prevent
127- // concurrency issues.
114+ // NOTE: ErrorMarkers are calculated for the present tab only Error Marker
115+ // index in the arraylist is LOCALIZED for current tab. Also, update is in
116+ // the UI thread via SwingWorker to prevent concurrency issues. [Manindra]
128117 try {
129118 new SwingWorker () {
130119 protected Object doInBackground () throws Exception {
@@ -168,30 +157,6 @@ protected void done() {
168157 }
169158
170159
171- /*
172- // Check if new errors have popped up in the sketch since the last check
173- public boolean errorPointsChanged() {
174- if (errorPointsOld.size() != errorPoints.size()) {
175- editor.getTextArea().repaint();
176- // System.out.println("2 Repaint " + System.currentTimeMillis());
177- return true;
178- }
179-
180- else {
181- for (int i = 0; i < errorPoints.size(); i++) {
182- if (errorPoints.get(i).getY() != errorPointsOld.get(i).getY()) {
183- editor.getTextArea().repaint();
184- // System.out.println("3 Repaint " +
185- // System.currentTimeMillis());
186- return true;
187- }
188- }
189- }
190- return false;
191- }
192- */
193-
194-
195160 /** Find out which error/warning the user has clicked and scroll to it */
196161 void scrollToMarkerAt (final int y ) {
197162 try {
@@ -201,7 +166,7 @@ protected Object doInBackground() throws Exception {
201166 // -2 and +2 are extra allowance, clicks in the
202167 // vicinity of the markers register that way
203168 if (Math .abs (y - m .getY ()) < 3 ) {
204- errorCheckerService .scrollToErrorLine (m .getProblem ());
169+ editor . getErrorChecker () .scrollToErrorLine (m .getProblem ());
205170 return null ;
206171 }
207172 }
0 commit comments