annotate src/myVncProxy/VncCanvas2.java @ 183:1f583d6e0d1a

modify MulticastQueue.java : method poll()
author e085711
date Tue, 25 Oct 2011 17:33:47 +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) 2006 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 import java.awt.*;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
22 import java.io.*;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
23
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
24 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
25 // VncCanvas2 is a special version of VncCanvas which may use Java 2 API.
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
26 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
27
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
28 class VncCanvas2 extends VncCanvas {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
29
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
30 public VncCanvas2(VncViewer v) throws IOException {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
31 super(v);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
32 disableFocusTraversalKeys();
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
33 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
34
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
35 public VncCanvas2(VncViewer v, int maxWidth_, int maxHeight_)
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
36 throws IOException {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
37
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
38 super(v, maxWidth_, maxHeight_);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
39 disableFocusTraversalKeys();
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
40 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
41
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
42 public void paintScaledFrameBuffer(Graphics g) {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
43 Graphics2D g2d = (Graphics2D)g;
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
44 g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
45 RenderingHints.VALUE_RENDER_QUALITY);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
46 g2d.drawImage(memImage, 0, 0, scaledWidth, scaledHeight, null);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
47 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
48
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
49 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
50 // Try to disable focus traversal keys (JVMs 1.4 and higher).
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
51 //
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
52
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
53 private void disableFocusTraversalKeys() {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
54 try {
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
55 Class[] argClasses = { Boolean.TYPE };
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
56 java.lang.reflect.Method method =
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
57 getClass().getMethod("setFocusTraversalKeysEnabled", argClasses);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
58 Object[] argObjects = { new Boolean(false) };
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
59 method.invoke(this, argObjects);
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
60 } catch (Exception e) {}
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 }
30bb7074acb1 upload all file of tighVNCProxy
e085711
parents:
diff changeset
64