01: /*
02: * $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/utils/vpbehaviors/VPCollisionBehavior.java,v 1.1 2005/04/20 21:05:15 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 Java 3D(tm) Fly Through.
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.j3dfly.utils.vpbehaviors;
19:
20: import javax.media.j3d.TransformGroup;
21: import javax.media.j3d.Canvas3D;
22:
23: public abstract class VPCollisionBehavior extends
24: com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior {
25:
26: protected VPCollisionInterface collisionControl;
27: private boolean collisionEnabled = false;
28:
29: /**
30: * @deprecated use VPCollisionBehavior()
31: */
32: public VPCollisionBehavior(Canvas3D c) {
33: this ();
34: }
35:
36: public VPCollisionBehavior() {
37: super (MOUSE_LISTENER | MOUSE_MOTION_LISTENER);
38: }
39:
40: /**
41: * Set the collision control object, can be null
42: *
43: * Called when behavior is set using VPBehaviorControl.setVPBehavior or
44: * when collision control is changed using
45: * VPBehaviorControl.setVPCollisionControl
46: */
47: public void setCollisionControl(
48: VPCollisionInterface collisionControl) {
49: this .collisionControl = collisionControl;
50: if (collisionControl != null)
51: collisionEnabled = true;
52: else
53: collisionEnabled = false;
54: }
55:
56: /**
57: * Called when the user wants to change the parameters of the
58: * behavior.
59: *
60: * This method may be called for the AWT event thread
61: *
62: * @param parent Parent frame, used if a diloge is displayed
63: */
64: public void editParameters(java.awt.Frame parent) {
65: }
66:
67: public boolean collisionEnabled() {
68: return collisionEnabled;
69: }
70:
71: public void setCollisionEnabled(boolean enable) {
72: collisionEnabled = enable;
73: }
74:
75: }
|