+ /** returns an InputStream to the builtin xwar */
+ protected InputStream _getBuiltinInputStream() {
+ return Platform.class.getClassLoader().getResourceAsStream("org/xwt/builtin.xwar");
+ }
+
+ /** returns the value of the environment variable key, or null if no such key exists */
+ protected String _getEnv(String key) {
+ try {
+ String os = System.getProperty("os.name").toLowerCase();
+ Process p;
+ if (os.indexOf("windows 9") != -1 || os.indexOf("windows me") != -1) {
+ // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not
+ if (platform.getClass().getName().endsWith("Java12")) return null;
+ p = Runtime.getRuntime().exec("command.com /c set");
+ } else if (os.indexOf("windows") > -1) {
+ // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not
+ if (platform.getClass().getName().endsWith("Java12")) return null;
+ p = Runtime.getRuntime().exec("cmd.exe /c set");
+ } else {
+ p = Runtime.getRuntime().exec("env");
+ }
+ BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String s;
+ while ((s = br.readLine()) != null)
+ if (s.startsWith(key + "="))
+ return s.substring(key.length() + 1);
+ } catch (Exception e) {
+ if (Log.on) Log.log(this, "Exception while reading from environment:");
+ if (Log.on) Log.log(this, e);
+ }
+ return null;
+ }
+
+ /** convert a JPEG into an Image */
+ protected ImageDecoder _decodeJPEG(InputStream is, String name) { return null; }
+