mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
window placement, and exact placement now working for external
This commit is contained in:
@@ -68,25 +68,24 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
|
||||
this.leechErr = leechErr;
|
||||
|
||||
//Frame frame = PdeBase.frame;
|
||||
Point parentLoc = editor.base.getLocation(); //frame.getLocation();
|
||||
Insets parentInsets = editor.base.getInsets(); //frame.getInsets();
|
||||
Point parentLoc = editor.base.getLocation();
|
||||
Insets parentInsets = editor.base.getInsets();
|
||||
|
||||
int x1 = parentLoc.x - 20;
|
||||
int y1 = parentLoc.y;
|
||||
|
||||
try {
|
||||
//if (PdeBase.getBoolean("play.external", false)) {
|
||||
//System.out.println(externalPaths);
|
||||
|
||||
if (externalRuntime) {
|
||||
//System.out.println("going external");
|
||||
String command[] = new String[] {
|
||||
"java",
|
||||
"-cp",
|
||||
externalPaths,
|
||||
"BApplet",
|
||||
"--external=" + x1 + "," + y1,
|
||||
BApplet.EXTERNAL_FLAG + ((windowLocation != null) ?
|
||||
("e" +
|
||||
windowLocation.x + "," +
|
||||
windowLocation.y) :
|
||||
(x1 + "," + y1)),
|
||||
className
|
||||
};
|
||||
|
||||
@@ -382,6 +381,16 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
return;
|
||||
}
|
||||
|
||||
if (s.indexOf(BApplet.EXTERNAL_MOVE) == 0) {
|
||||
String nums = s.substring(s.indexOf(' ') + 1);
|
||||
int space = nums.indexOf(' ');
|
||||
int left = Integer.parseInt(nums.substring(0, space));
|
||||
int top = Integer.parseInt(nums.substring(space + 1));
|
||||
editor.appletLocation = new Point(left, top);
|
||||
//System.out.println("wanna move to " + left + " " + top);
|
||||
return;
|
||||
}
|
||||
|
||||
//System.err.println("message " + s.length() + ":" + s);
|
||||
if (s.length() > 2) System.err.println(s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user