Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 512:16f9b37ef43b
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 20 Feb 2019 15:49:28 +0900 |
parents | 519d6f94edcc |
children | b97fdcd337fe |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 5 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Wed Feb 20 15:30:25 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Wed Feb 20 15:49:28 2019 +0900 @@ -23,11 +23,9 @@ private ViewerInterface vps; private MulticastSocket soc; private SecurityManager securityManager; - private boolean isTreeRoot; public TreeRootFinderListener(ViewerInterface vncProxyService) { vps = vncProxyService; - isTreeRoot = vps.getRfb().isTreeManager(); } public static MulticastSocket createMulticastSocket() throws IOException { @@ -61,6 +59,7 @@ String hostname = recvPacket.getAddress().getHostAddress(); byte[] reply = recvPacket.getData(); int len = recvPacket.getLength(); + boolean isTreeRoot = vps.getRfb().isTreeManager(); if (isTreeRoot && len == 12 && (reply[0] & 0xff) == TreeCommand.FIND_ROOT.cmd) { int port = reply[8]; port = port * 256 + reply[9];
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Wed Feb 20 15:30:25 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Wed Feb 20 15:49:28 2019 +0900 @@ -43,6 +43,7 @@ private boolean showTree = false; public int width; public int height; + private boolean useMulticast; public static void main(String[] args) { Parser parser = new Parser(); @@ -145,6 +146,7 @@ connectionPresenter.setConnectionWorkerFactory( new SwingConnectionWorkerFactory(null, passwordFromParams, connectionPresenter, null, myRfb)); connectionPresenter.setCuiVersion(true); + connectionPresenter.setMulticast(useMulticast); connectionPresenter.startConnection(settings, uiSettings, paramsMask, false, null, null); } @@ -164,6 +166,16 @@ } @Override + public void setUseMulticast(boolean useMulticast) { + this.useMulticast = useMulticast; + } + + @Override + public boolean getUseMulticast() { + return useMulticast; + } + + @Override public void windowOpened(WindowEvent e) { /* nop */ }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Wed Feb 20 15:30:25 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Wed Feb 20 15:49:28 2019 +0900 @@ -64,6 +64,7 @@ } setWidthAndHeight(v); + v.setUseMulticast(useMulticast); // if(filterSingleDisplay) if(fixingSizeDisplay) setFixingSizeDisplay(v); @@ -215,9 +216,6 @@ v.setWidth(width); v.setHeight(height); } - if (useMulticast) { - v.getConnectionPresenter().setMulticast(true); - } } public void setFixingSizeDisplay(ViewerInterface v) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Wed Feb 20 15:30:25 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Wed Feb 20 15:49:28 2019 +0900 @@ -76,6 +76,7 @@ public int height; public int fixingSizeWidth; public int fixingSizeHeight; + private boolean useMulticast; public static void main(String[] args) { Parser parser = new Parser(); @@ -226,6 +227,7 @@ final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || ! isApplet; connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + connectionPresenter.setMulticast(useMulticast); connectionPresenter.setReconnectingId(myRfb.getId()); connectionPresenter.setNoConnection(noConnection); connectionPresenter.addModel("ConnectionParamsModel", connectionParams); @@ -347,6 +349,16 @@ connectionPresenter.startVNCConnection(this, true, is, os); } + @Override + public void setUseMulticast(boolean useMulticast) { + this.useMulticast = useMulticast; + } + + @Override + public boolean getUseMulticast() { + return useMulticast; + } + private ConnectionPresenter createNewConnectionPresenter(String hostName, short newVNCServerId, int x, int y, int width, int height, int scale) { final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || ! isApplet;
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Wed Feb 20 15:30:25 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Wed Feb 20 15:49:28 2019 +0900 @@ -61,5 +61,7 @@ void changeToDirectConnectedServer(String hostName, Reader is, Writer os, int x, int y, int width, int height, int scale); + public void setUseMulticast(boolean useMulticast) ; + public boolean getUseMulticast(); }