OMGraphicList hunKLines = createEquiDistanceLines(utm, 100000); list.add(hunKLines);
if (show100kGrid) { Debug.message("utmgrid", "Creating 100k distance lines...");  OMGraphicList hunKLines = createEquiDistanceLines(utm, 100000); list.add(hunKLines); }  if (distanceGridResolution > 0) { Debug.message("utmgrid", "Creating distance lines...");  float decisionAid = 100000f/(float)Math.pow(10, distanceGridResolution);  float dglc = 30f * decisionAid;   int numberBasedForScale = (int)(p.getScale() / (2*decisionAid)); if (numberBasedForScale > 10) { numberBasedForScale = 10; }   OMGeometryList geoList = createMGRSRectangles(center, distanceGridResolution, numberBasedForScale);   if (showLabels && p.getScale() <= dglc) { Debug.message("utmgrid", "Creating labels for distance lines ...");  OMGraphicList textList = new OMGraphicList(); LatLonPoint llp = new LatLonPoint(); Point point = new Point(); Iterator it = geoList.iterator(); while (it.hasNext()) { PolygonGeometry.LL pll = (PolygonGeometry.LL)it.next(); String labelString = (String)(pll).getAppObject(); float[] ll = pll.getLatLonArray(); llp.setLatLon(ll[0], ll[1], true);  p.forward(llp, point);  double x = point.getX(); double y = point.getY(); int buffer = 20;   if ((x > -buffer || x < p.getWidth() + buffer) && (y > -buffer || y < p.getHeight() + buffer)) {  OMText label = new OMText(llp.getLatitude(), llp.getLongitude(), 4, -4, labelString, OMText.JUSTIFY_LEFT); label.setLinePaint(distanceGridPaint); textList.add(label); } } list.add(textList); }  geoList.setLinePaint(distanceGridPaint); list.add(geoList); }
    public OMGraphicList getRectangle(Projection p) {	OMGraphicList list = getList();	if (verticalList == null) {	    verticalList = createUTMZoneVerticalLines();	    horizontalList = createUTMZoneHorizontalLines();	    labelTree = createUTMZoneLabels();	}	list.clear();	list.add(verticalList);	list.add(horizontalList);	UTMPoint utm = new UTMPoint(p.getCenter());	OMGraphicList hunKLines = createEquiDistanceLines(utm, 100000);	list.add(hunKLines);	if (labelList != null) {	    labelList.clear();	} else {	    labelList = new OMGraphicList();	}	if (showLabels && p.getScale() < 33000000f) {	    Debug.message("utmgrid", "Creating labels for map...");	    LatLonPoint ul = p.getUpperLeft();	    LatLonPoint lr = p.getLowerRight();	    Vector labels = labelTree.get(ul.getLatitude(), ul.getLongitude(),					  lr.getLatitude(), lr.getLongitude());	    labelList.setTargets(labels);	    list.add(labelList);	}	list.generate(p);        return list;    } //end getRectangle