01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/visualtools/ShowBoundsVisualTool.java,v 1.1 2005/04/20 22:21:30 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.visualtools;
19:
20: import org.jdesktop.j3dedit.scenegrapheditor.WindowManager;
21: import org.jdesktop.j3dedit.scenegraph.SGNode;
22:
23: public class ShowBoundsVisualTool extends VisualTool {
24:
25: private ShowBoundsBehavior showBoundsBehavior;
26:
27: /** Creates new ShowBoundsVisualTool */
28: public ShowBoundsVisualTool() {
29: showBoundsBehavior = new ShowBoundsBehavior(this );
30: }
31:
32: /**
33: * Show or hide the bounds of node
34: */
35: public void showBounds(boolean showBounds, SGNode node) {
36: node.setLive(false);
37: if (showBounds)
38: showBoundsBehavior.showBounds((javax.media.j3d.Node) node
39: .getJ3dNode());
40: else
41: showBoundsBehavior.hideBounds((javax.media.j3d.Node) node
42: .getJ3dNode(), ShowBoundsBehavior.NODE_BOUNDS);
43: node.setLive(true);
44: }
45:
46: /**
47: * Show or hide the bounds of node
48: */
49: public void showSchedulingBounds(boolean showBounds, SGNode node) {
50: node.setLive(false);
51: if (showBounds)
52: showBoundsBehavior
53: .showSchedulingBounds((javax.media.j3d.Node) node
54: .getJ3dNode());
55: else
56: showBoundsBehavior.hideBounds(node.getJ3dNode(),
57: ShowBoundsBehavior.SCHEDULING_BOUNDS);
58: node.setLive(true);
59: }
60:
61: /**
62: * Show or hide the bounds of node
63: */
64: public void showInfluencingBounds(boolean showBounds, SGNode node) {
65: node.setLive(false);
66: if (showBounds)
67: showBoundsBehavior
68: .showInfluencingBounds((javax.media.j3d.Node) node
69: .getJ3dNode());
70: else
71: showBoundsBehavior.hideBounds((javax.media.j3d.Node) node
72: .getJ3dNode(),
73: ShowBoundsBehavior.INFLUENCING_BOUNDS);
74: node.setLive(true);
75: }
76:
77: public void reset() {
78: showBoundsBehavior.removeAllBounds();
79: }
80: }
|