gt: 		options.add(CheckInfo = new CheckboxMenuItemAction(this, Global
context: package jagoclient.igs;
  
  import jagoclient.CloseConnection;
  import jagoclient.Dump;
  import jagoclient.Global;
  import jagoclient.dialogs.GetParameter;
  import jagoclient.dialogs.Help;
  import jagoclient.dialogs.Message;
  import jagoclient.dialogs.Question;
  import jagoclient.gui.ButtonAction;
  import jagoclient.gui.CheckboxMenuItemAction;
  import jagoclient.gui.CloseFrame;
  import jagoclient.gui.GrayTextField;
  import jagoclient.gui.HistoryTextField;
  import jagoclient.gui.MenuItemAction;
  import jagoclient.gui.MyLabel;
  import jagoclient.gui.MyMenu;
  import jagoclient.gui.MyPanel;
  import jagoclient.gui.Panel3D;
  import jagoclient.igs.connection.Connection;
  import jagoclient.igs.games.GamesFrame;
  import jagoclient.igs.who.WhoFrame;
  
  import java.awt.BorderLayout;
  import java.awt.CheckboxMenuItem;
  import java.awt.Color;
  import java.awt.FileDialog;
  import java.awt.GridBagLayout;
  import java.awt.Menu;
  import java.awt.MenuBar;
  import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  import java.awt.event.WindowEvent;
  import java.io.DataOutputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.io.UnsupportedEncodingException;
  import java.net.Socket;
  
  import javax.swing.JTextField;
  
  import rene.util.list.ListClass;
  import rene.util.list.ListElement;
  import rene.viewer.SystemViewer;
  import rene.viewer.Viewer;
  
  class CloseConnectionQuestion extends Question
  {
  	public CloseConnectionQuestion (ConnectionFrame g)
  	{
  		super(g, Global.resourceString("This_will_close_your_connection_"),
  			Global.resourceString("Close"), g, true);
  		show();
  	}
  }
  
  
  class GetWaitfor extends GetParameter
  {
  	ConnectionFrame CF;
  
  	public GetWaitfor (ConnectionFrame cf)
  	{
  		super(cf, Global.resourceString("Wait_for_"), Global
  			.resourceString("Wait_for_Player"), cf, true);
  		CF = cf;
  		set(CF.Waitfor);
  		show();
  	}
  
  	@Override
  	public boolean tell (Object o, String s)
  	{
  		CF.Waitfor = s;
  		return true;
  	}
  }
  
  
  class GetReply extends GetParameter
  {
  	ConnectionFrame CF;
  
  	public GetReply (ConnectionFrame cf)
  	{
  		super(cf, Global.resourceString("Automatic_Reply_"), Global
  			.resourceString("Auto_Reply"), cf, true);
  		CF = cf;
  		set(CF.Reply);
  		show();
  	}
  
  	@Override
  	public boolean tell (Object o, String s)
  	{
  		CF.Reply = s;
  		Global.setParameter("autoreply", s);
  		return true;
  	}
  }
  
  
  class RefreshWriter extends PrintWriter
  {
  	Thread T;
  	boolean NeedsRefresh;
  	boolean Stop = false;
  
  	public RefreshWriter (OutputStreamWriter out, boolean flag)
  	{
  		super(out, flag);
  		if (Global.getParameter("refresh", true))
  		{
  			Dump.println("Refresh Thread started.");
  			T = new Thread()
  			{
  				@Override
  				public void run ()
  				{
  					runAYT();
  				}
  			};
  			T.start();
  		}
  	}
  
  	@Override
  	public void print (String s)
  	{
  		super.print(s);
  		Dump.println("Out ---> " + s);
  		NeedsRefresh = false;
  	}
  
  	public void printLn (String s)
  	{
  		super.println(s);
  		Dump.println("Out ---> " + s);
  		NeedsRefresh = false;
  	}
  
  	@Override
  	public void close ()
  	{
  		super.close();
  		NeedsRefresh = false;
  		Stop = true;
  	}
  
  	public void runAYT ()
  	{
  		while ( !Stop)
  		{
  			NeedsRefresh = true;
  			try
  			{
  				Thread.sleep(300000);
  			}
  			catch (Exception e)
  			{}
  			if (Stop) break;
  			if (NeedsRefresh)
  			{
  				println("ayt");
  				// write(254);
  				Dump.println("ayt sent!");
  			}
  		}
  	}
  }
  
  
  /**
   * This frame contains a menu, a text area for the server output, a text area to
   * send commands to the server and buttons to call who, games etc.
   */
  
  public class ConnectionFrame extends CloseFrame implements KeyListener
  {
  	GridBagLayout girdbag;
  	Viewer Output;
  	HistoryTextField Input;
  	GridBagLayout gridbag;
  	public WhoFrame Who;
  	public GamesFrame Games;
  
  	Socket Server;
  	PrintWriter Out;
  	public DataOutputStream Outstream;
  	String Encoding;
  	IgsStream In;
  	ReceiveThread RT;
  	String Dir;
  	JTextField Game;
  	CheckboxMenuItem CheckInfo, CheckMessages, CheckErrors, ReducedOutput,
  		AutoReply;
  	public int MoveStyle = Connection.MOVE;
  	JTextField WhoRange; // Kyu/Dan range for the who command.
  	String Waitfor; // Pop a a message, when this player connects.
  	ListClass OL; // List of Output-Listeners
  	String Reply;
  
  	public boolean hasClosed = false; // note that the user closed the window
  
  	public ConnectionFrame (String Name, String encoding)
  	{
  		super(Name);
  		Encoding = encoding;
  		Waitfor = "";
  		OL = new ListClass();
  		setLayout(new BorderLayout());
  		// Menu
  		MenuBar M = new MenuBar();
  		setMenuBar(M);
  		Menu file = new MyMenu(Global.resourceString("File"));
  		M.add(file);
  		file.add(new MenuItemAction(this, Global.resourceString("Save")));
  		file.addSeparator();
  		file.add(new MenuItemAction(this, Global.resourceString("Clear")));
  		file.addSeparator();
  		file.add(new MenuItemAction(this, Global.resourceString("Close")));
  		Menu options = new MyMenu(Global.resourceString("Options"));
  		M.add(options);
  		options.add(AutoReply = new CheckboxMenuItemAction(this, Global
  			.resourceString("Auto_Reply")));
  		AutoReply.setState(false);
  		options
  			.add(new MenuItemAction(this, Global.resourceString("Set_Reply")));
  		Reply = Global.getParameter("autoreply",
  			"I am busy! Please, try later.");
  		options.addSeparator();
  