Merge branch 'master' of github.com:processing/processing

This commit is contained in:
Ben Fry
2016-02-13 09:30:21 -05:00
5 changed files with 51 additions and 35 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ Processing
==========
This is the official source code for the [Processing](http://processing.org) Development Environment (PDE),
the “core” and the libraries that are included with the [download](http://processing.org/download).
the “core” and the libraries that are included with the [download](http://processing.org/download).
__I've found a bug!__
Let us know [here](https://github.com/processing/processing/issues) (after first checking if someone has already posted a similar problem).
@@ -22,7 +22,7 @@ The instructions for building the source [are here](https://github.com/processin
Please help us fix problems, and if you're submitting code, following the [style guidelines](https://github.com/processing/processing/wiki/Style-Guidelines) helps save us a lot of time.
__And finally...__
Someday we'll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we're giving away for free. But not today.
Someday we'll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we're giving away for free. But not today.
So in the meantime, I ask for your patience,
[participation](https://github.com/processing/processing/wiki/Project-List),
+4
View File
@@ -43,6 +43,10 @@
<opt>-Djna.nounpack=true</opt>
<!-- starting in 3.0, require Java 8 -->
<minVersion>1.8.0_51</minVersion>
<!-- TODO: remove the line below as soon as we are on 1.8.0_60 or newer,
see https://bugs.openjdk.java.net/browse/JDK-8060036 and
http://kingsfleet.blogspot.com.br/2014/11/but-thats-impossible-or-finding-out.html -->
<opt>-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot</opt>
<!-- increase available per PDE X request -->
<maxHeapSize>256</maxHeapSize>
</jre>
+7 -7
View File
@@ -10234,6 +10234,13 @@ public class PApplet implements PConstants {
// }
sketch.sketchPath = folder;
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
if (args.length != argIndex + 1) {
// pass everything after the class name in as args to the sketch itself
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
sketch.args = PApplet.subset(args, argIndex + 1);
}
// Call the settings() method which will give us our size() call
// try {
sketch.handleSettings();
@@ -10255,13 +10262,6 @@ public class PApplet implements PConstants {
// //fullScreen |= sketch.sketchFullScreen();
// sketch.fullScreen |= fullScreen;
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
if (args.length != argIndex + 1) {
// pass everything after the class name in as args to the sketch itself
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
sketch.args = PApplet.subset(args, argIndex + 1);
}
sketch.external = external;
if (windowColor != 0) {
@@ -1015,9 +1015,10 @@ public class ASTGenerator {
if (candidates.get(0).getElementName()
.equals(candidates.get(candidates.size() - 1).getElementName())) {
log("All CC are methods only: " + candidates.get(0).getElementName());
for (CompletionCandidate candidate : candidates) {
candidate.regenerateCompletionString();
defListModel.addElement(candidate);
for (int i = 0; i < candidates.size(); i++) {
CompletionCandidate cc = candidates.get(i).withRegeneratedCompString();
candidates.set(i, cc);
defListModel.addElement(cc);
}
}
else {
@@ -1030,14 +1031,15 @@ public class ASTGenerator {
CompletionCandidate cc = candidates.get(i - 1);
String label = cc.getLabel();
int x = label.lastIndexOf(')');
if(candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) {
cc.setLabel((cc.getLabel().contains("<html>") ? "<html>" : "")
+ cc.getElementName() + "(...)" + label.substring(x + 1));
String newLabel;
if (candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) {
newLabel = (cc.getLabel().contains("<html>") ? "<html>" : "")
+ cc.getElementName() + "(...)" + label.substring(x + 1);
} else {
newLabel = cc.getElementName() + "(...)" + label.substring(x + 1);
}
else {
cc.setLabel(cc.getElementName() + "(...)" + label.substring(x + 1));
}
cc.setCompletionString(cc.getElementName() + "(");
String newCompString = cc.getElementName() + "(";
candidates.set(i - 1, cc.withLabelAndCompString(newLabel, newCompString));
ignoredSome = true;
continue;
}
@@ -33,11 +33,11 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
public class CompletionCandidate implements Comparable<CompletionCandidate>{
private String elementName;
private String label; // the toString value
private String completionString;
private Object wrappedObject;
private int type;
private final String elementName;
private final String label; // the toString value
private final String completionString;
private final Object wrappedObject;
private final int type;
static final int PREDEF_CLASS = 0;
static final int PREDEF_FIELD = 1;
@@ -158,6 +158,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
label = labelStr;
completionString = completionStr;
this.type = type;
wrappedObject = null;
}
public CompletionCandidate(String name, int type) {
@@ -165,6 +166,17 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
label = name;
completionString = name;
this.type = type;
wrappedObject = null;
}
private CompletionCandidate(String elementName, String label,
String completionString, int type,
Object wrappedObject) {
this.elementName = elementName;
this.label = label;
this.completionString = completionString;
this.type = type;
this.wrappedObject = wrappedObject;
}
public String getElementName() {
@@ -204,14 +216,13 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
}
}
public void setLabel(String label) {
this.label = label;
}
public void setCompletionString(String completionString) {
this.completionString = completionString;
public CompletionCandidate withLabelAndCompString(String label,
String completionString) {
return new CompletionCandidate(this.elementName, label, completionString,
this.type, this.wrappedObject);
}
@Override
public int compareTo(CompletionCandidate cc) {
if(type != cc.getType()){
return cc.getType() - type;
@@ -219,7 +230,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
return (elementName.compareTo(cc.getElementName()));
}
public void regenerateCompletionString(){
public CompletionCandidate withRegeneratedCompString() {
if (wrappedObject instanceof MethodDeclaration) {
MethodDeclaration method = (MethodDeclaration)wrappedObject;
@@ -243,8 +254,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
if (method.getReturnType2() != null)
label.append(" : " + method.getReturnType2());
cstr.append(")");
this.label = label.toString();
this.completionString = cstr.toString();
return this.withLabelAndCompString(label.toString(), cstr.toString());
}
else if (wrappedObject instanceof Method) {
Method method = (Method)wrappedObject;
@@ -265,8 +275,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
label.append(" : " + method.getReturnType().getSimpleName());
label.append(" - <font color=#777777>" + method.getDeclaringClass().getSimpleName() + "</font></html>");
cstr.append(")");
this.label = label.toString();
this.completionString = cstr.toString();
return this.withLabelAndCompString(label.toString(), cstr.toString());
/*
* StringBuilder label = new StringBuilder("<html>"+method.getName() + "(");
StringBuilder cstr = new StringBuilder(method.getName() + "(");
@@ -286,6 +295,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
label.append(" - <font color=#777777>" + method.getDeclaringClass().getSimpleName() + "</font></html>");
* */
}
return this;
}
}