[tiled] r575 - in branches/bjorn/src/tiled: core io io/xml mapeditor mapeditor/brush mapeditor/dialogs mapeditor/dungeon mapeditor/plugin mapeditor/selection mapeditor/undo mapeditor/util mapeditor/widget plugins/mappy plugins/tmw util view

svn@biggeruniverse.com svn at biggeruniverse.com
Sat Feb 11 04:37:18 PST 2006


Author: bjorn
Date: 2006-02-11 06:37:18 -0600 (Sat, 11 Feb 2006)
New Revision: 575

Modified:
   branches/bjorn/src/tiled/core/KeyFrame.java
   branches/bjorn/src/tiled/core/Map.java
   branches/bjorn/src/tiled/core/MapLayer.java
   branches/bjorn/src/tiled/core/MapObject.java
   branches/bjorn/src/tiled/core/MultilayerPlane.java
   branches/bjorn/src/tiled/core/ObjectGroup.java
   branches/bjorn/src/tiled/core/Sprite.java
   branches/bjorn/src/tiled/core/Tile.java
   branches/bjorn/src/tiled/core/TileIterator.java
   branches/bjorn/src/tiled/core/TileLayer.java
   branches/bjorn/src/tiled/core/TileSet.java
   branches/bjorn/src/tiled/io/ImageHelper.java
   branches/bjorn/src/tiled/io/MapHelper.java
   branches/bjorn/src/tiled/io/MapReader.java
   branches/bjorn/src/tiled/io/MapWriter.java
   branches/bjorn/src/tiled/io/PluggableMapIO.java
   branches/bjorn/src/tiled/io/xml/XMLMapTransformer.java
   branches/bjorn/src/tiled/io/xml/XMLMapWriter.java
   branches/bjorn/src/tiled/io/xml/XMLWriter.java
   branches/bjorn/src/tiled/io/xml/XMLWriterException.java
   branches/bjorn/src/tiled/mapeditor/BrushDialog.java
   branches/bjorn/src/tiled/mapeditor/MapEditor.java
   branches/bjorn/src/tiled/mapeditor/TilePaletteDialog.java
   branches/bjorn/src/tiled/mapeditor/TilesetManager.java
   branches/bjorn/src/tiled/mapeditor/brush/AbstractBrush.java
   branches/bjorn/src/tiled/mapeditor/brush/Brush.java
   branches/bjorn/src/tiled/mapeditor/brush/CustomBrush.java
   branches/bjorn/src/tiled/mapeditor/brush/RandomBrush.java
   branches/bjorn/src/tiled/mapeditor/brush/ShapeBrush.java
   branches/bjorn/src/tiled/mapeditor/dialogs/AboutDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/ConfigurationDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/ImageColorDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/NewMapDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/NewTilesetDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/ObjectDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/PluginDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/PropertiesDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/ResizeDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/SearchDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/TileDialog.java
   branches/bjorn/src/tiled/mapeditor/dialogs/TileImageDialog.java
   branches/bjorn/src/tiled/mapeditor/dungeon/Builder.java
   branches/bjorn/src/tiled/mapeditor/dungeon/CorridorBuilder.java
   branches/bjorn/src/tiled/mapeditor/plugin/PluginClassLoader.java
   branches/bjorn/src/tiled/mapeditor/plugin/TiledPlugin.java
   branches/bjorn/src/tiled/mapeditor/selection/SelectionLayer.java
   branches/bjorn/src/tiled/mapeditor/undo/MapLayerEdit.java
   branches/bjorn/src/tiled/mapeditor/undo/MapLayerStateEdit.java
   branches/bjorn/src/tiled/mapeditor/undo/MoveLayerEdit.java
   branches/bjorn/src/tiled/mapeditor/undo/UndoStack.java
   branches/bjorn/src/tiled/mapeditor/util/ImageCellRenderer.java
   branches/bjorn/src/tiled/mapeditor/util/LayerTableModel.java
   branches/bjorn/src/tiled/mapeditor/util/MapChangeListener.java
   branches/bjorn/src/tiled/mapeditor/util/MapChangedEvent.java
   branches/bjorn/src/tiled/mapeditor/util/MapEventAdapter.java
   branches/bjorn/src/tiled/mapeditor/util/MapPrinter.java
   branches/bjorn/src/tiled/mapeditor/util/MultisetListRenderer.java
   branches/bjorn/src/tiled/mapeditor/util/PropertiesTableModel.java
   branches/bjorn/src/tiled/mapeditor/util/TileDialogListRenderer.java
   branches/bjorn/src/tiled/mapeditor/util/TileSelectionEvent.java
   branches/bjorn/src/tiled/mapeditor/util/TileSelectionListener.java
   branches/bjorn/src/tiled/mapeditor/util/TiledFileFilter.java
   branches/bjorn/src/tiled/mapeditor/util/TilesetTableModel.java
   branches/bjorn/src/tiled/mapeditor/util/TransparentImageFilter.java
   branches/bjorn/src/tiled/mapeditor/widget/BrushBrowser.java
   branches/bjorn/src/tiled/mapeditor/widget/ColorButton.java
   branches/bjorn/src/tiled/mapeditor/widget/ImageViewPanel.java
   branches/bjorn/src/tiled/mapeditor/widget/IntegerSpinner.java
   branches/bjorn/src/tiled/mapeditor/widget/MiniMapViewer.java
   branches/bjorn/src/tiled/mapeditor/widget/ResizePanel.java
   branches/bjorn/src/tiled/mapeditor/widget/TButton.java
   branches/bjorn/src/tiled/mapeditor/widget/TMenuItem.java
   branches/bjorn/src/tiled/mapeditor/widget/TileButton.java
   branches/bjorn/src/tiled/mapeditor/widget/TilePalettePanel.java
   branches/bjorn/src/tiled/mapeditor/widget/VerticalStaticJPanel.java
   branches/bjorn/src/tiled/plugins/mappy/Chunk.java
   branches/bjorn/src/tiled/plugins/mappy/MappyMapReader.java
   branches/bjorn/src/tiled/plugins/mappy/MappyMapWriter.java
   branches/bjorn/src/tiled/plugins/mappy/Util.java
   branches/bjorn/src/tiled/plugins/tmw/TMWServerMapWriter.java
   branches/bjorn/src/tiled/util/Base64.java
   branches/bjorn/src/tiled/util/MersenneTwister.java
   branches/bjorn/src/tiled/util/TileMergeHelper.java
   branches/bjorn/src/tiled/util/TiledConfiguration.java
   branches/bjorn/src/tiled/util/Util.java
   branches/bjorn/src/tiled/view/HexMapView.java
   branches/bjorn/src/tiled/view/IsoMapView.java
   branches/bjorn/src/tiled/view/MapView.java
   branches/bjorn/src/tiled/view/ObliqueMapView.java
   branches/bjorn/src/tiled/view/OrthoMapView.java
   branches/bjorn/src/tiled/view/ShiftedMapView.java
