[tiled] r602 - in trunk: . src/tiled/core src/tiled/io/xml src/tiled/mapeditor src/tiled/mapeditor/dialogs src/tiled/mapeditor/resources src/tiled/util

svn@biggeruniverse.com svn at biggeruniverse.com
Sun Apr 9 10:37:19 PDT 2006


Author: bjorn
Date: 2006-04-09 12:37:18 -0500 (Sun, 09 Apr 2006)
New Revision: 602

Added:
   trunk/src/tiled/mapeditor/resources/gui_de.properties
   trunk/src/tiled/mapeditor/resources/gui_it.properties
Modified:
   trunk/CHANGES
   trunk/SUGGESTIONS
   trunk/src/tiled/core/Map.java
   trunk/src/tiled/core/Tile.java
   trunk/src/tiled/core/TileSet.java
   trunk/src/tiled/io/xml/XMLMapTransformer.java
   trunk/src/tiled/io/xml/XMLMapWriter.java
   trunk/src/tiled/mapeditor/MapEditor.java
   trunk/src/tiled/mapeditor/dialogs/NewTileDialog.java
   trunk/src/tiled/mapeditor/dialogs/SearchDialog.java
   trunk/src/tiled/mapeditor/dialogs/TileDialog.java
   trunk/src/tiled/mapeditor/resources/gui.properties
   trunk/src/tiled/mapeditor/resources/gui_nl.properties
   trunk/src/tiled/util/NumberedSet.java
   trunk/src/tiled/util/Util.java
Log:
Added German and Italian language files, and did numereous cleanups.

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/CHANGES	2006-04-09 17:37:18 UTC (rev 602)
@@ -1,39 +1,37 @@
-0.6.0 - TBD (+ means planned change)
-
+UNDONE
 + Fixed memory problems when loading several maps with many tilesets in a row
-* Fixed tileset dialog so that it is now possible to change the tile height to
-  something else than the tile height used by the map.
-+ Fixed tile palette bug of displaying multiple tilesets over eachother
-* Improved usability
-+ Rewrote main mapeditor code
-* Rewrote configuration based on the Preferences class, no more tiled.conf
-+ Added a navigation minimap
-+ Added full support for animated tiles
-* Rearranged classes in packages
-+ Moved actions out of MapEditor, and created a package for them
-* Cleaned up TileSet- removed checksumming and rotation/orienation code
-* Added internationalization/localization support
-+ Added more useful visual feedback for some brushes
-+ Added the Shifted view, which emulates several tiling configurations
-+ Added "stamp" tool
 + Added ability to select multiple layers from layer table
 + Added the ability to merge tile images when layers are merged
-* Added "global properties" for tilesets (properties set for all tiles)
 + Added preview of new tileset when creating a tileset
 + Added tile cutter GUI
++ Added more useful visual feedback for some brushes
++ Added the Shifted view, which emulates several tiling configurations
++ Added "stamp" tool
++ Moved actions out of MapEditor, and created a package for them
++ Added a navigation minimap
++ Added full support for animated tiles
++ Rewrote main mapeditor code
++ Fixed tile palette bug of displaying multiple tilesets over eachother
 
-0.5.2 - (Rolled into the 0.6.0 release)
+0.6.0 - WIP
 
-* Fixed a bug when exporting a tileset with an external image
-* Fixed two cases of hanging when using the fill tool
-* Fixed tile palette bug of not accounting for gaps in tile ids (old bug)
-* Fixed bug of adding a new tile even if cancelling out of new tile dialog
-* Fixed NPE when saving a map with no extension - default to .tmx
+* Added internationalization/localization support, with translations to Dutch,
+  German and Italian.
 * Added stamp function for pencil: right-click, drag now creates a stamp
   for easy copying
 * Added core support for animated tiles
 * Added more error-checking to XMLMapTransformer, the default map reader
 * Added support for "tile cutters"
+* Added global properties for tilesets (properties set for all tiles)
+* Fixed tileset dialog so that it is now possible to change the tile height to
+  something else than the tile height used by the map.
+* Fixed a bug when exporting a tileset with an external image
+* Fixed two cases of hanging when using the fill tool
+* Fixed tile palette bug of not accounting for gaps in tile ids (old bug)
+* Fixed bug of adding a new tile even if cancelling out of new tile dialog
+* Fixed NPE when saving a map with no extension - default to .tmx
+* Rewrote configuration based on the Preferences class, no more tiled.conf
+* Cleaned up TileSet- removed checksumming and rotation/orienation code
 
 0.5.1 - June 15th, 2005
 

Modified: trunk/SUGGESTIONS
===================================================================
--- trunk/SUGGESTIONS	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/SUGGESTIONS	2006-04-09 17:37:18 UTC (rev 602)
@@ -162,12 +162,13 @@
 State:      Discussed and partly in progress.
 Problems:   * Get rid of #getNullTile in favour of actually using null. - DONE
             * Dump the whole tile image checksumming stuff in favour of
-              straightforward code and behaviour.
+              straightforward code and behaviour. - DONE
             * Do not support embedding of tilesets or tile images and neither
               multiple external individual tile images in a single tileset.
             * Remove option for XML-based layer data storage.
-            * Do not support tile image rotation or flipping.
+            * Do not support tile image rotation or flipping. - IN PROGRESS
             * Rename HexMapView to HexagonalMapView, IsoMapView to
               IsometricMapView and OrthoMapView to OrthographicMapView.
             * Remove the zoom argument from all the MapView drawing methods
               and get rid of the SmoothZoomer.
+            * Get rid of reflection used for loading maps.

Modified: trunk/src/tiled/core/Map.java
===================================================================
--- trunk/src/tiled/core/Map.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/core/Map.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -45,12 +45,12 @@
     private Vector tilesets;
     private LinkedList objects;
 
-    int tileWidth, tileHeight;
-    int totalObjects;
-    int orientation = MDO_ORTHO;
-    EventListenerList mapChangeListeners;
-    Properties properties;
-    String filename;
+    private int tileWidth, tileHeight;
+    private int totalObjects;
+    private int orientation = MDO_ORTHO;
+    private EventListenerList mapChangeListeners;
+    private Properties properties;
+    private String filename;
 
     /**
      * @param width  the map width in tiles.
@@ -58,14 +58,7 @@
      */
     public Map(int width, int height) {
         super(width, height);
-        init();
-    }
 
-    /**
-     * Internal initialization of the Map
-     *
-     */
-    private void init() {
         mapChangeListeners = new EventListenerList();
         properties = new Properties();
         tilesets = new Vector();
@@ -76,8 +69,8 @@
     /**
      * Adds a change listener. The listener will be notified when the map
      * changes in certain ways.
-     * @param l
      *
+     * @param l the change listener to add
      * @see MapChangeListener#mapChanged(MapChangedEvent)
      */
     public void addMapChangeListener(MapChangeListener l) {
@@ -128,7 +121,8 @@
     }
 
     /**
-     * Create a new empty TileLayer with the dimensions of the map. By default, the new layer's name is set to "Layer [layer index]"
+     * Create a new empty TileLayer with the dimensions of the map. By default,
+     * the new layer's name is set to "Layer [layer index]"
      *
      * @return The new TileLayer instance.
      */
@@ -228,14 +222,10 @@
         return layer;
     }
 
