FreeWRL/FreeX3D  3.0.0
FreeWRLBrowserInfo.java
1 package sai;
2 import org.web3d.x3d.sai.*;
3 import java.util.*;
4 
5 public class FreeWRLBrowserInfo {
6  private static HashMap browserProperties;
7 
8  private static final int ABSTRACT_NODES = 0;
9  private static final int CONCRETE_NODES = 1;
10  private static final int EXTERNAL_INTERACTIONS = 2;
11  private static final int PROTOTYPE_CREATE = 3;
12  private static final int DOM_IMPORT = 4;
13  private static final int XML_ENCODING = 5;
14  private static final int CLASSIC_VRML_ENCODING = 6;
15  private static final int BINARY_ENCODING = 7;
16 
17  static {
18  browserProperties = new HashMap();
19 
20  browserProperties.put(new Integer(ABSTRACT_NODES), new Boolean(false));
21  browserProperties.put(new Integer(CONCRETE_NODES), new Boolean(true));
22  browserProperties.put(new Integer(EXTERNAL_INTERACTIONS), new Boolean(true));
23  browserProperties.put(new Integer(PROTOTYPE_CREATE), new Boolean(true));
24  browserProperties.put(new Integer(DOM_IMPORT), new Boolean(false));
25  browserProperties.put(new Integer(XML_ENCODING), new Boolean(true));
26  browserProperties.put(new Integer(CLASSIC_VRML_ENCODING), new Boolean(true));
27  browserProperties.put(new Integer(BINARY_ENCODING), new Boolean(true));
28  }
29 
30  public static void setBrowserProperty(int property, boolean value) {
31  if ( property < 0 || property > 7) {
32  System.out.println("Passed invalid property value. Property set request ignored.");
33  } else {
34  browserProperties.remove(new Integer(property));
35  browserProperties.put(new Integer(property), new Boolean(value));
36  }
37  }
38 
39  public static boolean getBrowserProperty(int property) {
40  Boolean temp;
41  temp = (Boolean) browserProperties.get(new Integer(property));
42  return temp.booleanValue();
43  }
44 
45  public static Map getBrowserProperties() {
46  return browserProperties;
47  }
48 }