maptool.java~24~

来自「一个很有特点的地图平台,可以以动画方试展现电子地图,有拉近,拉远,滑动功能,最主」· JAVA~24~ 代码 · 共 40 行

JAVA~24~
40
字号
package mapcenter.visualmap;

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

public class MapTool extends AbstractAction{
  protected Icon originalIcon = null;
  protected Icon selectedIcon = null;
  protected Cursor cursor = null;
  protected MapView mapView = null;

  public MapTool(String origIcon,String seleIcon,String menuText,String toolTip,char acceKey) {
    super();
    this.originalIcon = new ImageIcon(getClass().getResource(origIcon));
    this.selectedIcon = new ImageIcon(getClass().getResource(seleIcon));
    this.putValue(NAME,menuText);
    this.putValue(SMALL_ICON, originalIcon);
    this.putValue(SHORT_DESCRIPTION, toolTip);
    this.putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(acceKey,
        Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    this.cursor = new Cursor(Cursor.DEFAULT_CURSOR);
  }
  //============= MapMouseListener接口实现 =============
  public void mouseEntered(MapMouseEvent e) {}
  public void mouseExited(MapMouseEvent e) {}
  public void mousePressed(MapMouseEvent e) {}
  public void mouseReleased(MapMouseEvent e) {}
  public void mouseDragged(MapMouseEvent e) {}
  public void mouseMoved(MapMouseEvent e) {}
  public void mouseClicked(MapMouseEvent e) {}
  //============= MapPainter接口实现 ===============
  public void paintOnMap(Graphics g) { }
  public void actionPerformed(ActionEvent evt){
    String toolName = (String)this.getValue(NAME);
    mapView.setCurrentTool(toolName);
  }
}

⌨️ 快捷键说明

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