01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/treeview/DefaultTreeViewFactory.java,v 1.1 2005/04/20 22:21:27 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is the Java 3D(tm) Scene Graph Editor.
11: * The Initial Developer of the Original Code is Paul Byrne.
12: * Portions created by Paul Byrne are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Paul Byrne.
16: *
17: **/
18: package org.jdesktop.j3dedit.scenegrapheditor.treeview;
19:
20: import org.jdesktop.j3dedit.scenegrapheditor.TreeViewFactory;
21: import org.jdesktop.j3dedit.scenegraph.SGLink;
22: import org.jdesktop.j3dedit.scenegraph.SGGeometryPrimitive;
23: import org.jdesktop.j3dedit.scenegraph.SGLoader;
24: import org.jdesktop.j3dedit.scenegraph.SGBehavior;
25: import org.jdesktop.j3dedit.scenegraph.SGLeaf;
26: import org.jdesktop.j3dedit.scenegraph.SGLocale;
27: import org.jdesktop.j3dedit.scenegraph.SGObject;
28: import org.jdesktop.j3dedit.scenegraph.SGGroup;
29:
30: /**
31: * A TreeViewFactory for the default scene graph viewing objects
32: *
33: * @author paulby
34: * @version
35: */
36: public class DefaultTreeViewFactory extends TreeViewFactory {
37:
38: /** Creates new DefaultTreeViewFactory */
39: public DefaultTreeViewFactory() {
40: }
41:
42: /**
43: * Creates a TVObject for the SGObject and calls
44: * object.setTreeViewObject
45: */
46: public void createTreeViewObject(SGObject object) {
47: if (object instanceof SGBehavior)
48: object.setTreeViewObject(new TVBehavior(object));
49: else if (object instanceof SGGeometryPrimitive)
50: object.setTreeViewObject(new TVGeometryPrimitive(object));
51: else if (object instanceof SGLink)
52: object.setTreeViewObject(new TVLink(object));
53: else if (object instanceof SGLoader)
54: object.setTreeViewObject(new TVLoader(object));
55: else if (object instanceof SGLocale)
56: object.setTreeViewObject(new TVLocale(object));
57: else if (object instanceof SGLeaf)
58: object.setTreeViewObject(new TVLeaf(object));
59: else if (object instanceof SGGroup)
60: object.setTreeViewObject(new TVGroup(object));
61: else
62: throw new RuntimeException(
63: "Unknown Object Type in DefaultTreeViewFactory "
64: + object);
65: }
66:
67: }
|