home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-26 | 1.1 KB | 65 lines |
- /*
- * File : manual.java (Script for Community Place)
- * Version : 2.0- 1996.09.11
- * Auther : cori co.
- *
- * Copyright(C) 1996 Sony Corporation. All rights reserved.
- */
-
- import vrml.*;
- import vrml.field.*;
- import vrml.node.*;
- import java.util.*;
- import vs.*;
-
-
- /* This is a sample script for event handler.*/
- public class manual extends Script {
- SFBool CubeSw;
- boolean CubeRotateFlg = false;
-
-
- /*
- * Initialize
- */
- public void initialize() {
- CubeSw = (SFBool) getEventOut( "Cube_switch" );
- }
-
-
- /*
- * eventIn
- */
- public void processEvent( Event e ) {
- String name = e.getName();
-
- if ( name.equals( "CubeClick" )) {
- CubeClick( (ConstSFBool)e.getValue() );
- } else {
- ;
- }
- }
-
-
- /*
- * Clicked on the cube
- */
- public void CubeClick( ConstSFBool state ) {
-
- if ( !state.getValue() ) { /* != mouseDown */
- if ( CubeRotateFlg == false ) {
- CubeRotateFlg = true;
- CubeSw.setValue( true );
- } else {
- CubeRotateFlg = false;
- CubeSw.setValue( false );
- }
- }
- }
-
-
- }
-
-
-
-