mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user