Commits

chunquedong committed a5c5bd7 Draft

Update chunmapSwing

Comments (0)

Files changed (10)

chunmap/buildJar.fan

       "concurrent",
       "gfx",
       "fwt",
-      "fan3dMath",
-      "array",
-      "gfx2",
-      "gfx2Imp",
-      "fan3dTouch",
+      "fgfxMath",
+      "fgfxArray",
+      "fgfx2d",
+      "fgfxFwt",
+      "fgfxWtk",
       "slanData",
       "isql",
       "slanOrm",

chunmap/ctrl/build.fan

       "chunmapData 1.0",
       "chunmapUtil 1.0",
       "slanData 1.0",
-      "array 1.0",
       "fgfxMath 1.0",
       "fgfx2d 1.0",
       "fgfxWtk 1.0",

chunmap/database/fan/DataShapeFeature.fan

 
 const class DataSchema : Schema
 {
-  new make(Str name, CField[] fields, Int idIndex := -1, Bool autoGenerateId := false)
-    : super.make(name, fields, idIndex, autoGenerateId) {}
+  new makeNew(Str name, CField[] fields, Int idIndex := -1, Bool autoGenerateId := false)
+    : super.makeNew(name, fields, idIndex, autoGenerateId) {}
 
   static new makeCopy(Schema s)
   {

chunmapx/chunmapSwing/src/chunmap/app/MapPanel.java

 
 import fan.chunmapCtrl.MapCtrl;
 import fan.chunmapCtrl.MapObserver;
-import fan.gfx.Size;
-import fan.gfx2Imp.AwtGraphics;
+import fan.fgfx2d.Size;
+import fan.fgfxWtk.AwtGraphics;
 
 /**
  * Swing panel

chunmapx/chunmapSwing/src/chunmap/example/BaseGeometryMap.java

  * @author chunquedong
  *
  */
-public abstract class BaseGeometryMap extends BaseMap{
+public abstract class BaseGeometryMap extends BaseMap {
 
   /**
    * Template method

chunmapx/chunmapSwing/src/chunmap/example/BaseMap.java

 import chunmap.app.MapPanel;
 import fan.chunmapCtrl.MapCtrl;
 import fan.chunmapCtrl.PickTool;
-import fan.gfx2Imp.Gfx2;
+import fan.fgfxWtk.ToolkitEnv;
 
 /**
  * Map UI base class
   protected PickTool tool = PickTool.make();
 
   public void init() {
-
-    // create frame
-    frame = new JFrame("Chunmap for Swing");
-    frame.setLocation(100, 100);
-    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-    frame.setSize(850, 700);
-    frame.setLayout(new FlowLayout());
-
-    // get map panel
-    final MapPanel ui = initMap();
-
-    frame.add(ui);
-    addButton();
-
-    // show frame
-    frame.setVisible(true);
+    java.awt.EventQueue.invokeLater(new Runnable() {
+      @Override
+      public void run() {
+      
+        // create frame
+        frame = new JFrame("Chunmap for Swing");
+        frame.setLocation(100, 100);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setSize(850, 700);
+        frame.setLayout(new FlowLayout());
+    
+        // get map panel
+        final MapPanel ui = initMap();
+    
+        frame.add(ui);
+        addButton();
+    
+        // show frame
+        frame.setVisible(true);
+      }
+    });
   }
 
   private MapPanel initMap() {
 
-  //set Graphics Engine
-    Gfx2.setEngine("AWT");
+    //set Graphics Engine
+    ToolkitEnv.init();
 
     MapPanel ui = new MapPanel(800, 510);
     ui.setPreferredSize(new Dimension(800, 510));

chunmapx/chunmapSwing/src/chunmap/example/ShapefileTest.java

  */
 public class ShapefileTest extends BaseMap {
   public static void main(String[] args) {
-    fanjardist.Main.main(new String[0]);
+    fanjardist.Main.main(new String[]{""});
     ShapefileTest me = new ShapefileTest();
     me.init();
   }
 
   @Override
   protected void addLayer(MapCtrl map) {
-    String path1 = "/home/yangjiandong/code/chunmap2/example/data/region.shp";
+    String path1 = "/E:/Hg/chunmapx/example/data/cntry02/cntry02.shp";
     // String path2 = "/D:/Temp/mapdata/gs/city1.shp";
     // String path3 = "/D:/Temp/mapdata/gs/river.shp";
 

chunmapx/frame/buildJar.fan

       "gfx",
       "fwt",
       "icons",
-      "fan3dMath",
-      "array",
-      "gfx2",
-      "gfx2Imp",
-      "fan3dTouch",
+      "fgfxMath",
+      "fgfxArray",
+      "fgfx2d",
+      "fgfxFwt",
+      "fgfxWtk",
       "slanData",
       "isql",
       "slanOrm",

chunmapx/frame/fan/Main.fan

 {
   static Void main(Str[] args)
   {
+    if (args.size > 0) return
     Frame().open
   }
 }
 
 Contacts
 -----
-Email: chunquedong_at_gmail_com
-QQGroup: 85369098
+Email: chunquedong_at_gmail_com