import uk.ac.leeds.ccg.grids.Utilities; import uk.ac.leeds.ccg.grids.*; import uk.ac.leeds.ccg.geotools.*; import uk.ac.leeds.ccg.raster.*; import java.awt.*; /* * GridtoGam.java * * Created on 10 July 2002, 09:31 */ import java.io.File; /** * * @author andyt */ public class GamtoCircleLayer { /** Creates a new instance of GamtoGrid */ public GamtoCircleLayer() { } /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println( "GamToCircleLayer " + System.currentTimeMillis() ); String dataDirectory1 = new String( "d:/andyt/Projects/PhD/Data/Gam/Output/" ); String dataDirectory2 = new String( "d:/andyt/data/TestData/Shapefiles/" ); File gamOutputFile = new File( new String( dataDirectory1 + "accnull_popnull_e.dat" ) ); File outlineShapeFile = new File( new String( dataDirectory2 + "gb1" ) ); Utilities u = new Utilities(); Grid2DSquareCellDoubleFactory f = new Grid2DSquareCellDoubleFactory(); AbstractGrid2DSquareCellDouble grid = f.createGrid2DSquareCellDouble( 1260, 720, 0.0, 0.0, 1000.0, -9999); Frame f1 = new Frame(); Viewer v1 = new Viewer(); v1.setBackground( Color.white ); ShapefileReader sfr1 = new ShapefileReader( outlineShapeFile.toString() ); Layer pl = sfr1.readPolygons(); f1.setLayout( new BorderLayout() ); Theme t2 = new Theme ( pl ); v1.addTheme( t2 ); CircleLayer cl = u.GamOutputToCircleLayer( gamOutputFile, grid ); Theme t1 = new Theme( cl ); v1.addTheme( t1 ); f1.add( v1, "Center" ); //ToolBar tb1 = new ToolBar( v1 ); //f1.add( tb1, "South" ); f1.pack(); f1.setVisible(true); // Annonymous inner class set up for closing frame. f1.addWindowListener(new java.awt.event.WindowAdapter(){ public void windowClosing(java.awt.event.WindowEvent e){ System.exit(0); } }); } }