public void autoAddLoci(double head, double tail, double interval, String prefix) {
        if (prefix==null || prefix.trim().equals("")) {
            prefix = "";
        }
        if (head<headPos) head=headPos;
        if (tail>tailPos) tail=tailPos;
        int count = (int) (1.0 +0.01*interval+(tail-head)/interval);
        String zeroes = "0";
        if (count>=10) zeroes += "0";
        if (count>=100) zeroes += "0";
        if (count>=1000) zeroes += "0";
        DecimalFormat df = new DecimalFormat(zeroes);
        Locus loc; 
        double pos = head;
        count = 0;
        while (pos < tail+0.01*interval) {
            loc = new Locus(prefix + df.format(count), pos, null, popdata);
            try {
                addLocus(loc);
            } catch (Exception ex) {} //cannot happen
            pos += interval;
            count++;
        }
    } //autoAddLoci