forked from I2P_Developers/i2p.i2p
I2PTunnelGUI: Deleted, moved to i2p.scripts
This commit is contained in:
@@ -40,6 +40,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
@@ -256,7 +257,15 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
|
||||
}
|
||||
|
||||
if (gui) {
|
||||
new I2PTunnelGUI(this);
|
||||
// removed from source, now in i2p.scripts
|
||||
//new I2PTunnelGUI(this);
|
||||
try {
|
||||
Class<?> cls = Class.forName("net.i2p.i2ptunnel.I2PTunnelGUI");
|
||||
Constructor<?> con = cls.getConstructor(I2PTunnel.class);
|
||||
con.newInstance(this);
|
||||
} catch (Throwable t) {
|
||||
throw new UnsupportedOperationException("GUI is not available, try -cli", t);
|
||||
}
|
||||
} else if (cli) {
|
||||
try {
|
||||
System.out.println("Enter 'help' for help.");
|
||||
|
@@ -1,48 +0,0 @@
|
||||
/* I2PTunnel is GPL'ed (with the exception mentioned in I2PTunnel.java)
|
||||
* (c) 2003 - 2004 mihi
|
||||
*/
|
||||
package net.i2p.i2ptunnel;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.Frame;
|
||||
import java.awt.TextArea;
|
||||
import java.awt.TextField;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
/**
|
||||
* AWT gui since kaffe doesn't support swing yet
|
||||
*/
|
||||
public class I2PTunnelGUI extends Frame implements ActionListener, Logging {
|
||||
|
||||
TextField input;
|
||||
TextArea log;
|
||||
I2PTunnel t;
|
||||
|
||||
public I2PTunnelGUI(I2PTunnel t) {
|
||||
super("I2PTunnel control panel");
|
||||
this.t = t;
|
||||
setLayout(new BorderLayout());
|
||||
add("South", input = new TextField());
|
||||
input.addActionListener(this);
|
||||
Font font = new Font("Monospaced", Font.PLAIN, 12);
|
||||
add("Center", log = new TextArea("", 20, 80, TextArea.SCROLLBARS_VERTICAL_ONLY));
|
||||
log.setFont(font);
|
||||
log.setEditable(false);
|
||||
log("enter 'help' for help.");
|
||||
pack();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
public void log(String s) {
|
||||
log.append(s + "\n");
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
log("I2PTunnel>" + input.getText());
|
||||
t.runCommand(input.getText(), this);
|
||||
log("---");
|
||||
input.setText("");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user