Mercurial > hg > Applications > TightVNC_orginal
changeset 14:ff01665d26b4
Remove TextBoxProxy
author | one |
---|---|
date | Thu, 23 Aug 2012 20:22:32 +0900 |
parents | 406fa09ae645 |
children | 5d43194fdc51 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java src/main/java/jp/ac/u_ryukyu/treevnc/server/TextBoxProxy.java |
diffstat | 3 files changed, 0 insertions(+), 164 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java Wed Aug 22 20:05:26 2012 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java Thu Aug 23 20:22:32 2012 +0900 @@ -94,33 +94,6 @@ acceptPort = port; } - void authenticationRequestAccess() throws IOException { - - byte[] headBuf = new byte[2]; - is.read(headBuf); - if (headBuf[1] == 2) { - byte[] b = new byte[258]; - is.read(b); - - byte[] outBuf = new byte[256]; - os.write(outBuf); - os.flush(); - } else if (headBuf[1] == 23) { - byte[] b = new byte[130]; - is.read(b); - byte[] outBuf = new byte[192]; - os.write(outBuf); - os.flush(); - } - - int result = readU32(); - if (result != 0) { - System.out.println("faild authentication "); - throw new IOException(); - } - - } - /* * default port number is 5999. */ @@ -163,10 +136,6 @@ cliListTmp.add(sock); } - boolean markSupported() { - return is.markSupported(); - } - synchronized void changeStatusFlag() { printStatusFlag = true; } @@ -321,11 +290,9 @@ len.limit(4); ByteBuffer inputData = ByteBuffer.allocate(dataLen - 20); - startTiming(); readFully(inputData.array(), 0, inputData.capacity()); // System.out.println(dataLen); inputData.limit(dataLen - 20); - stopTiming(); LinkedList<ByteBuffer> inputs = new LinkedList<ByteBuffer>(); inputs.add(inputData); @@ -361,10 +328,8 @@ bufs.add(header); if (dataLen > 16) { ByteBuffer b = ByteBuffer.allocate(dataLen - 16); - startTiming(); readFully(b.array(), 0, dataLen - 16); b.limit(dataLen - 16); - stopTiming(); bufs.add(b); } multicastqueue.put(bufs);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java Wed Aug 22 20:05:26 2012 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java Thu Aug 23 20:22:32 2012 +0900 @@ -36,8 +36,5 @@ notify(); } - public void checkDelay() throws IOException { - rfb.checkDelayData(); - } }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/TextBoxProxy.java Wed Aug 22 20:05:26 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -package jp.ac.u_ryukyu.treevnc.server; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.*; - -public class TextBoxProxy extends JFrame implements ActionListener { - - /** - * - */ - private static final long serialVersionUID = 1L; - private JPanel panel; - private JButton button; - private JButton button1; - private TextField t1; - private TextField t2; - private JPasswordField pw; - private double width; - private double height; - private JLabel label; - private boolean flag; - private VncProxyService vps; - - public void ipRegister() { - setSize(); - setText(); - visible(); - } - - public TextBoxProxy(VncProxyService _vps) { - vps = _vps; - setTitle("Informatin Connection Address"); - setResizable(false); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - } - - private void setSize() { - Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); - width = (d.getWidth() / 2); - height = (d.getHeight() / 2); - } - - private void visible() { - Point point = new Point(); - point.setLocation(width - 250, height - 80); - setLocation(point.getLocation()); - pack(); - setVisible(true); - } - - private void init(){ - frameInit(); -// panel = null; -// button = null; -// label = null; - setVisible(false); - } - - public void changeHost() { - init(); - button1 = new JButton("Change Host"); - t1 = new TextField("Address", 30); - panel = new JPanel(); - panel.add(t1); - panel.add(button1); - button1.addActionListener(this); - label = new JLabel(); - Container contentPane = getContentPane(); - contentPane.add(panel, BorderLayout.CENTER); - contentPane.add(label, BorderLayout.SOUTH); - visible(); - } - - private void setText() { - panel = new JPanel(); - t1 = new TextField("localhost", 30); - t2 = new TextField("5900", 5); -// pw = new JPasswordField("Password",30); - button = new JButton("Connect"); - panel.add(t1); - panel.add(t2); -// panel.add(pw); - panel.add(button); - button.addActionListener(this); - label = new JLabel(); - Container contentPane = getContentPane(); - contentPane.add(panel, BorderLayout.CENTER); - contentPane.add(label, BorderLayout.SOUTH); - } - - public String getAddress() { - while(!(flag)) { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - return t1.getText(); - } - public String getPort() { - return t2.getText(); - } - - - public String getPassword() { - return String.valueOf(pw.getPassword()); - } - - - public void actionPerformed(ActionEvent e) { - if(e.getSource()==button) { - flag = true; - setVisible(false); - } - if(e.getSource()==button1) - try { - init(); - vps.host = getAddress(); - vps.changeInit(); - } catch (Exception e1) { - e1.printStackTrace(); - } - } -} \ No newline at end of file