[tiled] r589 - in trunk: . src/tiled/core src/tiled/io/xml src/tiled/mapeditor src/tiled/mapeditor/dialogs src/tiled/mapeditor/selection src/tiled/mapeditor/widget src/tiled/view

svn@biggeruniverse.com svn at biggeruniverse.com
Sun Feb 26 14:20:24 PST 2006


Author: bjorn
Date: 2006-02-26 16:20:23 -0600 (Sun, 26 Feb 2006)
New Revision: 589

Modified:
   trunk/SUGGESTIONS
   trunk/src/tiled/core/Map.java
   trunk/src/tiled/core/MultilayerPlane.java
   trunk/src/tiled/core/TileLayer.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/ResizeDialog.java
   trunk/src/tiled/mapeditor/dialogs/TileDialog.java
   trunk/src/tiled/mapeditor/selection/SelectionLayer.java
   trunk/src/tiled/mapeditor/widget/ResizePanel.java
   trunk/src/tiled/view/HexMapView.java
   trunk/src/tiled/view/IsoMapView.java
   trunk/src/tiled/view/MapView.java
   trunk/src/tiled/view/ObliqueMapView.java
   trunk/src/tiled/view/OrthoMapView.java
   trunk/src/tiled/view/ShiftedMapView.java
Log:
Merged changes in revisions 585 and 588 to trunk.


Modified: trunk/SUGGESTIONS
===================================================================
--- trunk/SUGGESTIONS	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/SUGGESTIONS	2006-02-26 22:20:23 UTC (rev 589)
@@ -155,3 +155,19 @@
             on their own "property"-layers? Things to consider are ease of use
             and flexibility. Also, is this functionality provided by objects?
 
+- 28 --------------------------------------------------------------------------
+Suggestor:  bjorn
+Date:       18/02/06
+Summary:    Removing of stupid features.
+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.
+            * 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.
+            * 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.
\ No newline at end of file

Modified: trunk/src/tiled/core/Map.java
===================================================================
--- trunk/src/tiled/core/Map.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/core/Map.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -21,7 +21,6 @@
 import tiled.mapeditor.util.MapChangeListener;
 import tiled.mapeditor.util.MapChangedEvent;
 
-
 /**
  * The Map class is the focal point of the <code>tiled.core</code> package.
  * This class also handles notifing listeners if there is a change to any layer
@@ -219,7 +218,7 @@
     }
 
     /**
-     * Calls super method, and additionally fires a MapChangedEvent.
+     * Calls super method, and additionally fires a {@link MapChangedEvent}.
      *
      * @see MultilayerPlane#removeLayer(int)
      */
@@ -246,7 +245,7 @@
 
     /**
      * Calls super method, and additionally fires a MapChangedEvent.
-     * 
+     *
      * @see MultilayerPlane#removeAllLayers
      */
 
@@ -333,15 +332,6 @@
     }
 
     /**
-     * Retrieves the designated "Blank" or "Null" tile
-     *
-     * @return Tile designated Null tile, or null by default
-     */
-    public Tile getNullTile() {
-        return null;
-    }
-
-    /**
      * Get the tile set that matches the given global tile id, only to be used
      * when loading a map.
      */
