FreeWRL / FreeX3D 4.3.0
VIP.java
1// copyright (c) 1997,1998 stephen f. white
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2, or (at your option)
6// any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program; see the file COPYING. If not, write to
15// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16package vrml.external.FreeWRLEAI;
17//JAS import vrml.external.FreeWRLEAI.*;
18
19public final class VIP {
20 public static final short QUIT = -1;
21 public static final short MESSAGE = -2;
22 public static final short ADD_OBJECT = -3;
23 public static final short REMOVE_OBJECT = -4;
24 public static final short PRIVATE_MESSAGE = -5;
25 public static final short CREATE_OBJECT = -6;
26 public static final short USER_INFO = -7;
27 public static final short SELF_INFO = -8;
28 public static final short SSRC = -9;
29 public static final short TRANSFERREQUEST = -10;
30 public static final short TRANSFERACCEPT = -11;
31 public static final short TRANSFERREJECT = -12;
32 public static final short TRANSFERREQUESTADD = -13;
33 public static final short FILEREQUEST = -14;
34 public static final short FRQRESPONSE = -15;
35
36 public static final short POSITION = 0;
37 public static final short ORIENTATION = 1;
38 public static final short SCALE = 2;
39 public static final short NAME = 3;
40 public static final short OWNER = 4;
41 public static final short PARENT = 5;
42 public static final short CHILDREN = 6;
43 public static final short DROPPED = 7;
44
45
46 // this is the number of fields reserved by the VIP protocol
47 public static final short NUM_FIELDS = 4;
48
49 // this is the maximum number of possible gestures
50 public static final short MAX_GESTURES = 10;
51
52 // this is the maximum number of children
53 public static final short MAX_CHILDREN = 50;
54
55 public static String fieldName(short value) {
56 switch (value) {
57 case QUIT: return "QUIT";
58 case MESSAGE: return "message";
59 case ADD_OBJECT: return "add_object";
60 case REMOVE_OBJECT: return "remove_object";
61 case PRIVATE_MESSAGE: return "private_message";
62 case CREATE_OBJECT: return "create_object";
63 case USER_INFO: return "user_info";
64
65 case POSITION: return "position";
66 case ORIENTATION: return "orientation";
67 case SCALE: return "scale";
68 case NAME: return "name";
69 default: return String.valueOf(value);
70 }
71 }
72
73 static String msgToString(int vid, short field, VField value) {
74 return vid + " " + fieldName(field) + " " + value;
75 }
76}