Mercurial > hg > Members > riono > TreeVNC_ja_comment
comparison src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java @ 377:877008c86e85
Add direct option
author | innparusu |
---|---|
date | Mon, 31 Aug 2015 17:04:36 +0900 |
parents | 1e4285df9afb |
children | ea324e42bc78 |
comparison
equal
deleted
inserted
replaced
376:1e4285df9afb | 377:877008c86e85 |
---|---|
24 private boolean checkDelay = false; | 24 private boolean checkDelay = false; |
25 private boolean addSerialNum = false; | 25 private boolean addSerialNum = false; |
26 private boolean fixingSizeDisplay = false; | 26 private boolean fixingSizeDisplay = false; |
27 private boolean logFile = false; | 27 private boolean logFile = false; |
28 private boolean filterSingleDisplay = false; | 28 private boolean filterSingleDisplay = false; |
29 private boolean direct = false; | |
29 | 30 |
30 | 31 |
31 public static void main(String[] args) throws SocketException, UnknownHostException { | 32 public static void main(String[] args) throws SocketException, UnknownHostException { |
32 new TreeViewer().vncStart(args); | 33 new TreeViewer().vncStart(args); |
33 } | 34 } |
57 // if(filterSingleDisplay) | 58 // if(filterSingleDisplay) |
58 if(fixingSizeDisplay) | 59 if(fixingSizeDisplay) |
59 setFixingSizeDisplay(v); | 60 setFixingSizeDisplay(v); |
60 if (treeProxy) { | 61 if (treeProxy) { |
61 if (hostName != null) { | 62 if (hostName != null) { |
62 // send whereToConnect | 63 if (direct) { |
63 remoteRootStart(args, v); | 64 rootStart(args, new VncProxyService()); |
65 } else { | |
66 // send whereToConnect | |
67 v.startTreeViewer(hostName, cui); | |
68 } | |
64 } | 69 } |
65 // this viewer also works as tree root ( display mode -d flag ) | 70 // this viewer also works as tree root ( display mode -d flag ) |
66 // start with no connection waiting server change request | 71 // start with no connection waiting server change request |
67 rootStart(args, v); | 72 rootStart(args, v); |
68 } else { | 73 } else { |
71 } | 76 } |
72 } | 77 } |
73 | 78 |
74 public void rootStart(String[] args, ViewerInterface v) throws SocketException, UnknownHostException { | 79 public void rootStart(String[] args, ViewerInterface v) throws SocketException, UnknownHostException { |
75 v.setNoConnection(noConnection); // should we accept host name here? | 80 v.setNoConnection(noConnection); // should we accept host name here? |
76 v.proxyStart(args, width, height, showTree, checkDelay, addSerialNum, fixingSizeDisplay, filterSingleDisplay); | 81 v.proxyStart(args, hostName, width, height, showTree, checkDelay, addSerialNum, fixingSizeDisplay, filterSingleDisplay); |
77 v.getRfb().setHasViewer(viewer); | 82 v.getRfb().setHasViewer(viewer); |
78 if (!permitChangeScreen) v.getRfb().setPermitChangeScreen(false); | 83 if (!permitChangeScreen) v.getRfb().setPermitChangeScreen(false); |
79 v.getRfb().getAcceptThread().waitForShutdown(); | 84 v.getRfb().getAcceptThread().waitForShutdown(); |
80 } | |
81 | |
82 public void remoteRootStart(String[] args, ViewerInterface v) { | |
83 v.startTreeViewer(hostName, cui); | |
84 } | 85 } |
85 | 86 |
86 private void modeSelect(String[] args) { | 87 private void modeSelect(String[] args) { |
87 viewer = true; // default | 88 viewer = true; // default |
88 for (int i = 0; i < args.length; i++) { | 89 for (int i = 0; i < args.length; i++) { |
128 height = Integer.parseInt(args[i+1]); | 129 height = Integer.parseInt(args[i+1]); |
129 i++; | 130 i++; |
130 } else if ("--host".equals(args[i])) { | 131 } else if ("--host".equals(args[i])) { |
131 hostName = args[++i]; | 132 hostName = args[++i]; |
132 treeProxy = true; | 133 treeProxy = true; |
134 } else if ("--direct".equals(args[i])) { | |
135 // direct connect without whereToConnect message | |
136 // use is --host | |
137 direct = true; | |
133 } else if ("--showTree".equals(args[i])) { | 138 } else if ("--showTree".equals(args[i])) { |
134 // show Tree node. | 139 // show Tree node. |
135 showTree = true; | 140 showTree = true; |
136 } else if ("--checkDelay".equals(args[i])) { | 141 } else if ("--checkDelay".equals(args[i])) { |
137 // check flow of data delay. | 142 // check flow of data delay. |