peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(0.625, false, 1.0), "mark" }, "+");
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(0.75, false, 1.0), "mark" }, "--");
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(0.875, false, 1.0), "mark" }, "+");
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { "position: absolute; top: " + PEER_CIRCLE_RADIUS + "px; left: " + (PEER_CIRCLE_RADIUS + PEER_CIRCLE_ADDITIONAL_FREE_SPACE) + "px", "mark" }, "+");
PeerNodeStatus peerNodeStatus;
double peerLocation;
double peerDistance;
int histogramIndex;
int peerCount = peerNodeStatuses.length;
for (int peerIndex = 0; peerIndex < peerCount; peerIndex++) {
peerNodeStatus = peerNodeStatuses[peerIndex];
peerLocation = peerNodeStatus.getLocation();
if(!peerNodeStatus.isSearchable()) continue;
if(peerLocation < 0.0 || peerLocation > 1.0) continue;
double[] foafLocations=peerNodeStatus.getPeersLocation();
if (foafLocations!=null && peerNodeStatus.isRoutable()) {
for (double foafLocation : foafLocations) {
//one grey dot for each "Friend-of-a-friend"
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(foafLocation, false, 0.9), "disconnected" }, ".");
}
}
peerDistance = Location.distance( myLocation, peerLocation );
histogramIndex = (int) (Math.floor(peerDistance * HISTOGRAM_LENGTH * 2));
if (peerNodeStatus.isConnected()) {
histogramConnected[histogramIndex]++;
} else {
histogramDisconnected[histogramIndex]++;
}
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(peerLocation, false, (1.0 - peerNodeStatus.getPReject())), ((peerNodeStatus.isConnected())?"connected":"disconnected") }, ((peerNodeStatus.isOpennet())?"o":"x"));
}
peerCircleInfoboxContent.addChild("span", new String[] { "style", "class" }, new String[] { generatePeerCircleStyleString(myLocation, true, 1.0), "me" }, "x");
//
int histogramDiv = combinedHistogramDivisor(histogramConnected, histogramDisconnected);
double histogramPercent;