Merge pull request #2422 from jdf/master

Permit Mode developers to run their Modes in Eclipse (or however they like) during development.
This commit is contained in:
Ben Fry
2014-04-03 10:41:04 -04:00
3 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -364,13 +364,13 @@ public class Base {
} else {
for (Mode m : getModeList()) {
if (m.getIdentifier().equals(lastModeIdentifier)) {
logf("Setting next mode to {0}.", lastModeIdentifier); //$NON-NLS-1$
logf("Setting next mode to %s.", lastModeIdentifier); //$NON-NLS-1$
nextMode = m;
}
}
if (nextMode == null) {
nextMode = coreModes[0];
logf("Could not find mode {0}, using default.", lastModeIdentifier); //$NON-NLS-1$
logf("Could not find mode %s, using default.", lastModeIdentifier); //$NON-NLS-1$
}
}
@@ -24,7 +24,6 @@ package processing.app.contrib;
import java.io.File;
import java.lang.reflect.Constructor;
import java.util.*;
import java.util.HashMap;
import processing.app.Base;
import processing.app.Mode;
@@ -110,6 +109,17 @@ public class ModeContribution extends LocalContribution {
}
}
}
// This allows you to build and test your Mode code from Eclipse.
// -Dusemode=com.foo.FrobMode:/path/to/FrobMode/resources
final String usemode = System.getProperty("usemode");
if (usemode != null) {
final String[] modeinfo = usemode.split(":");
final String modeClass = modeinfo[0];
final String modeResourcePath = modeinfo[1];
System.err.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
contribModes.add(ModeContribution.load(base, new File(modeResourcePath), modeClass));
}
}
+2 -2
View File
@@ -784,6 +784,8 @@ public class PApplet extends Applet
*/
static public final String ARGS_EDITOR_LOCATION = "--editor-location";
static public final String ARGS_EXTERNAL = "--external";
/**
* Location for where to position the applet window on screen.
* <p>
@@ -791,8 +793,6 @@ public class PApplet extends Applet
* location, or could be used by other classes to launch at a
* specific position on-screen.
*/
static public final String ARGS_EXTERNAL = "--external";
static public final String ARGS_LOCATION = "--location";
static public final String ARGS_DISPLAY = "--display";