Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2001,2002 HorizonLive.com, Inc. All Rights Reserved. |
| 3 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. |
| 4 | // |
| 5 | // This is free software; you can redistribute it and/or modify |
| 6 | // it under the terms of the GNU General Public License as published by |
| 7 | // the Free Software Foundation; either version 2 of the License, or |
| 8 | // (at your option) any later version. |
| 9 | // |
| 10 | // This software is distributed in the hope that it will be useful, |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | // GNU General Public License for more details. |
| 14 | // |
| 15 | // You should have received a copy of the GNU General Public License |
| 16 | // along with this software; if not, write to the Free Software |
| 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 18 | // USA. |
| 19 | // |
| 20 | |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 21 | import java.awt.*; |
| 22 | import java.awt.event.*; |
| 23 | import java.io.*; |
Constantin Kaplinsky | 5d99c95 | 2002-05-25 09:49:23 +0000 | [diff] [blame] | 24 | import java.net.*; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 25 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 26 | public class RfbPlayer extends java.applet.Applet |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 27 | implements java.lang.Runnable, WindowListener { |
| 28 | |
| 29 | boolean inAnApplet = true; |
| 30 | boolean inSeparateFrame = false; |
| 31 | |
| 32 | // |
| 33 | // main() is called when run as a java program from the command line. |
| 34 | // It simply runs the applet inside a newly-created frame. |
| 35 | // |
| 36 | |
| 37 | public static void main(String[] argv) { |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 38 | RfbPlayer p = new RfbPlayer(); |
| 39 | p.mainArgs = argv; |
| 40 | p.inAnApplet = false; |
| 41 | p.inSeparateFrame = true; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 42 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 43 | p.init(); |
| 44 | p.start(); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | String[] mainArgs; |
| 48 | |
| 49 | RfbProto rfb; |
| 50 | Thread rfbThread; |
| 51 | |
| 52 | Frame vncFrame; |
| 53 | Container vncContainer; |
| 54 | ScrollPane desktopScrollPane; |
| 55 | GridBagLayout gridbag; |
| 56 | ButtonPanel buttonPanel; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 57 | VncCanvas vc; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 58 | |
Constantin Kaplinsky | 5d99c95 | 2002-05-25 09:49:23 +0000 | [diff] [blame] | 59 | String sessionURL; |
Constantin Kaplinsky | c833e01 | 2002-05-30 17:59:22 +0000 | [diff] [blame] | 60 | URL url; |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 61 | long initialTimeOffset; |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 62 | double playbackSpeed; |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 63 | boolean autoPlay; |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 64 | boolean showControls; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 65 | int deferScreenUpdates; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 66 | |
| 67 | // |
| 68 | // init() |
| 69 | // |
| 70 | |
| 71 | public void init() { |
| 72 | |
| 73 | readParameters(); |
| 74 | |
| 75 | if (inSeparateFrame) { |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 76 | vncFrame = new Frame("RFB Session Player"); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 77 | if (!inAnApplet) { |
| 78 | vncFrame.add("Center", this); |
| 79 | } |
| 80 | vncContainer = vncFrame; |
| 81 | } else { |
| 82 | vncContainer = this; |
| 83 | } |
| 84 | |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 85 | if (inSeparateFrame) |
| 86 | vncFrame.addWindowListener(this); |
| 87 | |
| 88 | rfbThread = new Thread(this); |
| 89 | rfbThread.start(); |
| 90 | } |
| 91 | |
| 92 | public void update(Graphics g) { |
| 93 | } |
| 94 | |
| 95 | // |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 96 | // run() - executed by the rfbThread to read RFB data. |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 97 | // |
| 98 | |
| 99 | public void run() { |
| 100 | |
| 101 | gridbag = new GridBagLayout(); |
| 102 | vncContainer.setLayout(gridbag); |
| 103 | |
| 104 | GridBagConstraints gbc = new GridBagConstraints(); |
| 105 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 106 | gbc.anchor = GridBagConstraints.NORTHWEST; |
| 107 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 108 | if (showControls) { |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 109 | buttonPanel = new ButtonPanel(this); |
| 110 | buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
| 111 | gridbag.setConstraints(buttonPanel, gbc); |
| 112 | vncContainer.add(buttonPanel); |
| 113 | } |
| 114 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 115 | if (inSeparateFrame) { |
| 116 | vncFrame.pack(); |
| 117 | vncFrame.show(); |
| 118 | } else { |
| 119 | validate(); |
| 120 | } |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 121 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 122 | try { |
Constantin Kaplinsky | 40ad171 | 2002-09-22 08:36:43 +0000 | [diff] [blame] | 123 | if (inAnApplet) { |
| 124 | url = new URL(getCodeBase(), sessionURL); |
| 125 | } else { |
| 126 | url = new URL(sessionURL); |
| 127 | } |
Constantin Kaplinsky | 37cc43e | 2002-05-30 17:30:11 +0000 | [diff] [blame] | 128 | rfb = new RfbProto(url); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 129 | |
| 130 | vc = new VncCanvas(this); |
| 131 | gbc.weightx = 1.0; |
| 132 | gbc.weighty = 1.0; |
| 133 | |
| 134 | if (inSeparateFrame) { |
| 135 | |
| 136 | // Create a panel which itself is resizeable and can hold |
| 137 | // non-resizeable VncCanvas component at the top left corner. |
| 138 | Panel canvasPanel = new Panel(); |
| 139 | canvasPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
| 140 | canvasPanel.add(vc); |
| 141 | |
| 142 | // Create a ScrollPane which will hold a panel with VncCanvas |
| 143 | // inside. |
| 144 | desktopScrollPane = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); |
| 145 | gbc.fill = GridBagConstraints.BOTH; |
| 146 | gridbag.setConstraints(desktopScrollPane, gbc); |
| 147 | desktopScrollPane.add(canvasPanel); |
| 148 | |
| 149 | // Finally, add our ScrollPane to the Frame window. |
| 150 | vncFrame.add(desktopScrollPane); |
| 151 | vncFrame.setTitle(rfb.desktopName); |
| 152 | vncFrame.pack(); |
| 153 | vc.resizeDesktopFrame(); |
| 154 | |
| 155 | } else { |
| 156 | |
| 157 | // Just add the VncCanvas component to the Applet. |
| 158 | gridbag.setConstraints(vc, gbc); |
| 159 | add(vc); |
| 160 | validate(); |
| 161 | |
| 162 | } |
| 163 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 164 | while (true) { |
| 165 | try { |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 166 | setPaused(!autoPlay); |
Constantin Kaplinsky | 37cc43e | 2002-05-30 17:30:11 +0000 | [diff] [blame] | 167 | rfb.fbs.setSpeed(playbackSpeed); |
Constantin Kaplinsky | d8770f6 | 2002-08-16 16:01:37 +0000 | [diff] [blame] | 168 | if (initialTimeOffset > rfb.fbs.getTimeOffset()) |
| 169 | setPos(initialTimeOffset); // don't seek backwards here |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 170 | vc.processNormalProtocol(); |
| 171 | } catch (EOFException e) { |
Constantin Kaplinsky | d8770f6 | 2002-08-16 16:01:37 +0000 | [diff] [blame] | 172 | if (e.getMessage() != null && e.getMessage().equals("[REWIND]")) { |
| 173 | // A special type of EOFException allowing us to seek backwards. |
| 174 | initialTimeOffset = rfb.fbs.getSeekOffset(); |
| 175 | autoPlay = !rfb.fbs.isPaused(); |
Constantin Kaplinsky | d8770f6 | 2002-08-16 16:01:37 +0000 | [diff] [blame] | 176 | } else { |
| 177 | // Return to the beginning after the playback is finished. |
| 178 | initialTimeOffset = 0; |
| 179 | autoPlay = false; |
Constantin Kaplinsky | d8770f6 | 2002-08-16 16:01:37 +0000 | [diff] [blame] | 180 | } |
Constantin Kaplinsky | 282aaa1 | 2002-09-22 11:33:22 +0000 | [diff] [blame^] | 181 | rfb.newSession(url); |
| 182 | vc.updateFramebufferSize(); |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 183 | } |
| 184 | } |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 185 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 186 | } catch (FileNotFoundException e) { |
| 187 | fatalError(e.toString()); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 188 | } catch (Exception e) { |
| 189 | e.printStackTrace(); |
| 190 | fatalError(e.toString()); |
| 191 | } |
| 192 | |
| 193 | } |
| 194 | |
Constantin Kaplinsky | ac6420d | 2002-05-29 17:05:39 +0000 | [diff] [blame] | 195 | public void setPaused(boolean paused) { |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 196 | if (showControls) |
| 197 | buttonPanel.setPaused(paused); |
Constantin Kaplinsky | 37cc43e | 2002-05-30 17:30:11 +0000 | [diff] [blame] | 198 | if (paused) { |
| 199 | rfb.fbs.pausePlayback(); |
| 200 | } else { |
| 201 | rfb.fbs.resumePlayback(); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 205 | public double getSpeed() { |
| 206 | return playbackSpeed; |
| 207 | } |
| 208 | |
Constantin Kaplinsky | ce39d3b | 2002-05-30 15:54:56 +0000 | [diff] [blame] | 209 | public void setSpeed(double speed) { |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 210 | playbackSpeed = speed; |
Constantin Kaplinsky | 37cc43e | 2002-05-30 17:30:11 +0000 | [diff] [blame] | 211 | rfb.fbs.setSpeed(speed); |
Constantin Kaplinsky | ce39d3b | 2002-05-30 15:54:56 +0000 | [diff] [blame] | 212 | } |
| 213 | |
Constantin Kaplinsky | c833e01 | 2002-05-30 17:59:22 +0000 | [diff] [blame] | 214 | public void setPos(long pos) { |
Constantin Kaplinsky | 5b1b92a | 2002-05-30 18:02:34 +0000 | [diff] [blame] | 215 | rfb.fbs.setTimeOffset(pos); |
Constantin Kaplinsky | 30f786a | 2002-05-29 10:59:52 +0000 | [diff] [blame] | 216 | } |
| 217 | |
Constantin Kaplinsky | ce39d3b | 2002-05-30 15:54:56 +0000 | [diff] [blame] | 218 | |
Constantin Kaplinsky | fe07983 | 2002-05-29 00:52:32 +0000 | [diff] [blame] | 219 | public void updatePos() { |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 220 | if (showControls) |
Constantin Kaplinsky | c833e01 | 2002-05-30 17:59:22 +0000 | [diff] [blame] | 221 | buttonPanel.setPos(rfb.fbs.getTimeOffset()); |
Constantin Kaplinsky | fe07983 | 2002-05-29 00:52:32 +0000 | [diff] [blame] | 222 | } |
| 223 | |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 224 | // |
| 225 | // readParameters() - read parameters from the html source or from the |
| 226 | // command line. On the command line, the arguments are just a sequence of |
| 227 | // param_name/param_value pairs where the names and values correspond to |
| 228 | // those expected in the html applet tag source. |
| 229 | // |
| 230 | |
| 231 | public void readParameters() { |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 232 | |
Constantin Kaplinsky | 5d99c95 | 2002-05-25 09:49:23 +0000 | [diff] [blame] | 233 | sessionURL = readParameter("URL", true); |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 234 | |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 235 | initialTimeOffset = readLongParameter("Position", 0); |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 236 | if (initialTimeOffset < 0) |
| 237 | initialTimeOffset = 0; |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 238 | |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 239 | playbackSpeed = readDoubleParameter("Speed", 1.0); |
| 240 | if (playbackSpeed <= 0.0) |
| 241 | playbackSpeed = 1.0; |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 242 | |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 243 | autoPlay = false; |
| 244 | String str = readParameter("Autoplay", false); |
| 245 | if (str != null && str.equalsIgnoreCase("Yes")) |
| 246 | autoPlay = true; |
| 247 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 248 | showControls = true; |
Constantin Kaplinsky | 5a7133a | 2002-07-24 17:02:04 +0000 | [diff] [blame] | 249 | str = readParameter("Show Controls", false); |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 250 | if (str != null && str.equalsIgnoreCase("No")) |
| 251 | showControls = false; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 252 | |
| 253 | if (inAnApplet) { |
| 254 | str = readParameter("Open New Window", false); |
| 255 | if (str != null && str.equalsIgnoreCase("Yes")) |
| 256 | inSeparateFrame = true; |
| 257 | } |
| 258 | |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 259 | // Fine tuning options. |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 260 | deferScreenUpdates = (int)readLongParameter("Defer screen updates", 20); |
| 261 | if (deferScreenUpdates < 0) |
| 262 | deferScreenUpdates = 0; // Just in case. |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | public String readParameter(String name, boolean required) { |
| 266 | if (inAnApplet) { |
| 267 | String s = getParameter(name); |
| 268 | if ((s == null) && required) { |
| 269 | fatalError(name + " parameter not specified"); |
| 270 | } |
| 271 | return s; |
| 272 | } |
| 273 | |
| 274 | for (int i = 0; i < mainArgs.length; i += 2) { |
| 275 | if (mainArgs[i].equalsIgnoreCase(name)) { |
| 276 | try { |
| 277 | return mainArgs[i+1]; |
| 278 | } catch (Exception e) { |
| 279 | if (required) { |
| 280 | fatalError(name + " parameter not specified"); |
| 281 | } |
| 282 | return null; |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | if (required) { |
| 287 | fatalError(name + " parameter not specified"); |
| 288 | } |
| 289 | return null; |
| 290 | } |
| 291 | |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 292 | long readLongParameter(String name, long defaultValue) { |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 293 | String str = readParameter(name, false); |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 294 | long result = defaultValue; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 295 | if (str != null) { |
| 296 | try { |
Constantin Kaplinsky | 972c257 | 2002-05-30 14:19:02 +0000 | [diff] [blame] | 297 | result = Long.parseLong(str); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 298 | } catch (NumberFormatException e) { } |
| 299 | } |
| 300 | return result; |
| 301 | } |
| 302 | |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 303 | double readDoubleParameter(String name, double defaultValue) { |
| 304 | String str = readParameter(name, false); |
| 305 | double result = defaultValue; |
| 306 | if (str != null) { |
| 307 | try { |
Constantin Kaplinsky | 3044ecb | 2002-06-04 18:29:05 +0000 | [diff] [blame] | 308 | result = Double.valueOf(str).doubleValue(); |
Constantin Kaplinsky | 7957ca1 | 2002-05-30 16:19:11 +0000 | [diff] [blame] | 309 | } catch (NumberFormatException e) { } |
| 310 | } |
| 311 | return result; |
| 312 | } |
| 313 | |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 314 | // |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 315 | // fatalError() - print out a fatal error message. |
| 316 | // |
| 317 | |
| 318 | public void fatalError(String str) { |
| 319 | System.out.println(str); |
| 320 | |
| 321 | if (inAnApplet) { |
| 322 | vncContainer.removeAll(); |
| 323 | if (rfb != null) { |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 324 | rfb = null; |
| 325 | } |
| 326 | Label errLabel = new Label(str); |
| 327 | errLabel.setFont(new Font("Helvetica", Font.PLAIN, 12)); |
| 328 | vncContainer.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 30)); |
| 329 | vncContainer.add(errLabel); |
| 330 | if (inSeparateFrame) { |
| 331 | vncFrame.pack(); |
| 332 | } else { |
| 333 | validate(); |
| 334 | } |
| 335 | Thread.currentThread().stop(); |
| 336 | } else { |
| 337 | System.exit(1); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | |
| 342 | // |
| 343 | // This method is called before the applet is destroyed. |
| 344 | // |
| 345 | |
| 346 | public void destroy() { |
| 347 | vncContainer.removeAll(); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 348 | if (rfb != null) { |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 349 | rfb = null; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 350 | } |
| 351 | if (inSeparateFrame) { |
| 352 | vncFrame.dispose(); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | |
| 357 | // |
| 358 | // Close application properly on window close event. |
| 359 | // |
| 360 | |
| 361 | public void windowClosing(WindowEvent evt) { |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 362 | vncContainer.removeAll(); |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 363 | if (rfb != null) |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 364 | rfb = null; |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 365 | |
| 366 | vncFrame.dispose(); |
| 367 | if (!inAnApplet) { |
| 368 | System.exit(0); |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | // |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 373 | // Ignore window events we're not interested in. |
| 374 | // |
| 375 | |
Constantin Kaplinsky | 903009e | 2002-05-20 10:55:47 +0000 | [diff] [blame] | 376 | public void windowActivated (WindowEvent evt) {} |
Constantin Kaplinsky | 1215b99 | 2008-04-18 09:51:44 +0000 | [diff] [blame] | 377 | public void windowDeactivated (WindowEvent evt) {} |
| 378 | public void windowOpened(WindowEvent evt) {} |
| 379 | public void windowClosed(WindowEvent evt) {} |
| 380 | public void windowIconified(WindowEvent evt) {} |
| 381 | public void windowDeiconified(WindowEvent evt) {} |
| 382 | } |