Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 71:36e116795e0c
option -d mode is behave as root with display. use this on main display such as large tv.
author | one |
---|---|
date | Thu, 17 Apr 2014 19:38:40 +0900 |
parents | 1370ef754bcf |
children | 50a14eeb080b |
files | src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java |
diffstat | 1 files changed, 36 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Thu Apr 17 19:00:41 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Thu Apr 17 19:38:40 2014 +0900 @@ -1,6 +1,5 @@ package com.glavsoft.viewer; -import jp.ac.u_ryukyu.treevnc.client.MyVncClient; import jp.ac.u_ryukyu.treevnc.server.VncProxyService; public class TreeViewer { @@ -9,7 +8,6 @@ private int width; private int height; private String hostName = null; - private boolean cuiVersion = true; // temp value.after remove. public static void main(String[] args) { new TreeViewer().vncStart(args); @@ -20,50 +18,62 @@ if (treeProxy) { VncProxyService vps = new VncProxyService(); vps.proxyStart(args,width,height); + } + if(hostName!=null) { + CuiViewer v = new CuiViewer(); + v.startViewer(hostName,true); } else if (viewer) { Viewer v = new Viewer(); v.startViewer(); - } else { - if(hostName!=null) { - CuiViewer v = new CuiViewer(); - v.startViewer(hostName,true); - } else { - Viewer v = new Viewer(); - v.startViewer(); - } - } } private void modeSelect(String[] args) { for (int i = 0; i < args.length; i++) { - if ("-p".equals(args[i])) { + if ("-p".equals(args[i]) || "-r".equals(args[i])) { + // no display. behave as root. + // relay rfb update to clients. treeProxy = true; + } else if ("-d".equals(args[i])) { + // behave as root with display. + // use this on main display such as large tv. + treeProxy = true; + viewer = true; } else if ("-v".equals(args[i])) { + // behave as client. + // open display and connect to some tree node. viewer = true; - } else if ("-r".equals(args[i])) { - treeProxy = true; } else if ("--version".equals(args[i])) { System.out.println("version :" + VncProxyService.ver()); System.exit(0); - } else if ("-retina".equals(args[i])) { + } else if ("--retina".equals(args[i])) { + // retina display too large for TreeVNC. + // restrict display size. treeProxy = true; - if(getParameter(args,i)) - i = i + 2; - }else if ("-h".equals(args[i])) { + width = 1280; + height = 800; + } else if ("--width".equals(args[i])) { + width = Integer.parseInt(args[i+1]); + i++; + } else if ("--height".equals(args[i])) { + height = Integer.parseInt(args[i+1]); + i++; + } else if ("--host".equals(args[i])) { hostName = args[++i]; } else { System.out.println("(default) TreeVNCClient\n" - + "-p: TreeVNCProxy\n" - + "-v: VNCViewer\n" - + "-r: TreeVNCProxy for RemoteHost. you should input parameter host and port\n" - + "-h: set host name\n" - + "-retina whidth heght: TreeVNC proxy for retina.this mode can select screen range."); + + "-p: TreeVNCProxy\n" + + "-v: VNCViewer\n" + + "-r: TreeVNCProxy for RemoteHost. you should input parameter host and port\n" + + "--host hostname: set host name\n" + + "--retina: TreeVNC proxy for retina.this mode can select screen range." + + "--width w: set display width" + + "--height h: set display height"); } } } - - private boolean getParameter(String[] args, int i) { + + private boolean setWidthAndHeight(String[] args, int i) { if(isInteger(args[++i])&&isInteger(args[++i])) { width = Integer.parseInt(args[--i]); height = Integer.parseInt(args[++i]); @@ -74,7 +84,7 @@ return false; } } - + private boolean isInteger(String num) { try { Integer.parseInt(num);