This site requires JavaScript, please enable it in your browser!
Greenfoot back
jberrich
jberrich wrote ...

2017/12/6

Eclipse source code problem

jberrich jberrich

2017/12/6

#
Hi every body, this my first time in greenfoot forum. I want the update the greenfoot v3.1.0 source to change some things in Actor class and World class, so for that i am using Eclipse plateforme. I have this error in bluej source code attached. Best, Jamal
davmac davmac

2017/12/6

#
That is a problem with Eclipse, which has its own Java compiler implementation and which doesn't accept some of the code in Greenfoot. Try updating to the latest version of Eclipse, if you haven't already; if that doesn't help, the only real solution is to use another IDE. It is also possibility to change the visibility of the classes mentioned in the error to public. If I remember correctly, this will stop Eclipse from showing an error. However, there may also be other issues.
jberrich jberrich

2017/12/7

#
this code :
SuggestedFollowUpDisplay disp = new SuggestedFollowUpDisplay(editor, "Do you want to rename all uses of old variable \"" + oldVal + "\" to use \"" + newVal + "\" instead?", () -> renamer.refs.forEach(r -> r.rename.accept(newVal)));
will be replaced by :
SuggestedFollowUpDisplay disp = new SuggestedFollowUpDisplay(editor, 
                		                                                     "Do you want to rename all uses of old variable \"" + oldVal + "\" to use \"" + newVal + "\" instead?", 
                		                                                     new FXRunnable() {
																				
																				@Override
																				public void run() {
																					for(PlainVarReference r : renamer.refs) {
																						r.rename.accept(newVal);
																					}
																				}
																				
																			});
and this code :
List<Bounds> boundsList = Utility.mapList(refs, ref -> ref.refNode.localToScene(ref.refNode.getBoundsInLocal()));
will be replaced by :
List<Bounds> boundsList = Utility.mapList(refs, 
        		                                  new Function<PlainVarReference, Bounds>() {
        	
        											@Override
        											public Bounds apply(PlainVarReference ref) {
        												return ref.refNode.localToScene(ref.refNode.getBoundsInLocal());
        											}
        	
												});
You need to login to post a reply.