String nick = null;
JIDStatus j = Roster.getJIDStatus(jid);
if (j != null) nick = j.getNick();
if (nick == null) nick = "?";
BSJIDLabel jidLabel = new BSJIDLabel(jid, nick, getIconForPresence(0));
jidLabel.setOpaque(false);
Icon onlineIcon = getIconForPresence(Presence.AVAILABLE);
if (onlineIcon != null) {
w = onlineIcon.getIconWidth();
h = onlineIcon.getIconHeight();
}
int x = Math.round(i.getLonFloat()*newScale + newOffsetX - w/2);
int y = Math.round(i.getLatFloat()*newScale + newOffsetY - h/2);
//mainPanel.add(jidLabel, new AbsoluteConstraints(x, y, w, h));
//mainPanel.add(jidLabel, JLayeredPane.DEFAULT_LAYER, layerNum);
mainPanel.add(jidLabel, new Integer(layerNum));
jidLabel.setBounds(x + insets.left, y + insets.top, w, h);
jidLabel.addMouseListener(this);
registerJIDLabel(jidLabel);
}
// else if it's cluster
else if (o instanceof ClusterTag) {
ClusterTag c = (ClusterTag) o;