Mercurial > hg > Applications > AliceVNC
view src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java @ 5:c05d3b89b446
Send DecodeInfo to Children Nodes. but occur ArrayIndexOutOfBoundsException.
author | YU |
---|---|
date | Sat, 13 Sep 2014 20:55:48 +0900 |
parents | 9a24e36d8ed7 |
children | 65d989192d63 |
line wrap: on
line source
package jp.ac.u_ryukyu.alicevnc; import java.util.ArrayList; import com.glavsoft.exceptions.TransportException; import com.glavsoft.rfb.encoding.EncodingType; import com.glavsoft.rfb.encoding.decoder.DecodeInfo; import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; import com.glavsoft.rfb.encoding.decoder.ZRLEDecoder; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class ReceiveUpdateRectangle extends CodeSegment{ private Receiver info = ids.create(CommandType.PEEK); private Receiver info1 = ids.create(CommandType.TAKE); private Receiver info2= ids.create(CommandType.PEEK); public ReceiveUpdateRectangle(){ info.setKey("Holder"); info1.setKey("decodeInfo"); info2.setKey("_CLIST"); } public void run() { ZRLEDecoder decoder = new ZRLEDecoder(); RenderAndControllerHolder holder = info.asClass(RenderAndControllerHolder.class); DecodeInfo decodeInfo = info1.asClass(DecodeInfo.class); try { decoder.decode(decodeInfo, holder.renderer); FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( decodeInfo.x, decodeInfo.y, decodeInfo.width, decodeInfo.height); rect.encodingType = EncodingType.byId(decodeInfo.encodingTypeId); holder.repaintController.repaintBitmap(rect); } catch (TransportException e) { e.printStackTrace(); } @SuppressWarnings("unchecked") ArrayList<String> clist = info2.asClass(ArrayList.class); for (String node : clist){ if (!"parent".equals(node)) ods.put(node, "decodeInfo", info1.getVal()); } new ReceiveUpdateRectangle(); } }