annotate src/myVncProxy/CapabilityInfo.java @ 32:015d43bb2b62

add CreateHtmlFile
author e085711
date Wed, 27 Apr 2011 05:43:22 +0900
parents 87b29d6039a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
87b29d6039a6 add package myVncProxy
e085711
parents: 0
diff changeset
1 package myVncProxy;
0
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
2 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
3 // Copyright (C) 2003 Constantin Kaplinsky. All Rights Reserved.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
4 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
5 // This is free software; you can redistribute it and/or modify
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
6 // it under the terms of the GNU General Public License as published by
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
7 // the Free Software Foundation; either version 2 of the License, or
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
8 // (at your option) any later version.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
9 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
10 // This software is distributed in the hope that it will be useful,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
13 // GNU General Public License for more details.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
14 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
15 // You should have received a copy of the GNU General Public License
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
16 // along with this software; if not, write to the Free Software
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
18 // USA.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
19 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
20
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
21 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
22 // CapabilityInfo.java - A class to hold information about a
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
23 // particular capability as used in the RFB protocol 3.130.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
24 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
25
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
26 class CapabilityInfo {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
27
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
28 // Public methods
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
29
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
30 public CapabilityInfo(int code,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
31 String vendorSignature,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
32 String nameSignature,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
33 String description) {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
34 this.code = code;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
35 this.vendorSignature = vendorSignature;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
36 this.nameSignature = nameSignature;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
37 this.description = description;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
38 enabled = false;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
39 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
40
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
41 public CapabilityInfo(int code,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
42 byte[] vendorSignature,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
43 byte[] nameSignature) {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
44 this.code = code;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
45 this.vendorSignature = new String(vendorSignature);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
46 this.nameSignature = new String(nameSignature);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
47 this.description = null;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
48 enabled = false;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
49 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
50
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
51 public int getCode() {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
52 return code;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
53 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
54
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
55 public String getDescription() {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
56 return description;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
57 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
58
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
59 public boolean isEnabled() {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
60 return enabled;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
61 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
62
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
63 public void enable() {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
64 enabled = true;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
65 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
66
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
67 public boolean equals(CapabilityInfo other) {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
68 return (other != null && this.code == other.code &&
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
69 this.vendorSignature.equals(other.vendorSignature) &&
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
70 this.nameSignature.equals(other.nameSignature));
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
71 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
72
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
73 public boolean enableIfEquals(CapabilityInfo other) {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
74 if (this.equals(other))
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
75 enable();
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
76
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
77 return isEnabled();
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
78 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
79
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
80 // Protected data
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
81
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
82 protected int code;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
83 protected String vendorSignature;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
84 protected String nameSignature;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
85
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
86 protected String description;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
87 protected boolean enabled;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
88 }