Mercurial > hg > Applications > AliceVNC
changeset 17:f4ecd1f01f0b
separate byteArray from others
author | sugi |
---|---|
date | Mon, 03 Nov 2014 20:32:52 +0900 |
parents | 2a6e2c89b708 |
children | 2f17d3fd2512 |
files | src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java |
diffstat | 1 files changed, 26 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Sat Oct 18 22:08:26 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Mon Nov 03 20:32:52 2014 +0900 @@ -16,17 +16,32 @@ 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); + private Receiver info1 = ids.create(CommandType.TAKE); // AliceVNC Message + private Receiver info2 = ids.create(CommandType.TAKE); + private Receiver info3 = ids.create(CommandType.PEEK); public ReceiveUpdateRectangle(){ info.setKey("Holder"); info1.setKey("aliceVNCMessage"); - info2.setKey("_CLIST"); + info2.setKey("pixelByteArray"); + info3.setKey("_CLIST"); } @Override public void run() { + // send other node + @SuppressWarnings("unchecked") + ArrayList<String> clist = info3.asClass(ArrayList.class); + for (String node : clist){ + if (!info1.from.equals(node)) { + // not need send data comes from + // Data Segment from other node is already serialized + ods.put(node, "aliceVNCMessage", info1.getReceiveData()); + ods.put(node, "pixelByteArray", info2.getReceiveData()); + } + + } + try { RenderAndControllerHolder holder = info.asClass(RenderAndControllerHolder.class); AliceVNCMessage message = info1.asClass(AliceVNCMessage.class); @@ -36,30 +51,27 @@ FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( message.x, message.y, message.width, message.height); rect.encodingType = message.getEncodingType(); - byte[] buf = message.buf; + + byte[] buf = info2.asClass(byte[].class); int offset = message.offset; - decoder.setColorDataOnRenderer(holder.getRenderer(), rect, buf, offset); + // this method name is wrong. + decoder.decode(holder.getRenderer(), rect, buf, offset); holder.getRepaintController().repaintBitmap(rect); } else if (message.getEncodingType() == EncodingType.DESKTOP_SIZE) { holder.setRenderer( - holder.getRepaintController().createRenderer(null ,message.width, + holder.getRepaintController().createRenderer(null, message.width, message.height, message.getPixelFormat()) ); } else if (message.getEncodingType() == EncodingType.RICH_CURSOR) { - RichCursorDecoder.getInstance().decode(holder.getRenderer(), message); + byte[] buf = info2.asClass(byte[].class); + RichCursorDecoder.getInstance().decode(holder.getRenderer(), message, buf); holder.getRepaintController().repaintCursor(); } - - @SuppressWarnings("unchecked") - ArrayList<String> clist = info2.asClass(ArrayList.class); - for (String node : clist){ - if (!"parent".equals(node)) - ods.put(node, "aliceVNCMessage", info1.getVal()); - } + this.recycle(); } catch (TransportException e) {