Mercurial > hg > Applications > AliceVNC
changeset 12:66c06ebbced1
refactor
author | YU |
---|---|
date | Tue, 23 Sep 2014 16:13:23 +0900 |
parents | aff2d0bb9c50 |
children | 0a44eb36cb1c |
files | src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Thu Sep 18 21:37:03 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/alicevnc/ReceiveUpdateRectangle.java Tue Sep 23 16:13:23 2014 +0900 @@ -6,6 +6,7 @@ import com.glavsoft.rfb.encoding.EncodingType; import com.glavsoft.rfb.encoding.decoder.AliceVNCMessage; import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; +import com.glavsoft.rfb.encoding.decoder.RichCursorDecoder; import com.glavsoft.rfb.encoding.decoder.ZRLEDecoder; import alice.codesegment.CodeSegment; @@ -16,7 +17,7 @@ private Receiver info = ids.create(CommandType.PEEK); private Receiver info1 = ids.create(CommandType.TAKE); - private Receiver info2= ids.create(CommandType.PEEK); + private Receiver info2 = ids.create(CommandType.PEEK); public ReceiveUpdateRectangle(){ info.setKey("Holder"); @@ -32,11 +33,13 @@ if (message.getEncodingType() == EncodingType.ZRLE){ ZRLEDecoder decoder = new ZRLEDecoder(); - decoder.decode(message, holder.getRenderer()); FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle( message.x, message.y, message.width, message.height); - - rect.encodingType = EncodingType.byId(message.encodingTypeId); + rect.encodingType = message.getEncodingType(); + byte[] buf = message.buf; + int offset = message.offset; + + decoder.setColorDataOnRenderer(holder.getRenderer(), rect, buf, offset); holder.getRepaintController().repaintBitmap(rect); @@ -46,8 +49,10 @@ message.height, message.getPixelFormat()) ); - - } + } else if (message.getEncodingType() == EncodingType.RICH_CURSOR) { + RichCursorDecoder.getInstance().decode(holder.getRenderer(), message); + holder.getRepaintController().repaintCursor(); + } @SuppressWarnings("unchecked") ArrayList<String> clist = info2.asClass(ArrayList.class); @@ -55,7 +60,7 @@ if (!"parent".equals(node)) ods.put(node, "aliceVNCMessage", info1.getVal()); } - new ReceiveUpdateRectangle(); + this.recycle(); } catch (TransportException e) { e.printStackTrace();