Log:
Set the Id keyword on all java files and some small changes.



Property changes on: branches/bjorn/src/tiled/core/KeyFrame.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/Map.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/MapLayer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/MapObject.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/MultilayerPlane.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/ObjectGroup.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/Sprite.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/Tile.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/TileIterator.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/TileLayer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/core/TileSet.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/ImageHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/MapHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/MapReader.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/MapWriter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/PluggableMapIO.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/xml/XMLMapTransformer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/xml/XMLMapWriter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/xml/XMLWriter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/io/xml/XMLWriterException.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/BrushDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/mapeditor/MapEditor.java
===================================================================
--- branches/bjorn/src/tiled/mapeditor/MapEditor.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/mapeditor/MapEditor.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -47,9 +47,9 @@
  *
  * @version $Id$
  */
-public class MapEditor implements ActionListener,
-    MouseListener, MouseMotionListener, MapChangeListener,
-    ListSelectionListener, ChangeListener, ComponentListener
+public class MapEditor implements ActionListener, MouseListener,
+        MouseMotionListener, MapChangeListener, ListSelectionListener,
+        ChangeListener, ComponentListener
 {
     // Constants and the like
     private static final int PS_POINT   = 0;
@@ -61,13 +61,16 @@
     private static final int PS_MOVE    = 6;
     private static final int PS_MOVEOBJ = 7;
 
-    private Cursor curDefault = null;
-    private Cursor curPaint   = null;
-    private Cursor curErase   = null;
-    private Cursor curPour    = null;
-    private Cursor curEyed    = null;
-    private Cursor curMarquee = null;
+    private static final int APP_WIDTH = 600;
+    private static final int APP_HEIGHT = 400;
 
+    private Cursor curDefault;
+    private Cursor curPaint;
+    private Cursor curErase;
+    private Cursor curPour;
+    private Cursor curEyed;
+    private Cursor curMarquee;
+
     /** Current release version */
     public static final String version = "0.5.2 (bjorn)";
 
@@ -83,14 +86,14 @@
     int currentPointerState;
     Tile currentTile;
     int currentLayer = -1;
-    boolean bMouseIsDown = false;
+    boolean bMouseIsDown;
     SelectionLayer cursorHighlight;
     Point mousePressLocation, mouseInitialPressLocation;
     Point moveDist;
     int mouseButton;
     AbstractBrush currentBrush;
-    SelectionLayer marqueeSelection = null;
-    MapLayer clipboardLayer = null;
+    SelectionLayer marqueeSelection;
+    MapLayer clipboardLayer;
 
     // GUI components
     JMenu       fileMenu, editMenu, selectMenu, viewMenu, helpMenu;
@@ -196,7 +199,7 @@
         appFrame.setContentPane(createContentPane());
         createMenuBar();
         appFrame.setJMenuBar(menuBar);
-        appFrame.setSize(600, 400);
+        appFrame.setSize(APP_WIDTH, APP_HEIGHT);
         setCurrentMap(null);
         updateRecent(null);
 
@@ -1025,7 +1028,7 @@
 
         Point tile = mapView.screenToTileCoords(e.getX(), e.getY());
         if (currentMap.inBounds(tile.x, tile.y)) {
-            tileCoordsLabel.setText("" + tile.x + ", " + tile.y);
+            tileCoordsLabel.setText(String.valueOf(tile.x) + ", " + tile.y);
         } else {
             tileCoordsLabel.setText(" ");
         }
@@ -1038,7 +1041,7 @@
         mousePressLocation = mapView.screenToTileCoords(e.getX(), e.getY());
         Point tile = mapView.screenToTileCoords(e.getX(), e.getY());
         if (currentMap.inBounds(tile.x, tile.y)) {
-            tileCoordsLabel.setText("" + tile.x + ", " + tile.y);
+            tileCoordsLabel.setText(String.valueOf(tile.x) + ", " + tile.y);
         } else {
             tileCoordsLabel.setText(" ");
         }
@@ -1139,7 +1142,7 @@
         } else if (command.equals("Import Tileset...")) {
             if (currentMap != null) {
                 JFileChooser ch = new JFileChooser(currentMap.getFilename());
-                MapReader readers[] = pluginLoader.getReaders();
+                MapReader[] readers = pluginLoader.getReaders();
                 for(int i = 0; i < readers.length; i++) {
                     try {
                         ch.addChoosableFileFilter(new TiledFileFilter(
@@ -1244,7 +1247,8 @@
 
     public void componentResized(ComponentEvent event) {
         // This can currently only happen when the map changes size
-        zoomLabel.setText("" + (int)(mapView.getZoom() * 100) + "%");
+        String s = String.valueOf((int) (mapView.getZoom() * 100)) + "%";
+        zoomLabel.setText(s);
     }
 
     public void componentShown(ComponentEvent event) {
@@ -1985,7 +1989,7 @@
                     mapView.getMode(MapView.PF_COORDINATES));
 
             Vector tilesets = currentMap.getTilesets();
-            if (tilesets.size() > 0) {
+            if (!tilesets.isEmpty()) {
                 tilePalettePanel.setTilesets(tilesets);
                 TileSet first = (TileSet)tilesets.get(0);
                 setCurrentTile(first.getFirstTile());
@@ -1994,14 +1998,15 @@
                 setCurrentTile(null);
             }
 
-            tileCoordsLabel.setText("" + (currentMap.getWidth() - 1) + ", " +
-                    (currentMap.getHeight() - 1));
+            tileCoordsLabel.setText(String.valueOf(currentMap.getWidth() - 1)
+                    + ", " + (currentMap.getHeight() - 1));
             tileCoordsLabel.setPreferredSize(null);
             Dimension size = tileCoordsLabel.getPreferredSize();
             tileCoordsLabel.setText(" ");
             tileCoordsLabel.setMinimumSize(size);
             tileCoordsLabel.setPreferredSize(size);
-            zoomLabel.setText("" + (int)(mapView.getZoom() * 100) + "%");
+            zoomLabel.setText(
+                    String.valueOf((int) (mapView.getZoom() * 100)) + "%");
         }
 
         zoomInAction.setEnabled(mapLoaded);
@@ -2129,7 +2134,7 @@
         return ImageIO.read(MapEditor.class.getResourceAsStream(fname));
     }
 
-    private ImageIcon loadIcon(String fname) {
+    private static ImageIcon loadIcon(String fname) {
         try {
             return new ImageIcon(loadImageResource(fname));
         } catch (IOException e) {
@@ -2144,11 +2149,6 @@
      * @param args the first argument may be a map file
      */
     public static void main(String[] args) {
-        //try {
-        //    UIManager.setLookAndFeel(
-        //            UIManager.getSystemLookAndFeelClassName());
-        //} catch (Exception e) {}
-
         MapEditor editor = new MapEditor();
 
         if (args.length > 0) {


Property changes on: branches/bjorn/src/tiled/mapeditor/MapEditor.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/TilePaletteDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/TilesetManager.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/brush/AbstractBrush.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/brush/Brush.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/brush/CustomBrush.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/brush/RandomBrush.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/brush/ShapeBrush.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/AboutDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/ConfigurationDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/ImageColorDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/NewMapDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/NewTilesetDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/ObjectDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/PluginDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/PropertiesDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/ResizeDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/SearchDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/TileDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dialogs/TileImageDialog.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dungeon/Builder.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/dungeon/CorridorBuilder.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/plugin/PluginClassLoader.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/plugin/TiledPlugin.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/selection/SelectionLayer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/undo/MapLayerEdit.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/undo/MapLayerStateEdit.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/undo/MoveLayerEdit.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/undo/UndoStack.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/ImageCellRenderer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/LayerTableModel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/MapChangeListener.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/MapChangedEvent.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/MapEventAdapter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/MapPrinter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/MultisetListRenderer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/PropertiesTableModel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TileDialogListRenderer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TileSelectionEvent.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TileSelectionListener.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TiledFileFilter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TilesetTableModel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/util/TransparentImageFilter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/BrushBrowser.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/ColorButton.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/ImageViewPanel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/IntegerSpinner.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/MiniMapViewer.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/ResizePanel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/TButton.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/TMenuItem.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/mapeditor/widget/TileButton.java
===================================================================
--- branches/bjorn/src/tiled/mapeditor/widget/TileButton.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/mapeditor/widget/TileButton.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -20,7 +20,9 @@
 import tiled.core.*;
 import tiled.mapeditor.util.*;
 
-
+/**
+ * @version $Id$
+ */
 public class TileButton extends JButton
 {
     private Tile tile;
@@ -59,8 +61,8 @@
 
             if (imgWidth > w) {
                 icon = new ImageIcon(tileImg.getScaledInstance(w,
-                            ((tileImg.getHeight(null) * w) / imgWidth),
-                            Image.SCALE_SMOOTH));
+                        (tileImg.getHeight(null) * w) / imgWidth,
+                        Image.SCALE_SMOOTH));
             } else {
                 icon = new ImageIcon(tileImg);
             }


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/TileButton.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/TilePalettePanel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/mapeditor/widget/VerticalStaticJPanel.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/plugins/mappy/Chunk.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/plugins/mappy/MappyMapReader.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/plugins/mappy/MappyMapWriter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/plugins/mappy/Util.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/plugins/tmw/TMWServerMapWriter.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/util/Base64.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/util/MersenneTwister.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/util/TileMergeHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/util/TiledConfiguration.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/util/Util.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/view/HexMapView.java
===================================================================
--- branches/bjorn/src/tiled/view/HexMapView.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/view/HexMapView.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -82,7 +82,7 @@
 
     public Dimension getPreferredSize() {
         Dimension tsize = getTileSize(zoom);
-        int border = ((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0;
+        int border = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
         int wbhc = (int)getWidthBetweenHexCentres();
 
         return new Dimension(
@@ -94,7 +94,7 @@
     protected void paintLayer(Graphics2D g2d, TileLayer layer, double zoom) {
         // Determine area to draw from clipping rectangle
         Dimension tsize = getTileSize(zoom);
-        int toffset = (((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0);
+        int toffset = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
 
         Rectangle clipRect = g2d.getClipBounds();
         int startX = clipRect.x / tsize.width;
@@ -278,7 +278,7 @@
         centrex = tx*tileSize.getWidth() + tileSize.getWidth() / 2;
         centrey = ty*tileSize.getHeight() + tileSize.getHeight() / 2;
 
-        //Go round the sides clockwise
+        // Go round the sides clockwise
         poly.addPoint(
                 (int)(centrex - tileSize.getWidth() / 2),
                 (int)centrey);


Property changes on: branches/bjorn/src/tiled/view/HexMapView.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/view/IsoMapView.java
===================================================================
--- branches/bjorn/src/tiled/view/IsoMapView.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/view/IsoMapView.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -21,7 +21,9 @@
 import tiled.core.*;
 import tiled.mapeditor.selection.SelectionLayer;
 
-
+/**
+ * @version $Id$
+ */
 public class IsoMapView extends MapView
 {
     public IsoMapView(Map m) {
@@ -55,7 +57,7 @@
 
         Rectangle clipRect = g2d.getClipBounds();
         Dimension tileSize = getTileSize(zoom);
-        int tileStepY = (tileSize.height / 2 == 0) ? 1 : tileSize.height / 2;
+        int tileStepY = tileSize.height / 2 == 0 ? 1 : tileSize.height / 2;
 
         Point rowItr = screenToTileCoords(clipRect.x, clipRect.y);
         rowItr.x--;
@@ -144,7 +146,7 @@
 
         Rectangle clipRect = g2d.getClipBounds();
         Dimension tileSize = getTileSize(zoom);
-        int tileStepY = (tileSize.height / 2 == 0) ? 1 : tileSize.height / 2;
+        int tileStepY = tileSize.height / 2 == 0 ? 1 : tileSize.height / 2;
         Font font = new Font("SansSerif", Font.PLAIN, tileSize.height / 4);
         g2d.setFont(font);
         FontRenderContext fontRenderContext = g2d.getFontRenderContext();
@@ -214,7 +216,7 @@
 
     public Dimension getPreferredSize() {
         Dimension tileSize = getTileSize(zoom);
-        int border = ((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0;
+        int border = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
         int mapSides = myMap.getHeight() + myMap.getWidth();
 
         return new Dimension(
@@ -237,8 +239,8 @@
         // Calculate map coords and divide by tile size (tiles assumed to
         // be square in normal projection)
         return new Point(
-                ((mx < 0) ? mx - tileSize.height : mx) / tileSize.height,
-                ((my < 0) ? my - tileSize.height : my) / tileSize.height);
+                (mx < 0 ? mx - tileSize.height : mx) / tileSize.height,
+                (my < 0 ? my - tileSize.height : my) / tileSize.height);
     }
 
     protected Polygon createGridPolygon(int tx, int ty, int border) {
@@ -247,11 +249,11 @@
         tileSize.height -= border * 2;
 
         Polygon poly = new Polygon();
-        poly.addPoint((tx + tileSize.width / 2 + border), ty + border);
-        poly.addPoint((tx + tileSize.width), ty + tileSize.height / 2 + border);
-        poly.addPoint((tx + tileSize.width / 2 + border),
+        poly.addPoint(tx + tileSize.width / 2 + border, ty + border);
+        poly.addPoint(tx + tileSize.width, ty + tileSize.height / 2 + border);
+        poly.addPoint(tx + tileSize.width / 2 + border,
                 ty + tileSize.height + border);
-        poly.addPoint((tx + border), ty + tileSize.height / 2 + border);
+        poly.addPoint(tx + border, ty + tileSize.height / 2 + border);
         return poly;
     }
 


Property changes on: branches/bjorn/src/tiled/view/IsoMapView.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/view/MapView.java
===================================================================
--- branches/bjorn/src/tiled/view/MapView.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/view/MapView.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -22,7 +22,6 @@
 import tiled.mapeditor.selection.SelectionLayer;
 import tiled.util.TiledConfiguration;
 
-
 /**
  * The base class for map views. This is meant to be extended for different
  * tile map orientations, such as orthagonal and isometric.
@@ -39,14 +38,15 @@
     public static int ZOOM_NORMALSIZE = 5;
 
     protected Map myMap;
-    protected int modeFlags = 0;
+    protected int modeFlags;
     protected double zoom = 1.0;
-    protected int zoomLevel = 5;
+    protected int zoomLevel = ZOOM_NORMALSIZE;
     protected static double[] zoomLevels = {
         0.0625, 0.125, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0
     };
 
     private SmoothZoomer smoothZoomer;
+    private static final Color DEFAULT_BACKGROUND_COLOR = new Color(64, 64, 64);
 
 
     public MapView(Map m) {
@@ -205,13 +205,15 @@
             String colorString = conf.getValue("tiled.background.color");
             g2d.setColor(Color.decode(colorString));
         } catch (NumberFormatException e) {
-            g2d.setColor(new Color(64, 64, 64));
+            g2d.setColor(DEFAULT_BACKGROUND_COLOR);
         }
 
         g2d.fillRect(clip.x, clip.y, clip.width, clip.height);
 
         while (li.hasNext()) {
-            if ((layer = (MapLayer)li.next()) != null) {
+            layer = (MapLayer)li.next();
+
+            if (layer != null) {
                 float opacity = layer.getOpacity();
                 if (layer.isVisible() && opacity > 0.0f) {
                     if (opacity < 1.0f) {


Property changes on: branches/bjorn/src/tiled/view/MapView.java
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: branches/bjorn/src/tiled/view/ObliqueMapView.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/view/OrthoMapView.java
===================================================================
--- branches/bjorn/src/tiled/view/OrthoMapView.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/view/OrthoMapView.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -29,7 +29,9 @@
 import tiled.core.*;
 import tiled.mapeditor.selection.SelectionLayer;
 
-
+/**
+ * @version $Id$
+ */
 public class OrthoMapView extends MapView
 {
     public OrthoMapView(Map m) {
@@ -59,7 +61,7 @@
 
     public Dimension getPreferredSize() {
         Dimension tsize = getTileSize(zoom);
-        int border = ((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0;
+        int border = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
 
         return new Dimension(
                 myMap.getWidth() * tsize.width + border,
@@ -70,7 +72,7 @@
         // Determine tile size and offset
         Dimension tsize = getTileSize(zoom);
         if (tsize.width <= 0 || tsize.height <= 0) return;
-        int toffset = (((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0);
+        int toffset = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
 
         // Determine area to draw from clipping rectangle
         Rectangle clipRect = g2d.getClipBounds();
@@ -149,7 +151,7 @@
                 RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
 
         // Determine tile size and offset
-        int toffset = (((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0);
+        int toffset = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
         Font font = new Font("SansSerif", Font.PLAIN, tsize.height / 4);
         g2d.setFont(font);
         FontRenderContext fontRenderContext = g2d.getFontRenderContext();
@@ -183,7 +185,7 @@
     public void repaintRegion(Rectangle region) {
         Dimension tsize = getTileSize(zoom);
         if (tsize.width <= 0 || tsize.height <= 0) return;
-        int toffset = (((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0);
+        int toffset = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
         int maxExtraHeight =
             (int)((myMap.getTileHeightMax() * zoom + toffset) - tsize.height);
 
@@ -194,7 +196,7 @@
         int endY = (region.y + region.height) * tsize.height;
 
         Rectangle dirty =
-            new Rectangle(startX, startY, (endX - startX), (endY - startY));
+            new Rectangle(startX, startY, endX - startX, endY - startY);
 
         repaint(dirty);
     }
@@ -205,7 +207,7 @@
     }
 
     protected Dimension getTileSize(double zoom) {
-        int grid = (((modeFlags & PF_GRIDMODE) != 0) ? 1 : 0);
+        int grid = (modeFlags & PF_GRIDMODE) != 0 ? 1 : 0;
 
         return new Dimension(
                 (int)(myMap.getTileWidth() * zoom) + grid,


Property changes on: branches/bjorn/src/tiled/view/OrthoMapView.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: branches/bjorn/src/tiled/view/ShiftedMapView.java
===================================================================
--- branches/bjorn/src/tiled/view/ShiftedMapView.java	2006-02-11 11:42:38 UTC (rev 574)
+++ branches/bjorn/src/tiled/view/ShiftedMapView.java	2006-02-11 12:37:18 UTC (rev 575)
@@ -19,6 +19,9 @@
 import tiled.core.ObjectGroup;
 import tiled.core.TileLayer;
 
+/**
+ * @version $Id$
+ */
 public class ShiftedMapView extends MapView
 {
     private int horSide;       // Length of horizontal sides


Property changes on: branches/bjorn/src/tiled/view/ShiftedMapView.java
___________________________________________________________________
Name: svn:keywords
   + Id




More information about the tiled-commit mailing list