simpletoolframe.java~4~

来自「基于JAVA的电子地图程序,包括自定义地力工具制做,地图平台为MAPXTREME」· JAVA~4~ 代码 · 共 47 行

JAVA~4~
47
字号
/**
* Copyright 2000 MapInfo Corporation
* You are free to use this code in your applications, but you may not
* redistribute the source code without this notice.
*/

import javax.swing.*;
import java.awt.*;
import com.mapinfo.beans.vmapj.*;
import com.mapinfo.beans.tools.*;

/**
 * We need to create a Frame that will house the VisualMapj to display our
 * vector map data.  We also will add a MapJToolBar and then add our custom
 * built tool to it
 */
public class SimpleToolFrame extends JFrame {
	BorderLayout borderLayout1 = new BorderLayout();
  SimpleRulerMapTool simpleRulerMapTool = new SimpleRulerMapTool();
	MapToolBar mapToolBar1 = new MapToolBar();
	VisualMapJ visualMapJ1 = new VisualMapJ();

	public SimpleToolFrame() {
		super();
		try  {
			jbInit();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void jbInit() throws Exception {
		this.getContentPane().setLayout(borderLayout1);
		this.setSize(new Dimension(628, 544));
		visualMapJ1.setShowToolTips(true);
    // Add the Map tool bar control
		this.getContentPane().add(mapToolBar1, BorderLayout.NORTH);
		// Add VisualMapJ
		this.getContentPane().add(visualMapJ1, BorderLayout.CENTER);
		// Load a geoset into VMapJ
		visualMapJ1.getMapJ().loadGeoset("D:\\柳州地图\\firemap.gst", "D:\\柳州地图\\", null);
		// Add our custom Tool to the MapJ tool bar
		mapToolBar1.add(simpleRulerMapTool);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?