annotate src/myVncClient/CapabilityInfo.java @ 18:4881586aead9

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