View Javadoc

1   /* -------------------------------------------------------------------
2    * Java source file for the class J3DBeanUtil
3    * 
4    * Copyright (c), 2003, Masahiro Takatsuka.
5    * All Rights Researved.
6    * 
7    * Original Author: Masahiro Takatsuka (masa@jbeans.net)
8    * $Author: takatsukam $
9    * 
10   * $Date: 2004/03/03 11:53:05 $
11   * 
12   * $Id: J3DBeanUtil.java,v 1.3 2004/03/03 11:53:05 takatsukam Exp $
13   * 
14   * Reference:		Document no:
15   * ___				___
16   * 
17   * To Do:
18   * ___
19   * 
20  ------------------------------------------------------------------- */
21  
22  /* --------------------------- Package ---------------------------- */
23  package net.jbeans.j3d.bean;
24  
25  /* ------------------ Import classes (packages) ------------------- *//package-summary/html">class="comment"> ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment"> ------------------ Import classes (packages) ------------------- */
26  import java.beans.*;
27  import javax.media.j3d.*;
28  import javax.vecmath.*;
29  
30  import net.jbeans.bean.factory.*;
31  import net.jbeans.util.debug.*;
32  
33  /*====================================================================
34                   Implementation of class J3DBeanUtil                  
35  ====================================================================*/
36  /***
37   * J3DBeanUtil defines various helper methods.
38   * 
39   * @version $Revision: 1.3 $
40   * @author Masahiro Takatsuka (masa@jbeans.net)
41   */
42  
43  public class J3DBeanUtil {
44  	private static final boolean DEBUG = Debug.getDebugFlag(J3DBeanUtil.class);
45  
46  	private static boolean propertyEditorsSet = false;
47  	static {
48  		if (!propertyEditorsSet) {
49  			setPropertyEditors();
50  			propertyEditorsSet = true;
51  		}
52  	}
53  	private static boolean factorySet = false;
54  // 	static {
55  // 		if (!factorySet) {
56  // 			setFactories();
57  // 			factorySet = true;
58  // 		}
59  // 	}
60  	
61  	private J3DBeanUtil() {
62  		super();
63  	}
64  
65  	private static final void setPropertyEditors() {
66          PropertyEditorManager.registerEditor(javax.media.j3d.Transform3D.class, net.jbeans.j3d.bean.property.editor.Transform3DEditor.class);				
67          PropertyEditorManager.registerEditor(javax.vecmath.Color3b.class, net.jbeans.j3d.bean.property.editor.Color3bEditor.class);
68          PropertyEditorManager.registerEditor(javax.vecmath.Color3f.class, net.jbeans.j3d.bean.property.editor.Color3fEditor.class);		
69          PropertyEditorManager.registerEditor(javax.vecmath.Color4b.class, net.jbeans.j3d.bean.property.editor.Color4bEditor.class);
70          PropertyEditorManager.registerEditor(javax.vecmath.Color4f.class, net.jbeans.j3d.bean.property.editor.Color4fEditor.class);		
71          PropertyEditorManager.registerEditor(javax.vecmath.Point2d.class, net.jbeans.j3d.bean.property.editor.Point2dEditor.class);
72          PropertyEditorManager.registerEditor(javax.vecmath.Point2f.class, net.jbeans.j3d.bean.property.editor.Point2fEditor.class);		
73          PropertyEditorManager.registerEditor(javax.vecmath.Point3d.class, net.jbeans.j3d.bean.property.editor.Point3dEditor.class);
74          PropertyEditorManager.registerEditor(javax.vecmath.Point3f.class, net.jbeans.j3d.bean.property.editor.Point3fEditor.class);
75          PropertyEditorManager.registerEditor(javax.vecmath.Point3i.class, net.jbeans.j3d.bean.property.editor.Point3iEditor.class);				
76          PropertyEditorManager.registerEditor(javax.vecmath.Point4d.class, net.jbeans.j3d.bean.property.editor.Point4dEditor.class);
77          PropertyEditorManager.registerEditor(javax.vecmath.Point4f.class, net.jbeans.j3d.bean.property.editor.Point4fEditor.class);
78          PropertyEditorManager.registerEditor(javax.vecmath.Point4i.class, net.jbeans.j3d.bean.property.editor.Point4iEditor.class);
79          PropertyEditorManager.registerEditor(javax.vecmath.Vector2d.class, net.jbeans.j3d.bean.property.editor.Vector2dEditor.class);
80          PropertyEditorManager.registerEditor(javax.vecmath.Vector2f.class, net.jbeans.j3d.bean.property.editor.Vector2fEditor.class);				
81          PropertyEditorManager.registerEditor(javax.vecmath.Vector3d.class, net.jbeans.j3d.bean.property.editor.Vector3dEditor.class);
82          PropertyEditorManager.registerEditor(javax.vecmath.Vector3f.class, net.jbeans.j3d.bean.property.editor.Vector3fEditor.class);
83          PropertyEditorManager.registerEditor(javax.vecmath.Vector4d.class, net.jbeans.j3d.bean.property.editor.Vector4dEditor.class);
84          PropertyEditorManager.registerEditor(javax.vecmath.Vector4f.class, net.jbeans.j3d.bean.property.editor.Vector4fEditor.class);
85  	}
86  
87  // 	private static final void setFactories() {
88  //         FactoryManager.registerFactory(javax.media.j3d.Appearance.class, net.jbeans.j3d.bean.factory.AppearanceFactory.class);
89  //         FactoryManager.registerFactory(javax.media.j3d.BranchGroup.class, net.jbeans.j3d.bean.factory.BranchGroupFactory.class);
90  // 		FactoryManager.registerFactory(javax.media.j3d.ColoringAttributes.class, net.jbeans.j3d.bean.factory.ColoringAttributesFactory.class);
91  // 		FactoryManager.registerFactory(javax.media.j3d.LineAttributes.class, net.jbeans.j3d.bean.factory.LineAttributesFactory.class);
92  // 		FactoryManager.registerFactory(javax.media.j3d.Material.class, net.jbeans.j3d.bean.factory.MaterialFactory.class);
93  // 		FactoryManager.registerFactory(javax.media.j3d.PointAttributes.class, net.jbeans.j3d.bean.factory.PointAttributesFactory.class);
94  // 		FactoryManager.registerFactory(javax.media.j3d.PolygonAttributes.class, net.jbeans.j3d.bean.factory.PolygonAttributesFactory.class);
95  // 		FactoryManager.registerFactory(javax.media.j3d.RenderingAttributes.class, net.jbeans.j3d.bean.factory.RenderingAttributesFactory.class);
96  // 		FactoryManager.registerFactory(javax.media.j3d.Shape3D.class, net.jbeans.j3d.bean.factory.Shape3DFactory.class);
97  // 		FactoryManager.registerFactory(javax.media.j3d.TexCoordGeneration.class, net.jbeans.j3d.bean.factory.TexCoordGenerationFactory.class);
98  // 		FactoryManager.registerFactory(javax.media.j3d.TextureAttributes.class, net.jbeans.j3d.bean.factory.TextureAttributesFactory.class);
99  // 		FactoryManager.registerFactory(javax.media.j3d.Texture.class, net.jbeans.j3d.bean.factory.TextureFactory.class);
100 // 		FactoryManager.registerFactory(javax.media.j3d.TransparencyAttributes.class, net.jbeans.j3d.bean.factory.TransparencyAttributesFactory.class);
101 // 	}
102 }