if (!hideNetwork) {
FontMetrics fm = g.getFontMetrics();
int fnHeight = fm.getHeight();
int fnDescent = fm.getDescent();
for (int j = 0, mu = n.node.getLinkCount(); j < mu; j++) {
Link link = n.node.getLink(j);
if (link.node.hasLocation()) {
long age = (time - link.getLastActive()) / 100;
int x2 = link.node.getX();
int y2 = link.node.getY();
if (n.isSelected) {
if (age > LINK_COLOR.length) {
age = 100;
} else {
age -= 50;
}
}
line.setLine(x, y, x2, y2);
if (age < LINK_COLOR.length) {
g.setColor(age < 0 ? LINK_COLOR[0] : LINK_COLOR[(int) age]);
} else {
g.setColor(LINK_COLOR[LINK_COLOR.length - 1]);
}
g2d.draw(line);
// g.setColor(Color.lightGray);
int xn1, xn2, yn1, yn2;
if (x <= x2) {
xn1 = x; xn2 = x2;
yn1 = y; yn2 = y2;
} else {
xn1 = x2; xn2 = x;
yn1 = y2; yn2 = y;
}
int dx = xn1 + (xn2 - xn1) / 2 + 4;
int dy = yn1 + (yn2 - yn1) / 2 - fnDescent;
if (yn2 < yn1) {
dy += fnHeight - fnDescent;
}
g.drawString("ETX:" + (((int)(link.getETX() * 100 + 0.5)) / 100.0), dx, dy);
}
}
}
n.paint(g, x, y);