Mercurial > hg > Applications > TreeVNC
changeset 310:9b70bfdef8bd
add function set full size when press fit button
author | oc |
---|---|
date | Fri, 23 Jan 2015 15:43:34 +0900 |
parents | 31d86f0ee977 |
children | e6a5f3100b6a |
files | src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Thu Jan 22 11:17:50 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Fri Jan 23 15:43:34 2015 +0900 @@ -200,12 +200,10 @@ public void fitScreen(int thisScreenWidth, int thisScreenHeight, int singleWidth, int singleHeight) { double doubleThisWidth = (double) thisScreenWidth; double doubleThisHeight = (double) thisScreenHeight; - double widthScale = (doubleThisWidth/singleWidth); double heightScale = (doubleThisHeight/singleHeight); double defaultScaleFactor = 100.0; double scaleFactor = 100.0; - double diff = widthScale - heightScale; if(diff == 0) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Thu Jan 22 11:17:50 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Fri Jan 23 15:43:34 2015 +0900 @@ -920,14 +920,16 @@ int singleWidth = viewer.getRfb().getSingleWidth(); int singleHeight = viewer.getRfb().getSingleHeight(); - if (viewer.getRfb().isTreeManager()) { - System.out.println(singleWidth); - uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); - return; + if (!viewer.getRfb().isTreeManager()) { + context.sendMessage(new RequestSingleDisplayWidth()); } - context.sendMessage(new RequestSingleDisplayWidth()); - System.out.println(singleWidth); uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); + /* + Dimension scaleSize = new Dimension(); + scaleSize.setSize(thisScreenWidth * scaleFactor, thisScreenHeight * scaleFactor); + frame.setSize(scaleSize); + */ + frame.setSize(thisScreenWidth, thisScreenHeight); } }); kbdButtons.add(fitScreenButton);