int i; int avgx = 0; int avgy = 0;
    protected Point getTextPoint(Projection proj) {        int i;        int avgx = 0;        int avgy = 0;        // Assuming that the rendertype is not unknown...        if (renderType == RENDERTYPE_LATLON) {            int numPoints = rawllpts.length / 2;            if (rawllpts.length < 2) {                // off screen...                handyPoint.setLocation(-10, -10);                return handyPoint;            }            if (locateAtCenter) {                handyPoint = getCenter();                // New getCenter algorithm works better.                //              for (i = 0; i < rawllpts.length; i+=2) {                //                  proj.forward(rawllpts[i], rawllpts[i+1],                //                               handyPoint, true);                //                  avgy += handyPoint.getY();                //                  avgx += handyPoint.getX();                //              }                //              avgy = avgy/numPoints;                //              avgx = avgx/numPoints;                //              handyPoint.setLocation(avgx, avgy);            } else {                if (index < 0)                    index = 0;                if (index > numPoints)                    index = numPoints - 1;                proj.forward(rawllpts[2 * index],                        rawllpts[2 * index + 1],                        handyPoint,                        true);            }        } else {            int[][] x = xpoints;            int[][] y = ypoints;            if (x[0].length < 2) {                // off screen...                handyPoint.setLocation(-10, -10);                return handyPoint;            }            if (locateAtCenter) {                handyPoint = getCenter();                // New getCenter algorithm works better.                //              for (i = 0; i < x[0].length; i++) {                //                  avgx += x[0][i];                //                  avgy += y[0][i];                //              }                //              handyPoint.setLocation(avgx/x[0].length,                // avgy/x[0].length);            } else {                if (index < 0)                    index = 0;                if (index >= x[0].length)                    index = x[0].length - 1;                handyPoint.setLocation(x[0][index], y[0][index]);            }        }        return handyPoint;    }