Mercurial > hg > Applications > TreeVNC
changeset 561:52da5806661c
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 02 Feb 2020 11:12:24 +0900 |
parents | bdd659ce8e64 |
children | 87ae979b88cd |
files | build.gradle src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 24 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/build.gradle Fri Jan 31 11:41:13 2020 +0900 +++ b/build.gradle Sun Feb 02 11:12:24 2020 +0900 @@ -16,9 +16,9 @@ defaultTasks 'clean' , 'jar' -application { - mainClassName = "com.glavsoft.viewer.TreeViewer" -} +//application { +// mainClassName = "com.glavsoft.viewer.TreeViewer"// +// } configurations { viewerSwingImplementation { extendsFrom implementation }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Fri Jan 31 11:41:13 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Sun Feb 02 11:12:24 2020 +0900 @@ -26,7 +26,7 @@ private boolean logFile = false; private boolean filterSingleDisplay = false; private boolean direct = false; - private boolean useMulticast = false; + private boolean useMulticast = true; public static void main(String[] args) throws SocketException, UnknownHostException { @@ -46,7 +46,8 @@ } if (treeProxy && !viewer) { // start treeManager only ( -p flag ) - VncProxyService vps = new VncProxyService(); + // Viewer vps = new VncProxyService(); + Viewer vps = new Viewer(); if(fixingSizeDisplay) setFixingSizeDisplay(vps); rootStart(args,vps); @@ -83,7 +84,6 @@ rootStart(args, v); } else { v.startTreeViewer(hostName,cui, addSerialNum); - // selected "Start Display Mode" or "Start as TreeVNC Root" for start selection panel if (v.getRfb().getConnectionParam().isDisplayMode()) { noConnection = true; @@ -197,7 +197,6 @@ + "-d: Show shared screen and behave as tree root.\n" + "-r: Connect to fix to specified host and port.\n" + "--host hostname: Set host name.\n" - + "--retina: Limit screen size for very large display.\n" + "--width w: Set display width.\n" + "--height h: Set display height.\n" + "--showTree: Show connected tree node.\n"
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Fri Jan 31 11:41:13 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Feb 02 11:12:24 2020 +0900 @@ -851,21 +851,7 @@ JButton screenButton = buttonsBar.createButton("share", "Share my screen", new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - ArrayList<FbRectangle> rectangles = viewer.getScreenRectangles(); - if (rectangles.size() == 1) { // single display - screenChangeRequest(context, 0); - } else if (rectangles.size() > 1){ // dual display - ScreenChangeSelectionPanel selectionPanel = new ScreenChangeSelectionPanel(viewerWindow, context); - for (int i = 0; i < rectangles.size(); i++) { - Rectangle rectangle = rectangles.get(i); - // int scale = retinaScale(i); - int screenWidth = rectangle.width; // * scale; - int screenHeight = rectangle.height; // * scale; - selectionPanel.checkBox(screenWidth+" X "+screenHeight); - } - selectionPanel.setButton(); - selectionPanel.visible(); - } + createScreenSelectionPanel(context, viewerWindow); } }); @@ -912,6 +898,23 @@ setButtonsBarVisible(true, container); } + public void createScreenSelectionPanel(ProtocolContext context, SwingViewerWindow viewerWindow) { + ArrayList<FbRectangle> rectangles = viewer.getScreenRectangles(); + if (rectangles.size() == 1) { // single display + screenChangeRequest(context, 0); + } else if (rectangles.size() > 1){ // dual display + ScreenChangeSelectionPanel selectionPanel = new ScreenChangeSelectionPanel(viewerWindow, context); + for (int i = 0; i < rectangles.size(); i++) { + Rectangle rectangle = rectangles.get(i); + int screenWidth = rectangle.width; + int screenHeight = rectangle.height; + selectionPanel.checkBox(screenWidth+" X "+screenHeight); + } + selectionPanel.setButton(); + selectionPanel.visible(); + } + } + public void screenChangeRequest(ProtocolContext context, int shareScreenNumber) { ArrayList<FbRectangle> rectangles = viewer.getScreenRectangles(); FbRectangle rectangle1 = rectangles.get(shareScreenNumber);