Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 438:e89f2a8fc7f4
use scale in fitScreen
frame size change in fitScreen
author | Nozomi |
---|---|
date | Sun, 12 Jun 2016 19:48:42 +0900 |
parents | 345c92f0b67d |
children | 2c7dcc6e59eb |
files | .idea/workspace.xml src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 3 files changed, 86 insertions(+), 108 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/workspace.xml Sun Jun 12 19:05:26 2016 +0900 +++ b/.idea/workspace.xml Sun Jun 12 19:48:42 2016 +0900 @@ -1,11 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> - <list default="true" id="8c014d34-63b7-4e87-8d9c-e9f73c2c3803" name="Default" comment="send multicasts to both ipv4 and ipv6"> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/gradle.xml" afterPath="$PROJECT_DIR$/.idea/gradle.xml" /> + <list default="true" id="8c014d34-63b7-4e87-8d9c-e9f73c2c3803" name="Default" comment="use scale in fitScreen frame size change in fitScreen"> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/build.gradle" afterPath="$PROJECT_DIR$/build.gradle" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java" afterPath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" /> </list> <ignored path="TreeVNC.iws" /> <ignored path=".idea/workspace.xml" /> @@ -65,55 +64,25 @@ </provider> </entry> </file> - <file leaf-file-name="SwingViewerWindow.java" pinned="false" current-in-tab="false"> + <file leaf-file-name="SwingViewerWindow.java" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="908" column="45" selection-start-line="908" selection-start-column="45" selection-end-line="908" selection-end-column="45" /> + <state vertical-scroll-proportion="0.53196347"> + <caret line="1027" column="14" selection-start-line="1027" selection-start-column="14" selection-end-line="1027" selection-end-column="14" /> <folding> - <element signature="e#0#45693#0" expanded="true" /> + <element signature="e#0#45454#0" expanded="true" /> + <element signature="e#41512#41830#0" expanded="true" /> + <element signature="e#41829#41830#0" expanded="true" /> </folding> </state> </provider> </entry> </file> - <file leaf-file-name="FindRoot.java" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java"> + <file leaf-file-name="UiSettings.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> - <caret line="57" column="13" selection-start-line="57" selection-start-column="13" selection-end-line="57" selection-end-column="13" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="TreeRootFinderListener.java" pinned="false" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.02930773"> - <caret line="2" column="7" selection-start-line="2" selection-start-column="7" selection-end-line="2" selection-end-column="7" /> - <folding> - <element signature="imports" expanded="true" /> - </folding> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="build.gradle" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/build.gradle"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="57" column="43" selection-start-line="57" selection-start-column="43" selection-end-line="57" selection-end-column="43" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="CreateConnectionParam.java" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="24" column="32" selection-start-line="24" selection-start-column="32" selection-end-line="24" selection-end-column="32" /> + <caret line="217" column="5" selection-start-line="217" selection-start-column="5" selection-end-line="217" selection-end-column="5" /> <folding /> </state> </provider> @@ -427,11 +396,12 @@ <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncRootSelectionPanel.java" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java" /> - <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" /> <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/client/ClientToServerMessage.java" /> <option value="$PROJECT_DIR$/build.gradle" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java" /> + <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java" /> + <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" /> </list> </option> </component> @@ -1139,7 +1109,13 @@ <option name="project" value="LOCAL" /> <updated>1465690013153</updated> </task> - <option name="localTasksCounter" value="5" /> + <task id="LOCAL-00005" summary="send multicasts to both ipv4 and ipv6"> + <created>1465725926823</created> + <option name="number" value="00005" /> + <option name="project" value="LOCAL" /> + <updated>1465725926823</updated> + </task> + <option name="localTasksCounter" value="6" /> <servers /> </component> <component name="TestHistory"> @@ -1156,7 +1132,7 @@ <layout> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32904503" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32904503" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> @@ -1197,7 +1173,8 @@ <MESSAGE value="find our screen on fitScreen remove requestSingleScreenSize " /> <MESSAGE value="remove unsed code in FindRoot " /> <MESSAGE value="send multicasts to both ipv4 and ipv6" /> - <option name="LAST_COMMIT_MESSAGE" value="send multicasts to both ipv4 and ipv6" /> + <MESSAGE value="use scale in fitScreen frame size change in fitScreen" /> + <option name="LAST_COMMIT_MESSAGE" value="use scale in fitScreen frame size change in fitScreen" /> </component> <component name="XDebuggerManager"> <breakpoint-manager> @@ -1240,7 +1217,9 @@ <state vertical-scroll-proportion="0.0"> <caret line="908" column="45" selection-start-line="908" selection-start-column="45" selection-end-line="908" selection-end-column="45" /> <folding> - <element signature="e#0#45693#0" expanded="true" /> + <element signature="e#0#45454#0" expanded="true" /> + <element signature="e#41512#41830#0" expanded="true" /> + <element signature="e#41829#41830#0" expanded="true" /> </folding> </state> </provider> @@ -1309,7 +1288,9 @@ <state vertical-scroll-proportion="0.0"> <caret line="1034" column="91" selection-start-line="1034" selection-start-column="91" selection-end-line="1034" selection-end-column="91" /> <folding> - <element signature="e#0#45693#0" expanded="true" /> + <element signature="e#0#45454#0" expanded="true" /> + <element signature="e#41512#41830#0" expanded="true" /> + <element signature="e#41829#41830#0" expanded="true" /> </folding> </state> </provider> @@ -1385,7 +1366,9 @@ <state vertical-scroll-proportion="0.0"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding> - <element signature="e#0#45693#0" expanded="true" /> + <element signature="e#0#45454#0" expanded="true" /> + <element signature="e#41512#41830#0" expanded="true" /> + <element signature="e#41829#41830#0" expanded="true" /> </folding> </state> </provider> @@ -1444,14 +1427,6 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="79" column="9" selection-start-line="79" selection-start-column="9" selection-end-line="79" selection-end-column="9" /> - <folding /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> @@ -1518,16 +1493,6 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="908" column="45" selection-start-line="908" selection-start-column="45" selection-end-line="908" selection-end-column="45" /> - <folding> - <element signature="e#0#45693#0" expanded="true" /> - </folding> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVncProtocol.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> @@ -1536,14 +1501,6 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="24" column="32" selection-start-line="24" selection-start-column="32" selection-end-line="24" selection-end-column="32" /> - <folding /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0"> @@ -1554,28 +1511,56 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/build.gradle"> + <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="57" column="43" selection-start-line="57" selection-start-column="43" selection-end-line="57" selection-end-column="43" /> - <folding /> + <state vertical-scroll-proportion="0.8938858"> + <caret line="63" column="46" selection-start-line="63" selection-start-column="46" selection-end-line="63" selection-end-column="46" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/FindRoot.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> + <state vertical-scroll-proportion="0.6887317"> <caret line="57" column="13" selection-start-line="57" selection-start-column="13" selection-end-line="57" selection-end-column="13" /> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java"> + <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/CreateConnectionParam.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="24" column="32" selection-start-line="24" selection-start-column="32" selection-end-line="24" selection-end-column="32" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/build.gradle"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.02930773"> - <caret line="2" column="7" selection-start-line="2" selection-start-column="7" selection-end-line="2" selection-end-column="7" /> + <state vertical-scroll-proportion="0.83527035"> + <caret line="57" column="43" selection-start-line="57" selection-start-column="43" selection-end-line="57" selection-end-column="43" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0"> + <caret line="217" column="5" selection-start-line="217" selection-start-column="5" selection-end-line="217" selection-end-column="5" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.53196347"> + <caret line="1027" column="14" selection-start-line="1027" selection-start-column="14" selection-end-line="1027" selection-end-column="14" /> <folding> - <element signature="imports" expanded="true" /> + <element signature="e#0#45454#0" expanded="true" /> + <element signature="e#41512#41830#0" expanded="true" /> + <element signature="e#41829#41830#0" expanded="true" /> </folding> </state> </provider>
--- a/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Sun Jun 12 19:05:26 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java Sun Jun 12 19:48:42 2016 +0900 @@ -203,7 +203,7 @@ double widthScale = (doubleThisWidth/singleWidth); double heightScale = (doubleThisHeight/singleHeight); double defaultScaleFactor = 100.0; - double scaleFactor = 100.0; + double scaleFactor; if (widthScale > heightScale) { scaleFactor = defaultScaleFactor * widthScale;
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Jun 12 19:05:26 2016 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Sun Jun 12 19:48:42 2016 +0900 @@ -1016,32 +1016,25 @@ int thisScreenHeight = (int) rectangles.get(leftScreenNumber).getHeight(); - final int thatScreenX = (int) presenter.getX(); - final int thatScreenY = (int) presenter.getY(); - final int thatScreenWidth = presenter.getFrameSizeWidth(); - final int thatScreenHeight = presenter.getFrameSizeHeight(); - if (false) { - System.out.println("thatScreenX:" + thatScreenX); - System.out.println("thatScreenY:" + thatScreenY); - System.out.println("thatScreenWidth:" + thatScreenWidth); - System.out.println("thatScreenHeight:" + thatScreenHeight); - System.out.println("getMaximum:" + scroller.getHorizontalScrollBar().getMaximum()); - System.out.println("getMinmum:" + scroller.getHorizontalScrollBar().getMinimum()); + final int thatScreenX = presenter.getX(); + final int thatScreenY = presenter.getY(); + final int thatScreenWidth = presenter.getFrameSizeWidth()*presenter.getRetinaScale(); + final int thatScreenHeight = presenter.getFrameSizeHeight()*presenter.getRetinaScale(); + //System.out.println("thatScreenX:" + thatScreenX); + //System.out.println("thatScreenY:" + thatScreenY); + //System.out.println("thatScreenWidth:" + thatScreenWidth); + //System.out.println("thatScreenHeight:" + thatScreenHeight); + //System.out.println("getMaximum:" + scroller.getHorizontalScrollBar().getMaximum()); + //System.out.println("getMinmum:" + scroller.getHorizontalScrollBar().getMinimum()); // uiSettings.zoomToFit(2*thatScreenWidth, 2*thatScreenHeight, thisScreenWidth, thisScreenHeight); - } - - int singleWidth = viewer.getRfb().getSingleWidth() * viewer.getRfb().getRetinaScale(); - int singleHeight = viewer.getRfb().getSingleHeight() * viewer.getRfb().getRetinaScale(); - if (false) - System.out.println("singleeight:"+singleHeight); - //frame.setSize(thisScreenWidth, thisScreenHeight); - uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, singleWidth, singleHeight); + frame.setSize(thisScreenWidth, thisScreenHeight); + uiSettings.fitScreen(thisScreenWidth, thisScreenHeight, thatScreenWidth, thatScreenHeight); // final Rectangle visible = new Rectangle(thatScreenX,thatScreenY,thatScreenWidth,thatScreenHeight); + final double scale = (double)thisScreenWidth/(double)thatScreenWidth; SwingUtilities.invokeLater(new Runnable(){ public void run() { - // we want to shift thaScreenX, to do so, * 1.5 is required. - scroller.getHorizontalScrollBar().setValue((int)(thatScreenX*1.5)); - scroller.getVerticalScrollBar().setValue((int)(thatScreenY*1.5)); + scroller.getHorizontalScrollBar().setValue((int)(thatScreenX*scale)); + scroller.getVerticalScrollBar().setValue((int)(thatScreenY*scale)); // scroller.scrollRectToVisible(visible); this does not work } });