question: public synchronized boolean generate ( Projection proj ) { double upLat ; int columns = getColumns ( ) ; int rows = getRows ( ) ; super . clear ( ) ; setShape ( null ) ; if ( renderType == RENDERTYPE_LATLON ) { double rightLon ; rightLon = longitude + columns * horizontalResolution ; upLat = latitude + rows * verticalResolution ; point1 = ( Point ) proj . forward ( upLat , longitude , new Point ( ) ) ; point2 = ( Point ) proj . forward ( latitude , rightLon , new Point ( ) ) ; height = point2 . y - point1 . y ; width = point2 . x - point1 . x ; if ( Debug . debugging ( "grid" ) ) { Debug . output ( "OMGrid.generate:  height = " + height + ", width = " + width ) ; } } else if ( renderType == RENDERTYPE_XY || renderType == RENDERTYPE_OFFSET ) { width = ( int ) Math . round ( columns * horizontalResolution ) ; height = ( int ) Math . round ( rows * verticalResolution ) ; if ( renderType == RENDERTYPE_OFFSET ) { upLat = latitude + columns * verticalResolution ; point1 = ( Point ) proj . forward ( upLat , longitude , new Point ( ) ) ; point1 . x += point . x ; point1 . y += point . y ; } else { point1 = point ; } point2 = new Point ( point1 . x + width , point1 . y + height ) ; } else { return false ; } if ( Debug . debugging ( "grid" ) ) { Debug . output ( "OMGrid generated grid, at " + point1 + " and " + point2 + " with height " + height + " and width " + width ) ; } setShape ( ) ; if ( generator != null && generator . needGenerateToRender ( ) ) { add ( generator . generate ( this , proj ) ) ; } else if ( gridObjects != null ) { add ( generateGridObjects ( proj ) ) ; } setLabelLocation ( getShape ( ) , proj ) ; setNeedToRegenerate ( false ) ; return true ; }
target:  Generate OMGraphics based on the data array. If there is an OMGridGenerator, it will be used to generate OMGraphics from the data array. If not, the OMGridObjects will be used to create OMGraphics for the map.