annotate src/treeVnc/ButtonPanel.java @ 5:970d5ac80256

add MyDataInputStream.java and DataInputStream1.java
author one
date Mon, 23 Apr 2012 21:10:23 +0900
parents 756bfaf731f3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package treeVnc;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // Copyright (C) 2001,2002 HorizonLive.com, Inc. All Rights Reserved.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // This is free software; you can redistribute it and/or modify
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // it under the terms of the GNU General Public License as published by
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // the Free Software Foundation; either version 2 of the License, or
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // (at your option) any later version.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 // This software is distributed in the hope that it will be useful,
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 // GNU General Public License for more details.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 // You should have received a copy of the GNU General Public License
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 // along with this software; if not, write to the Free Software
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 // USA.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 // ButtonPanel class implements panel with four buttons in the
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 // VNCViewer desktop window.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 import java.awt.*;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 import java.awt.event.*;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 import java.io.*;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 class ButtonPanel extends Panel implements ActionListener {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 /**
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 *
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 */
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 private static final long serialVersionUID = 1L;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 VncViewer viewer;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 Button disconnectButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 Button optionsButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 Button recordButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 Button clipboardButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 Button ctrlAltDelButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 Button refreshButton;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 Button changeHost;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 ButtonPanel(VncViewer v) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 viewer = v;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 disconnectButton = new Button("Disconnect");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 disconnectButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 add(disconnectButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 disconnectButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 optionsButton = new Button("Options");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 add(optionsButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 optionsButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 clipboardButton = new Button("Clipboard");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 clipboardButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 add(clipboardButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 clipboardButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 if (viewer.rec != null) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 recordButton = new Button("Record");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 add(recordButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 recordButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 ctrlAltDelButton = new Button("Send Ctrl-Alt-Del");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 ctrlAltDelButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 add(ctrlAltDelButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 ctrlAltDelButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 refreshButton = new Button("Refresh");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 refreshButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 add(refreshButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 refreshButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 changeHost = new Button("Change Host");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 add(changeHost);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 changeHost.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 // Enable buttons on successful connection.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 public void enableButtons() {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 disconnectButton.setEnabled(true);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 clipboardButton.setEnabled(true);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 refreshButton.setEnabled(true);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 // Disable all buttons on disconnect.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 public void disableButtonsOnDisconnect() {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 remove(disconnectButton);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 disconnectButton = new Button("Hide desktop");
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 disconnectButton.setEnabled(true);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 add(disconnectButton, 0);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 disconnectButton.addActionListener(this);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 optionsButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 clipboardButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 ctrlAltDelButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 refreshButton.setEnabled(false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 validate();
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 // Enable/disable controls that should not be available in view-only
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 // mode.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 public void enableRemoteAccessControls(boolean enable) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 ctrlAltDelButton.setEnabled(enable);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 // Event processing.
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 //
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 public void actionPerformed(ActionEvent evt) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 viewer.moveFocusToDesktop();
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 if (evt.getSource() == disconnectButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 viewer.disconnect();
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 } else if (evt.getSource() == optionsButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 viewer.options.setVisible(!viewer.options.isVisible());
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 } else if (evt.getSource() == recordButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 viewer.rec.setVisible(!viewer.rec.isVisible());
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 } else if (evt.getSource() == clipboardButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 viewer.clipboard.setVisible(!viewer.clipboard.isVisible());
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 }else if (evt.getSource() == changeHost) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 //write when click to "Change Host"
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 } else if (evt.getSource() == ctrlAltDelButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 try {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 final int modifiers = InputEvent.CTRL_MASK | InputEvent.ALT_MASK;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 KeyEvent ctrlAltDelEvent =
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 new KeyEvent(this, KeyEvent.KEY_PRESSED, 0, modifiers, 127,KeyEvent.CHAR_UNDEFINED);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 viewer.rfb.writeKeyEvent(ctrlAltDelEvent);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 ctrlAltDelEvent =
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 new KeyEvent(this, KeyEvent.KEY_RELEASED, 0, modifiers, 127,KeyEvent.CHAR_UNDEFINED);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 viewer.rfb.writeKeyEvent(ctrlAltDelEvent);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 } catch (IOException e) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 e.printStackTrace();
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 } else if (evt.getSource() == refreshButton) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 try {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 RfbProto rfb = viewer.rfb;
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 rfb.writeFramebufferUpdateRequest(0, 0, rfb.framebufferWidth,
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 rfb.framebufferHeight, false);
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 } catch (IOException e) {
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 e.printStackTrace();
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 }
756bfaf731f3 create new repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166