private void calculatePositions() {

    List<IAgent> agents = Esb.getAgents();
    for (IAgent a : agents) {
      RelativePoint rp = Esb.getScreenPosition(a);
      Point fromAgentScreenLocation = convertRelativePositionToPoint(rp);

      agentScreenPoints.put(a, fromAgentScreenLocation);

      GwtBitsCanvasRectangle item =
          new GwtBitsCanvasRectangle(fromAgentScreenLocation.x, fromAgentScreenLocation.y, 5, 5);
      item.text = a.getAgentName();
      gwtBitsCanvas.add(item);

      List<IAgent> agentsThisAgentTalksTo = Esb.getListOfAgentsMessagesSentTo(a);
      if (agentsThisAgentTalksTo != null) {
        for (IAgent toAgent : agentsThisAgentTalksTo) {
          if (toAgent != null) {
            Point locationOfToAgent = agentScreenPoints.get(toAgent);
            if (locationOfToAgent != null) {

              GwtBitsSendMessageArrow newArrow =
                  new GwtBitsSendMessageArrow(
                      fromAgentScreenLocation.x,
                      fromAgentScreenLocation.y,
                      locationOfToAgent.x,
                      locationOfToAgent.y,
                      infoWindow);

              Map<IAgent, Map<String, DebugAgentToAgentMessageTotals>> totals =
                  Esb.getAllMessageTotalsFromAgent(a);
              Map<String, DebugAgentToAgentMessageTotals> messTotalsToAgent = totals.get(toAgent);
              if (messTotalsToAgent != null) {
                List<DebugAgentToAgentMessageTotals> ttt =
                    new ArrayList<DebugAgentToAgentMessageTotals>();
                String text = "";
                for (String stt : messTotalsToAgent.keySet()) {
                  DebugAgentToAgentMessageTotals tt = messTotalsToAgent.get(stt);
                  text = text + tt.messageType + ",";
                  ttt.add(tt);
                }
                newArrow.text = text;
                newArrow.setMessageTotals(ttt);
              }
              gwtBitsCanvas.add(newArrow);
            }
          }
        }
      }
    }
    String s = "jhkhj";
    Esb.getAgents();
  }
  private void setNewAgentSelected(IAgent newagent) {
    currentAgent = newagent;
    propertyPanel.clear();
    propertyPanel.add(new Label(newagent.getAgentDescription()));

    messagesFromAgent = new ArrayList<EsbHistoryItem>();
    for (EsbHistoryItem currentHistoryItem : Esb.getHistory()) {
      if (currentHistoryItem.senderAgent == newagent) {
        messagesFromAgent.add(currentHistoryItem);
      }
    }

    messagesToAgent = new ArrayList<EsbHistoryItem>();
    for (EsbHistoryItem currentHistoryItem : Esb.getHistory()) {
      for (IAgent receiverAgent : currentHistoryItem.receiverAgents) {
        if (receiverAgent == newagent) {
          messagesToAgent.add(currentHistoryItem);
        }
      }
    }
  }