地图编辑器软件

  • d9_234670
    了解作者
  • 401KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 13:24
    上传日期
地图编辑器软件,二维平面地图编辑,很不错的国外软件。
地图编辑器软件.zip
内容介绍
/* * Tiled Map Editor, (c) 2004-2006 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Adam Turk <aturk@biggeruniverse.com rel='nofollow' onclick='return false;'> * Bjorn Lindeijer <b.lindeijer@xs4all.nl> */ package tiled.mapeditor; import java.awt.*; import java.awt.event.*; import java.awt.geom.Area; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Stack; import java.util.Vector; import java.util.prefs.Preferences; import java.util.prefs.PreferenceChangeEvent; import java.util.prefs.PreferenceChangeListener; import javax.imageio.ImageIO; import javax.swing.*; import javax.swing.event.*; import javax.swing.undo.UndoableEditSupport; import tiled.core.*; import tiled.io.MapHelper; import tiled.io.MapReader; import tiled.mapeditor.actions.*; import tiled.mapeditor.brush.*; import tiled.mapeditor.dialogs.*; import tiled.mapeditor.plugin.PluginClassLoader; import tiled.mapeditor.selection.SelectionLayer; import tiled.mapeditor.undo.*; import tiled.mapeditor.util.*; import tiled.mapeditor.widget.*; import tiled.util.TiledConfiguration; import tiled.view.MapView; /** * The main class for the Tiled Map Editor. * * @version $Id: MapEditor.java 689 2006-07-15 17:44:21Z bjorn $ */ public class MapEditor implements ActionListener, MouseListener, MouseMotionListener, MapChangeListener, ListSelectionListener, ChangeListener, ComponentListener { // Constants and the like private static final int PS_POINT = 0; private static final int PS_PAINT = 1; private static final int PS_ERASE = 2; private static final int PS_POUR = 3; private static final int PS_EYED = 4; private static final int PS_MARQUEE = 5; private static final int PS_MOVE = 6; private static final int PS_MOVEOBJ = 7; private static final int APP_WIDTH = 600; private static final int APP_HEIGHT = 400; private Cursor curDefault; private Cursor curPaint; private Cursor curErase; private Cursor curPour; private Cursor curEyed; private Cursor curMarquee; /** Current release version. */ public static final String version = "0.6.1"; private Map currentMap; private MapView mapView; private final UndoHandler undoHandler; private final UndoableEditSupport undoSupport; private final MapEventAdapter mapEventAdapter; private final PluginClassLoader pluginLoader; private final Preferences prefs = TiledConfiguration.root(); private int currentPointerState; private Tile currentTile; private int currentLayer = -1; private boolean bMouseIsDown, bMouseIsDragging; private SelectionLayer cursorHighlight; private Point mousePressLocation, mouseInitialPressLocation; private Point moveDist; private int mouseButton; private AbstractBrush currentBrush; private SelectionLayer marqueeSelection; private MapLayer clipboardLayer; private float relativeMidX, relativeMidY; // GUI components private JPanel mainPanel; private JPanel dataPanel; private JPanel statusBar; private JMenuBar menuBar; private JCheckBoxMenuItem gridMenuItem, boundaryMenuItem, cursorMenuItem; private JCheckBoxMenuItem coordinatesMenuItem; private JMenu recentMenu; private JScrollPane mapScrollPane; private JTable layerTable; private JList editHistoryList; private MiniMapViewer miniMap; private TileButton tilePaletteButton; private JFrame appFrame; private JSlider opacitySlider; private JLabel zoomLabel, tileCoordsLabel; private AbstractButton paintButton, eraseButton, pourButton; private AbstractButton eyedButton, marqueeButton, moveButton; private AbstractButton objectMoveButton, objectAddButton; private TilePaletteDialog tilePaletteDialog; private AboutDialog aboutDialog; private MapLayerEdit paintEdit; /** Available brushes */ private Vector brushes = new Vector(); private Brush eraserBrush; // Actions private final SaveAction saveAction; private final SaveAsAction saveAsAction; private final Action exitAction; private final Action zoomInAction, zoomOutAction, zoomNormalAction; private final Action rot90Action, rot180Action, rot270Action; private final Action flipHorAction, flipVerAction; private final Action selectAllAction, inverseAction, cancelSelectionAction; private final Action addLayerAction, cloneLayerAction, deleteLayerAction; private final Action moveLayerDownAction, moveLayerUpAction; private final Action mergeLayerDownAction, mergeAllLayersAction; private static final String TOOL_PAINT = Resources.getString("tool.paint.name"); private static final String TOOL_ERASE = Resources.getString("tool.erase.name"); private static final String TOOL_FILL = Resources.getString("tool.fill.name"); private static final String TOOL_EYE_DROPPER = Resources.getString("tool.eyedropper.name"); private static final String TOOL_SELECT = Resources.getString("tool.select.name"); private static final String TOOL_MOVE_LAYER = Resources.getString("tool.movelayer.name"); private static final String TOOL_MOVE_OBJECT = Resources.getString("tool.moveobject.name"); public MapEditor() { /* eraserBrush = new Eraser(); brushes.add(eraserBrush()); setBrush(eraserBrush); */ /* try { Image imgPaintCursor = Resources.getImage("cursor-pencil.png"); curPaint = Toolkit.getDefaultToolkit().createCustomCursor( imgPaintCursor, new Point(0,0), "paint"); } catch (Exception e) { System.out.println("Error while loading custom cursors!"); e.printStackTrace(); } */ curEyed = new Cursor(Cursor.CROSSHAIR_CURSOR); curDefault = new Cursor(Cursor.DEFAULT_CURSOR); undoHandler = new UndoHandler(this); undoSupport = new UndoableEditSupport(); undoSupport.addUndoableEditListener(undoHandler); cursorHighlight = new SelectionLayer(1, 1); cursorHighlight.select(0, 0); cursorHighlight.setVisible(prefs.getBoolean("cursorhighlight", true)); mapEventAdapter = new MapEventAdapter(); // Create the actions saveAction = new SaveAction(this); saveAsAction = new SaveAsAction(this); exitAction = new ExitAction(this, saveAction); zoomInAction = new ZoomInAction(); zoomOutAction = new ZoomOutAction(); zoomNormalAction = new ZoomNormalAction(); rot90Action = new LayerTransformAction(MapLayer.ROTATE_90); rot180Action = new LayerTransformAction(MapLayer.ROTATE_180); rot270Action = new LayerTransformAction(MapLayer.ROTATE_270); flipHorAction = new LayerTransformAction(MapLayer.MIRROR_HORIZONTAL); flipVerAction = new LayerTransformAction(MapLayer.MIRROR_VERTICAL); selectAllAction = new SelectAllAction(); cancelSelectionAction = new CancelSelectionAction(); inverseAction = new InverseSelectionAction(); addLayerAction = new AddLayerAction(this); cloneLayerAction = new CloneLayerAction(this); deleteLayerAction = new DeleteLayerAction(this); moveLayerUpAction = new MoveLayerUpAction(this); moveLayerDownAction = new MoveLayerDownAction(this); mergeLayerDownAction = new MergeLayerDownAction(this); mergeAllLayersAction = new MergeAllLayersAction(this); // Create our frame appFrame = new JFrame(Resources.getString("dialog.main.title")); appFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); appFrame.addWindowListener(n
评论
    相关推荐
    • UltraEdit编辑器
      这是一款优秀的代码编辑器,UltraEdit简洁,良好的代码风格,广泛被程序员使用。上传的资源能成功的教大家安装好UltraEdit
    • 公式编辑器
      你想快速编辑公式?公式编辑器能帮你解决这个难题,公式编辑器是快速编辑公式的利器。
    • markdown 编辑器
      markdown 编辑器 markdown 编辑器 markdown 编辑器 markdown 编辑器 markdown 编辑器 markdown 编辑器markdown 编辑器 markdown 编辑器 markdown 编辑器markdown 编辑器 markdown 编辑器 markdown 编辑器
    • 文本编辑器
      我设计的一个文本编辑器,可以修改文字的字体,颜色,以及一些菜单栏,状态栏,时间等等的设计!
    • Warkdown编辑器
      editor是一个在线编辑markdown的工具,Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式
    • 文本编辑器
      文本编辑器,非常好用,文本编辑器,非常好用,文本编辑器,非常好用,文本编辑器,非常好用,
    • 文本编辑器
      用汇编写的一个小编辑器,献给汇编爱好者,里面有源码,构建文件和exe文件-Written compiled by the editor of a small, dedicated to the compilation of lovers
    • UltraEdit 编辑器
      著名文本编辑器UltraEdit近日迎来了新版V21.20。这款功能强大的文本编辑器,而且即使开启很大的文件速度也很快。软件内置多种编辑环境,可定义所有的工具栏,支持众多格式文件编辑。同时也是一款不错的资源编辑工具...
    • 种子编辑器
      种子编辑器,有一些基础功能。种子编辑器,有一些基础功能。种子编辑器,有一些基础功能。种子编辑器,有一些基础功能。种子编辑器,有一些基础功能。
    • 编辑器
      编辑器