Examples of AID


Examples of jade.core.AID

          String command = e.getActionCommand();
          AIDGui guiSender = new AIDGui(getChildrenOwner());

          if(command.equals("Set"))
          {
            AID senderToView = SenderAID;
            //another sender was already inserted.
            if(newAIDSender != null)
              senderToView = newAIDSender;
            senderToView = guiSender.ShowAIDGui(senderToView,true,true);
            //if the cancel button was clicked --> maintain the old value inserted.
View Full Code Here

Examples of jade.core.AID

        public void actionPerformed(ActionEvent e){
          String command = e.getActionCommand();
          AIDGui guiFrom = new AIDGui(ownerGui);
          if(command.equals("Set"))
          {
            AID fromToView = fromAID;
            if (newAIDFrom != null)
              fromToView = newAIDFrom;
            fromToView = guiFrom.ShowAIDGui(fromToView,true,true);
            if(fromToView != null)
            {
View Full Code Here

Examples of jade.core.AID

    this.out = null;
    this.editable = ed;
    this.checkSlots = checkMandatorySlots;

    if(agentIdentifier == null)
      this.agentAID =  new AID();
    else
      this.agentAID = agentIdentifier;

    JLabel label;

    JPanel mainPanel = new JPanel();

    mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
    //mainPanel.setBackground(Color.black);

    //Name
    JPanel namePanel = new JPanel();
    namePanel.setLayout(new BoxLayout(namePanel,BoxLayout.X_AXIS));
    label = new JLabel("NAME");
    label.setPreferredSize(new Dimension(80,26));
    label.setMinimumSize(new Dimension(80,26));
    label.setMaximumSize(new Dimension(80,26));
    namePanel.add(label);

    isLocalName = new JCheckBox();
    isLocalName.setVisible(ed); //if the AID is editable then the checkbox is show otherwise no.
    isLocalName.setToolTipText("Select if the name is not a GUID.");

    namePanel.add(isLocalName);
    nameText = new JTextField();
    nameText.setBackground(Color.white);
    nameText.setText(agentAID.getName());
    nameText.setPreferredSize(new Dimension(125,26));
    nameText.setMinimumSize(new Dimension(125,26));
    nameText.setMaximumSize(new Dimension(125,26));
    nameText.setEditable(editable);
    namePanel.add(nameText);

    mainPanel.add(namePanel);


    //Addresses
    JPanel addressesPanel = new JPanel();
    addressesPanel.setLayout(new BorderLayout());
    addressesPanel.setBorder(BorderFactory.createTitledBorder("Addresses"));
    //#DOTNET_EXCLUDE_BEGIN
    addressListPanel = new VisualStringList(agentAID.getAllAddresses(), getChildrenOwner());
    //#DOTNET_EXCLUDE_END
    /*#DOTNET_INCLUDE_BEGIN
    java.util.ArrayList aList = new java.util.ArrayList();
    jade.util.leap.Iterator it = agentAID.getAllAddresses();
    while ( it.hasNext() )
    {
      aList.add( it.next() );
    }
    addressListPanel = new VisualStringList(aList.iterator(), getChildrenOwner());
    #DOTNET_INCLUDE_END*/
    addressListPanel.setDimension(new Dimension(200,40));
    addressListPanel.setEnabled(editable);
    addressesPanel.add(addressListPanel);
    mainPanel.add(addressesPanel);


    //Resolvers
    JPanel resolversPanel = new JPanel();
    resolversPanel.setLayout(new BorderLayout());
    resolversPanel.setBorder(BorderFactory.createTitledBorder("Resolvers"));
    //#DOTNET_EXCLUDE_BEGIN
    resolverListPanel = new VisualAIDList(agentAID.getAllResolvers(), getChildrenOwner());
    //#DOTNET_EXCLUDE_END
    /*#DOTNET_INCLUDE_BEGIN
    java.util.ArrayList bList = new java.util.ArrayList();
    jade.util.leap.Iterator it2 = agentAID.getAllResolvers();
    while ( it2.hasNext() )
    {
      bList.add( it2.next() );
    }
    resolverListPanel = new VisualAIDList(bList.iterator(), getChildrenOwner());
    #DOTNET_INCLUDE_END*/
    resolverListPanel.setDimension(new Dimension(200,40));
    resolverListPanel.setEnabled(editable);
    resolverListPanel.setCheckMandatorySlots(checkMandatorySlots);
    resolversPanel.add(resolverListPanel);
    mainPanel.add(resolversPanel);


    //Properties
    JPanel propertiesPanel = new JPanel();
    propertiesPanel.setLayout(new BorderLayout());
    propertiesPanel.setBorder(BorderFactory.createTitledBorder("Properties"));
    propertiesListPanel = new VisualPropertiesList(agentAID.getAllUserDefinedSlot(), getChildrenOwner());
    propertiesListPanel.setDimension(new Dimension(200,40));
    propertiesListPanel.setEnabled(editable);
    propertiesPanel.add(propertiesListPanel);
    mainPanel.add(propertiesPanel);

    //Button Ok-Cancel
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        String param = (String)e.getActionCommand();
        if(param.equals("OK"))
        {

          if(editable)
          {

            String name = (nameText.getText()).trim();
            if (checkSlots)
              if (name.length() == 0) {
                JOptionPane.showMessageDialog(AIDGui.this,"AID must have a non-empty name.","Error Message",JOptionPane.ERROR_MESSAGE);
                return;
              }
            out = new AID();

            if(isLocalName.isSelected())
              out.setLocalName(name);
            else
              out.setName(name);
View Full Code Here

Examples of jade.core.AID

  }
 
  private void firePostedMessage(ACLMessage msg, AID receiver) {
    // Set the sender explicitly only if different than that included in the message
    String realSenderName = msg.getUserDefinedParameter(ACLMessage.REAL_SENDER);
    AID sender = null;
    if (realSenderName != null) {
      sender = new AID(realSenderName, AID.ISGUID);
    }
    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = messageListeners.startScanning();
    if (l != null) {
View Full Code Here

Examples of jade.core.AID

  }
 
  private void fireReceivedMessage(ACLMessage msg, AID receiver) {
    // Set the sender explicitly only if different than that included in the message
    String realSenderName = msg.getUserDefinedParameter(ACLMessage.REAL_SENDER);
    AID sender = null;
    if (realSenderName != null) {
      sender = new AID(realSenderName, AID.ISGUID);
    }
    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = messageListeners.startScanning();
    if (l != null) {
View Full Code Here

Examples of jade.core.AID

      Iterator it = l.iterator();
      while(it.hasNext()) {
        Object obj = it.next();
        if(obj instanceof ToolNotifier) {
          ToolNotifier tni = (ToolNotifier) obj;
          AID id = tni.getObserver();
          if(id.equals(observerName)) {
            tn = tni;
            break;
          }
        }
      }
View Full Code Here

Examples of jade.core.AID

      // matter if they match)
      if(factDesc.checkLeaseTimeExpired())
        return false;

      // Match name
      AID id1 = templateDesc.getName();
      if(id1 != null) {
        AID id2 = factDesc.getName();
        if((id2 == null) || (!matchAID(id1, id2)))
          return false;
      }

      // Match protocol set
View Full Code Here

Examples of jade.core.AID

    // Resolvers
    iter = aid.getAllResolvers();
    if (iter.hasNext()) {
      pss.stm_insAgentResolverAID.clearBatch();
      while(iter.hasNext()){
        AID resolverAID = (AID)iter.next();
        saveResolverAID(aid, resolverAID);
     
      pss.stm_insAgentResolverAID.executeBatch();
    }
  }
View Full Code Here

Examples of jade.core.AID

   *  Insert a new DFD object.
   *  @return the previous DFD (if any) corresponding to the same AID
   */
  protected Object insertSingle(Object name, Object fact) throws SQLException {
    DFAgentDescription dfd = (DFAgentDescription) fact;
    AID agentAID = dfd.getName();
    String agentName = agentAID.getName();
    DFAgentDescription dfdToReturn = null;
    String batchErrMsg = "";
   
    Connection conn = getConnectionWrapper().getConnection();
    PreparedStatements pss = getPreparedStatements();
View Full Code Here

Examples of jade.core.AID

  /**
   * Remove the DFD object corresponding to the indicated AID.
   * @return the removed DFD (if any)
   */
  protected Object removeSingle(Object name) throws SQLException {
    AID agentAID = (AID) name;
    String n = agentAID.getName();
   
    DFAgentDescription dfd = getDFD(n);
    if (dfd != null) {
      remove(n);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.