Files
processing4/mobile/app/PdeEmulator.java
2005-01-27 06:00:01 +00:00

49 lines
1.3 KiB
Java
Executable File

import java.awt.Point;
import java.io.*;
/**
*
* @author Francis Li
*/
public class PdeEmulator extends PdeRuntime {
/** Creates a new instance of PdeEmulator */
public PdeEmulator(PdeSketch sketch, PdeEditor editor) {
super(sketch, editor);
}
public void start(Point windowLocation) throws PdeException {
try{
String wtkBinPath = PdePreferences.get("wtk.path") + File.separator + "bin";
StringBuffer command = new StringBuffer();
command.append(wtkBinPath);
command.append(File.separator);
command.append("emulator.exe -Xdescriptor:\"");
command.append(sketch.folder.getPath());
command.append(File.separator);
command.append("midlet");
command.append(File.separator);
command.append(sketch.name);
command.append(".jad\"");
process = Runtime.getRuntime().exec(command.toString(), null, new File(wtkBinPath));
processInput = new SystemOutSiphon(process.getInputStream());
processError = new PdeMessageSiphon(process.getErrorStream(), this);
processOutput = process.getOutputStream();
} catch (Exception e) {
e.printStackTrace();
}
}
public void stop() {
}
public void close() {
}
public void message(String s) {
System.err.println(s);
}
}