@@ -450,7 +440,7 @@
      * Returns the orientation of this map. Orientation will be one of
      * {@link Map#MDO_ISO}, {@link Map#MDO_ORTHO}, {@link Map#MDO_HEX},
      * {@link Map#MDO_OBLIQUE} and {@link Map#MDO_SHIFTED}.
-     * 
+     *
      * @return The orientation from the enumerated set
      */
     public int getOrientation() {

Modified: trunk/src/tiled/core/MultilayerPlane.java
===================================================================
--- trunk/src/tiled/core/MultilayerPlane.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/core/MultilayerPlane.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -15,15 +15,16 @@
 import java.awt.Rectangle;
 import java.util.*;
 
-
 /**
  * MultilayerPlane makes up the core functionality of both Maps and Brushes.
  * This class handles the order of layers as a group.
+ *
+ * @version $Id$
  */
 public class MultilayerPlane
 {
     private Vector layers;
-    protected int widthInTiles = 0, heightInTiles = 0;
+    protected int widthInTiles, heightInTiles;
 
     /**
      * Default constructor.
@@ -95,7 +96,7 @@
      * Adds the MapLayer <code>l</code> after the MapLayer <code>after</code>.
      *
      * @param l the layer to add
-     * @param after specifies the layer to add <code>l</code> after 
+     * @param after specifies the layer to add <code>l</code> after
      */
     public void addLayerAfter(MapLayer l, MapLayer after) {
         layers.add(layers.indexOf(after) + 1, l);

Modified: trunk/src/tiled/core/TileLayer.java
===================================================================
--- trunk/src/tiled/core/TileLayer.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/core/TileLayer.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -244,7 +244,7 @@
         for (int y = 0; y < bounds.height; y++) {
             for (int x = 0; x < bounds.width; x++) {
                 if (map[y][x] == tile) {
-                    setTileAt(x + bounds.x, y + bounds.y, myMap.getNullTile());
+                    setTileAt(x + bounds.x, y + bounds.y, null);
                 }
             }
         }
@@ -338,8 +338,8 @@
         for (int y = bounds.y; y < bounds.y + bounds.height; y++) {
             for (int x = bounds.x; x < bounds.x + bounds.width; x++) {
                 Tile tile = getTileAt(x, y);
-                if (myMap == null || tile != myMap.getNullTile()) {
-                    ((TileLayer)other).setTileAt(x, y, tile);
+                if (tile != null) {
+                    ((TileLayer) other).setTileAt(x, y, tile);
                 }
             }
         }
@@ -358,7 +358,7 @@
 
         for (int y = bounds.y; y < bounds.y + bounds.height; y++) {
             for (int x = bounds.x; x < bounds.x + bounds.width; x++) {
-                setTileAt(x, y, ((TileLayer)other).getTileAt(x, y));
+                setTileAt(x, y, ((TileLayer) other).getTileAt(x, y));
             }
         }
     }
@@ -379,7 +379,7 @@
         for (int y = boundBox.y; y < boundBox.y + boundBox.height; y++) {
             for (int x = boundBox.x; x < boundBox.x + boundBox.width; x++) {
                 if (mask.contains(x,y)) {
-                    setTileAt(x, y, ((TileLayer)other).getTileAt(x, y));
+                    setTileAt(x, y, ((TileLayer) other).getTileAt(x, y));
                 }
             }
         }
@@ -398,7 +398,7 @@
 
         for (int y = bounds.y; y < bounds.y + bounds.height; y++) {
             for (int x = bounds.x; x < bounds.x + bounds.width; x++) {
-                ((TileLayer)other).setTileAt(x, y, getTileAt(x, y));
+                ((TileLayer) other).setTileAt(x, y, getTileAt(x, y));
             }
         }
     }

Modified: trunk/src/tiled/core/TileSet.java
===================================================================
--- trunk/src/tiled/core/TileSet.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/core/TileSet.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -248,7 +248,7 @@
      * Removes a tile from this tileset. Does not invalidate other tile
      * indices. Removal is simply setting the reference at the specified
      * index to <b>null</b>
-     * 
+     *
      * @param i the index to remove
      */
     public void removeTile(int i) {
@@ -356,7 +356,7 @@
 
     /**
      * Returns the base directory for the tileset
-     * 
+     *
      * @return a directory in native format as given in the tileset file or tag
      */
     public String getBaseDir() {

Modified: trunk/src/tiled/io/xml/XMLMapTransformer.java
===================================================================
--- trunk/src/tiled/io/xml/XMLMapTransformer.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/io/xml/XMLMapTransformer.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -376,7 +376,7 @@
 
                                 set.setTransparentColor(color);
                                 set.setTilesetImageFilename(sourcePath);
-                            } catch(IIOException iioe) {
+                            } catch (IIOException iioe) {
                                 warnings.push("ERROR: "+iioe.getMessage()+" ("+sourcePath+")");
                             }
                         } else {
@@ -560,7 +560,7 @@
                                     ml.setTileAt(x, y,
                                             ts.getTile(tileId - ts.getFirstGid()));
                                 } else {
-                                    ml.setTileAt(x, y, map.getNullTile());
+                                    ml.setTileAt(x, y, null);
                                 }
                             }
                         }
@@ -578,7 +578,7 @@
                                 ml.setTileAt(x, y,
                                         ts.getTile(tileId - ts.getFirstGid()));
                             } else {
-                                ml.setTileAt(x, y, map.getNullTile());
+                                ml.setTileAt(x, y, null);
                             }
 
                             x++;
@@ -710,7 +710,7 @@
         URL url = new URL(xmlFile);
         InputStream is = url.openStream();
 
-        // Wrap with GZIP decoder for .tmx.gz files 
+        // Wrap with GZIP decoder for .tmx.gz files
         if (filename.endsWith(".gz")) {
             is = new GZIPInputStream(is);
         }

Modified: trunk/src/tiled/io/xml/XMLMapWriter.java
===================================================================
--- trunk/src/tiled/io/xml/XMLMapWriter.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/io/xml/XMLMapWriter.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -184,7 +184,7 @@
             }
         } catch (XMLWriterException e) {
             e.printStackTrace();
-        } 
+        }
     }
 
     private static void writeTileset(TileSet set, XMLWriter w, String wp)

