Mercurial > hg > Members > riono > TreeVNC_ja_comment
comparison src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java @ 175:e1aa06b0d2ff
on going ...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 22 Jun 2014 11:35:01 +0900 |
parents | 2e1530139169 |
children | c1b91dd27a13 |
comparison
equal
deleted
inserted
replaced
174:2e1530139169 | 175:e1aa06b0d2ff |
---|---|
1 package jp.ac.u_ryukyu.treevnc.server; | 1 package jp.ac.u_ryukyu.treevnc.server; |
2 | 2 |
3 import java.awt.event.*; | 3 import java.awt.event.*; |
4 import java.util.logging.Logger; | 4 import java.util.logging.Logger; |
5 | 5 |
6 import jp.ac.u_ryukyu.treevnc.MyRfbProto; | |
7 import com.glavsoft.core.SettingsChangedEvent; | 6 import com.glavsoft.core.SettingsChangedEvent; |
8 import com.glavsoft.rfb.IChangeSettingsListener; | 7 import com.glavsoft.rfb.IChangeSettingsListener; |
9 import com.glavsoft.rfb.IRfbSessionListener; | 8 import com.glavsoft.rfb.IRfbSessionListener; |
10 import com.glavsoft.rfb.protocol.ProtocolSettings; | 9 import com.glavsoft.rfb.protocol.ProtocolSettings; |
11 import com.glavsoft.viewer.Viewer; | 10 import com.glavsoft.viewer.Viewer; |
12 import com.glavsoft.viewer.cli.Parser; | 11 import com.glavsoft.viewer.cli.Parser; |
13 import com.glavsoft.viewer.swing.ConnectionParams; | |
14 import com.glavsoft.viewer.swing.ParametersHandler; | 12 import com.glavsoft.viewer.swing.ParametersHandler; |
15 | 13 |
16 public class VncProxyService extends Viewer implements Runnable, | 14 public class VncProxyService extends Viewer implements Runnable, |
17 IRfbSessionListener, IChangeSettingsListener { | 15 IRfbSessionListener, IChangeSettingsListener { |
18 | 16 |
22 private static final long serialVersionUID = 1L; | 20 private static final long serialVersionUID = 1L; |
23 | 21 |
24 public static Logger logger = Logger.getLogger("com.glavsoft"); | 22 public static Logger logger = Logger.getLogger("com.glavsoft"); |
25 private boolean forceReconnection; | 23 private boolean forceReconnection; |
26 private String reconnectionReason; | 24 private String reconnectionReason; |
27 public TreeManagement clients; | |
28 static VncProxyService currentVps; | 25 static VncProxyService currentVps; |
29 private int fbWidth = 0; | |
30 public int vncport = ConnectionParams.DEFAULT_RFB_PORT; | |
31 | 26 |
32 public VncProxyService() { | 27 public VncProxyService() { |
33 ProtocolSettings.getDefaultSettings(); | 28 ProtocolSettings.getDefaultSettings(); |
34 uiSettings = super.uiSettings; | 29 uiSettings = super.uiSettings; |
35 } | 30 } |
38 this(); | 33 this(); |
39 connectionParams.hostName = hostName; | 34 connectionParams.hostName = hostName; |
40 myRfb = vps.myRfb; | 35 myRfb = vps.myRfb; |
41 forceReconnection = vps.forceReconnection; | 36 forceReconnection = vps.forceReconnection; |
42 reconnectionReason = vps.reconnectionReason; | 37 reconnectionReason = vps.reconnectionReason; |
43 clients = vps.clients; | |
44 } | 38 } |
45 | 39 |
46 public static void main(String[] argv) { | 40 public static void main(String[] argv) { |
47 String[] mainArgs = argv; | 41 String[] mainArgs = argv; |
48 System.out.println(mainArgs.length); | 42 System.out.println(mainArgs.length); |
58 } | 52 } |
59 VncProxyService vps = new VncProxyService(); | 53 VncProxyService vps = new VncProxyService(); |
60 vps.myRfb.initRoot(vps, "localhost"); | 54 vps.myRfb.initRoot(vps, "localhost"); |
61 } | 55 } |
62 | 56 |
63 /** | |
64 * start new VNC server receiver with | |
65 * inherited clients | |
66 * @param vs | |
67 * @param hostName | |
68 */ | |
69 public void inhelitClients(VncProxyService vs, String hostName) { | |
70 myRfb.setReadyReconnect(false); | |
71 setConnectionParam(hostName,vncport); | |
72 isApplet = true; | |
73 this.setNoConnection(false); | |
74 run(); | |
75 myRfb.createConnectionAndStart(this); | |
76 } | |
77 | 57 |
78 public void proxyStart(String[] argv, int width, int height) { | |
79 fbWidth = width; | |
80 proxyStart(argv); | |
81 } | |
82 | 58 |
83 public void proxyStart(String[] argv) { | |
84 // input into arguments Decision | |
85 Parser parser = new Parser(); | |
86 ParametersHandler.completeParserOptions(parser); | |
87 if (fbWidth == 0) | |
88 parser.parse(argv); | |
89 if (parser.isSet(ParametersHandler.ARG_HELP)) { | |
90 printUsage(parser.optionsUsage()); | |
91 System.exit(0); | |
92 } | |
93 myRfb = new MyRfbProtoProxy(); | |
94 myRfb.initRoot(this, "localhost"); | |
95 } | |
96 | |
97 public void initRootViewer(String hostName) { | |
98 isApplet = false; | |
99 setIsTreeVNC(true); | |
100 setConnectionParam(hostName,vncport); | |
101 isApplet = true; | |
102 run(); | |
103 } | |
104 @Override | 59 @Override |
105 public void destroy() { | 60 public void destroy() { |
106 | 61 |
107 } | 62 } |
108 | 63 |