summaryrefslogtreecommitdiffstats
path: root/src/main/java/nn/pp/rc/u.java
blob: c5c08d44d495e3aab639ebf218e6bd88dca5cf64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package nn.pp.rc;

import java.applet.Applet;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * This is a simple class to override the nn.pp.rc.u class from the applet.
 *
 * We need to do this, because the original class is doing some nasty things in
 * the processWindowEvent method. This class has the same name (and the same
 * package) and is somewhere before the applet in the classpath. So we cannot
 * import the original class here, but the class is so simple, that we can
 * implement it from scratch.
 */
public class u extends Frame
{
    ServerConsolePanelBase consolePanel;

    public u(Applet applet, String title, ServerConsolePanelBase consolePanel)
    {
        super(title + " Remote Console");
        this.consolePanel = consolePanel;
        this.add(consolePanel, "Center");

        this.addWindowListener(new WindowAdapter()
        {
            @Override
            public void windowClosing(WindowEvent windowEvent)
            {
                applet.stop();
            }
        });
    }

    /**
     * Close this frame.
     */
    public void a()
    {
        this.setVisible(false);
        this.setState(0);
        this.dispose();

        // "Close" the console panel
        consolePanel.r();
    }

    public void a(String path, String target)
    {
        // Nothing here, because we do not need the redirection to another page
        // when the applet exists.
    }
}