Modified: trunk/src/tiled/mapeditor/MapEditor.java
===================================================================
--- trunk/src/tiled/mapeditor/MapEditor.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/mapeditor/MapEditor.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -730,7 +730,7 @@
 
     /**
      * Returns the currently selected tile.
-     * 
+     *
      * @return The currently selected tile.
      */
     public Tile getCurrentTile() {
@@ -739,7 +739,7 @@
 
     /**
      * Returns the current map.
-     * 
+     *
      * @return The currently selected map.
      */
     public Map getCurrentMap() {
@@ -748,7 +748,7 @@
 
     /**
      * Returns the currently selected layer.
-     * 
+     *
      * @return THe currently selected layer.
      */
     public MapLayer getCurrentLayer() {
@@ -757,7 +757,7 @@
 
     /**
      * Returns the main application frame.
-     * 
+     *
      * @return The frame of the main application
      */
     public Frame getAppFrame() {
@@ -886,8 +886,7 @@
                 case PS_ERASE:
                     paintEdit.setPresentationName("Erase");
                     if (layer instanceof TileLayer) {
-                        ((TileLayer)layer).setTileAt(tile.x, tile.y,
-                                                     currentMap.getNullTile());
+                        ((TileLayer) layer).setTileAt(tile.x, tile.y, null);
                     }
                     mapView.repaintRegion(new Rectangle(tile.x, tile.y, 1, 1));
                     break;
@@ -1613,7 +1612,7 @@
                     for (int i = area.y; i < area.height+area.y; i++) {
                         for (int j = area.x; j < area.width + area.x; j++){
                             if (mask.contains(j,i)) {
-                                tl.setTileAt(j, i, currentMap.getNullTile());
+                                tl.setTileAt(j, i, null);
                             }
                         }
                     }

Modified: trunk/src/tiled/mapeditor/dialogs/ResizeDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/ResizeDialog.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/mapeditor/dialogs/ResizeDialog.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,7 +5,7 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  */
@@ -81,11 +81,13 @@
         GridBagConstraints c = new GridBagConstraints();
         c.anchor = GridBagConstraints.WEST;
         c.fill = GridBagConstraints.BOTH; c.weighty = 1;
-        c.insets = new Insets(5, 0, 0, 0);
+        c.insets = new Insets(5, 0, 0, 5);
         offsetPanel.add(new JLabel(X_LABEL), c);
         c.gridy = 1;
         offsetPanel.add(new JLabel(Y_LABEL), c);
-        c.gridx = 1; c.gridy = 0;
+        c.gridx = 1;
+        c.gridy = 0;
+        c.insets = new Insets(5, 0, 0, 0);
         offsetPanel.add(offsetX, c);
         c.gridy = 1;
         offsetPanel.add(offsetY, c);
@@ -102,12 +104,13 @@
         c = new GridBagConstraints();
         c.anchor = GridBagConstraints.WEST;
         c.fill = GridBagConstraints.BOTH; c.weighty = 1;
-        c.insets = new Insets(5, 0, 0, 0);
+        c.insets = new Insets(5, 0, 0, 5);
         newSizePanel.add(new JLabel(WIDTH_LABEL), c);
         c.gridy = 1;
         newSizePanel.add(new JLabel(HEIGHT_LABEL), c);
         c.fill = GridBagConstraints.HORIZONTAL;
         c.gridx = 1; c.gridy = 0; c.weightx = 1;
+        c.insets = new Insets(5, 0, 0, 0);
         newSizePanel.add(width, c);
         c.gridy = 1;
         newSizePanel.add(height, c);
@@ -120,7 +123,7 @@
         c = new GridBagConstraints();
         c.anchor = GridBagConstraints.EAST;
         c.fill = GridBagConstraints.BOTH; c.weighty = 1; c.weightx = 1;
-        c.insets = new Insets(5, 0, 0, 0);
+        c.insets = new Insets(5, 0, 0, 5);
         origSizePanel.add(new JLabel(WIDTH_LABEL), c);
         c.gridy = 1;
         origSizePanel.add(new JLabel(HEIGHT_LABEL), c);
@@ -195,7 +198,7 @@
             offsetY.setValue((int)(val / (currentMap.getTileHeight() * zoom)));
         }
     }
-    
+
     public void stateChanged(ChangeEvent e) {
         Object source = e.getSource();
 

Modified: trunk/src/tiled/mapeditor/dialogs/TileDialog.java
===================================================================
--- trunk/src/tiled/mapeditor/dialogs/TileDialog.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/mapeditor/dialogs/TileDialog.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,7 +5,7 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  *  Rainer Deyke <rainerd at eldwood.com>
@@ -31,7 +31,9 @@
 import tiled.mapeditor.util.*;
 import tiled.mapeditor.widget.*;
 
-
+/**
+ * @version $Id$
+ */
 public class TileDialog extends JDialog
     implements ActionListener, ListSelectionListener
 {
@@ -274,7 +276,7 @@
 
     private void newTile() {
     	NewTileDialog d = new NewTileDialog(this, tileset);
-    	if(d.createTile() != null) queryTiles();
+    	if (d.createTile() != null) queryTiles();
     }
 
     public void setTileset(TileSet s) {
@@ -358,8 +360,8 @@
 
     private void updateEnabledState() {
         // boolean internal = (tileset.getSource() == null);
-        boolean tilebmp = (tileset.getTilebmpFile() != null);
-        boolean tileSelected = (currentTile != null);
+        boolean tilebmp = tileset.getTilebmpFile() != null;
+        boolean tileSelected = currentTile != null;
         boolean sharedImages = tileset.usesSharedImages();
         boolean atLeastOneSharedImage = sharedImages
           && tileset.getTotalImages() >= 1;
@@ -512,7 +514,7 @@
                 JOptionPane.YES_NO_OPTION,
                 JOptionPane.QUESTION_MESSAGE);
             if (answer == JOptionPane.YES_OPTION) {
-           
+
             	Enumeration ids = tileset.getImageIds();
                 while (ids.hasMoreElements()) {
                 	int id = Integer.parseInt((String)ids.nextElement());

Modified: trunk/src/tiled/mapeditor/selection/SelectionLayer.java
===================================================================
--- trunk/src/tiled/mapeditor/selection/SelectionLayer.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/mapeditor/selection/SelectionLayer.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,7 +5,7 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  */

Modified: trunk/src/tiled/mapeditor/widget/ResizePanel.java
===================================================================
--- trunk/src/tiled/mapeditor/widget/ResizePanel.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/mapeditor/widget/ResizePanel.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,29 +5,31 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  */
 
 package tiled.mapeditor.widget;
 
-import java.awt.Point;
 import java.awt.Dimension;
-import java.awt.event.*;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.OverlayLayout;
+import javax.swing.event.MouseInputAdapter;
 
-import javax.swing.*;
-
 import tiled.core.Map;
 import tiled.view.MapView;
 
-
 /**
  * A special widget designed as an aid for resizing the map. Based on a similar
  * widget used by the GIMP when resizing the image.
+ *
+ * @version $Id$
  */
-public class ResizePanel extends JPanel implements MouseListener,
-       MouseMotionListener
+public class ResizePanel extends JPanel
 {
     private MapView inner;
     private Map currentMap;
@@ -43,23 +45,27 @@
 
     public ResizePanel(Map map) {
         this();
-        inner = MapView.createViewforMap(map);
-        inner.addMouseListener(this);
-        inner.addMouseMotionListener(this);
-        add(inner);
         zoom = 0.1;
-        inner.setZoom(zoom);
         currentMap = map;
+
+        DragHandler dragHandler = new DragHandler();
+
+        inner = MapView.createViewforMap(map);
+        inner.setZoom(zoom);
+        inner.addMouseListener(dragHandler);
+        inner.addMouseMotionListener(dragHandler);
+        add(inner);
+
         Dimension old = inner.getPreferredSize();
         // TODO: get smaller dimension, zoom based on that...
-
         oldDim = old;
         setSize(old);
     }
 
     public ResizePanel(Dimension size, Map map) {
         this(map);
-        oldDim = newDim = size;
+        oldDim = size;
+        newDim = size;
         setSize(size);
     }
 
@@ -83,41 +89,31 @@
         return zoom;
     }
 
-    public void mouseClicked(MouseEvent e) {
-    }
-
-    public void mouseDragged(MouseEvent e) {		
-        int newOffsetX = offsetX + (e.getX() - startPress.x);
-        int newOffsetY = offsetY + (e.getY() - startPress.y);
-
-        newOffsetX /= currentMap.getTileWidth() * zoom;
-        newOffsetY /= currentMap.getTileHeight() * zoom;
-
-        if (newOffsetX != offsetX) {
-            firePropertyChange("offsetX", offsetX, newOffsetX);
-            offsetX = newOffsetX;
+    private class DragHandler extends MouseInputAdapter {
+        public void mousePressed(MouseEvent e) {
+            startPress = e.getPoint();
         }
 
-        if (newOffsetY != offsetY) {
-            firePropertyChange("offsetY", offsetY, newOffsetY);
-            offsetY = newOffsetY;
+        public void mouseReleased(MouseEvent e) {
+            startPress = null;
         }
-    }
 
-    public void mousePressed(MouseEvent e) {
-        startPress = e.getPoint();
-    }
+        public void mouseDragged(MouseEvent e) {
+            int newOffsetX = offsetX + (e.getX() - startPress.x);
+            int newOffsetY = offsetY + (e.getY() - startPress.y);
 
-    public void mouseReleased(MouseEvent e) {
-        startPress = null;
-    }
+            newOffsetX /= currentMap.getTileWidth() * zoom;
+            newOffsetY /= currentMap.getTileHeight() * zoom;
 
-    public void mouseEntered(MouseEvent e) {
-    }
+            if (newOffsetX != offsetX) {
+                firePropertyChange("offsetX", offsetX, newOffsetX);
+                offsetX = newOffsetX;
+            }
 
-    public void mouseExited(MouseEvent e) {
+            if (newOffsetY != offsetY) {
+                firePropertyChange("offsetY", offsetY, newOffsetY);
+                offsetY = newOffsetY;
+            }
+        }
     }
-
-    public void mouseMoved(MouseEvent e) {
-    }
 }

Modified: trunk/src/tiled/view/HexMapView.java
===================================================================
--- trunk/src/tiled/view/HexMapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/HexMapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -20,7 +20,6 @@
 import tiled.core.*;
 import tiled.mapeditor.selection.SelectionLayer;
 
-
 /**
  * A View for displaying Hex based maps.
  * The Hexs are layed out horizontally (i.e. the pointy sides are on the sides
@@ -55,8 +54,13 @@
 {
     private static final double HEX_SLOPE = Math.tan(Math.toRadians(60));
 
-    public HexMapView(Map m) {
-        super(m);
+    /**
+     * Creates a new hexagonal map view that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    public HexMapView(Map map) {
+        super(map);
     }
 
     public int getScrollableBlockIncrement(Rectangle visibleRect,
@@ -110,7 +114,7 @@
             for (int x = startX; x < endX; x++) {
                 Tile t = layer.getTileAt(x, y);
 
-                if (t != null && t != myMap.getNullTile()) {
+                if (t != null) {
                     if (layer.getClass() == SelectionLayer.class) {
                         g2d.fillPolygon(gridPoly);
                     } else {
@@ -176,7 +180,7 @@
                 grid.translate((int)(tileSize.getWidth() * .75), 0);
                 grid.translate(0,
                         -(int)((tileSize.getHeight() / 2) * (1 - x % 2)));
-            }            
+            }
         }
     }
 
@@ -303,7 +307,7 @@
 
     /**
      * Returns the location on screen for the given tile.
-     * 
+     *
      * @return The point at the centre of the Hex.
      */
     public Point tileToScreenCoords(double x, double y) {

Modified: trunk/src/tiled/view/IsoMapView.java
===================================================================
--- trunk/src/tiled/view/IsoMapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/IsoMapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,7 +5,7 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  */
@@ -26,8 +26,13 @@
  */
 public class IsoMapView extends MapView
 {
-    public IsoMapView(Map m) {
-        super(m);
+    /**
+     * Creates a new isometric map view that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    public IsoMapView(Map map) {
+        super(map);
     }
 
     public int getScrollableBlockIncrement(Rectangle visibleRect,

Modified: trunk/src/tiled/view/MapView.java
===================================================================
--- trunk/src/tiled/view/MapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/MapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -53,9 +53,13 @@
     private static final Color DEFAULT_BACKGROUND_COLOR = new Color(64, 64, 64);
     private static final Color DEFAULT_GRID_COLOR = Color.black;
 
-
-    public MapView(Map m) {
-        myMap = m;
+    /**
+     * Creates a new <code>MapView</code> that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    protected MapView(Map map) {
+        myMap = map;
         setSize(getPreferredSize());
     }
 
@@ -313,10 +317,10 @@
     /**
      * Draws a TileLayer. Implemented in a subclass.
      *
-     * @param tileLayer the TileLayer to be drawn
-     * @param zoom      the zoom level to draw the layer on
+     * @param layer the TileLayer to be drawn
+     * @param zoom  the zoom level to draw the layer on
      */
-    protected abstract void paintLayer(Graphics2D g2d, TileLayer tileLayer,
+    protected abstract void paintLayer(Graphics2D g2d, TileLayer layer,
             double zoom);
 
     /**

Modified: trunk/src/tiled/view/ObliqueMapView.java
===================================================================
--- trunk/src/tiled/view/ObliqueMapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/ObliqueMapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -5,11 +5,11 @@
  *  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 at biggeruniverse.com>
  *  Bjorn Lindeijer <b.lindeijer at xs4all.nl>
  */
- 
+
 package tiled.view;
 
 import java.awt.Dimension;
@@ -23,8 +23,13 @@
 
 public class ObliqueMapView extends MapView
 {
-    public ObliqueMapView(Map m) {
-        super(m);
+    /**
+     * Creates a new oblique map view that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    public ObliqueMapView(Map map) {
+        super(map);
     }
 
     public int getScrollableBlockIncrement(

Modified: trunk/src/tiled/view/OrthoMapView.java
===================================================================
--- trunk/src/tiled/view/OrthoMapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/OrthoMapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -34,8 +34,13 @@
  */
 public class OrthoMapView extends MapView
 {
-    public OrthoMapView(Map m) {
-        super(m);
+    /**
+     * Creates a new orthographic map view that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    public OrthoMapView(Map map) {
+        super(map);
     }
 
     public int getScrollableBlockIncrement(Rectangle visibleRect,
@@ -89,7 +94,7 @@
                     x < endX; x++, gx += tsize.width) {
                 Tile tile = layer.getTileAt(x, y);
 
-                if (tile != null && tile != myMap.getNullTile()) {
+                if (tile != null) {
                     if (layer instanceof SelectionLayer) {
                         Polygon gridPoly = createGridPolygon(
                                 gx, gy - tsize.height, 0);

Modified: trunk/src/tiled/view/ShiftedMapView.java
===================================================================
--- trunk/src/tiled/view/ShiftedMapView.java	2006-02-23 21:34:06 UTC (rev 588)
+++ trunk/src/tiled/view/ShiftedMapView.java	2006-02-26 22:20:23 UTC (rev 589)
@@ -27,8 +27,13 @@
     private int horSide;       // Length of horizontal sides
     private int verSide;       // Length of vertical sides
 
-    public ShiftedMapView(Map m) {
-        super(m);
+    /**
+     * Creates a new shifted map view that displays the specified map.
+     *
+     * @param map the map to be displayed by this map view
+     */
+    public ShiftedMapView(Map map) {
+        super(map);
 
         horSide = 16;
         verSide = 0;




More information about the tiled-commit mailing list