Exemplo n.º 1
0
  public PDAAgentGui(AgentGuiConfig configuration) {

    config = configuration;
    components = new Hashtable<String, Component>();
    window = new JFramePDA();

    window.jLabel4.setText(config.windowName);

    components.put(PDAComponents.JOIN.toString(), window.jTextField1);
    components.put(PDAComponents.ADD.toString(), window.jTextField2);
    components.put(PDAComponents.DELETE.toString(), window.jTextField3);
    components.put(PDAComponents.PROOPINION.toString(), window.jTextArea1);
    components.put(PDAComponents.CONOPINION.toString(), window.jTextArea2);
    components.put(PDAComponents.AGENT_NAME.toString(), window.jLabel4);

    window.setVisible(true);
  }
Exemplo n.º 2
0
  @Override
  public void connectInput(String componentName, InputListener input) {

    final InputListener listener = input;

    if ((PDAComponents.JOIN.toString().toLowerCase()).equals(componentName.toLowerCase())) {
      window.joinListener = listener;
      System.out.println("connectInput join");
    } else if ((PDAComponents.ADD.toString().toLowerCase()).equals(componentName.toLowerCase())) {
      window.addListener = listener;
      System.out.println("connectInput add");
    } else if ((PDAComponents.DELETE.toString().toLowerCase())
        .equals(componentName.toLowerCase())) {
      window.deleteListener = listener;
      System.out.println("connectInput delete");
    } else {
      System.err.println(
          "component [" + componentName + "] not found."); // FIXME: get a log from somewhere
    }
  }