2 import org.web3d.x3d.sai.*;
11 private static Properties freewrlProperties;
15 freewrlProperties =
new Properties();
17 InputStream is = BrowserFactory.class.getClassLoader().getResourceAsStream(
"freewrlsai.properties");
20 freewrlProperties.put(
"factory",
"sai.FreeWRLFactory");
23 freewrlProperties.load(is);
24 }
catch (IOException e) {
25 System.out.println(e);
36 if (freewrlFactory != null) {
37 throw new X3DException(
"Factory has already been defined");
41 throw new IllegalArgumentException(
"Null factory passed to setBrowserFactoryImpl");
48 if (freewrlFactory == null)
51 return freewrlFactory.createX3DComponent(params);
55 if (freewrlFactory == null)
68 if (freewrlFactory == null)
82 if (freewrlFactory == null)
85 return freewrlFactory.getBrowser(address, port);
88 private static void loadFactory() {
90 String factoryClassName = (String) freewrlProperties.getProperty(
"factory");
91 Class factoryClass = Class.forName(factoryClassName);
93 }
catch (Exception e) {
94 System.out.println(e);