0
|
1 package treeVnc;
|
|
2 //
|
|
3 // Copyright (C) 2002 Cendio Systems. All Rights Reserved.
|
|
4 // Copyright (C) 2002 Constantin Kaplinsky. All Rights Reserved.
|
|
5 //
|
|
6 // This is free software; you can redistribute it and/or modify
|
|
7 // it under the terms of the GNU General Public License as published by
|
|
8 // the Free Software Foundation; either version 2 of the License, or
|
|
9 // (at your option) any later version.
|
|
10 //
|
|
11 // This software is distributed in the hope that it will be useful,
|
|
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 // GNU General Public License for more details.
|
|
15 //
|
|
16 // You should have received a copy of the GNU General Public License
|
|
17 // along with this software; if not, write to the Free Software
|
|
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
19 // USA.
|
|
20 //
|
|
21
|
|
22 //
|
|
23 // ReloginPanel class implements panel with a button for logging in again,
|
|
24 // after fatal errors or disconnect
|
|
25 //
|
|
26
|
|
27
|
|
28 import java.awt.*;
|
|
29 import java.awt.event.*;
|
|
30
|
|
31 //
|
|
32 // The panel which implements the Relogin button
|
|
33 //
|
|
34
|
|
35 class ReloginPanel extends Panel implements ActionListener {
|
|
36 /**
|
|
37 *
|
|
38 */
|
|
39 private static final long serialVersionUID = 1L;
|
|
40 Button reloginButton;
|
|
41 Button closeButton;
|
|
42 VncViewer viewer;
|
|
43
|
|
44 //
|
|
45 // Constructor.
|
|
46 //
|
|
47 public ReloginPanel(VncViewer v) {
|
|
48 viewer = v;
|
|
49 setLayout(new FlowLayout(FlowLayout.CENTER));
|
|
50 reloginButton = new Button("Login again");
|
|
51 add(reloginButton);
|
|
52 reloginButton.addActionListener(this);
|
|
53 if (viewer.inSeparateFrame) {
|
|
54 closeButton = new Button("Close window");
|
|
55 add(closeButton);
|
|
56 closeButton.addActionListener(this);
|
|
57 }
|
|
58 }
|
|
59
|
|
60 //
|
|
61 // This method is called when a button is pressed.
|
|
62 //
|
|
63 public synchronized void actionPerformed(ActionEvent evt) {
|
|
64 if (viewer.inSeparateFrame)
|
|
65 viewer.vncFrame.dispose();
|
|
66 if (evt.getSource() == reloginButton)
|
|
67 viewer.getAppletContext().showDocument(viewer.getDocumentBase());
|
|
68 }
|
|
69 }
|