01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegraph/SGLink.java,v 1.1 2005/04/20 22:20:40 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.scenegraph;
19:
20: import java.awt.Graphics;
21: import java.awt.Graphics2D;
22: import java.awt.Point;
23: import java.awt.Shape;
24: import java.awt.Color;
25: import java.awt.geom.GeneralPath;
26: import java.awt.Polygon;
27: import java.awt.Dimension;
28: import java.awt.Font;
29: import java.awt.font.GlyphVector;
30: import java.awt.font.FontRenderContext;
31: import java.awt.geom.AffineTransform;
32: import java.util.Properties;
33:
34: import org.jdesktop.j3dedit.treelayout.TreeNode;
35: import org.jdesktop.j3dedit.treelayout.TreeLayout;
36: import org.jdesktop.j3dedit.treelayout.TreePanel;
37:
38: public class SGLink extends SGGroup {
39:
40: private SGGroup sharedGroup;
41:
42: private boolean hideChildren = false;
43:
44: /** Creates new groupTreeNode */
45: public SGLink(javax.media.j3d.Node node,
46: org.jdesktop.j3dedit.J3dEditContext editContext) {
47: super (node, editContext);
48: }
49:
50: public int numChildrenIgnoreHiddenFlag() {
51: return super .numChildren();
52: }
53:
54: public void addSharedGroup(SGGroup node) {
55: this .sharedGroup = node;
56: if (node.getParent() == null)
57: this .addChild(node);
58: }
59:
60: public SGGroup getSharedGroup() {
61: return sharedGroup;
62: }
63:
64: public int numChildren() {
65: if (hideChildren)
66: return 0;
67:
68: return super .numChildren();
69: }
70:
71: public void hideChildren(boolean hide) {
72: hideChildren = hide;
73: }
74:
75: public boolean childrenHidden() {
76: return hideChildren;
77: }
78:
79: }
|