|| debug)
entities.add(entity);
if (entity instanceof MapNode) {
MapNode mNode = (MapNode) entity;
for (WayRef ref : mNode.getWayRefs()) {
MapEntity me = ref.getWay();
if (me.getName() != null || me.getAttributes().length > 0
|| debug)
entities.add(me);
}
}
boolean done = false;
for (int i = 0; i < entities.size() && !done; i++) {
MapEntity me = entities.get(i);
Object[] content = new Object[] { "", "", "" };
String text = (me.getName() != null) ? me.getName() : "";
if (debug)
text += " (" + ((me instanceof MapNode) ? "Node " : "Way ")
+ me.getId() + ")";
content[0] = text;
if (me instanceof MapNode) {
PositionPanel pos = new PositionPanel();
pos.setPosition(((MapNode) me).getLat(), ((MapNode) me)
.getLon());
pos.setEnabled(false);
content[1] = pos;
}
if (me.getAttributes().length > 0) {
EntityAttribute[] atts = me.getAttributes();
String[][] attTexts = new String[atts.length][2];
for (int j = 0; j < atts.length; j++) {
attTexts[j][0] = atts[j].getKey();
attTexts[j][1] = atts[j].getValue();
}