-    public MapLayer removeLayerSpecial(MapLayer l) {
-        try {
-            if (specialLayers.remove(l)) {
-                fireMapChanged();
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
+    public void removeLayerSpecial(MapLayer layer) {
+        if (specialLayers.remove(layer)) {
+            fireMapChanged();
         }
-        return l;
     }
 
     public void removeAllSpecialLayers() {
@@ -244,22 +234,28 @@
     }
 
     /**
-     * Calls super method, and additionally fires a MapChangedEvent.
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
      *
      * @see MultilayerPlane#removeAllLayers
      */
-
     public void removeAllLayers() {
         super.removeAllLayers();
         fireMapChanged();
     }
 
+    /**
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
+     *
+     * @see MultilayerPlane#setLayerVector
+     */
     public void setLayerVector(Vector layers) {
         super.setLayerVector(layers);
         fireMapChanged();
     }
 
     /**
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
+     *
      * @see MultilayerPlane#swapLayerUp
      */
     public void swapLayerUp(int index) throws Exception {
@@ -268,6 +264,8 @@
     }
 
     /**
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
+     *
      * @see MultilayerPlane#swapLayerDown
      */
     public void swapLayerDown(int index) throws Exception {
@@ -276,6 +274,8 @@
     }
 
     /**
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
+     *
      * @see MultilayerPlane#mergeLayerDown
      */
     public void mergeLayerDown(int index) throws Exception {
@@ -304,6 +304,8 @@
     }
 
     /**
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
+     *
      * @see MultilayerPlane#resize
      */
     public void resize(int width, int height, int dx, int dy) {

Modified: trunk/src/tiled/core/Tile.java
===================================================================
--- trunk/src/tiled/core/Tile.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/core/Tile.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -43,7 +43,7 @@
 
     /**
      * Copy constructor
-     * 
+     *
      * @param t
      */
     public Tile(Tile t) {
@@ -59,7 +59,7 @@
 
     /**
      * Sets the id of the tile as long as it is at least 0.
-     * 
+     *
      * @param i The id of the tile
      */
     public void setId(int i) {
@@ -88,7 +88,6 @@
     }
 
     /**
-     * 
      * @deprecated
      * @param orientation
      */
@@ -100,7 +99,7 @@
      * Sets the parent tileset for a tile. If the tile is already
      * a member of a set, and this method is called with a different
      * set as argument, the tile image is transferred to the new set.
-     * 
+     *
      * @param set
      */
     public void setTileSet(TileSet set) {
@@ -124,9 +123,8 @@
     }
 
     /**
-     * Returns the tile id of this tile, relative to
-     * tileset.
-     * 
+     * Returns the tile id of this tile, relative to tileset.
+     *
      * @return id
      */
     public int getId() {
@@ -134,9 +132,8 @@
     }
 
     /**
-     * Returns the global tile id by adding the
-     * tile id to the map-assigned 
-     * 
+     * Returns the global tile id by adding the tile id to the map-assigned.
+     *
      * @return id
      */
     public int getGid() {
@@ -147,8 +144,7 @@
     }
 
     /**
-     * Returns the {@link tiled.core.TileSet} that this tile is
-     * part of.
+     * Returns the {@link tiled.core.TileSet} that this tile is part of.
      *
      * @return TileSet
      */
@@ -157,9 +153,9 @@
     }
 
     /**
-     * This drawing function handles drawing the tile image at the 
-     * specified zoom level. It will attempt to use a cached copy, 
-     * but will rescale if the requested zoom does not equal the 
+     * This drawing function handles drawing the tile image at the
+     * specified zoom level. It will attempt to use a cached copy,
+     * but will rescale if the requested zoom does not equal the
      * current cache zoom.
      *
      * @param g Graphics instance to draw to
@@ -196,7 +192,7 @@
     /**
      * Draws the tile at the given pixel coordinates in the given
      * graphics context, and at the given zoom level
-     * 
+     *
      * @param g
      * @param x
      * @param y
@@ -257,7 +253,7 @@
 
     /**
      * Returns a scaled instance of the tile image.
-     * 
+     *
      * @param zoom
      * @return Image
      */

Modified: trunk/src/tiled/core/TileSet.java
===================================================================
--- trunk/src/tiled/core/TileSet.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/core/TileSet.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -29,10 +29,11 @@
  * <p>TileSet handles operations on tiles as a set, or group. It has several
  * advanced internal functions aimed at reducing unnecessary data replication.
  * A 'tile' is represented internally as two distinct pieces of data. The
- * first and most important is a tiled.core.Tile object, and these are held in
- * a java.util.Vector.</p><br/>
- * <p> The other is the tile image.</p>
- * 
+ * first and most important is a {@link Tile} object, and these are held in
+ * a {@link java.util.Vector}.</p>
+ *
+ * <p>The other is the tile image.</p>
+ *
  * @version $Id$
  */
 public class TileSet
@@ -45,8 +46,8 @@
     private String name;
     private Color transparentColor;
     private Properties defaultTileProperties;
-    private Image tileSetImage; 
-    
+    private Image tileSetImage;
+
     /**
      * Default constructor
      */
@@ -59,7 +60,7 @@
 
     /**
      * Creates a tileset from a tile bitmap file.
-     * 
+     *
      * @param imgFilename
      * @param cutter
      * @param createTiles
@@ -77,7 +78,7 @@
         }
 
         System.out.println("Importing " + imgFilename + "...");
-        
+
         importTileBitmap(ImageIO.read(imgFile.toURL()), cutter, createTiles);
     }
 
@@ -96,20 +97,18 @@
             throw new Exception("Failed to load " + tilebmpFile);
         }
 
-        if(cutter == null) {
+        if (cutter == null) {
         	throw new Exception("No cutter!");
         }
-        
+
         tileDimensions = new Rectangle(cutter.getDimensions());
-        
         tileSetImage = tilebmp;
-        
-        BufferedImage tile;
-        
+
         cutter.setImage(tilebmp);
-        
+
         try {
-	        while((tile = (BufferedImage) cutter.getNextTile()) != null) {
+            BufferedImage tile;
+	        while ((tile = (BufferedImage) cutter.getNextTile()) != null) {
 	        	int newId = addImage(tile);
 	        	if (createTiles) {
                     Tile newTile = new Tile();
@@ -117,7 +116,7 @@
                     addNewTile(newTile);
                 }
 	        }
-        } catch(Exception e) {
+        } catch (Exception e) {
         	e.printStackTrace();
         }
 
@@ -174,7 +173,7 @@
     /**
      * Sets the filename of the tileset image. Doesn't change the tileset in
      * any other way.
-     * 
+     *
      * @param name
      */
     public void setTilesetImageFilename(String name) {
@@ -201,7 +200,7 @@
 
     /**
      * Sets the transparent color in the tileset image.
-     * 
+     *
      * @param color
      */
     public void setTransparentColor(Color color) {
@@ -219,7 +218,7 @@
         if (t.getId() < 0) {
             t.setId(tiles.getMaxId());
         }
-        
+
         if (tileDimensions.height < t.getHeight()) {
         	tileDimensions.height = t.getHeight();
         }
@@ -227,12 +226,12 @@
         if (tileDimensions.width < t.getWidth()) {
         	tileDimensions.width = t.getWidth();
         }
-        
-        //add any default properties
+
+        // Add any default properties
+        // todo: use parent properties instead?
         t.getProperties().putAll(defaultTileProperties);
-        
+
         tiles.put(t.getId(), t);
-        //System.out.println("adding tile " +t.getId());
         t.setTileSet(this);
 
         return t.getId();
@@ -293,7 +292,7 @@
      * Returns the width of tiles in this tileset. All tiles in a tileset
      * should be the same width, and the same as the tile width of the map the
      * tileset is used with.
-     * 
+     *
      * @return int - The maximum tile width
      */
     public int getTileWidth() {
@@ -307,21 +306,22 @@
      *
      * If there are tiles with varying heights in this tileset, the returned
      * height will be the maximum.
-     * 
-     * @return int - The max height of the tiles in the set
+     *
+     * @return the max height of the tiles in the set
      */
     public int getTileHeight() {
         return tileDimensions.height;
     }
 
     /**
-     * @deprecated
-     * @return int
+     * Returns the spacing between the tiles on the tileset image.
+     * @return the spacing in pixels between the tiles on the tileset image
      */
-    public int getMaxTileHeight() {
-    	return getTileHeight();
+    public int getTileSpacing() {
+        // todo: make this functional
+        return 0;
     }
-    
+
     /**
      * Gets the tile with <b>local</b> id <code>i</code>.
      *
@@ -399,7 +399,7 @@
     /**
      * Returns the transparent color of the tileset image, or <code>null</code>
      * if none is set.
-     * 
+     *
      * @return Color - The transparent color of the set
      */
     public Color getTransparentColor() {
@@ -452,32 +452,14 @@
      * @param id
      * @return the image identified by the key, or <code>null</code> when
      *         there is no such image
-     * @see TileSet#getImageByIdAndOrientation(Object, int)
      */
     public Image getImageById(int id) {
         return (Image) images.get(id);
     }
 
     /**
-     * Returns the image referred to by the given key, and automatically
-     * sets it to the given orientation.
-     * 
-     * @deprecated
-     * @param key
-     * @param orientation
-     * @return Image
-     */
-    public Image getImageByIdAndOrientation(Object key, int orientation) {
-        /*int img_id = Integer.parseInt((String)key);
-        ImageGroup img = (ImageGroup)images.get(img_id);
-        if (img == null) return null;
-        return img.getImage(orientation);*/
-    	return null;
-    }
-
-    /**
      * Overlays the image in the set referred to by the given key.
-     * 
+     *
      * @param id
      * @param i
      */
@@ -517,16 +499,17 @@
     public int addImage(Image image, int id) {
         return images.put(id, image);
     }
-    
+
     public void removeImage(int id) {
         images.remove(id);
     }
 
     /**
-     * @return boolean 
+     * Returns whether the tileset is derived from a tileset image.
+     *
+     * @return tileSetImage != null
      */
     public boolean isSetFromImage() {
-        // TODO: Currently only uses shared sets...
         return tileSetImage != null;
     }
 
@@ -541,15 +524,16 @@
         Iterator itr = iterator();
 
         //[ATURK] I don't think that this check makes complete sense...
-        /*while (itr.hasNext()) {
+        /*
+        while (itr.hasNext()) {
             Tile t = (Tile)itr.next();
             if (t.countAnimationFrames() != 1 || t.getImageId() != t.getId()
                     || t.getImageOrientation() != 0) {
                 return false;
             }
-        }*/
+        }
+        */
 
-
         for (int id = 0; id <= images.getMaxId(); ++id) {
             int relations = 0;
             itr = iterator();

Modified: trunk/src/tiled/io/xml/XMLMapTransformer.java
===================================================================
--- trunk/src/tiled/io/xml/XMLMapTransformer.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/io/xml/XMLMapTransformer.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -118,7 +118,7 @@
         }
     }
 
-    private String getAttributeValue(Node node, String attribname) {
+    private static String getAttributeValue(Node node, String attribname) {
         NamedNodeMap attributes = node.getAttributes();
         String att = null;
         if (attributes != null) {
@@ -130,7 +130,7 @@
         return att;
     }
 
-    private int getAttribute(Node node, String attribname, int def) {
+    private static int getAttribute(Node node, String attribname, int def) {
         String attr = getAttributeValue(node, attribname);
         if (attr != null) {
             return Integer.parseInt(attr);
@@ -226,7 +226,7 @@
 
         return img;
     }
-    
+
     private TileSet unmarshalTilesetFile(InputStream in, String filename)
         throws Exception
     {
@@ -354,8 +354,8 @@
                         }
 
                         if (transStr != null) {
-                        	//in this case, the tileset image needs special handling for
-                        	//transparency
+                            // In this case, the tileset image needs special
+                            // handling for transparency
                             Color color = new Color(
                                     Integer.parseInt(transStr, 16));
                             Toolkit tk = Toolkit.getDefaultToolkit();
@@ -372,17 +372,19 @@
 
                                 img.getGraphics().drawImage(trans, 0, 0, null);
 
-                                set.importTileBitmap(img, new BasicTileCutter( 
+                                set.importTileBitmap(img, new BasicTileCutter(
                                             tileWidth, tileHeight, tileSpacing, 0),
                                         !hasTileElements);
 
                                 set.setTransparentColor(color);
                                 set.setTilesetImageFilename(sourcePath);
                             } catch (IIOException iioe) {
-                                warnings.push("ERROR: "+iioe.getLocalizedMessage()+" ("+sourcePath+")");
+                                warnings.push("ERROR: " +
+                                        iioe.getLocalizedMessage() + " (" +
+                                        sourcePath + ")");
                             }
                         } else {
-                            set.importTileBitmap(sourcePath, new BasicTileCutter( 
+                            set.importTileBitmap(sourcePath, new BasicTileCutter(
                                     tileWidth, tileHeight, tileSpacing, 0), !hasTileElements);
                         }
 
@@ -403,6 +405,7 @@
             obj = (MapObject)unmarshalClass(MapObject.class, t);
         } catch (Exception e) {
             e.printStackTrace();
+            return obj;
         }
 
         Properties objProps = obj.getProperties();
@@ -411,7 +414,8 @@
         for (int i = 0; i < children.getLength(); i++) {
             Node child = children.item(i);
             if (child.getNodeName().equalsIgnoreCase("property")) {
-                objProps.setProperty(getAttributeValue(child, "name"),
+                objProps.setProperty(
+                        getAttributeValue(child, "name"),
                         getAttributeValue(child, "value"));
             }
         }
@@ -434,13 +438,14 @@
         }
 
         try {
-            if(isAnimated) {
+            if (isAnimated) {
                 tile = (Tile)unmarshalClass(AnimatedTile.class, t);
             } else {
                 tile = (Tile)unmarshalClass(Tile.class, t);
             }
         } catch (Exception e) {
             e.printStackTrace();
+            return tile;
         }
 
         tile.setTileSet(set);
@@ -454,26 +459,11 @@
                     id = set.addImage(unmarshalImage(child, baseDir));
                 }
                 tile.setImage(id);
-                int rotation = getAttribute(child, "rotation", 0);
-                String flipped_s = getAttributeValue(child, "flipped");
-                boolean flipped = (flipped_s != null
-                    && flipped_s.equalsIgnoreCase("true"));
-                int orientation;
-                if (rotation == 90) {
-                    orientation = flipped ? 6 : 4;
-                } else if (rotation == 180) {
-                    orientation = flipped ? 2 : 3;
-                } else if (rotation == 270) {
-                    orientation = flipped ? 5 : 7;
-                } else {
-                    orientation = flipped ? 1 : 0;
-                }
-                tile.setImageOrientation(orientation);
             } else if (child.getNodeName().equalsIgnoreCase("property")) {
                 tileProps.setProperty(getAttributeValue(child, "name"),
                         getAttributeValue(child, "value"));
             } else if (child.getNodeName().equalsIgnoreCase("animation")) {
-                //TODO: fill this in once XMLMapWriter is complete
+                // TODO: fill this in once XMLMapWriter is complete
             }
         }
 
@@ -486,6 +476,7 @@
             og = (ObjectGroup)unmarshalClass(ObjectGroup.class, t);
         } catch (Exception e) {
             e.printStackTrace();
+            return og;
         }
 
         //Read all objects from the group, "...and in the darkness bind them."

Modified: trunk/src/tiled/io/xml/XMLMapWriter.java
===================================================================
--- trunk/src/tiled/io/xml/XMLMapWriter.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/io/xml/XMLMapWriter.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -205,7 +205,11 @@
             if (tilebmpFile != null) {
                 w.writeAttribute("tilewidth", set.getTileWidth());
                 w.writeAttribute("tileheight", set.getTileHeight());
-                //w.writeAttribute("spacing", "0");
+
+                int tileSpacing = set.getTileSpacing();
+                if (tileSpacing != 0) {
+                    w.writeAttribute("spacing", tileSpacing);
+                }
             }
 
             if (set.getBaseDir() != null) {
@@ -458,17 +462,6 @@
                 } else if (tileSetImages) {
                     w.startElement("image");
                     w.writeAttribute("id", tile.getImageId());
-                    int orientation = tile.getImageOrientation();
-                    int rotation;
-                    boolean flipped =
-                            (orientation & 1) == (orientation & 2) >> 1;
-                    if ((orientation & 4) == 4) {
-                        rotation = (orientation & 1) == 1 ? 270 : 90;
-                    } else {
-                        rotation = (orientation & 2) == 2 ? 180 : 0;
-                    }
-                    if (rotation != 0) w.writeAttribute("rotation", rotation);
-                    if (flipped) w.writeAttribute("flipped", "true");
                     w.endElement();
                 } else {
                     String prefix = prefs.get("tileImagePrefix", "tile");

Modified: trunk/src/tiled/mapeditor/MapEditor.java
===================================================================
--- trunk/src/tiled/mapeditor/MapEditor.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/MapEditor.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -38,7 +38,6 @@
 import tiled.mapeditor.undo.*;
 import tiled.util.TileMergeHelper;
 import tiled.util.TiledConfiguration;
-import tiled.util.Util;
 import tiled.io.MapHelper;
 import tiled.io.MapReader;
 import tiled.io.MapWriter;
@@ -142,7 +141,6 @@
     final Action undoAction, redoAction;
     final Action rot90Action, rot180Action, rot270Action;
     final Action flipHorAction, flipVerAction;
-    final Action copyAction, cutAction, pasteAction;
     final Action selectAllAction, inverseAction, cancelSelectionAction;
 
     public MapEditor() {
@@ -191,9 +189,6 @@
         rot270Action = new LayerTransformAction(MapLayer.ROTATE_270);
         flipHorAction = new LayerTransformAction(MapLayer.MIRROR_HORIZONTAL);
         flipVerAction = new LayerTransformAction(MapLayer.MIRROR_VERTICAL);
-        copyAction = new CopyAction();
-        pasteAction = new PasteAction();
-        cutAction = new CutAction();
         selectAllAction = new SelectAllAction();
         cancelSelectionAction = new CancelSelectionAction();
         inverseAction = new InverseSelectionAction();
@@ -303,9 +298,9 @@
         undoMenuItem.setEnabled(false);
         redoMenuItem.setEnabled(false);
 
-        copyMenuItem = new TMenuItem(copyAction);
-        cutMenuItem = new TMenuItem(cutAction);
-        pasteMenuItem = new TMenuItem(pasteAction);
+        copyMenuItem = new TMenuItem(new CopyAction());
+        cutMenuItem = new TMenuItem(new CutAction());
+        pasteMenuItem = new TMenuItem(new PasteAction());
         copyMenuItem.setEnabled(false);
         cutMenuItem.setEnabled(false);
         pasteMenuItem.setEnabled(false);
@@ -851,8 +846,10 @@
             setCurrentLayer(0);
         }
 
-        undoSupport.postEdit(new MapLayerStateEdit(currentMap, layersBefore,
-                    new Vector(currentMap.getLayerVector()), command));
+        MapLayerStateEdit mapLayerStateEdit = new MapLayerStateEdit(
+                currentMap, layersBefore,
+                new Vector(currentMap.getLayerVector()), command);
+        undoSupport.postEdit(mapLayerStateEdit);
     }
 
     private void doMouse(MouseEvent event) {
@@ -1058,7 +1055,7 @@
             Rectangle oldArea = null;
 
             if (currentBrush instanceof CustomBrush) {
-                oldArea = ((CustomBrush)currentBrush).getBounds();
+                oldArea = currentBrush.getBounds();
             }
 
             Rectangle bounds = new Rectangle(
@@ -1759,16 +1756,16 @@
      *         an error occured
      */
     public boolean loadMap(String file) {
-    	
+
     	File exist = new File(file);
         if (!exist.exists()) {
         	JOptionPane.showMessageDialog(appFrame,
-        			Resources.getString("general.file.notexists.message"), 
+        			Resources.getString("general.file.notexists.message"),
 					Resources.getString("dialog.openmap.error.title"),
                     JOptionPane.ERROR_MESSAGE);
         	return false;
         }
-    	
+
         try {
             Map m = MapHelper.loadMap(file);
 
@@ -1780,7 +1777,7 @@
                 return true;
             } else {
                 JOptionPane.showMessageDialog(appFrame,
-                        "Unsupported map format", 
+                        "Unsupported map format",
 						Resources.getString("dialog.openmap.error.title"),
                         JOptionPane.ERROR_MESSAGE);
             }
@@ -1808,21 +1805,21 @@
      *                 a "Save As" dialog.
      */
     public void saveMap(String filename, boolean bSaveAs) {
-    	
+
     	TiledFileFilter saver = new TiledFileFilter(TiledFileFilter.FILTER_EXT);
     	JFileChooser ch = null;
-    	
+
     	try {
 	    	while(true) {
 		        if (bSaveAs || filename == null) {
-		
+
 		        	if(ch == null) {
 			            if (filename == null) {
 			                ch = new JFileChooser();
 			            } else {
 			                ch = new JFileChooser(filename);
 			            }
-			
+
 			            MapWriter[] writers = pluginLoader.getWriters();
 			            for(int i = 0; i < writers.length; i++) {
 			                try {
@@ -1831,13 +1828,13 @@
 			                    e.printStackTrace();
 			                }
 			            }
-			
+
 			            ch.addChoosableFileFilter(
 			                    new TiledFileFilter(TiledFileFilter.FILTER_TMX));
-			
+
 			            ch.addChoosableFileFilter(saver);
 		        	}
-		        	
+
 		            if (ch.showSaveDialog(appFrame) == JFileChooser.APPROVE_OPTION) {
 		                filename = ch.getSelectedFile().getAbsolutePath();
 		                saver = (TiledFileFilter) ch.getFileFilter();
@@ -1845,12 +1842,12 @@
 		                // User cancelled operation, do nothing
 		                return;
 		            }
-		            
+
 		            // Don't let users be tricky (no foo. files)
 		            if(filename.substring(filename.lastIndexOf('.')+1).length() == 0) {
 		            	filename = filename.substring(0,filename.lastIndexOf('.'));
 		            }
-		            
+
 		            // Make sure that the file has an extension. If not, append extension
 		            // chosen from dropdown.
 		            // NOTE: we can't know anything more than the filename has at least
@@ -1861,25 +1858,25 @@
 		            		JOptionPane.showMessageDialog(appFrame, Resources.getString("dialog.saveas.unknown-type.message"));
 		            		continue;
 		            	}
-		            	
+
 		            	//we will also be lazy about picking a valid extention...
 		            	filename = filename.concat("."+saver.getFirstExtention());
 		            }
 		        }
-		        
-		        
+
+
 	            // Check if file exists
 	            File exist = new File(filename);
 	            if (exist.exists() && bSaveAs) {
 	                int result = JOptionPane.showConfirmDialog(appFrame,
-	                        Resources.getString("general.file.exists.message"), 
+	                        Resources.getString("general.file.exists.message"),
 	                        Resources.getString("general.file.exists.title"),
 	                        JOptionPane.YES_NO_OPTION);
 	                if (result != JOptionPane.OK_OPTION) {
 	                    continue;
 	                }
 	            }
-	            
+
 	            // Do we want to just go by extention?
 	            if(saver.getType() == TiledFileFilter.FILTER_EXT) {
 	            	MapHelper.saveMap(currentMap, filename);
@@ -1895,10 +1892,10 @@
 		                    continue;
 		                }
 	                }
-	                
+
 	                MapHelper.saveMap(currentMap, saver.getPlugin(), filename);
 	            }
-	            
+
 	            // If we make it to the bottom, the user and Tiled have agreed on something,
 	            // and the file was saved successfully. Update UI.
 	            currentMap.setFilename(filename);
@@ -2203,15 +2200,14 @@
         MapEditor editor = new MapEditor();
 
         if (args.length > 0) {
-            String toLoad = args[0];
-            if (!Util.checkRoot(toLoad) || toLoad.startsWith(".")) {
-                if (toLoad.startsWith(".")) {
-                    toLoad = toLoad.substring(1);
-                }
-                toLoad = System.getProperty("user.dir") +
-                    File.separatorChar + toLoad;
+            File file = new File(args[0]);
+
+            try {
+                editor.loadMap(file.getCanonicalPath());
             }
-            editor.loadMap(toLoad);
+            catch (IOException e) {
+                e.printStackTrace();
+            }
         }
     }
 }

Modified: trunk/src/tiled/mapeditor/dialogs/NewTileDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/NewTileDialog.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/dialogs/NewTileDialog.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -16,6 +16,7 @@
 import java.awt.event.*;
 import java.awt.image.BufferedImage;
 import java.io.File;
+import java.io.IOException;
 
 import javax.imageio.ImageIO;
 
@@ -23,33 +24,36 @@
 
 import tiled.core.*;
 
-public class NewTileDialog extends JDialog implements ActionListener {
-
+/**
+ * $Id$
+ */
+public class NewTileDialog extends JDialog implements ActionListener
+{
 	private TileSet tileset;
-	private Tile currentTile=null;
+	private Tile currentTile;
 	private String location;
-	
+
 	private JButton bAddTiles, bCancel;
-	
+
 	public NewTileDialog(Dialog parent, TileSet set) {
 		super(parent, "New Tile", true);
 		tileset = set;
 		location = "";
-		
+
 		init();
 		pack();
 		setLocationRelativeTo(getOwner());
 	}
-	
+
 	private void init() {
-		
+
 	}
-	
+
 	public Tile createTile() {
 		setVisible(true);
 		return currentTile;
 	}
-	
+
 	private void pickImage() {
 		if (tileset.isSetFromImage()) {
             TileImageDialog d = new TileImageDialog(this, tileset);
@@ -61,7 +65,7 @@
             return;
         }
 
-        File files[];
+        File[] files;
         JFileChooser ch = new JFileChooser(location);
         ch.setMultiSelectionEnabled(true);
         BufferedImage image = null;
@@ -69,31 +73,30 @@
         int ret = ch.showOpenDialog(this);
         if(ret == JFileChooser.APPROVE_OPTION) {
 		    files = ch.getSelectedFiles();
-		
+
 		    for (int i = 0; i < files.length; i++) {
 		        try {
 		            image = ImageIO.read(files[i]);
 		            // TODO: Support for a transparent color
-		        } catch (Exception e) {
+		        } catch (IOException e) {
 		            JOptionPane.showMessageDialog(this, e.getLocalizedMessage(),
 		                    "Error!", JOptionPane.ERROR_MESSAGE);
 		            return;
 		        }
-		
+
 		        Tile newTile = new Tile(tileset);
 		        newTile.setImage(image);
 		        tileset.addNewTile(newTile);
 		    }
-		
+
 		    if (files.length > 0) {
 		        location = files[0].getAbsolutePath();
 		    }
-		
+
         }
 	}
-		
+
 	public void actionPerformed(ActionEvent e) {
 		// TODO Auto-generated method stub
-
 	}
 }


Property changes on: trunk/src/tiled/mapeditor/dialogs/NewTileDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/src/tiled/mapeditor/dialogs/SearchDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/SearchDialog.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/dialogs/SearchDialog.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -29,7 +29,7 @@
  */
 public class SearchDialog extends JDialog implements ActionListener
 {
-    private final Map myMap;
+    private final Map map;
     private JComboBox searchCBox, replaceCBox;
     private Point currentMatch;
     private SelectionLayer sl;
@@ -41,7 +41,7 @@
 
     public SearchDialog(JFrame parent, Map map) {
         super(parent, "Search/Replace", false);
-        myMap = map;
+        this.map = map;
         init();
         setLocationRelativeTo(parent);
     }
@@ -127,7 +127,7 @@
     }
 
     private void queryTiles(JComboBox b) {
-        final Vector sets = myMap.getTilesets();
+        final Vector sets = map.getTilesets();
         final Iterator itr = sets.iterator();
 
         while (itr.hasNext()) {
@@ -146,7 +146,7 @@
         String command = e.getActionCommand();
 
         if (command.equalsIgnoreCase("close")) {
-            myMap.removeLayerSpecial(sl);
+            map.removeLayerSpecial(sl);
             dispose();
         } else if (command.equalsIgnoreCase("find")) {
             if (searchCBox.getSelectedItem() instanceof Tile) {
@@ -154,11 +154,11 @@
             }
         } else if (command.equalsIgnoreCase("find all")) {
             if (sl != null) {
-                myMap.removeLayerSpecial(sl);
+                map.removeLayerSpecial(sl);
             }
 
-            sl = new SelectionLayer(myMap.getWidth(), myMap.getHeight());
-            final Iterator itr = myMap.getLayers();
+            sl = new SelectionLayer(map.getWidth(), map.getHeight());
+            final Iterator itr = map.getLayers();
             while (itr.hasNext()) {
                 MapLayer layer = (MapLayer) itr.next();
                 if (layer instanceof TileLayer) {
@@ -172,8 +172,8 @@
                     }
                 }
             }
-            myMap.addLayerSpecial(sl);
-            myMap.touch();
+            map.addLayerSpecial(sl);
+            map.touch();
 
         } else if (command.equalsIgnoreCase("replace all")) {
             if (!(searchCBox.getSelectedItem() instanceof TileSet) && !(replaceCBox.getSelectedItem() instanceof TileSet))
@@ -186,7 +186,7 @@
 
                 // run through the layers, look for the first instance of the
                 // tile we need to replace
-                final Iterator itr = myMap.getLayers();
+                final Iterator itr = map.getLayers();
                 while (itr.hasNext()) {
                     MapLayer layer = (MapLayer) itr.next();
                     if (layer instanceof TileLayer) {
@@ -206,33 +206,33 @@
 
     private void replaceAll(Tile f, Tile r) {
         // TODO: Allow for "scopes" of one or more layers, rather than all layers
-        final Iterator itr = myMap.getLayers();
+        final Iterator itr = map.getLayers();
         while (itr.hasNext()) {
             MapLayer layer = (MapLayer) itr.next();
             if (layer instanceof TileLayer) {
                 ((TileLayer)layer).replaceTile(f,r);
             }
         }
-        myMap.touch();
+        map.touch();
     }
 
     private void find(Tile f) {
         boolean bFound = false;
 
         if (sl != null) {
-            myMap.removeLayerSpecial(sl);
-            myMap.touch();
+            map.removeLayerSpecial(sl);
+            map.touch();
         }
 
-        sl = new SelectionLayer(myMap.getWidth(), myMap.getHeight());
+        sl = new SelectionLayer(map.getWidth(), map.getHeight());
 
 
         int startx = currentMatch == null ? 0 : currentMatch.x;
         int starty = currentMatch == null ? 0 : currentMatch.y;
 
-        for (int y = starty; y < myMap.getHeight() && !bFound; y++) {
-            for (int x = startx; x < myMap.getWidth() && !bFound; x++) {
-                final Iterator itr = myMap.getLayers();
+        for (int y = starty; y < map.getHeight() && !bFound; y++) {
+            for (int x = startx; x < map.getWidth() && !bFound; x++) {
+                final Iterator itr = map.getLayers();
                 while (itr.hasNext()) {
                     MapLayer layer = (MapLayer) itr.next();
 
@@ -256,8 +256,8 @@
         }
 
         if (bFound) {
-            myMap.addLayerSpecial(sl);
-            myMap.touch();
+            map.addLayerSpecial(sl);
+            map.touch();
         }
     }
 }

Modified: trunk/src/tiled/mapeditor/dialogs/TileDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/TileDialog.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/dialogs/TileDialog.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -65,9 +65,9 @@
     private static final String TILES_TAB = Resources.getString("general.tile.tiles");
     private static final String TILESET_TAB = Resources.getString("general.tile.tileset");
     private static final String NAME_LABEL = Resources.getString("dialog.newtileset.name.label");
-    
+
     /* -- */
-    
+
     public TileDialog(Dialog parent, TileSet s, Map m) {
         super(parent, DIALOG_TITLE + " '" + s.getName() + "'", true);
         location = "";
@@ -88,13 +88,13 @@
         duplicateTileButton = new JButton(DUPLICATE_BUTTON);
         newTileButton = new JButton(NEW_BUTTON);
         animationButton = new JButton(ANIMATION_BUTTON);
-        
+
         deleteTileButton.addActionListener(this);
         changeImageButton.addActionListener(this);
         duplicateTileButton.addActionListener(this);
         newTileButton.addActionListener(this);
         animationButton.addActionListener(this);
-        
+
         tileList = new JList();
         tileList.setCellRenderer(new TileDialogListRenderer());
 
@@ -153,7 +153,7 @@
         mainPanel.add(splitPane, c);
         c.weightx = 0; c.weighty = 0; c.gridy = 1;
         mainPanel.add(buttons, c);
-        
+
         return mainPanel;
     }
 
@@ -233,8 +233,8 @@
 
         getContentPane().add(mainPanel);
         getRootPane().setDefaultButton(okButton);
-        
-        //create actionlisteners
+
+        // Create actionlisteners
         okButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent actionEvent) {
             	tileset.setName(tilesetNameEntry.getText());
@@ -493,14 +493,14 @@
         else if (source == createTileButton) {
         	Image img = (Image)imageList.getSelectedValue();
         	Tile n = new Tile(tileset);
-        	
+
         	n.setImage(tileset.getIdByImage(img));
         	tileset.addNewTile(n);
         	queryTiles();
             // Select the last (cloned) tile
             tileList.setSelectedIndex(tileset.size() - 1);
             tileList.ensureIndexIsVisible(tileset.size() - 1);
-            JOptionPane.showMessageDialog(this, 
+            JOptionPane.showMessageDialog(this,
             		"Tile created with id "+n.getId(),
             		"Created Tile",
             		JOptionPane.INFORMATION_MESSAGE);

Modified: trunk/src/tiled/mapeditor/resources/gui.properties
===================================================================
--- trunk/src/tiled/mapeditor/resources/gui.properties	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/resources/gui.properties	2006-04-09 17:37:18 UTC (rev 602)
@@ -17,6 +17,7 @@
 dialog.newmap.title=New Map
 dialog.newmap.width.label=Width:
 dialog.newtileset.autotiles.label=Automatically create tiles from images
+dialog.newtileset.button.properties=Set Default Properties...
 dialog.newtileset.colorchoose.error.title=Error while choosing color
 dialog.newtileset.fromtilesetimg.title=From tileset image
 dialog.newtileset.image.label=Tile image:
@@ -29,21 +30,18 @@
 dialog.newtileset.tilewidth.label=Tile width:
 dialog.newtileset.title=New Tileset
 dialog.newtileset.usetransparentcolor.label=Use transparent color
-dialog.newtileset.button.properties=Set Default Properties...
-dialog.tile.title=Edit Tileset
-dialog.tile.button.newtile=Add Tile
-dialog.tile.button.deletetile=Delete Tile
-dialog.tile.button.changeimage=Change Image
-dialog.tile.button.duptile=Duplicate Tile
-dialog.tile.button.animation=Animation
-dialog.tile.button.createtile=Create Tile
-dialog.tile.imgload.error.message=Error while loading image:
-dialog.tile.imgload.error.title=Error while loading image
-dialog.tileimage.title=Choose Tile Image
+dialog.openmap.error.title=Error while opening map file
 dialog.plugins.info.button=Info
 dialog.plugins.remove.button=Remove
 dialog.plugins.title=Available Plugins
 dialog.preferences.title=Preferences
+dialog.properties.column.name=Name
+dialog.properties.column.value=Value
+dialog.properties.default.title=Default Properties
+dialog.properties.layer.title=Layer Properties
+dialog.properties.map.title=Map Properties
+dialog.properties.tileset.title=Tileset Properties
+dialog.properties.title=Properties
 dialog.resizemap.currentsize.title=Current size
 dialog.resizemap.height.label=Height:
 dialog.resizemap.newsize.title=New size
@@ -52,35 +50,37 @@
 dialog.resizemap.width.label=Width:
 dialog.resizemap.x.label=X:
 dialog.resizemap.y.label=Y:
-dialog.openmap.error.title=Error while opening map file
 dialog.saveas.confirm.mismatch=The file extension does not match the plugin. Do you wish to continue?
 dialog.saveas.error.message=Error while attempting to save
+dialog.saveas.error.title=Error while saving map
 dialog.saveas.unknown-type.message=Save failed, unknown type
-dialog.saveas.error.title=Error while saving map
-dialog.properties.title=Properties
-dialog.properties.map.title=Map Properties
-dialog.properties.default.title=Default Properties
-dialog.properties.tileset.title=Tileset Properties
-dialog.properties.layer.title=Layer Properties
-dialog.properties.column.name=Name
-dialog.properties.column.value=Value
+dialog.tile.button.animation=Animation
+dialog.tile.button.changeimage=Change Image
+dialog.tile.button.createtile=Create Tile
+dialog.tile.button.deletetile=Delete Tile
+dialog.tile.button.duptile=Duplicate Tile
+dialog.tile.button.newtile=Add Tile
+dialog.tile.imgload.error.message=Error while loading image:
+dialog.tile.imgload.error.title=Error while loading image
+dialog.tile.title=Edit Tileset
+dialog.tileimage.title=Choose Tile Image
 dialog.tilepalette.title=Palette
 general.button.browse=Browse...
 general.button.cancel=Cancel
 general.button.close=Close
+general.button.delete=Delete
 general.button.ok=OK
 general.button.preview=Preview...
-general.button.delete=Delete
+general.file.exists.message=The file already exists. Do you wish to overwrite it?
 general.file.exists.title=Overwrite file?
-general.file.exists.message=The file already exists. Do you wish to overwrite it?
 general.file.notexists.message=File does not exist
 general.file.untitled=Untitled
-general.tile.tile=Tile
-general.tile.tiles=Tiles
-general.tile.tileset=Tileset
-general.tile.notile=(No Tile)
 general.maptype.hexagonal=Hexagonal (experimental)
 general.maptype.isometric=Isometric
 general.maptype.oblique=Oblique
 general.maptype.orthogonal=Orthogonal
 general.maptype.shifted=Shifted (iso and hex)
+general.tile.notile=(No Tile)
+general.tile.tile=Tile
+general.tile.tiles=Tiles
+general.tile.tileset=Tileset

Added: trunk/src/tiled/mapeditor/resources/gui_de.properties
===================================================================
--- trunk/src/tiled/mapeditor/resources/gui_de.properties	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/resources/gui_de.properties	2006-04-09 17:37:18 UTC (rev 602)
@@ -0,0 +1,63 @@
+action.layer.add.name=Ebene hinzufügen
+action.layer.add.tooltip=Fügt eine Ebene hinzu
+action.layer.delete.name=Ebene löschen
+action.layer.delete.tooltip=Löscht die aktuelle Ebene
+action.layer.duplicate.name=Ebene duplizieren
+action.layer.duplicate.tooltip=Dupliziert die aktuelle Ebene
+action.layer.moveup.name=Ebene anheben
+action.tileset.remove.error.layer-locked.message=Eine Ebene, die Kacheln aus diesem Kachelsatz nutzt, ist gesperrt. Sie muss entsperrt werden bevor dieser Kachelsatz komplett entfernt werden kann.
+action.tileset.remove.error.title=Fehler beim Entfernen des Kachelsatzes
+action.zoom.in.name=Vergrößern
+action.zoom.out.name=Verkleinern
+dialog.brush.title=Pinsel Einstellungen
+dialog.newmap.height.label=Höhe:
+dialog.newmap.mapsize.title=Kartengröße
+dialog.newmap.maptype.label=Kartentyp:
+dialog.newmap.tilesize.title=Kachelgröße
+dialog.newmap.title=Neue Karte
+dialog.newmap.width.label=Breite:
+dialog.newtileset.autotiles.label=Automatisch Kacheln von Bildern erzeugen
+dialog.newtileset.colorchoose.error.title=Fehler beim Wählen einer Farbe
+dialog.newtileset.fromtilesetimg.title=Von einem Kachelsatzbild
+dialog.newtileset.image.label=Kachelbild:
+dialog.newtileset.imgload.error.message=Fehler beim Laden des Bildes:
+dialog.newtileset.import.error.message=Fehler beim Importieren des Kachelsatzes:
+dialog.newtileset.name.label=Name des Kachelsatzes:
+dialog.newtileset.tileheight.label=Kachelhöhe:
+dialog.newtileset.tilesetimgref.label=Bezogenes Kachelsatzbild
+dialog.newtileset.tilespacing.label=Kachelabstand:
+dialog.newtileset.tilewidth.label=Kachelbreite:
+dialog.newtileset.title=Neuer Kachelsatz
+dialog.newtileset.usetransparentcolor.label=Durchsichtige Farbe nutzen
+dialog.plugins.info.button=Information
+dialog.plugins.remove.button=Entfernen
+dialog.plugins.title=Verfügbare Erweiterungen
+dialog.preferences.title=Präferenzen
+dialog.properties.title=Eigenschaften
+dialog.resizemap.currentsize.title=Aktuelle Größe
+dialog.resizemap.height.label=Höhe:
+dialog.resizemap.newsize.title=Neue Größe
+dialog.resizemap.offset.title=Verschiebung
+dialog.resizemap.title=Kartegröße anpassen
+dialog.resizemap.width.label=Breite:
+dialog.resizemap.x.label=X:
+dialog.resizemap.y.label=Y:
+dialog.openmap.error.title=Fehler beim Öffnen der Kartendatei
+dialog.saveas.confirm.mismatch=Die Dateigröße passt nicht mit der Erweiterung zusammen. Fortfahren?
+dialog.saveas.error.message=Fehler beim Versuch zu speichern
+dialog.saveas.unknown-type.message=Speichern fehlgeschlagen, unbekannte Ursache
+dialog.saveas.error.title=Fehler beim Speichern der Karte
+dialog.tilepalette.title=Palette
+general.button.browse=Durchsuchen...
+general.button.cancel=Abbrechen
+general.button.close=Schließen
+general.button.ok=In Ordnung
+general.file.exists.title=Datei überschreiben?
+general.file.exists.message=Die Datei existiert bereits. Überschreiben?
+general.file.notexists.message=Datei existiert nicht.
+general.file.untitled=Ohne Titel
+general.maptype.hexagonal=Hexagonal (experimentell)
+general.maptype.isometric=Isometrisch
+general.maptype.oblique=Schräg
+general.maptype.orthogonal=Orthogonal
+general.maptype.shifted=Versetzt (iso und hex)

Added: trunk/src/tiled/mapeditor/resources/gui_it.properties
===================================================================
--- trunk/src/tiled/mapeditor/resources/gui_it.properties	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/resources/gui_it.properties	2006-04-09 17:37:18 UTC (rev 602)
@@ -0,0 +1,63 @@
+action.layer.add.name=Aggiungi livello
+action.layer.add.tooltip=Aggiunge un livello
+action.layer.delete.name=Cancella livello
+action.layer.delete.tooltip=Cancella il livello corrente
+action.layer.duplicate.name=Duplica livello
+action.layer.duplicate.tooltip=Duplica il livello corrente
+action.layer.moveup.name=Sposta livello verso l'alto
+action.tileset.remove.error.layer-locked.message=Un livello contenente tiles usati da questo tileset è bloccato,\n è necessario sbloccarlo prima che il tileset possa essere completamente rimosso.
+action.tileset.remove.error.title=Errore durante la rimozione del tileset
+action.zoom.in.name=Zoom Dentro
+action.zoom.out.name=Zoom Fuori
+dialog.brush.title=Opzioni Pennello
+dialog.newmap.height.label=Altezza:
+dialog.newmap.mapsize.title=Dimensione mappa
+dialog.newmap.maptype.label=Tipo mappa:
+dialog.newmap.tilesize.title=Tile size
+dialog.newmap.title=Nuova Mappa
+dialog.newmap.width.label=Larghezza:
+dialog.newtileset.autotiles.label=Crea automaticamente tiles da immagini
+dialog.newtileset.colorchoose.error.title=Errore durante la scelta del colore
+dialog.newtileset.fromtilesetimg.title=Da immagine tileset
+dialog.newtileset.image.label=Tile immagine:
+dialog.newtileset.imgload.error.message=Errore durante caricamento immagine:
+dialog.newtileset.import.error.message=Errore durante l'importazione del tileset
+dialog.newtileset.name.label=Nome tileset:
+dialog.newtileset.tileheight.label=Altezza tile:
+dialog.newtileset.tilesetimgref.label=Immagine tileset di riferimento
+dialog.newtileset.tilespacing.label=Spaziatura tile:
+dialog.newtileset.tilewidth.label=Larghezza tile:
+dialog.newtileset.title=Nuovo Tileset
+dialog.newtileset.usetransparentcolor.label=Usa colore trasparente
+dialog.plugins.info.button=Informazioni
+dialog.plugins.remove.button=Rimuovi
+dialog.plugins.title=Plugins Disponibili
+dialog.preferences.title=Preference
+dialog.properties.title=Proprietà
+dialog.resizemap.currentsize.title=Dimensione corrente
+dialog.resizemap.height.label=Altezza:
+dialog.resizemap.newsize.title=Nuova dimensione
+dialog.resizemap.offset.title=Offset
+dialog.resizemap.title=Ridimensiona Mappa
+dialog.resizemap.width.label=Larghezza:
+dialog.resizemap.x.label=X:
+dialog.resizemap.y.label=Y:
+dialog.openmap.error.title=Errore durante l'apertura della mappa
+dialog.saveas.confirm.mismatch=L'estensione differisce dal plugin. Si desidera continuare?
+dialog.saveas.error.message=Errore durante il tentativo di salvataggio
+dialog.saveas.unknown-type.message=Salvataggio fallito, tipo sconosciuto
+dialog.saveas.error.title=Errore durante il salvataggio della mappa
+dialog.tilepalette.title=Palette
+general.button.browse=Sfoglia...
+general.button.cancel=Cancella
+general.button.close=Chiudi
+general.button.ok=OK
+general.file.exists.title=Sovrascrivere file?
+general.file.exists.message=Il file esiste già. Si desidera sovrascriverlo?
+general.file.notexists.message=Il file non esiste
+general.file.untitled=Senza titolo
+general.maptype.hexagonal=Esagonale (sperimentale)
+general.maptype.isometric=Isometrica
+general.maptype.oblique=Obliqua
+general.maptype.orthogonal=Ortogonale
+general.maptype.shifted=Spostata (iso and hex)

Modified: trunk/src/tiled/mapeditor/resources/gui_nl.properties
===================================================================
--- trunk/src/tiled/mapeditor/resources/gui_nl.properties	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/mapeditor/resources/gui_nl.properties	2006-04-09 17:37:18 UTC (rev 602)
@@ -17,6 +17,7 @@
 dialog.newmap.title=Nieuwe Map
 dialog.newmap.width.label=Breedte:
 dialog.newtileset.autotiles.label=Maak automatisch tiles van de plaatjes
+dialog.newtileset.button.properties=Standaard eigenschappen...
 dialog.newtileset.colorchoose.error.title=Fout tijdens het kiezen van de kleur
 dialog.newtileset.fromtilesetimg.title=Tileset afbeelding
 dialog.newtileset.image.label=Afbeelding:
@@ -29,10 +30,17 @@
 dialog.newtileset.tilewidth.label=Tile breedte:
 dialog.newtileset.title=Nieuwe Tileset
 dialog.newtileset.usetransparentcolor.label=Gebruik transparante kleur
+dialog.openmap.error.title=Fout tijdens het openen van de map
 dialog.plugins.info.button=Info
 dialog.plugins.remove.button=Verwijderen
 dialog.plugins.title=Beschikbare Plugins
 dialog.preferences.title=Voorkeuren
+dialog.properties.column.name=Naam
+dialog.properties.column.value=Waarde
+dialog.properties.default.title=Standaard Eigenschappen
+dialog.properties.layer.title=Laag Eigenschappen
+dialog.properties.map.title=Map Eigenschappen
+dialog.properties.tileset.title=Tileset Eigenschappen
 dialog.properties.title=Eigenschappen
 dialog.resizemap.currentsize.title=Huidig formaat
 dialog.resizemap.height.label=Hoogte:
@@ -42,15 +50,37 @@
 dialog.resizemap.width.label=Breedte:
 dialog.resizemap.x.label=X:
 dialog.resizemap.y.label=Y:
+dialog.saveas.confirm.mismatch=De bestandsextensie past niet bij de plugin. Toch doorgaan?
+dialog.saveas.error.message=Fout tijdens het opslaan
+dialog.saveas.error.title=Fout tijdens het opslaan van de map
+dialog.saveas.unknown-type.message=Fout tijdens opslaan, onbekend type
+dialog.tile.button.animation=Animatie
+dialog.tile.button.changeimage=Verander Afbeelding
+dialog.tile.button.createtile=Nieuwe Tile
+dialog.tile.button.deletetile=Tile Verwijderen
+dialog.tile.button.duptile=Tile Dupliceren
+dialog.tile.button.newtile=Tile Toevoegen
+dialog.tile.imgload.error.message=Fout tijdens het openen van de afbeelding:
+dialog.tile.imgload.error.title=Fout tijdens het openen van de afbeelding:
+dialog.tile.title=Tileset Bewerken
+dialog.tileimage.title=Kies Tile Afbeelding
 dialog.tilepalette.title=Palet
 general.button.browse=Bladeren...
 general.button.cancel=Annuleren
 general.button.close=Sluiten
+general.button.delete=Verwijderen
 general.button.ok=OK
+general.button.preview=Voorbeeld...
 general.file.exists.message=Een bestand met dezelfde naam bestaat al. Wil je deze overschrijven?
+general.file.exists.title=Bestand overschrijven?
+general.file.notexists.message=Bestand bestaat niet
 general.file.untitled=Naamloos
 general.maptype.hexagonal=Hexagonaal (experimenteel)
 general.maptype.isometric=Isometrisch
 general.maptype.oblique=Schuin
 general.maptype.orthogonal=Orthogonaal
 general.maptype.shifted=Verschoven (iso en hex)
+general.tile.notile=(Geen Tile)
+general.tile.tile=Tile
+general.tile.tiles=Tiles
+general.tile.tileset=Tileset

Modified: trunk/src/tiled/util/NumberedSet.java
===================================================================
--- trunk/src/tiled/util/NumberedSet.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/util/NumberedSet.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -12,7 +12,8 @@
 
 package tiled.util;
 
-import java.util.*;
+import java.util.Iterator;
+import java.util.Vector;
 
 /**
  * A NumberedSet is a generic container of Objects where each element is
@@ -20,11 +21,11 @@
  * id and element remains unaffected when elements are deleted.  This means
  * that the set of ids for a NumberedSet may not be contiguous. (A sparse
  * array)
- * 
+ *
  * @author rainerd
  */
 public class NumberedSet {
-	
+
 	private Vector data;
 
 	/**
@@ -37,7 +38,7 @@
 	/**
 	 * Returns the element for a specific element, or null if the id does not
 	 * identify any element in this NumberedSet.
-	 * 
+	 *
 	 * @param id
 	 * @return Object
 	 */
@@ -45,13 +46,13 @@
 		try {
 			return data.get(id);
 		} catch (ArrayIndexOutOfBoundsException e) {}
-		
+
 		return null;
 	}
-	
+
 	/**
 	 * Returns true if the NumberedSet contains an element for the specified id.
-	 * 
+	 *
 	 * @param id
 	 * @return boolean
 	 */
@@ -63,26 +64,26 @@
 	 * Sets the element for the specified id, replacing any previous element that
 	 * was associated with that id.  id should be a relatively small positive
 	 * integer.
-	 * 
+	 *
 	 * @param id
 	 * @param o
 	 * @return int
-	 * @throws IllegalArgumentException 
+	 * @throws IllegalArgumentException
 	 */
 	public int put(int id, Object o) throws IllegalArgumentException {
 		if (id < 0) throw new IllegalArgumentException();
-		
+
 		//make sure there is sufficient space to overlay
 		for(int i=id-data.size();i>0;i--) data.add(null);
-		
+
 		data.add(id, o);
 		return id;
 	}
 
 	/**
 	 * Removes the element associated with the given id from the NumberedSet.
-	 * 
-	 * @param id 
+	 *
+	 * @param id
 	 */
 	public void remove(int id) {
 		data.remove(id);
@@ -91,7 +92,7 @@
 	/**
 	 * Returns the last id in the NumberedSet that is associated with an element,
 	 * or -1 if the NumberedSet is empty.
-	 * 
+	 *
 	 * @return int
 	 */
 	public int getMaxId() {
@@ -99,13 +100,13 @@
 		for(int i=0;i<data.size();i++) {
 			if(data.get(i) != null) id = i;
 		}
-		
+
 		return id+1;
 	}
-	
+
 	/**
 	 * Returns an iterator to iterate over the elements of the NumberedSet.
-	 * 
+	 *
 	 * @return NumberedSetIterator
 	 */
 	public Iterator iterator() {
@@ -114,7 +115,7 @@
 
 	/**
 	 * Adds a new element to the NumberedSet and returns its id.
-	 * 
+	 *
 	 * @param o
 	 * @return int
 	 */
@@ -127,7 +128,7 @@
 	/**
 	 * Returns the id of the first element of the NumberedSet that is euqal to
 	 * the given object, or -1 otherwise.
-	 * 
+	 *
 	 * @param o
 	 */
 	public int indexOf(Object o) {
@@ -155,7 +156,7 @@
 
 	/**
 	 * Returns the number of actual elements in the NumberedSet.
-	 * 
+	 *
 	 * @return int
 	 */
   	public int size() {

Modified: trunk/src/tiled/util/Util.java
===================================================================
--- trunk/src/tiled/util/Util.java	2006-04-09 13:57:47 UTC (rev 601)
+++ trunk/src/tiled/util/Util.java	2006-04-09 17:37:18 UTC (rev 602)
@@ -15,10 +15,10 @@
 import java.io.File;
 import java.io.IOException;
 
-
 /**
  * Various utility functions
  *
+ * $Id$
  */
 public class Util
 {
@@ -26,19 +26,19 @@
      * This function converts an <code>int</code> integer array to a
      * <code>byte</code> array. Each integer element is broken into 4 bytes and
      * stored in the byte array in litte endian byte order.
-     * 
+     *
      * @param integers an integer array
      * @return a byte array containing the values of the int array. The byte
-     *         array is 4x the length of the integer array. 
+     *         array is 4x the length of the integer array.
      */
     public static byte[] convertIntegersToBytes (int[] integers) {
         if (integers != null) {
-            byte outputBytes[] = new byte[integers.length * 4];
+            byte[] outputBytes = new byte[integers.length * 4];
 
             for(int i = 0, k = 0; i < integers.length; i++) {
                 int integerTemp = integers[i];
                 for(int j = 0; j < 4; j++, k++) {
-                    outputBytes[k] = (byte)((integerTemp >> (8*j)) & 0xFF);
+                    outputBytes[k] = (byte)((integerTemp >> (8 * j)) & 0xFF);
                 }
             }
             return outputBytes;
@@ -51,7 +51,7 @@
      * This utility function will check the specified string to see if it
      * starts with one of the OS root designations. (Ex.: '/' on Unix, 'C:' on
      * Windows)
-     * 
+     *
      * @param filename a filename to check for absolute or relative path
      * @return <code>true</code> if the specified filename starts with a
      *         filesystem root, <code>false</code> otherwise.
@@ -61,7 +61,8 @@
 
         for (int i = 0; i < roots.length; i++) {
             try {
-                if (filename.toLowerCase().startsWith(roots[i].getCanonicalPath().toLowerCase())) {
+                String root = roots[i].getCanonicalPath().toLowerCase();
+                if (filename.toLowerCase().startsWith(root)) {
                     return true;
                 }
             } catch (IOException e) {




More information about the tiled-commit mailing list