Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 390:dc168770dbe3
Add flag useHostName is call getHostName() method
author | innparusu |
---|---|
date | Tue, 22 Sep 2015 16:18:55 +0900 |
parents | 5a61cbdd83ab |
children | 6a8b661367c6 |
files | .idea/workspace.xml src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java |
diffstat | 2 files changed, 49 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/workspace.xml Tue Sep 22 16:03:22 2015 +0900 +++ b/.idea/workspace.xml Tue Sep 22 16:18:55 2015 +0900 @@ -2,10 +2,7 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" id="0a04b9e3-21eb-43ee-b441-59e664eecd89" name="Default" comment=""> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java" afterPath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java" afterPath="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java" /> </list> <ignored path="TreeVNC.iws" /> <ignored path=".idea/workspace.xml" /> @@ -137,8 +134,8 @@ <file leaf-file-name="SwingRfbConnectionWorker.java" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.3426791" vertical-offset="2300" max-vertical-offset="5080"> - <caret line="180" column="8" selection-start-line="180" selection-start-column="8" selection-end-line="180" selection-end-column="8" /> + <state vertical-scroll-proportion="1.6510904" vertical-offset="80" max-vertical-offset="5080"> + <caret line="153" column="40" selection-start-line="153" selection-start-column="40" selection-end-line="153" selection-end-column="40" /> <folding /> </state> </provider> @@ -236,13 +233,9 @@ <file leaf-file-name="TreeViewer.java" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0" vertical-offset="1110" max-vertical-offset="3090"> - <caret line="79" column="18" selection-start-line="79" selection-start-column="18" selection-end-line="79" selection-end-column="18" /> - <folding> - <element signature="imports" expanded="false" /> - <element signature="e#8529#8530#0" expanded="false" /> - <element signature="e#8595#8596#0" expanded="false" /> - </folding> + <state vertical-scroll-proportion="0.0" vertical-offset="652" max-vertical-offset="4532"> + <caret line="40" column="26" selection-start-line="40" selection-start-column="26" selection-end-line="40" selection-end-column="26" /> + <folding /> </state> </provider> </entry> @@ -364,11 +357,11 @@ </provider> </entry> </file> - <file leaf-file-name="TreeRFBProto.java" pinned="false" current-in-tab="true"> + <file leaf-file-name="TreeRFBProto.java" pinned="false" current-in-tab="false"> <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="-6.5054517" vertical-offset="18036" max-vertical-offset="19320"> - <caret line="495" column="0" selection-start-line="495" selection-start-column="0" selection-end-line="495" selection-end-column="0" /> + <state vertical-scroll-proportion="0.0" vertical-offset="8933" max-vertical-offset="19320"> + <caret line="479" column="16" selection-start-line="479" selection-start-column="16" selection-end-line="479" selection-end-column="16" /> <folding> <element signature="e#19848#19860#0" expanded="true" /> <element signature="e#26002#26014#0" expanded="true" /> @@ -377,6 +370,16 @@ </provider> </entry> </file> + <file leaf-file-name="TreeVNCNetwork.java" pinned="false" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.23130842" vertical-offset="0" max-vertical-offset="2403"> + <caret line="19" column="28" selection-start-line="19" selection-start-column="28" selection-end-line="19" selection-end-column="28" /> + <folding /> + </state> + </provider> + </entry> + </file> </leaf> </split-second> </splitter> @@ -673,6 +676,7 @@ <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java" /> + <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java" /> </list> </option> </component> @@ -1390,8 +1394,8 @@ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15745568" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15172054" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> - <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.34071887" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Hierarchy" active="true" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15172054" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.34071887" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32940573" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> @@ -1654,13 +1658,6 @@ <option name="FILTER_TARGETS" value="false" /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/META-INF/MANIFEST.MF"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1323"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - </state> - </provider> - </entry> <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/src.zip!/java/lang/Class.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="8605" max-vertical-offset="53025"> @@ -2086,18 +2083,6 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0" vertical-offset="968" max-vertical-offset="4532"> - <caret line="79" column="18" selection-start-line="79" selection-start-column="18" selection-end-line="79" selection-end-column="18" /> - <folding> - <element signature="imports" expanded="false" /> - <element signature="e#8529#8530#0" expanded="false" /> - <element signature="e#8595#8596#0" expanded="false" /> - </folding> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="5580" max-vertical-offset="7200"> @@ -2277,16 +2262,24 @@ </entry> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.3426791" vertical-offset="2300" max-vertical-offset="5080"> - <caret line="180" column="8" selection-start-line="180" selection-start-column="8" selection-end-line="180" selection-end-column="8" /> + <state vertical-scroll-proportion="1.6510904" vertical-offset="80" max-vertical-offset="5080"> + <caret line="153" column="40" selection-start-line="153" selection-start-column="40" selection-end-line="153" selection-end-column="40" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0" vertical-offset="652" max-vertical-offset="4532"> + <caret line="40" column="26" selection-start-line="40" selection-start-column="26" selection-end-line="40" selection-end-column="26" /> <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="-6.5054517" vertical-offset="18036" max-vertical-offset="19320"> - <caret line="495" column="0" selection-start-line="495" selection-start-column="0" selection-end-line="495" selection-end-column="0" /> + <state vertical-scroll-proportion="0.0" vertical-offset="8933" max-vertical-offset="19320"> + <caret line="479" column="16" selection-start-line="479" selection-start-column="16" selection-end-line="479" selection-end-column="16" /> <folding> <element signature="e#19848#19860#0" expanded="true" /> <element signature="e#26002#26014#0" expanded="true" /> @@ -2294,6 +2287,14 @@ </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.23130842" vertical-offset="0" max-vertical-offset="2403"> + <caret line="19" column="28" selection-start-line="19" selection-start-column="28" selection-end-line="19" selection-end-column="28" /> + <folding /> + </state> + </provider> + </entry> </component> <component name="masterDetails"> <states>
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java Tue Sep 22 16:03:22 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java Tue Sep 22 16:18:55 2015 +0900 @@ -15,6 +15,8 @@ private HashMap<String, TreeManagement> interfaces = new HashMap<String, TreeManagement>(); private TreeRFBProto myRfb; + private boolean useHostName = false; + public TreeRFBProto getMyRfb() { return myRfb; } @@ -29,8 +31,11 @@ if (ni.isUp() && ni.supportsMulticast() && !ni.isLoopback()) { for (InterfaceAddress ipaddress : ni.getInterfaceAddresses()) { byte [] netmask = getNetMask(ipaddress); - String hostName = ipaddress.getAddress().getHostName(); - TreeManagement treeManager = new TreeManagement(hostName, ConnectionParams.DEFAULT_VNC_ROOT, myRfb.getViewer().getShowTree()); + String hostName = ipaddress.getAddress().toString(); + if (useHostName) { + hostName = ipaddress.getAddress().getHostName(); + } + TreeManagement treeManager = new TreeManagement(hostName, ConnectionParams.DEFAULT_VNC_ROOT, myRfb.getViewer().getShowTree()); treeManager.getList().getFirst().setPort(myRfb.getAcceptPort()); byte[] netaddr = ipaddress.getAddress().getAddress(); for(int i=0;i<netaddr.length;i++) {