Mercurial > hg > Applications > AliceVNC
annotate src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java @ 10:65d989192d63
change Protocol aliceVNCMessage
author | YU |
---|---|
date | Thu, 18 Sep 2014 21:07:46 +0900 |
parents | c05d3b89b446 |
children | aff2d0bb9c50 |
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 | |
41 holder.getRepaintController().repaintBitmap(rect); | |
42 | |
43 | |
44 } else if (message.getEncodingType() == EncodingType.DESKTOP_SIZE) { | |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
45 |
10 | 46 |
47 holder.setRenderer( | |
48 holder.getRepaintController().createRenderer(null ,message.width, | |
49 message.height, holder.getRenderer().pixelFormat) | |
50 ); | |
51 | |
52 | |
53 } | |
5
c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
YU
parents:
4
diff
changeset
|
54 |
10 | 55 @SuppressWarnings("unchecked") |
56 ArrayList<String> clist = info2.asClass(ArrayList.class); | |
57 for (String node : clist){ | |
58 if (!"parent".equals(node)) | |
59 ods.put(node, "aliceVNCMessage", info1.getVal()); | |
60 } | |
61 new ReceiveUpdateRectangle(); | |
62 | |
2 | 63 } catch (TransportException e) { |
64 e.printStackTrace(); | |
65 } | |
66 } | |
67 | |
68 } |