Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 363:bc5624e3e9c5
Add newVNCConnection method to Viewer
author | innparusu |
---|---|
date | Mon, 10 Aug 2015 18:17:12 +0900 |
parents | 1eaaa650b4d0 |
children | 6558eb66ac8e |
files | TreeVNC.iml src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java |
diffstat | 5 files changed, 22 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/TreeVNC.iml Thu Aug 06 20:11:28 2015 +0900 +++ b/TreeVNC.iml Mon Aug 10 18:17:12 2015 +0900 @@ -6,19 +6,18 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/viewerSwing/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/viewerSwing/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/src/viewer_swing/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> <excludeFolder url="file://$MODULE_DIR$/build" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" exported="" name="Gradle: jsch-0.1.50" level="project" /> + <orderEntry type="library" exported="" name="Gradle: com.jcraft:jsch:0.1.50" level="project" /> </component> -</module> - +</module> \ No newline at end of file
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Thu Aug 06 20:11:28 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Aug 10 18:17:12 2015 +0900 @@ -136,21 +136,8 @@ final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || !isApplet; - connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + ConnectionPresenter connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); connectionPresenter.addModel("ConnectionParamsModel", connectionParams); - - - /* - * SwingViewerWindowFactory viewerWindowFactory = new - * SwingViewerWindowFactory( isSeparateFrame, isApplet, this); - * - * connectionPresenter.setConnectionWorkerFactory(new - * SwingConnectionWorkerFactory( connectionView.getFrame(), - * passwordFromParams, connectionPresenter, viewerWindowFactory, - * myRfb)); - */ - - connectionPresenter.setConnectionWorkerFactory( new SwingConnectionWorkerFactory(null, passwordFromParams, connectionPresenter, null, myRfb)); connectionPresenter.setCuiVersion(true); @@ -158,6 +145,11 @@ } @Override + public synchronized void newVNCConnection(ConnectionPresenter presenter) { + connectionPresenter = presenter; + } + + @Override public void windowOpened(WindowEvent e) { /* nop */ }
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Thu Aug 06 20:11:28 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Aug 10 18:17:12 2015 +0900 @@ -224,7 +224,7 @@ public void run() { final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || ! isApplet; - connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + ConnectionPresenter connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); connectionPresenter.setNoConnection(noConnection); connectionPresenter.addModel("ConnectionParamsModel", connectionParams); ConnectionView connectionView = new ConnectionView( @@ -249,6 +249,11 @@ } @Override + public synchronized void newVNCConnection(ConnectionPresenter presenter) { + connectionPresenter = presenter; + } + + @Override public void windowOpened(WindowEvent e) { /* nop */ } @Override public void windowClosed(WindowEvent e) { /* nop */ } @@ -458,6 +463,7 @@ return rectangles; } + @Override public void setFitScreen() { SwingViewerWindow v = connectionPresenter.getViewer();
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Thu Aug 06 20:11:28 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Aug 10 18:17:12 2015 +0900 @@ -50,4 +50,6 @@ public void setFitScreen(); public ArrayList<Rectangle> getScreenRectangles(); + + void newVNCConnection(ConnectionPresenter presenter); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Thu Aug 06 20:11:28 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Mon Aug 10 18:17:12 2015 +0900 @@ -108,6 +108,9 @@ try { get(); presenter.showMessage("Handshake established"); + if(myRfb.hasViewer()) { + myRfb.getViewer().newVNCConnection(presenter); + } ClipboardControllerImpl clipboardController; if(!myRfb.getCuiVersion()) clipboardController = new ClipboardControllerImpl(workingProtocol, rfbSettings.getRemoteCharsetName());