Mercurial > hg > Applications > tvnjviewer
changeset 25:bf9480332e72
reconnect New connection window can select expression
author | sugi |
---|---|
date | Sun, 09 Nov 2014 11:13:05 +0900 |
parents | 94b36ee816ef |
children | f1dc728ffe87 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java |
diffstat | 3 files changed, 20 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java Sat Nov 08 19:13:58 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java Sun Nov 09 11:13:05 2014 +0900 @@ -13,13 +13,11 @@ public int width; public int height; public int encodingTypeId; - //public byte[] buf; + public String name; - public String name; - // use RichCursorDecoder public byte[] bitmask; - + // pixel format info public byte bitsPerPixel; public byte depth; @@ -31,11 +29,11 @@ public byte redShift; public byte greenShift; public byte blueShift; - + public AliceVNCMessage(){ - + } - + public void setRectangle(FramebufferUpdateRectangle rect){ x = rect.x; y = rect.y; @@ -43,19 +41,19 @@ height = rect.height; encodingTypeId = rect.getEncodingType().getId(); } - + public FramebufferUpdateRectangle getFramebufferUpdateRectangle(){ - FramebufferUpdateRectangle rect = + FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(x, y, width, height); rect.encodingType = EncodingType.byId(encodingTypeId); - + return rect; } - + public EncodingType getEncodingType() { return EncodingType.byId(encodingTypeId); } - + public void setPixelFormat(PixelFormat pixelFormat) { bitsPerPixel = pixelFormat.bitsPerPixel; depth = pixelFormat.depth; @@ -68,10 +66,10 @@ greenShift = pixelFormat.greenShift; blueShift = pixelFormat.blueShift; } - + public PixelFormat getPixelFormat(){ PixelFormat pixelFormat = new PixelFormat(); - + pixelFormat.bitsPerPixel = bitsPerPixel; pixelFormat.depth = depth; pixelFormat.bigEndianFlag = bigEndianFlag; @@ -82,7 +80,7 @@ pixelFormat.redShift = redShift; pixelFormat.greenShift = greenShift; pixelFormat.blueShift = blueShift; - + return pixelFormat; } @@ -91,6 +89,6 @@ width = serverInitMessage.getFrameBufferWidth(); height = serverInitMessage.getFrameBufferHeight(); name = serverInitMessage.getName(); - + } }
--- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Sat Nov 08 19:13:58 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Sun Nov 09 11:13:05 2014 +0900 @@ -85,7 +85,7 @@ AliceVNCMessage mes = new AliceVNCMessage(); mes.setServerInitMessage(serverInitMessage); ReceiveData rData = new ReceiveData(mes, false, false); - DataSegment.getLocal().put("ServerInitMessage", rData, null); + DataSegment.getLocal().put("initMessage", rData, null); rData = new ReceiveData(mes, false, false); mes.encodingTypeId = EncodingType.DESKTOP_SIZE.getId();
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Sat Nov 08 19:13:58 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Sun Nov 09 11:13:05 2014 +0900 @@ -62,6 +62,7 @@ private final UiSettings uiSettings; private volatile boolean isAppletStopped = false; private ConnectionPresenter connectionPresenter; + private boolean needReconnect = true; public static void main(String[] args) { Parser parser = new Parser(); @@ -110,6 +111,7 @@ isApplet = true; ReceiveData rData = new ReceiveData(this, false, false); DataSegment.getLocal().put("viewer", rData, null); + this.needReconnect = false; }; } } @@ -235,12 +237,13 @@ } }); } + if (!needReconnect) { + connectionPresenter.setNeedReconnection(false); + } SwingViewerWindowFactory viewerWindowFactory = new SwingViewerWindowFactory(isSeparateFrame, isApplet, this); - connectionPresenter.setConnectionWorkerFactory( new SwingConnectionWorkerFactory(connectionView.getFrame(), passwordFromParams, connectionPresenter, viewerWindowFactory)); - connectionPresenter.startConnection(settings, uiSettings, paramsMask); }