Mercurial > hg > Applications > AliceVNC
annotate src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java @ 11:aff2d0bb9c50
Viewable multi display
author | YU |
---|---|
date | Thu, 18 Sep 2014 21:37:03 +0900 |
parents | 65d989192d63 |
children | 66c06ebbced1 |
rev | line source |
---|---|
2 | 1 package jp.ac.u_ryukyu.alicevnc; |
2 | |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
3 import java.util.ArrayList; |
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
4 |
2 | 5 import com.glavsoft.exceptions.TransportException; |
4 | 6 import com.glavsoft.rfb.encoding.EncodingType; |
10 | 7 import com.glavsoft.rfb.encoding.decoder.AliceVNCMessage; |
2 | 8 import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; |
9 import com.glavsoft.rfb.encoding.decoder.ZRLEDecoder; | |
10 | |
11 import alice.codesegment.CodeSegment; | |
12 import alice.datasegment.CommandType; | |
13 import alice.datasegment.Receiver; | |
14 | |
15 public class ReceiveUpdateRectangle extends CodeSegment{ | |
16 | |
17 private Receiver info = ids.create(CommandType.PEEK); | |
18 private Receiver info1 = ids.create(CommandType.TAKE); | |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
19 private Receiver info2= ids.create(CommandType.PEEK); |
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
20 |
2 | 21 public ReceiveUpdateRectangle(){ |
22 info.setKey("Holder"); | |
10 | 23 info1.setKey("aliceVNCMessage"); |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
24 info2.setKey("_CLIST"); |
2 | 25 } |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
26 |
10 | 27 @Override |
2 | 28 public void run() { |
29 try { | |
10 | 30 RenderAndControllerHolder holder = info.asClass(RenderAndControllerHolder.class); |
31 AliceVNCMessage message = info1.asClass(AliceVNCMessage.class); | |
32 | |
33 if (message.getEncodingType() == EncodingType.ZRLE){ | |
34 ZRLEDecoder decoder = new ZRLEDecoder(); | |
35 decoder.decode(message, holder.getRenderer()); | |
36 FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( | |
37 message.x, message.y, message.width, message.height); | |
38 | |
39 rect.encodingType = EncodingType.byId(message.encodingTypeId); | |
40 holder.getRepaintController().repaintBitmap(rect); | |
41 | |
42 | |
11 | 43 } else if (message.getEncodingType() == EncodingType.DESKTOP_SIZE) { |
10 | 44 holder.setRenderer( |
45 holder.getRepaintController().createRenderer(null ,message.width, | |
11 | 46 message.height, message.getPixelFormat()) |
10 | 47 ); |
48 | |
49 | |
50 } | |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
51 |
10 | 52 @SuppressWarnings("unchecked") |
53 ArrayList<String> clist = info2.asClass(ArrayList.class); | |
54 for (String node : clist){ | |
55 if (!"parent".equals(node)) | |
56 ods.put(node, "aliceVNCMessage", info1.getVal()); | |
57 } | |
58 new ReceiveUpdateRectangle(); | |
59 | |
2 | 60 } catch (TransportException e) { |
61 e.printStackTrace(); | |
62 } | |
63 } | |
64 | |
65 } |