private void drawNodes(Graphics gs) {
        //bg.setColor(Color.white);
        //bg.fillRect(0, 0, gs.get, 5000);

        for (int i = 0; i < timeout.length; i++) {
            timeout[i]++;
        }

        if (nodes == null) {
            return;
        }

        int id = 0;
        for (Point p : nodes) {
            int i = 0;

            for (byte d : nodeRSSI[id]) {
                if (timeout[id] > 20) {
                    bg.setColor(Color.DARK_GRAY);
                } else {
                    bg.setColor(Color.green);
                }

                if (nodes[i].equals(p)) {
                    continue;
                }


                bg.drawLine(p.x, p.y, nodes[i].x, nodes[i].y);
                Point mid = getMid(p, nodes[i]);
                bg.setColor(Color.black);

                bg.drawString("Rssi " + d, mid.x, mid.y);
                i++;
            }
            if (timeout[id] > 20) {
                bg.setColor(Color.red);
            } else {
                bg.setColor(Color.green);
            }

            bg.fillOval(p.x - 4, p.y - 4, 8, 8);
            bg.setColor(Color.black);
            bg.drawString("node " + (id + 1), p.x, p.y);
            id++;

        }
        //gs.clearRect(0, 0, 5000, 5000);
        gs.drawImage(buf, 0, 25, null);
    }