import javax.swing.*;
import java.awt.GridLayout;

/**
   Class that handles the connection
   @author Sugiharto Widjaja
   @version 10/30/02
*/
public class ConnectPanel extends JPanel
{
   /**
      Construct the panel
   */
   public ConnectPanel()
   {
      setLayout(new GridLayout(gridSize,gridSize));
      lHost = new JLabel("Host : ");
      comm = new JLabel("Community : ");
      port = new JLabel("Port : ");
      setValue = new JLabel("Set Value : ");
      wComm = new JLabel("Write Community : ");
      fHost = new JTextField(fieldSize);
      fComm = new JTextField(fieldSize);
      fPort = new JTextField(fieldSize);
      fComm.setText("public");
      fPort.setText("161");
      fSetValue = new JTextField(fieldSize);
      fWComm = new JTextField(fieldSize);
      add(lHost);
      add(fHost);
      add(comm);
      add(fComm);
      add(port);
      add(fPort);
      add(setValue);
      add(fSetValue);
      add(wComm);
      add(fWComm);
   }

   /**
      Get the hostname
      @return the hostname
   */
   public String getHost()
   {
      return fHost.getText();
   }

   /**
      Get the community name
      @return the community name
   */
   public String getCommunity()
   {
      return fComm.getText();
   }

   // Size of grid
   public static final int gridSize = 5;
   // Size of the text field
   public static final int fieldSize = 25;
   // Host label
   private JLabel lHost;
   // Community label
   private JLabel comm;
   // Port label
   private JLabel port;
   // Object ID label
   private JLabel obId;
   // Set ID value
   private JLabel setValue;
   // The write community
   private JLabel wComm;
   // The hostname field
   private JTextField fHost;
   // The community name field
   private JTextField fComm;
   // The port field
   private JTextField fPort;
   // The object ID field
   private JTextField fObId;
   // The value field
   private JTextField fSetValue;
   // The write community field
   private JTextField fWComm;
}