From: <aki...@us...> - 2006-10-01 18:24:50
|
Revision: 440 http://svn.sourceforge.net/gridarta/?rev=440&view=rev Author: akirschbaum Date: 2006-10-01 11:24:46 -0700 (Sun, 01 Oct 2006) Log Message: ----------- Fix incorrect indentation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-10-01 17:50:49 UTC (rev 439) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-10-01 18:24:46 UTC (rev 440) @@ -371,7 +371,7 @@ if (!mapControl.isPointValid(mapPos)) { // outside map - return; + return; } final GameObject newTail = tmp.createClone(mapPos.x, mapPos.y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 20:08:59
|
Revision: 760 http://svn.sourceforge.net/gridarta/?rev=760&view=rev Author: akirschbaum Date: 2006-12-01 12:08:55 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Declare variable more local. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-30 22:02:41 UTC (rev 759) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-01 20:08:55 UTC (rev 760) @@ -371,11 +371,10 @@ * for default archetypes, and a clone for non-default archetypes. */ private void addArchToMap(final MapControl mapControl, final GameObject gameObject, final Point pos, final boolean allowDouble, final boolean fillBelow) { - final GameObject newHead; if (gameObject.isArchetype()) { mapControl.addArchToMap(gameObject.getArchetypeName(), pos, allowDouble, false, fillBelow); } else { - newHead = gameObject.createClone(pos.x, pos.y); + final GameObject newHead = gameObject.createClone(pos.x, pos.y); for (GameObject tmp = gameObject.getArchetype().getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { final Point mapPos = new Point(pos.x + tmp.getMultiX(), pos.y + tmp.getMultiY()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-16 22:38:19
|
Revision: 1116 http://svn.sourceforge.net/gridarta/?rev=1116&view=rev Author: akirschbaum Date: 2006-12-16 14:38:19 -0800 (Sat, 16 Dec 2006) Log Message: ----------- Replace redundant variable. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-16 21:30:26 UTC (rev 1115) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-16 22:38:19 UTC (rev 1116) @@ -72,8 +72,6 @@ /** MapControl for {@link #copyMap}. */ @Nullable private MapControl copyMapCtrl; - private boolean empty; // Is the CopyBuffer empty? - /** The dummy MapArchObject of {@link #copyMap}. */ private final MapArchObject mapArch; @@ -86,7 +84,6 @@ * @param mainControl main control */ public CopyBuffer(final CMainControl mainControl) { - empty = true; // Buffer is empty this.mainControl = mainControl; // link main control in mapArch = new MapArchObject(); @@ -105,7 +102,7 @@ * <code>false</code> */ public boolean isEmpty() { - return empty; + return copyMap == null; } /** @@ -146,19 +143,18 @@ // Prepare the buffer (if it's a cut or copy) if (mode == Mode.DO_CUT || mode == Mode.DO_COPY) { - if (empty) { - empty = false; // from now on the buffer is never empty again - mainControl.getMainView().refreshMenus(); // "Paste" enabled - } + final boolean wasEmpty = copyMap == null; // recycle and resize buffer bufWidth = Math.abs(selRec.width) + 1; // new width bufHeight = Math.abs(selRec.height) + 1; // new height mapArch.setMapSize(new Size2D(bufWidth, bufHeight)); - copyMap = null; // free objects (at least that is the plan and theory) - copyMapCtrl = null; copyMap = new DefaultMapModel(mainControl, copyMapCtrl, null, mapArch); // new MapModel copyMapCtrl = new MapControl(mainControl, null, mapArch, false, null); // new MapControl + + if (wasEmpty) { + mainControl.getMainView().refreshMenus(); // "Paste" enabled + } } // cycle through all tile coordinates which are highlighted: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 00:04:03
|
Revision: 1119 http://svn.sourceforge.net/gridarta/?rev=1119&view=rev Author: akirschbaum Date: 2006-12-16 16:04:01 -0800 (Sat, 16 Dec 2006) Log Message: ----------- Make paste menu entry work. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 00:01:21 UTC (rev 1118) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 00:04:01 UTC (rev 1119) @@ -92,8 +92,6 @@ mapArch.setMapSize(new Size2D(bufWidth, bufHeight)); mapArch.setFileName("cb"); mapArch.setMapName("cb"); - - copyMap = new DefaultMapModel(this.mainControl, copyMapCtrl, null, mapArch); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 00:06:12
|
Revision: 1120 http://svn.sourceforge.net/gridarta/?rev=1120&view=rev Author: akirschbaum Date: 2006-12-16 16:06:13 -0800 (Sat, 16 Dec 2006) Log Message: ----------- Add assert statement. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 00:04:01 UTC (rev 1119) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 00:06:13 UTC (rev 1120) @@ -135,9 +135,7 @@ */ private void copyNCut(final MapControl mapControl, final Mode mode) { final Rectangle selRec = mapControl.getMapGrid().getSelectedRec(); - if (selRec == null) { - return; - } + assert selRec != null; // Prepare the buffer (if it's a cut or copy) if (mode == Mode.DO_CUT || mode == Mode.DO_COPY) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 12:36:34
|
Revision: 1132 http://svn.sourceforge.net/gridarta/?rev=1132&view=rev Author: akirschbaum Date: 2006-12-17 04:36:33 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 12:33:53 UTC (rev 1131) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 12:36:33 UTC (rev 1132) @@ -182,10 +182,6 @@ gameObject.remove(); } mapControl.getMapModel().endTransaction(); - // finally redraw the map - if (mode != Mode.DO_COPY) { - mainControl.refreshCurrentMap(); - } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 16:35:51
|
Revision: 1155 http://svn.sourceforge.net/gridarta/?rev=1155&view=rev Author: akirschbaum Date: 2006-12-17 08:35:50 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 16:28:59 UTC (rev 1154) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 16:35:50 UTC (rev 1155) @@ -228,8 +228,7 @@ } mapControl.getMapModel().endTransaction(); - // now the map and toolbars must be redrawn - mapControl.repaint(); + // now the toolbars must be redrawn mainControl.getMainView().refreshMapTileList(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-04 14:46:53
|
Revision: 1801 http://svn.sourceforge.net/gridarta/?rev=1801&view=rev Author: akirschbaum Date: 2007-02-04 06:46:52 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Unify comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-02-04 14:45:42 UTC (rev 1800) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-02-04 14:46:52 UTC (rev 1801) @@ -368,7 +368,7 @@ * @param mapControl MapControl of the active map we paste on * @param startX starting x-coord for floodfill * @param startY starting y-coord for floodfill - * @param archList List of GameObjects to fill with + * @param archList GameObject list to fill with */ private void floodfill(final MapControl mapControl, final int startX, final int startY, final List<GameObject> archList) { final GameObject gameObject = archList.get(MainControl.rnd.nextInt(archList.size())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-25 22:04:51
|
Revision: 1983 http://svn.sourceforge.net/gridarta/?rev=1983&view=rev Author: akirschbaum Date: 2007-03-25 15:04:48 -0700 (Sun, 25 Mar 2007) Log Message: ----------- Use MapView instead of MapViewIFrame. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-25 22:02:33 UTC (rev 1982) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-25 22:04:48 UTC (rev 1983) @@ -21,6 +21,7 @@ import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; +import cfeditor.gui.MapView; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; @@ -315,12 +316,12 @@ if (mapControl == null) { return null; } - final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + final MapView mapView = mapControl.getMapViewFrame(); final Iterable<MapSquare<GameObject, MapArchObject, Archetype>> mapSquares; - if (mapViewIFrame == null) { + if (mapView == null) { mapSquares = mapControl.getAllSquares(); } else { - final List<MapSquare<GameObject, MapArchObject, Archetype>> selectedMapSquares = mapViewIFrame.getView().getSelectedSquares(); + final List<MapSquare<GameObject, MapArchObject, Archetype>> selectedMapSquares = mapView.getView().getSelectedSquares(); if (selectedMapSquares.isEmpty()) { mapSquares = mapControl.getAllSquares(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-29 22:31:58
|
Revision: 2008 http://svn.sourceforge.net/gridarta/?rev=2008&view=rev Author: akirschbaum Date: 2007-03-29 15:31:59 -0700 (Thu, 29 Mar 2007) Log Message: ----------- Improve comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-29 22:10:56 UTC (rev 2007) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-29 22:31:59 UTC (rev 2008) @@ -86,7 +86,7 @@ /** * Executing the Clear command. - * @param mapView map view to clear + * @param mapView the map view to clear */ public void clear(final MapView mapView) { copyNCut(mapView, Mode.DO_CLEAR); @@ -94,7 +94,7 @@ /** * Executing the Cut command. - * @param mapView map view to cut from + * @param mapView the map view to cut from */ public void cut(final MapView mapView) { copyNCut(mapView, Mode.DO_CUT); @@ -102,7 +102,7 @@ /** * Executing the Copy command. - * @param mapView map view to copy from + * @param mapView the map view to copy from */ public void copy(final MapView mapView) { copyNCut(mapView, Mode.DO_COPY); @@ -111,7 +111,7 @@ /** * copyNCut implements clear, cut and copy in one function (since they are * so similar). - * @param mapView map view to operate on + * @param mapView the map view to copy from * @param mode defines if we have a cut, copy or paste action */ private void copyNCut(final MapView mapView, final Mode mode) { @@ -127,7 +127,7 @@ } mapArch.setMapSize(new Size2D(selRec.width + 1, selRec.height + 1)); - copyMapCtrl = new MapControl(mainControl, null, mapArch, false, null); // new MapControl + copyMapCtrl = new MapControl(mainControl, null, mapArch, false, null); copyMapCtrl.setMapFileName("cb"); copyMap = copyMapCtrl.getMapModel(); @@ -181,7 +181,7 @@ /** * Executing the Paste command. - * @param mapView map view to paste on + * @param mapView the map view to paste on * @todo paste only subregions when a region is selected */ public void paste(final MapView mapView) { @@ -222,10 +222,10 @@ /** * Executing the Fill command. - * @param mapView map view to fill on + * @param mapView the map view to fill on * @param fillBelow if true, the filling content is placed *below* the * existing map - * @param seed map view of the random objects or <code>null</code> to use the currently selected Archetype. + * @param seed map view of the random objects or <code>null</code> to use the currently selected Archetype. * @param density the fill density in percent; -1 to disable */ public void fill(final MapView mapView, final boolean fillBelow, final MapView seed, final int density) { @@ -287,7 +287,7 @@ /** * Get a random gameObject from a map. - * @param mapView map view to get random gameObject from + * @param mapView the map view to get random gameObject from * @param max Initial size of Array in #getMapArchList * @return random gameObject from <var>mapView</var> */ @@ -357,7 +357,7 @@ /** * Floodfill the the map, starting at the cursor position. * - * @param mapView map view to fill + * @param mapView the map view to fill */ public void floodfill(@NotNull final MapView mapView) { final Point cursor = mapView.getView().getCursorPosition(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-30 19:11:53
|
Revision: 2022 http://svn.sourceforge.net/gridarta/?rev=2022&view=rev Author: akirschbaum Date: 2007-03-30 12:11:53 -0700 (Fri, 30 Mar 2007) Log Message: ----------- Unify comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-30 19:11:12 UTC (rev 2021) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-30 19:11:53 UTC (rev 2022) @@ -309,7 +309,7 @@ /** * Returns a list of all ArchObjects on a map control. * Tail ArchObjects will not be in the list. - * @param mapControl map control to get ArchList from + * @param mapControl the map control to get ArchList from * @param max Initial size of Array size * @return Array of all ArchObjects */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-30 19:16:12
|
Revision: 2023 http://svn.sourceforge.net/gridarta/?rev=2023&view=rev Author: akirschbaum Date: 2007-03-30 12:16:13 -0700 (Fri, 30 Mar 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-30 19:11:53 UTC (rev 2022) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-03-30 19:16:13 UTC (rev 2023) @@ -198,8 +198,7 @@ if (mapControl.isPointValid(pos)) { for (final GameObject gameObject : square) { if (!gameObject.isMulti()) { - final GameObject clone = gameObject.createClone(pos.x, pos.y); - mapControl.getMapModel().addGameObjectToMap(clone, false); + addArchToMap(mapControl, gameObject, pos, true, false); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |