You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-12-17 17:17:11
|
Revision: 1159 http://svn.sourceforge.net/gridarta/?rev=1159&view=rev Author: akirschbaum Date: 2006-12-17 09:17:10 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 17:12:54 UTC (rev 1158) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 17:17:10 UTC (rev 1159) @@ -338,9 +338,6 @@ } mapControl.getMapModel().endTransaction(); - - // now the map and toolbars must be redrawn - mapControl.repaint(); mainControl.getMainView().refreshMapTileList(); return replaceCount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 17:12:58
|
Revision: 1158 http://svn.sourceforge.net/gridarta/?rev=1158&view=rev Author: akirschbaum Date: 2006-12-17 09:12:54 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 16:54:48 UTC (rev 1157) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 17:12:54 UTC (rev 1158) @@ -1274,10 +1274,12 @@ // path points to the same map if (exitPos.x == 0 && exitPos.y == 0) { ACTION_FACTORY.showMessageDialog(mainView, "enterExitNowhere"); - } else if (currentMap.isPointValid(exitPos)) { - currentMap.getMapViewFrame().setHotspot(exitPos); + } else if (!currentMap.isPointValid(exitPos)) { + ACTION_FACTORY.showMessageDialog(mainView, "enterExitOutside"); } else { - ACTION_FACTORY.showMessageDialog(mainView, "enterExitOutside"); + currentMap.getMapModel().beginTransaction("Enter Exit"); + currentMap.getMapViewFrame().setCursorPosition(exitPos); + currentMap.getMapModel().endTransaction(); } } else { // path points to a different map @@ -1316,7 +1318,9 @@ exitPos.x = currentMap.getMapModel().getMapArchObject().getEnterX(); exitPos.y = currentMap.getMapModel().getMapArchObject().getEnterY(); } - currentMap.getMapViewFrame().setHotspot(exitPos); // set hotspot + currentMap.getMapModel().beginTransaction("Enter Exit"); + currentMap.getMapViewFrame().setCursorPosition(exitPos); + currentMap.getMapModel().endTransaction(); // Update the main view so the new map instantly pops up. mainView.update(mainView.getGraphics()); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 16:54:48 UTC (rev 1157) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 17:12:54 UTC (rev 1158) @@ -263,39 +263,10 @@ } /** - * Highlight the tile at given coordinates (just as - * if it had been selected with leftclick). Besides, the mapview is - * always centered on the coordinates as far as possible. - * @param point Coordinates to set hotsopt to. + * Set the cursor position. + * @param cursorPosition cursor position + * @see #getCursorPosition() */ - public void setHotspot(final Point point) { - // set the highlighted spot: - - // set scroll position accordingly to center on target - final Rectangle scrollto = new Rectangle((point.x + 1) * 32 + 16 - getViewport().getViewRect().width / 2, - (point.y + 1) * 32 + 16 - getViewport().getViewRect().height / 2, - getViewport().getViewRect().width, - getViewport().getViewRect().height); - if (scrollto.x + scrollto.width > getViewport().getViewSize().width) { - scrollto.x = getViewport().getViewSize().width - scrollto.width; - } - if (scrollto.x < 0) { - scrollto.x = 0; - } - if (scrollto.y + scrollto.height > getViewport().getViewSize().height) { - scrollto.y = getViewport().getViewSize().height - scrollto.height; - } - if (scrollto.y < 0) { - scrollto.y = 0; - } - getViewport().setViewPosition(scrollto.getLocation()); - //getViewport().scrollRectToVisible(scrollto); - - // repaint map to display selection - mapControl.repaint(); - mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), null); - } - public void setCursorPosition(final Point cursorPosition) { mapCursor.setLocation(cursorPosition); } Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 16:54:48 UTC (rev 1157) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 17:12:54 UTC (rev 1158) @@ -151,8 +151,8 @@ view.closeNotify(); } - public void setHotspot(final Point point) { - view.setHotspot(point); + public void setCursorPosition(final Point cursorPosition) { + view.setCursorPosition(cursorPosition); } public void printFullImage(final File file) throws IOException { 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:54:47
|
Revision: 1157 http://svn.sourceforge.net/gridarta/?rev=1157&view=rev Author: akirschbaum Date: 2006-12-17 08:54:48 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove variable that is only written. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 16:39:06 UTC (rev 1156) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 16:54:48 UTC (rev 1157) @@ -106,8 +106,6 @@ private MapCursor mapCursor; - private final Point mapMouseRightPos = new Point(); // coordinates of selected tile on the map - private final boolean[] needMpanelUpdate; // indicates that the mapArchPanel needs private MapGrid mapGrid; @@ -143,8 +141,6 @@ needMpanelUpdate[0] = false; needMpanelUpdate[1] = false; needMpanelUpdate[2] = false; - mapMouseRightPos.x = -1; - mapMouseRightPos.y = -1; if (isPickmap()) { setBackground(IGUIConstants.BG_COLOR); @@ -274,8 +270,6 @@ */ public void setHotspot(final Point point) { // set the highlighted spot: - mapMouseRightPos.x = point.x; - mapMouseRightPos.y = point.y; // set scroll position accordingly to center on target final Rectangle scrollto = new Rectangle((point.x + 1) * 32 + 16 - getViewport().getViewRect().width / 2, @@ -345,7 +339,6 @@ } void setMapAndArchPosition(final GameObject gameObject, final Point pos) { - mapMouseRightPos.setLocation(pos); if (pos.x == -1 || pos.y == -1) { mainControl.getMainView().setMapTileList(null, null); } else { 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:39:06
|
Revision: 1156 http://svn.sourceforge.net/gridarta/?rev=1156&view=rev Author: akirschbaum Date: 2006-12-17 08:39:06 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 16:35:50 UTC (rev 1155) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 16:39:06 UTC (rev 1156) @@ -229,18 +229,6 @@ return mapCursor.isActive(); } - /** Turn the highlight off. */ - public void unHighlight() { - if (mapCursor.isActive()) { - mapCursor.deactivate(); - mainControl.getMainView().refreshMenus(); - } - - // repaint map to display selection no more - mapControl.repaint(); - mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), null); - } - public int getActiveEditType() { return mapControl.getActiveEditType(); } Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 16:35:50 UTC (rev 1155) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 16:39:06 UTC (rev 1156) @@ -131,10 +131,6 @@ return view.isHighlight(); } - public void unHighlight() { - view.unHighlight(); - } - public int getActiveEditType() { return view.getActiveEditType(); } 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...> - 2006-12-17 16:28:58
|
Revision: 1154 http://svn.sourceforge.net/gridarta/?rev=1154&view=rev Author: akirschbaum Date: 2006-12-17 08:28:59 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove redundant this qualifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:27:08 UTC (rev 1153) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:28:59 UTC (rev 1154) @@ -149,7 +149,7 @@ ((JComponent) e.getSource()).scrollRectToVisible(r); } }; - this.addMouseMotionListener(doScrollRectToVisible); + addMouseMotionListener(doScrollRectToVisible); } /** This method is called when the look and feel has changed. */ 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:27:08
|
Revision: 1153 http://svn.sourceforge.net/gridarta/?rev=1153&view=rev Author: akirschbaum Date: 2006-12-17 08:27:08 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:21:56 UTC (rev 1152) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:27:08 UTC (rev 1153) @@ -107,11 +107,11 @@ /** * Creates a DefaultLevelRenderer. - * @param mapViewBasic MapView to render. - * @param mainControl MainControl, used for getting icons and similar. - * @param mapControl MapControl of the map to render. + * @param mapViewBasic MapView to render + * @param mainControl MainControl, used for getting icons and similar + * @param mapControl MapControl of the map to render * @param pickmap <code>true</code> if the rendered map is a pickmap, otherwise <code>false</code> - * @param mapGrid Grid to render. + * @param mapGrid Grid to render */ public DefaultLevelRenderer(final CMapViewBasic mapViewBasic, final CMainControl mainControl, final MapControl mapControl, final boolean pickmap, final MapGrid mapGrid) { this.mapViewBasic = mapViewBasic; @@ -162,7 +162,7 @@ /** * Returns whether the rendered map is a pickmap. - * @return <code>true</code> if the rendered map is a pickmap, otherwise <code>false</code>. + * @return <code>true</code> if the rendered map is a pickmap, otherwise <code>false</code> */ public boolean isPickmap() { return isPickmap; @@ -228,7 +228,7 @@ /** * Paints this component. - * @param grfx The graphics context to paint to. + * @param grfx The graphics context to paint to * @param isSnapshot true when this drawing is for a * "screenshot"-image, false for normal drawing */ @@ -315,7 +315,7 @@ * Important: This method currently works only for standard * (rectangular) view. Iso has overlapping tiles which makes this a lot * more difficult. :( - * @param point Map coordinates for the tile to draw. + * @param point Map coordinates for the tile to draw */ @Override public void paintTile(final Point point) { final Graphics grfx; Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:21:56 UTC (rev 1152) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:27:08 UTC (rev 1153) @@ -98,10 +98,10 @@ /** * Creates a DefaultLevelRenderer. - * @param mainControl MainControl, used for getting icons and similar. - * @param mapControl MapControl of the map to render. + * @param mainControl MainControl, used for getting icons and similar + * @param mapControl MapControl of the map to render * @param pickmap <code>true</code> if the rendered map is a pickmap, otherwise <code>false</code> - * @param mapGrid Grid to render. + * @param mapGrid Grid to render */ public DefaultLevelRenderer(final CMainControl mainControl, final MapControl mapControl, final boolean pickmap, final MapGrid mapGrid) { this.mainControl = mainControl; @@ -178,8 +178,8 @@ } /** - * Returns whether the associated map is a pickmap. - * @return <code>true</code> if the associated map is a pickmap, otherwise <code>false</code>. + * Returns whether the rendered map is a pickmap. + * @return <code>true</code> if the rendered map is a pickmap, otherwise <code>false</code> */ public boolean isPickmap() { return isPickmap; @@ -236,7 +236,7 @@ /** * Paints this component. - * @param grfx The graphics context to paint to. + * @param grfx The graphics context to paint to */ private void paintComponent2(final Graphics2D grfx) { final long start = System.currentTimeMillis(); @@ -285,7 +285,7 @@ /** * Get smallest Rectangle on map that needs to be repaint. - * @param visRec visible Rectangle. + * @param visRec visible Rectangle * @return rectangle on the map. */ private Rectangle getRepaintRec(final Rectangle visRec) { @@ -470,7 +470,7 @@ /** * Sets the ArchObjects that are known to contain errors. - * @param erraneousArchObjects the ArchObjects that are known to contain errors. + * @param erraneousArchObjects the ArchObjects that are known to contain errors */ public void setErraneousArchObjects(final Map<net.sf.gridarta.gameobject.GameObject, ValidationError> erraneousArchObjects) { final Map<net.sf.gridarta.gameobject.GameObject, ValidationError> erraneousArchObjects1 = erraneousArchObjects; @@ -478,7 +478,7 @@ /** * Sets the MapSquares that are known to contain errors. - * @param erraneousMapSquares the MapSquares that are known to contain errors. + * @param erraneousMapSquares the MapSquares that are known to contain errors */ public void setErraneousMapSquares(final Map<MapSquare<? extends net.sf.gridarta.gameobject.GameObject>, ValidationError> erraneousMapSquares) { this.erraneousMapSquares = erraneousMapSquares; 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:21:56
|
Revision: 1152 http://svn.sourceforge.net/gridarta/?rev=1152&view=rev Author: akirschbaum Date: 2006-12-17 08:21:56 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:11:55 UTC (rev 1151) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:21:56 UTC (rev 1152) @@ -86,10 +86,8 @@ private final boolean isPickmap; /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ - private int borderOffset; + private final Point borderOffset = new Point(); - private final CMainControl mainControl; - private final Color[] highLightMask; private BufferedImage backBuffer; @@ -99,10 +97,12 @@ private final AffineTransform renderTransform; - private MapModel mapModel; + private final MapModel mapModel; - private Size2D mapSize = new Size2D(1, 1); + private final CMainControl mainControl; + private Size2D mapSize; + private final MapGrid mapGrid; /** @@ -126,17 +126,17 @@ // initialize the tmp. graphic buffer tmpImage = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB); tmpGrfx = tmpImage.getGraphics(); - if (!pickmap) { + if (isPickmap) { + tmpGrfx.setColor(IGUIConstants.BG_COLOR); + } else { tmpGrfx.setColor(mainControl.getMainView().getBackground()); // background color of window - } else { - tmpGrfx.setColor(IGUIConstants.BG_COLOR); } tmpIcon = new ImageIcon(); setFocusable(true); - borderOffset = !pickmap ? 32 : 0; - renderTransform = new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, (float) borderOffset, (float) borderOffset); + borderOffset.setLocation(pickmap ? 0 : 32, pickmap ? 0 : 32); + renderTransform = new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, borderOffset.x, borderOffset.y); highLightMask = new Color[]{ new Color(1.0f, 0.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 0.0f, 0.33f), @@ -181,10 +181,10 @@ bufGrfx.fillRect(0, 0, mapWidth, mapHeight); // paint the mapview into the image - final int storeOffset = borderOffset; - borderOffset = 0; + final Point storeOffset = new Point(borderOffset); + borderOffset.setLocation(0, 0); paintComponent((Graphics2D) bufGrfx, true); - borderOffset = storeOffset; + borderOffset.setLocation(storeOffset); return bufImage; } @@ -203,10 +203,10 @@ repaint(); } else { log.debug("modelChanged(), we are in a backbuffered behaviour."); - final int storeOffset = borderOffset; - borderOffset = 0; + final Point storeOffset = new Point(borderOffset); + borderOffset.setLocation(0, 0); paintComponent((Graphics2D) backBuffer.getGraphics(), false); - borderOffset = storeOffset; + borderOffset.setLocation(storeOffset); repaint(); } } @@ -219,8 +219,8 @@ * @return Boundary rectangle of tile */ public Rectangle getTileBounds(final Point p) { - tmpRec.x = borderOffset + p.x * 32; - tmpRec.y = borderOffset + p.y * 32; + tmpRec.x = borderOffset.x + p.x * 32; + tmpRec.y = borderOffset.y + p.y * 32; tmpRec.width = 32; tmpRec.height = 32; return tmpRec; @@ -253,9 +253,9 @@ if (!mapModel.containsArchObject(point)) { // empty square if (isPickmap) { - grfx.fillRect(point.x * 32 + borderOffset, point.y * 32 + borderOffset, 32, 32); + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); } else { - CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); + CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); } } else { for (final GameObject node : mapModel.getMapSquare(point)) { @@ -265,17 +265,17 @@ } if (mainControl.isTileEdit(node) || isPickmap) { if (node.getArchetypeName() == null) { - CMainControl.getNoarchTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); + CMainControl.getNoarchTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); } else if (node.getFaceFlag()) { - CMainControl.getNofaceTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); + CMainControl.getNofaceTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); } else { if (node.getFaceNr() == -1) { - CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); + CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); } else { // draw object face final ImageIcon img = archlist.getFace(node.getFaceNr()); if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { - archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); + archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); } else if (node.isHead()) { oversizedMultiHeads.addElement(node); // store oversized arches for later } @@ -291,7 +291,7 @@ final Color alpha = highLightMask[i]; final Color c = grfx.getColor(); grfx.setColor(alpha); - grfx.fillRect(point.x * 32 + borderOffset, point.y * 32 + borderOffset, 32, 32); + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); grfx.setColor(c); } } @@ -299,7 +299,7 @@ // at the end, we have to draw the oversized multipart images on top of the rest for (int i = 0; i < oversizedMultiHeads.size(); i++) { final GameObject node = oversizedMultiHeads.elementAt(i); - archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, node.getMapX() * 32 + borderOffset, node.getMapY() * 32 + borderOffset); + archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, node.getMapX() * 32 + borderOffset.x, node.getMapY() * 32 + borderOffset.y); } if (!isSnapshot) { @@ -334,7 +334,7 @@ // draw the empty-tile icon (direcly to the mapview) if (isPickmap) { grfx.setColor(IGUIConstants.BG_COLOR); - grfx.fillRect(point.x * 32 + borderOffset, point.y * 32 + borderOffset, 32, 32); + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); } else { CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); } @@ -432,16 +432,16 @@ private void paintSelection(final Graphics2D grfx) { for (int y = 0; y < mapSize.getHeight(); y++) { for (int x = 0; x < mapSize.getWidth(); x++) { - if (grfx.hitClip(x * 32 + borderOffset, y * 32 + borderOffset, 32, 32)) { + if (grfx.hitClip(x * 32 + borderOffset.x, y * 32 + borderOffset.y, 32, 32)) { final int gridFlags = mapGrid.getFlags(x, y); if ((gridFlags & MapGrid.GRID_FLAG_SELECTION) != 0) { - CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); } if ((gridFlags & MapGrid.GRID_FLAG_SELECTING) != 0) { - CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); } if ((gridFlags & MapGrid.GRID_FLAG_CURSOR) != 0) { - CMainControl.getMapCursorIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getMapCursorIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); } } } @@ -459,17 +459,17 @@ if (mapViewBasic.isGridVisible()) { for (int x = 0; x <= mapGrid.getSize().getWidth(); x++) { grfx.drawLine( - x * 32 + borderOffset, - borderOffset, - x * 32 + borderOffset, - mapGrid.getSize().getHeight() * 32 + borderOffset); + x * 32 + borderOffset.x, + borderOffset.x, + x * 32 + borderOffset.y, + mapGrid.getSize().getHeight() * 32 + borderOffset.y); } for (int y = 0; y <= mapGrid.getSize().getHeight(); y++) { grfx.drawLine( - borderOffset, - y * 32 + borderOffset, - mapGrid.getSize().getWidth() * 32 + borderOffset, - y * 32 + borderOffset); + borderOffset.x, + y * 32 + borderOffset.y, + mapGrid.getSize().getWidth() * 32 + borderOffset.x, + y * 32 + borderOffset.y); } } } 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:11:55
|
Revision: 1151 http://svn.sourceforge.net/gridarta/?rev=1151&view=rev Author: akirschbaum Date: 2006-12-17 08:11:55 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Add final modifier; remove redundant initialization. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:06:35 UTC (rev 1150) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:11:55 UTC (rev 1151) @@ -68,7 +68,7 @@ private final boolean isPickmap; /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ - private Point borderOffset = new Point(); + private final Point borderOffset = new Point(); /** Time of last selection painting. */ private transient long lastSelectionPaint; @@ -77,13 +77,13 @@ private transient long lastCorePaint; /** The origin is the point in the north-west corner. */ - private Point origin = new Point(); + private final Point origin = new Point(); - private MapModel mapModel; + private final MapModel mapModel; - private CMainControl mainControl; + private final CMainControl mainControl; - private Size2D mapSize = new Size2D(1, 1); + private Size2D mapSize; private final MapGrid mapGrid; 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:06:36
|
Revision: 1150 http://svn.sourceforge.net/gridarta/?rev=1150&view=rev Author: akirschbaum Date: 2006-12-17 08:06:35 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 15:57:52 UTC (rev 1149) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 16:06:35 UTC (rev 1150) @@ -32,6 +32,7 @@ import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapControl; +import cfeditor.map.MapModel; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -68,8 +69,6 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - private final MapControl mapControl; - private final CMapViewBasic mapViewBasic; // 32x32 Image and Icon for temprary storing tiles before drawing @@ -100,6 +99,8 @@ private final AffineTransform renderTransform; + private MapModel mapModel; + private Size2D mapSize = new Size2D(1, 1); private final MapGrid mapGrid; @@ -115,8 +116,8 @@ public DefaultLevelRenderer(final CMapViewBasic mapViewBasic, final CMainControl mainControl, final MapControl mapControl, final boolean pickmap, final MapGrid mapGrid) { this.mapViewBasic = mapViewBasic; this.mainControl = mainControl; - this.mapControl = mapControl; - mapSize = mapControl.getMapModel().getMapSize(); + mapModel = mapControl.getMapModel(); + mapSize = mapModel.getMapSize(); this.mapGrid = mapGrid; final AttributeFilter af = new AttributeFilter(); @@ -169,7 +170,6 @@ /** {@inheritDoc} */ @Override public BufferedImage getFullImage() { - final Size2D mapSize = mapControl.getMapSize(); final int mapWidth = 32 * mapSize.getWidth(); final int mapHeight = 32 * mapSize.getHeight(); @@ -250,7 +250,7 @@ for (point.y = 0; point.y < mapGrid.getSize().getHeight(); point.y++) { for (point.x = 0; point.x < mapGrid.getSize().getWidth(); point.x++) { filter.newSquare(); - if (!mapControl.getMapModel().containsArchObject(point)) { + if (!mapModel.containsArchObject(point)) { // empty square if (isPickmap) { grfx.fillRect(point.x * 32 + borderOffset, point.y * 32 + borderOffset, 32, 32); @@ -258,7 +258,7 @@ CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); } } else { - for (final GameObject node : mapControl.getMapModel().getMapSquare(point)) { + for (final GameObject node : mapModel.getMapSquare(point)) { filter.objectInSquare(node); if (!filter.canShow(node)) { continue; @@ -330,7 +330,7 @@ final CFilterControl filter = mainControl.getFilterControl(); filter.newSquare(); // first, draw the object's faces: - if (!mapControl.getMapModel().containsArchObject(point)) { + if (!mapModel.containsArchObject(point)) { // draw the empty-tile icon (direcly to the mapview) if (isPickmap) { grfx.setColor(IGUIConstants.BG_COLOR); @@ -341,7 +341,7 @@ } else { tmpGrfx.fillRect(0, 0, 32, 32); // loop through all arches on that square and draw em - for (final GameObject node : mapControl.getMapModel().getMapSquare(point)) { + for (final GameObject node : mapModel.getMapSquare(point)) { filter.objectInSquare(node); if (!filter.canShow(node)) { continue; @@ -379,7 +379,7 @@ } // We have been drawing to the tmp. buffer, now convert it to // an ImageIcon and paint it into the mapview: - if (mapControl.getMapModel().containsArchObject(point)) { + if (mapModel.containsArchObject(point)) { tmpIcon.setImage(tmpImage); tmpIcon.paintIcon(this, grfx, point.x * 32, point.y * 32); } @@ -481,7 +481,6 @@ } catch (final NoninvertibleTransformException e) { } - final Size2D mapSize = mapViewBasic.getMapControl().getMapSize(); final int xm, ym; if (point.x >= 0 && point.x < mapSize.getWidth() * 32 && point.y >= 0 && point.y < mapSize.getHeight() * 32) { xm = point.x / 32; @@ -518,7 +517,6 @@ return false; } - final Size2D mapSize = mapControl.getMapSize(); final Dimension size = new Dimension(mapSize.getWidth() * 32, mapSize.getHeight() * 32); if (bufferedSize.equals(size)) { return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:57:51
|
Revision: 1149 http://svn.sourceforge.net/gridarta/?rev=1149&view=rev Author: akirschbaum Date: 2006-12-17 07:57:52 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Fix comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 15:50:49 UTC (rev 1148) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 15:57:52 UTC (rev 1149) @@ -59,7 +59,7 @@ /** * The component that does the actual rendering of tiles in the palette. * Flat version. -b * @author unknown (probably Ragnor) + * @author unknown */ public final class DefaultLevelRenderer extends LevelRenderer implements MapGridListener { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:50:48
|
Revision: 1148 http://svn.sourceforge.net/gridarta/?rev=1148&view=rev Author: akirschbaum Date: 2006-12-17 07:50:49 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Center error message on dialog box. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CFTreasureListTree.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:48:18 UTC (rev 1147) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:50:49 UTC (rev 1148) @@ -642,7 +642,7 @@ // is selected, also return null because those must not be used on maps. final TreasureTreeNode trNode = (TreasureTreeNode) node; if (trNode.getTreasureObj().getType() == TreasureObj.FOLDER) { - ACTION_FACTORY.showMessageDialog(this, "treasurelistForbidden", trNode.getTreasureObj().getName()); + ACTION_FACTORY.showMessageDialog(frame, "treasurelistForbidden", trNode.getTreasureObj().getName()); return null; } Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:48:18 UTC (rev 1147) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:50:49 UTC (rev 1148) @@ -665,7 +665,7 @@ // is selected, also return null because those must not be used on maps. final TreasureTreeNode trNode = (TreasureTreeNode) node; if (trNode.getTreasureObj().getType() == TreasureObj.FOLDER) { - ACTION_FACTORY.showMessageDialog(this, "treasurelistForbidden", trNode.getTreasureObj().getName()); + ACTION_FACTORY.showMessageDialog(frame, "treasurelistForbidden", trNode.getTreasureObj().getName()); return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:48:18
|
Revision: 1147 http://svn.sourceforge.net/gridarta/?rev=1147&view=rev Author: akirschbaum Date: 2006-12-17 07:48:18 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Move text message into message file. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:48:18 UTC (rev 1147) @@ -57,6 +57,7 @@ import javax.swing.tree.TreePath; import net.sf.gridarta.help.Help; import net.sf.gridarta.io.IOUtils; +import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -69,6 +70,9 @@ private static final Logger log = Logger.getLogger(CFTreasureListTree.class); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -638,7 +642,7 @@ // is selected, also return null because those must not be used on maps. final TreasureTreeNode trNode = (TreasureTreeNode) node; if (trNode.getTreasureObj().getType() == TreasureObj.FOLDER) { - JOptionPane.showMessageDialog(this, "The " + trNode.getTreasureObj().getName() + " treasurelists must not be used in maps.\nThese lists are reserved for internal use in the Crossfire server.", "Invalid Selection", JOptionPane.WARNING_MESSAGE); + ACTION_FACTORY.showMessageDialog(this, "treasurelistForbidden", trNode.getTreasureObj().getName()); return null; } Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-12-17 15:48:18 UTC (rev 1147) @@ -36,6 +36,10 @@ openScriptNotFound.title=Script file not found openScriptNotFound.message=The file ''{0}'' does not exist.\nPlease correct the path. +# Treasure lists +treasurelistForbidden.title=Invalid Selection +treasurelistForbidden.message=The {0} treasurelists must not be used in maps.\nThese lists are reserved for internal use in the Crossfire server. + # Map Properties mapParametersTabTitle=Parameters mapShopTabTitle=Shop Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-17 15:48:18 UTC (rev 1147) @@ -53,6 +53,9 @@ createImgIOException.title=Kann Bild nicht erzeugen createImgIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} +treasurelistForbidden.title=Ung\xFCltige Auswahl +treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. + enterExitNoExit.title=Ausgang nicht gefunden enterExitNoExit.message=Die Auswahl enth\xE4lt keinen Ausgang. enterExitNowhere.title=Ziel ung\xFCltig Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:48:18 UTC (rev 1147) @@ -62,6 +62,7 @@ import javax.swing.tree.TreePath; import net.sf.gridarta.help.Help; import net.sf.gridarta.io.IOUtils; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.EnumerationIterator; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -75,6 +76,9 @@ private static final Logger log = Logger.getLogger(CFTreasureListTree.class); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -661,7 +665,7 @@ // is selected, also return null because those must not be used on maps. final TreasureTreeNode trNode = (TreasureTreeNode) node; if (trNode.getTreasureObj().getType() == TreasureObj.FOLDER) { - JOptionPane.showMessageDialog(this, "The " + trNode.getTreasureObj().getName() + " treasurelists must not be used in maps.\nThese lists are reserved for internal use in the Daimonin server.", "Invalid Selection", JOptionPane.WARNING_MESSAGE); + ACTION_FACTORY.showMessageDialog(this, "treasurelistForbidden", trNode.getTreasureObj().getName()); return null; } Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/daimonin/src/daieditor/messages.properties 2006-12-17 15:48:18 UTC (rev 1147) @@ -96,6 +96,10 @@ loadDuplicateArch.title=Error: Duplicate arch loadDuplicateArch.message=Warning!\n\nDuplicate arch: ''{0}''\nFile: ''{1}''\nI will ignore this duplicate. +# Treasure lists +treasurelistForbidden.title=Invalid Selection +treasurelistForbidden.message=The {0} treasurelists must not be used in maps.\nThese lists are reserved for internal use in the Daimonin server. + # Map Properties mapMap=Map mapSound=Background sound Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-12-17 15:30:30 UTC (rev 1146) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-12-17 15:48:18 UTC (rev 1147) @@ -35,6 +35,9 @@ overwriteOtherFile.title=Datei \xFCberschreiben? overwriteOtherFile.message=Eine Datei mit Namen "{0}" existiert bereits.\n\nWirklich \xFCberschreiben? +treasurelistForbidden.title=Ung\xFCltige Auswahl +treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. + # New Map newMap.title=Neue Karte erstellen newPickmap.title=Neue Pickmap erstellen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:30:30
|
Revision: 1146 http://svn.sourceforge.net/gridarta/?rev=1146&view=rev Author: akirschbaum Date: 2006-12-17 07:30:30 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Unify (remove) static import statement. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFTreasureListTree.java Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:29:22 UTC (rev 1145) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 15:30:30 UTC (rev 1146) @@ -24,7 +24,6 @@ package daieditor; -import static daieditor.CGUIUtils.getSysIcon; import daieditor.gameobject.GameObject; import java.awt.BorderLayout; import java.awt.Color; @@ -874,12 +873,12 @@ */ public TreasureCellRenderer() { // get icons - tlistIcon = getSysIcon(IGUIConstants.TILE_TREASURE); - tlistOneIcon = getSysIcon(IGUIConstants.TILE_TREASUREONE); - yesIcon = getSysIcon(IGUIConstants.TILE_TR_YES); - noIcon = getSysIcon(IGUIConstants.TILE_TR_NO); - noface = getSysIcon(IGUIConstants.TILE_NOFACE); - noarch = getSysIcon(IGUIConstants.TILE_NOARCH); + tlistIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASURE); + tlistOneIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASUREONE); + yesIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_YES); + noIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_NO); + noface = CGUIUtils.getSysIcon(IGUIConstants.TILE_NOFACE); + noarch = CGUIUtils.getSysIcon(IGUIConstants.TILE_NOARCH); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:29:22
|
Revision: 1145 http://svn.sourceforge.net/gridarta/?rev=1145&view=rev Author: akirschbaum Date: 2006-12-17 07:29:22 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove redundant package qualifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:25:30 UTC (rev 1144) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 15:29:22 UTC (rev 1145) @@ -854,12 +854,12 @@ */ public TreasureCellRenderer() { // get icons - tlistIcon = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASURE); - tlistOneIcon = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASUREONE); - yesIcon = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_YES); - noIcon = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_NO); - noface = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_NOFACE); - noarch = cfeditor.CGUIUtils.getSysIcon(IGUIConstants.TILE_NOARCH); + tlistIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASURE); + tlistOneIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TREASUREONE); + yesIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_YES); + noIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_TR_NO); + noface = CGUIUtils.getSysIcon(IGUIConstants.TILE_NOFACE); + noarch = CGUIUtils.getSysIcon(IGUIConstants.TILE_NOARCH); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:25:32
|
Revision: 1144 http://svn.sourceforge.net/gridarta/?rev=1144&view=rev Author: akirschbaum Date: 2006-12-17 07:25:30 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Move similar code into function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 15:22:49 UTC (rev 1143) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 15:25:30 UTC (rev 1144) @@ -344,6 +344,16 @@ } /** + * Get information whether the gameObject is edited. + * Are tiles of type 'v' displayed? + * @param gameObject are tiles of this type displayed? + * @return true if these tiles are currently displayed + */ + public boolean isTileEdit(final GameObject gameObject) { + return tileEdit == 0 || isTileEdit(gameObject.getEditType()); + } + + /** * Returns whether a tileEdit value is set. * In case a tileEdit value is set, not all tiles should be displayed. * @return <code>true</code> if a tileEdit value is set, otherwise <code>false</code>. Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 15:22:49 UTC (rev 1143) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 15:25:30 UTC (rev 1144) @@ -622,7 +622,7 @@ tmpArch = gameObject; // now search backwards for matching view settings - if (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(tmpArch.getEditType())) { + if (mainControl.isTileEdit(tmpArch)) { break; } } @@ -695,7 +695,7 @@ final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(mapLoc).reverse().iterator(); for (final GameObject gameObject : mapControl.getMapModel().getMapSquare(mapLoc).reverse()) { tmpArch = gameObject; - if (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(tmpArch.getEditType())) { + if (mainControl.isTileEdit(tmpArch)) { break; } } Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 15:22:49 UTC (rev 1143) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 15:25:30 UTC (rev 1144) @@ -160,7 +160,7 @@ // store a clone of the gameObject in the CopyBuffer // (for multiparts, only the heads get copied into the buffer) // arches that don't match the view settings are ignored! - if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) && gameObject.isHead() && !gameObject.isInContainer() && (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(gameObject.getEditType()))) { + if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) && gameObject.isHead() && !gameObject.isInContainer() && mainControl.isTileEdit(gameObject)) { // copy this gameObject final GameObject clone = gameObject.createClone(posx - selRec.x, posy - selRec.y); assert copyMapCtrl != null; @@ -168,7 +168,7 @@ } // delete the gameObject if we have a "cut" or "clear" command // again, arches that don't match the view settings are ignored - if ((mode == Mode.DO_CLEAR || mode == Mode.DO_CUT) && (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(gameObject.getEditType()))) { + if ((mode == Mode.DO_CLEAR || mode == Mode.DO_CUT) && mainControl.isTileEdit(gameObject)) { // store next arch in tmp // delete gameObject (without redrawing the map) Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 15:22:49 UTC (rev 1143) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 15:25:30 UTC (rev 1144) @@ -263,7 +263,7 @@ if (!filter.canShow(node)) { continue; } - if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0 || isPickmap) { + if (mainControl.isTileEdit(node) || isPickmap) { if (node.getArchetypeName() == null) { CMainControl.getNoarchTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset, point.y * 32 + borderOffset); } else if (node.getFaceFlag()) { @@ -346,7 +346,7 @@ if (!filter.canShow(node)) { continue; } - if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0) { + if (mainControl.isTileEdit(node)) { if (node.getArchetypeName() == null) { CMainControl.getNoarchTileIcon().paintIcon(this, tmpGrfx, 0, 0); } else if (node.getFaceFlag()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 15:22:54
|
Revision: 1143 http://svn.sourceforge.net/gridarta/?rev=1143&view=rev Author: christianhujer Date: 2006-12-17 07:22:49 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Some unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-17 15:16:42 UTC (rev 1142) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-17 15:22:49 UTC (rev 1143) @@ -201,12 +201,10 @@ archetype = this.gameObject.getArchetype(); // check if the type of the object is present in the definitions - CFArchType tmp = archTypeList.getHead().getNext(); //typeNr = 0; // for invalid types, we take "type 0" - type = tmp; boolean typeFound = false; int i = 0; - for (; tmp != null; tmp = tmp.getNext()) { + for (final CFArchType tmp : archTypeList) { if (tmp.getTypeNr() == this.gameObject.getArchTypNr()) { if (tmp.getTypeAttr() == null) { // no type-attributes, so we only compared type-numbers @@ -254,6 +252,9 @@ } i++; } + if (!typeFound) { + type = archTypeList.getArchType(0); + } // get the type data //type = archTypeList.getType(typeNr); @@ -309,9 +310,9 @@ final String[] namelist = new String[archTypeList.getLength()]; // list of typenames // read all type names - CFArchType tmp = archTypeList.getHead().getNext(); - for (int i = 0; tmp != null; tmp = tmp.getNext(), i++) { - namelist[i] = " " + tmp.getTypeName(); + int i = 0; + for (final CFArchType tmp : archTypeList) { + namelist[i++] = " " + tmp.getTypeName(); } // the active type appears selected in the box Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 15:16:42 UTC (rev 1142) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 15:22:49 UTC (rev 1143) @@ -341,6 +341,10 @@ return archTypeList.iterator(); } + public CFArchType getArchType(final int n) { + return archTypeList.get(n); + } + /** * Lookup the name of an archtype. * @param typeNr type number Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-17 15:16:42 UTC (rev 1142) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-17 15:22:49 UTC (rev 1143) @@ -83,9 +83,9 @@ /* Build Panel */ CArchPanelPan(final CArchPanel controlPanel, final CMainControl mainControl) { + super(new BorderLayout()); this.mainControl = mainControl; archPanel = controlPanel; - setLayout(new BorderLayout()); panelDesktop = new JPanel(); panelDesktop.setLayout(new BorderLayout()); Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-17 15:16:42 UTC (rev 1142) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-17 15:22:49 UTC (rev 1143) @@ -605,7 +605,7 @@ final String trueVal = attrib.getMisc()[0]; if (trueVal.equals("0")) { final String attrString = gameObject.getAttributeString(nameOld); - input = new JCheckBox(attrib.getNameNew(), attrString.length() == 0 || "0".equals(attrString)); + input = new JCheckBox(attrib.getNameNew(), attrString.length() == 0 || attrString.equals("0")); } else { input = new JCheckBox(attrib.getNameNew(), gameObject.getAttributeString(nameOld).equals(trueVal)); } @@ -672,7 +672,7 @@ case FACENAME: case ANIMNAME: { final String dtxt; - if ("name".equalsIgnoreCase(nameOld)) { + if (nameOld.equalsIgnoreCase("name")) { if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { dtxt = gameObject.getObjName(); } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { @@ -680,7 +680,7 @@ } else { dtxt = archetype.getArchetypeName(); } - } else if ("face".equalsIgnoreCase(nameOld)) { + } else if (nameOld.equalsIgnoreCase("face")) { if (gameObject.getFaceRealName() != null && gameObject.getFaceRealName().length() > 0) { dtxt = gameObject.getFaceRealName(); } else { @@ -810,7 +810,7 @@ newAttr = new DialogAttrib<JTextField>(attrib); // textfield (no direct input, text is set by the treasurelist dialog) String treasureName = gameObject.getAttributeString(nameOld); - if (treasureName.trim().length() == 0 || "none".equalsIgnoreCase(treasureName.trim())) { + if (treasureName.trim().length() == 0 || treasureName.trim().equalsIgnoreCase("none")) { treasureName = CFTreasureListTree.NONE_SYM; } final JTextField input = new JTextField(" " + treasureName, TEXTFIELD_COLUMNS); @@ -1138,7 +1138,7 @@ final String inline = ((DialogAttrib<JTextField>) attr).input.getText().trim(); if (inline != null) { - if ("name".equalsIgnoreCase(attr.ref.getNameOld())) { + if (attr.ref.getNameOld().equalsIgnoreCase("name")) { // special case #1: "name"-textfield if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { if (!inline.equals(archetype.getObjName())) { @@ -1177,7 +1177,7 @@ break; case TEXT: { // a String attribute - if ("msg".equalsIgnoreCase(attr.ref.getNameOld()) && ((DialogAttrib<JTextArea>) attr).input.getText().trim().length() > 0) { + if (attr.ref.getNameOld().equalsIgnoreCase("msg") && ((DialogAttrib<JTextArea>) attr).input.getText().trim().length() > 0) { newMsg = ((DialogAttrib<JTextArea>) attr).input.getText().trim(); } } @@ -1248,7 +1248,7 @@ if (!isNone && !CFTreasureListTree.containsTreasureList(inline) && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. - showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + "\'" + inline + "' is not a known treasurelist name!", "Input Error", ERROR_MESSAGE); + showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + "'" + inline + "' is not a known treasurelist name!", "Input Error", ERROR_MESSAGE); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:16:42
|
Revision: 1142 http://svn.sourceforge.net/gridarta/?rev=1142&view=rev Author: akirschbaum Date: 2006-12-17 07:16:42 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove refreshCurrentMap() function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 15:05:02 UTC (rev 1141) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 15:16:42 UTC (rev 1142) @@ -304,7 +304,15 @@ * @param v tileedit bitmask of types to show */ public void setTileEdit(final int v) { + if ((tileEdit & v) == v) { + return; + } + tileEdit |= v; + + if (currentMap != null) { + currentMap.repaint(); + } } /** @@ -313,7 +321,15 @@ * @param v tileedit bitmask of types to hide */ public void unsetTileEdit(final int v) { + if ((tileEdit & v) == 0) { + return; + } + tileEdit &= ~v; + + if (currentMap != null) { + currentMap.repaint(); + } } /** @@ -365,7 +381,6 @@ } else { unsetTileEdit(editType); } - refreshCurrentMap(); } public boolean isShowMonster() { @@ -541,14 +556,6 @@ return lockAllPickmaps; } - /** Refresh the active map view, if there is one. */ - public void refreshCurrentMap() { - mainView.refreshMapTileList(); // update tile window - if (currentMap != null) { - currentMap.repaint(); // update map view (if there is one) - } - } - // ask arch panel which arch is highlighted public GameObject getArchPanelHighlight() { return mainView.getArchPanelHighlight(); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 15:05:02 UTC (rev 1141) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 15:16:42 UTC (rev 1142) @@ -819,7 +819,6 @@ ((ToggleAction) aShowEquipment).setSelected(false); ((ToggleAction) aShowTreasure).setSelected(false); ((ToggleAction) aShowConnected).setSelected(false); - mainControl.refreshCurrentMap(); // redraw map } private final String[] directionsMap = {"enterNorthMap", "enterEastMap", "enterSouthMap", "enterWestMap", "enterUpperMap", "enterLowerMap"}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 15:05:06
|
Revision: 1141 http://svn.sourceforge.net/gridarta/?rev=1141&view=rev Author: akirschbaum Date: 2006-12-17 07:05:02 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -563,8 +563,8 @@ return currentMap.insertArchToMap(newarch, archname, next, pos, join); } - public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean refreshMap, final boolean join) { - currentMap.deleteMapArch(gameObject, pos, refreshMap, join); + public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean join) { + currentMap.deleteMapArch(gameObject, pos, join); } public GameObject getMapArch(final GameObject gameObject, final Point pos) { Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -211,7 +211,9 @@ // --- middle mouse button: delete arch --- final int listIndex = getListIndex(e); if (listIndex < list.getModel().getSize()) { + mainControl.getCurrentMap().getMapModel().beginTransaction("Delete"); // TODO; I18N/L10N deleteIndexFromList(listIndex); + mainControl.getCurrentMap().getMapModel().endTransaction(); } } } @@ -275,7 +277,7 @@ final GameObject temp = getMapTileSelection(); final GameObject entry = (GameObject) model.getElementAt(index); if (entry != null) { - mainControl.deleteMapArch(entry, currentSquare, true, MapModel.JOIN_ENABLE); + mainControl.deleteMapArch(entry, currentSquare, MapModel.JOIN_ENABLE); setMapTileList(mainControl.getCurrentMap(), temp); } } Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -628,7 +628,7 @@ } if (tmpArch != null) { mapControl.calcArchRedraw(tmpArch); // get redraw info - mapControl.deleteMapArch(tmpArch, temp, false, MapModel.JOIN_ENABLE); + mapControl.deleteMapArch(tmpArch, temp, MapModel.JOIN_ENABLE); } } } @@ -701,7 +701,7 @@ } if (tmpArch != null) { mapControl.calcArchRedraw(tmpArch); // get redraw info - mapControl.deleteMapArch(tmpArch, mapLoc, false, MapModel.JOIN_ENABLE); + mapControl.deleteMapArch(tmpArch, mapLoc, MapModel.JOIN_ENABLE); // update mapArch panel mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), null); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -381,7 +381,7 @@ } /** {@inheritDoc} */ - public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean refreshMap, final boolean join) { + public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean join) { // first, try to find the tile we had selected for (final GameObject node : getMapSquare(pos)) { if (node == gameObject) { @@ -405,10 +405,6 @@ } } setLevelChangedFlag(); // the map has been modified - - if (refreshMap) { - mainControl.getMainView().refreshMapTileList(); - } } /** Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -223,8 +223,8 @@ mapModel.addGameObjectToMap(arch, false); } - public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean refreshMap, final boolean join) { - mapModel.deleteMapArch(gameObject, pos, refreshMap, join); + public void deleteMapArch(final GameObject gameObject, final Point pos, final boolean join) { + mapModel.deleteMapArch(gameObject, pos, join); } public GameObject getMapArch(final GameObject gameObject, final Point pos) { Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-12-17 14:58:15 UTC (rev 1140) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-12-17 15:05:02 UTC (rev 1141) @@ -71,11 +71,9 @@ * inventory.) * @param gameObject the game object to remove * @param pos location of the arch to be removed - * @param refreshMap If true, mapview is redrawn after deletion. Keep in - * mind: drawing consumes time! * @param join if set to JOIN_ENABLE auto-joining is supported */ - void deleteMapArch(GameObject gameObject, Point pos, boolean refreshMap, boolean join); + void deleteMapArch(GameObject gameObject, Point pos, boolean join); /** * Get the arch from the map with the specified 'id', at location pos. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 14:58:15
|
Revision: 1140 http://svn.sourceforge.net/gridarta/?rev=1140&view=rev Author: akirschbaum Date: 2006-12-17 06:58:15 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 14:54:47 UTC (rev 1139) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 14:58:15 UTC (rev 1140) @@ -339,15 +339,6 @@ } /** {@inheritDoc} */ - public void deleteMapArch(final GameObject arch, final boolean refreshMap) { - // Okay, it's in an inventory then - arch.remove(); - if (refreshMap) { - mainControl.getMainView().refreshMapTileList(); - } - } - - /** {@inheritDoc} */ @Nullable public GameObject getMapArch(final GameObject gameObject, final Point pos) { if (mapGrid == null || !isPointValid(pos)) { return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 14:54:47
|
Revision: 1139 http://svn.sourceforge.net/gridarta/?rev=1139&view=rev Author: akirschbaum Date: 2006-12-17 06:54:47 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 14:43:03 UTC (rev 1138) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-17 14:54:47 UTC (rev 1139) @@ -343,7 +343,7 @@ // Okay, it's in an inventory then arch.remove(); if (refreshMap) { - mainControl.refreshCurrentMap(); // redraw + mainControl.getMainView().refreshMapTileList(); } } @@ -416,7 +416,7 @@ setLevelChangedFlag(); // the map has been modified if (refreshMap) { - mainControl.refreshCurrentMap(); // redraw + mainControl.getMainView().refreshMapTileList(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 14:43:06
|
Revision: 1138 http://svn.sourceforge.net/gridarta/?rev=1138&view=rev Author: akirschbaum Date: 2006-12-17 06:43:03 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove explicit map redraw. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapTileList.java Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 14:20:04 UTC (rev 1137) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 14:43:03 UTC (rev 1138) @@ -193,6 +193,7 @@ // --- right mouse button: insert arch --- if (currentSquare != null && mainControl.getArchPanelHighlight() != null) { + mainControl.getCurrentMap().getMapModel().beginTransaction("Insert"); // TODO; I18N/L10N final int listIndex = getListIndex(e); if (listIndex >= list.getModel().getSize()) { mainControl.insertArchToMap(mainControl.getArchPanelHighlight(), mainControl.getPanelArchName(), null, currentSquare, MapModel.JOIN_ENABLE); @@ -200,10 +201,11 @@ final GameObject entry = (GameObject) model.getElementAt(listIndex); mainControl.insertArchToMap(mainControl.getArchPanelHighlight(), mainControl.getPanelArchName(), entry, currentSquare, MapModel.JOIN_ENABLE); } + mainControl.getCurrentMap().getMapModel().endTransaction(); // refresh mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified - mainControl.refreshCurrentMap(); + mainControl.getMainView().refreshMapTileList(); // update tile window } } else { // --- middle mouse button: delete arch --- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 14:20:06
|
Revision: 1137 http://svn.sourceforge.net/gridarta/?rev=1137&view=rev Author: akirschbaum Date: 2006-12-17 06:20:04 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Split fill and floodfill into separate functions in user interface. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/ChangeLog 2006-12-17 14:20:04 UTC (rev 1137) @@ -1,5 +1,8 @@ 2006-12-17 Andreas Kirschbaum + * Split fill and floodfill into separate functions in user + interface. + * Add replace of non-rectangular selections; make replacement of large areas much faster. Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -1577,6 +1577,17 @@ } } + /** + * "Floodfill" was selected from the Edit menu. + */ + public void floodfill() { + if (currentMap == null || currentMap.getMapViewFrame() == null) { + return; // this should never be possible, but I just wanna make sure... + } + + copybuffer.floodfill(currentMap); + } + /** "Replace" was selected from the Edit menu. */ public void replace() { if (currentMap == null || currentMap.getMapViewFrame() == null) { Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -863,6 +863,8 @@ private final Action aRandFillBelow = ACTION_FACTORY.createAction(true, "randFillBelow", mainControl); + private final Action aFloodfill = ACTION_FACTORY.createAction(true, "floodfill", mainControl); + private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", mainControl); private final Action aTileShow = ACTION_FACTORY.createToggle(true, "tileShow", mainControl); @@ -945,6 +947,7 @@ aFillBelow.setEnabled(selState); aRandFillAbove.setEnabled(selState); aRandFillBelow.setEnabled(selState); + aFloodfill.setEnabled(selState); aEnterExit.setEnabled(selState); aRevert.setEnabled(mapState && fLevelEdited && mainControl.isPlainSaveEnabled()); aPaste.setEnabled(selState && !mainControl.isCopyBufferEmpty()); Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -2,6 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 Andreas Kirschbaum * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -36,12 +37,14 @@ import net.sf.gridarta.MainControl; import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * This class manages the cut/copy/paste actions in maps. The data is stored in * an ordinary but invisible map-object. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author Andreas Kirschbaum */ public final class CopyBuffer { @@ -236,7 +239,6 @@ * @param fillBelow if true, the filling content is placed *below* the * existing map * @param density the fill density in percent; -1 to disable - * @todo the fill density is ignored for floodfill */ public void fill(final MapControl mapControl, final boolean fillBelow, final int density) { if (!mapControl.getMapViewFrame().isHighlight()) { @@ -250,32 +252,46 @@ return; } - // If selection is empty and map-spot empty, a floodfill is done - final GameObject arch; - if ((selRec == null || (selRec.x == 0 && selRec.height == 0)) && !mapControl.containsArchObject(cursor)) { - arch = mainControl.getArchPanelHighlight(); - if (arch != null) { - floodfill(mapControl, cursor.x, cursor.y, arch); + mapControl.getMapModel().beginTransaction("Fill"); // TODO; I18N/L10N + for (final Point p : mapControl.getMapViewFrame().getView().getSelection()) { + if (density != -1 && density != 100 && density < MainControl.rnd.nextInt(100) + 1) { + continue; } - } else { - mapControl.getMapModel().beginTransaction("Fill"); // TODO; I18N/L10N - for (final Point p : mapControl.getMapViewFrame().getView().getSelection()) { - if (density != -1 && density != 100 && density < MainControl.rnd.nextInt(100) + 1) { - continue; - } - final GameObject gameObject = mainControl.getArchPanelHighlight(); - addArchToMap(mapControl, gameObject, p, false, fillBelow); - } - mapControl.getMapModel().endTransaction(); + final GameObject gameObject = mainControl.getArchPanelHighlight(); + addArchToMap(mapControl, gameObject, p, false, fillBelow); } + mapControl.getMapModel().endTransaction(); + mainControl.getMainView().refreshMapTileList(); + } - // now the map and toolbars must be redrawn - mapControl.repaint(); + /** + * Floodfill the the map, starting at the cursor position. + * + * @param mapControl the map to fill + */ + public void floodfill(@NotNull final MapControl mapControl) { + final Point cursor = mapControl.getMapViewFrame().getView().getCursorPosition(); + if (cursor == null) { + return; + } + + if (mapControl.containsArchObject(cursor)) { + return; + } + + final GameObject arch = mainControl.getArchPanelHighlight(); + if (arch == null) { + return; + } + + mapControl.getMapModel().beginTransaction("Floodfill"); // TODO: I18N/L10N + floodfill(mapControl, cursor.x, cursor.y, arch); + mapControl.getMapModel().endTransaction(); mainControl.getMainView().refreshMapTileList(); } /** - * Floodfill the map, starting at the highlighted square. + * Floodfill the map. * <p/> * Okay, yes, this algorithm is as inefficient as it could be. But it is * short and easy. And CF maps are so small anyways. Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/action.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -10,7 +10,7 @@ main.menubar=file edit map cursor pickmaps resources tools analyze view plugins window help file.menu=createNew open close - save saveAs revert createImg - options - exit -edit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow +edit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill map.menu=autoJoin - gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterUpperMap enterLowerMap tileShow - mapProperties cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes pickmaps.menu=lockAllPickmaps - addNewPickmap closePickmap - openPickmapMap - savePickmap revertPickmap @@ -25,7 +25,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor mapwindowView mapwindowFile.menu=save saveAs createImg - revert - close -mapwindowEdit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow +mapwindowEdit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill mapwindowMap.menu=autoJoin - gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterUpperMap enterLowerMap tileShow - mapProperties mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes mapwindowView.menu=showMonster showExit showBackground showDoor showWall showEquipment showTreasure showConnected resetView @@ -71,7 +71,9 @@ randFillBelow.icon=EmptySmallIcon +floodfill.icon=EmptySmallIcon + mapProperties.icon=general/Properties16 Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -169,7 +169,9 @@ randFillBelow.text=Random Fill Below randFillBelow.accel=ctrl shift pressed D +floodfill.text=Flood Fill + ####### # Map Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -394,7 +394,9 @@ randFillBelow.text=Zuf\xE4llig unten f\xFCllen randFillBelow.accel=ctrl shift pressed D +floodfill.text=Freien Bereich f\xFCllen + ####### # Map Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -1848,6 +1848,17 @@ } } + /** + * "Floodfill" was selected from the Edit menu. + */ + public void floodfill() { + if (currentMap == null || currentMap.getMapViewFrame() == null) { + return; // this should never be possible, but I just wanna make sure... + } + + copybuffer.floodfill(currentMap); + } + /** "Replace" was selected from the Edit menu. */ public void replace() { if (currentMap == null || currentMap.getMapViewFrame() == null) { Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -766,6 +766,8 @@ private final Action aRandFillBelow = ACTION_FACTORY.createAction(true, "randFillBelow", mainControl); + private final Action aFloodfill = ACTION_FACTORY.createAction(true, "floodfill", mainControl); + private final Action aSelectAll = ACTION_FACTORY.createAction(true, "selectAll", mainControl); private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", mainControl); @@ -839,6 +841,7 @@ aFillBelow.setEnabled(selState); aRandFillAbove.setEnabled(selState); aRandFillBelow.setEnabled(selState); + aFloodfill.setEnabled(selState); aEnterExit.setEnabled(selState); //aRevert.setEnabled(mapState && mainControl.getCurrentMap().isLevelChanged()); aPaste.setEnabled(selState && !mainControl.isCopyBufferEmpty()); Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-17 14:20:04 UTC (rev 1137) @@ -2,6 +2,7 @@ * Daimonin Java Editor. * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 Andreas Kirschbaum * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -37,12 +38,14 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * This class manages the cut/copy/paste actions in maps. The data is stored in * an ordinary but invisible map-object. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author Andreas Kirschbaum */ public final class CopyBuffer { @@ -258,25 +261,15 @@ return; } - // If offset is zero and map-spot empty, a floodfill at the cursor is done - if (!mapControl.getMapViewFrame().getView().hasSelection() && mapControl.getMapViewFrame().getView().getCursorSquare().isEmpty()) { - final Point p = mapControl.getMapViewFrame().getView().getCursorPosition(); - assert p != null; - floodfill(mapControl, p.x, p.y, archList); // floodfill - } else { - mapControl.getMapModel().beginTransaction("Fill"); // TODO; I18N/L10N - for (final Point p : mapControl.getMapViewFrame().getView().getSelection()) { - if (density != -1 && density != 100 && density < rnd.nextInt(100) + 1) { - continue; - } - final GameObject gameObject = archList.get(rnd.nextInt(archList.size())); - addArchToMap(mapControl, gameObject, p, false, fillBelow); + mapControl.getMapModel().beginTransaction("Fill"); // TODO; I18N/L10N + for (final Point p : mapControl.getMapViewFrame().getView().getSelection()) { + if (density != -1 && density != 100 && density < rnd.nextInt(100) + 1) { + continue; } - mapControl.getMapModel().endTransaction(); + final GameObject gameObject = archList.get(rnd.nextInt(archList.size())); + addArchToMap(mapControl, gameObject, p, false, fillBelow); } - - // now the map and toolbars must be redrawn - mapControl.repaint(); + mapControl.getMapModel().endTransaction(); mainControl.getMainView().refreshMapTileList(); } @@ -359,6 +352,32 @@ return objects.size() == 0 ? null : objects; } + /** + * Floodfill the the map, starting at the cursor position. + * + * @param mapControl the map to fill + */ + public void floodfill(@NotNull final MapControl mapControl) { + final Point cursor = mapControl.getMapViewFrame().getView().getCursorPosition(); + if (cursor == null) { + return; + } + + if (!mapControl.getMapViewFrame().getView().getCursorSquare().isEmpty()) { + return; + } + + final List<GameObject> archList = mainControl.getArchPanelSelection(); + if (archList == null || archList.size() == 0) { + return; + } + + mapControl.getMapModel().beginTransaction("Floodfill"); // TODO: I18N/L10N + floodfill(mapControl, cursor.x, cursor.y, archList); + mapControl.getMapModel().endTransaction(); + mainControl.getMainView().refreshMapTileList(); + } + /** Constants for lookArea. */ private static final byte NOT_LOOKED_AT = (byte) 0; @@ -369,7 +388,7 @@ private static final byte BLOCKED = (byte) 3; /** - * Floodfill the map, starting at the highlighted square. + * Floodfill the map. * @param mapControl MapControl of the active map we paste on * @param startX starting x-coord for floodfill * @param startY starting y-coord for floodfill Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/action.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -9,7 +9,7 @@ # Menus main.menubar=file edit map cursor pickmaps resources tools view window help file.menu=createNew open recent close closeAll - save saveAs revert createImg - options - exit -edit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow - selectAll +edit.menu=clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll map.menu=enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes @@ -94,6 +94,8 @@ randFillBelow.icon=EmptySmallIcon +floodfill.icon=EmptySmallIcon + selectAll.icon=EmptySmallIcon Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/messages.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -330,6 +330,8 @@ randFillBelow.text=Random Fill Below randFillBelow.accel=ctrl shift pressed D +floodfill.text=Flood Fill + selectAll.text=Select All selectAll.mnemonic=S selectAll.accel=ctrl pressed A Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-12-17 13:22:22 UTC (rev 1136) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-12-17 14:20:04 UTC (rev 1137) @@ -299,6 +299,8 @@ randFillBelow.text=Zuf\xE4llig unten f\xFCllen randFillBelow.accel=ctrl shift pressed D +floodfill.text=Freien Bereich f\xFCllen + selectAll.text=Alles ausw\xE4hlen selectAll.accel=ctrl pressed A This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 13:22:21
|
Revision: 1136 http://svn.sourceforge.net/gridarta/?rev=1136&view=rev Author: akirschbaum Date: 2006-12-17 05:22:22 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Add replace of non-rectangular selections; make replacement of large areas much faster. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-17 12:55:31 UTC (rev 1135) +++ trunk/crossfire/ChangeLog 2006-12-17 13:22:22 UTC (rev 1136) @@ -1,5 +1,8 @@ 2006-12-17 Andreas Kirschbaum + * Add replace of non-rectangular selections; make replacement of + large areas much faster. + * Add filling of non-rectangular selections. * Add copy/cut/paste for non-rectangular selections. Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 12:55:31 UTC (rev 1135) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 13:22:22 UTC (rev 1136) @@ -46,6 +46,7 @@ import javax.swing.JTextField; import javax.swing.WindowConstants; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; /** @@ -282,75 +283,62 @@ * @return number of arches that have been replaced */ private int doReplace(final int matchCriteria, final String matchString, final boolean entireMap, final boolean deleteOnly) { - if (mapControl == null) { return 0; } - // define area of effect - final Point startp; - final Point offset; - if (entireMap) { - startp = new Point(0, 0); - final Size2D mapSize = mapControl.getMapSize(); - offset = new Point(mapSize.getWidth() - 1, mapSize.getHeight() - 1); - } else { - final Rectangle selRec = mapControl.getMapGrid().getSelectedRec(); - startp = new Point(selRec.x, selRec.y); - offset = new Point(selRec.width, selRec.height); - } + mapControl.getMapModel().beginTransaction("Replace"); // TODO: I18N/L10N - // cycle through all tile coordinates between startpoint and offset: - final Point pos = new Point(); + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + assert mapViewIFrame != null; int replaceCount = 0; final ArrayList<GameObject> objectsToReplace = new ArrayList<GameObject>(); - for (pos.x = startp.x; pos.x - startp.x <= offset.x; pos.x++) { - for (pos.y = startp.y; pos.y - startp.y <= offset.y; pos.y++) { - - // find objects to replace - objectsToReplace.clear(); - for (final GameObject node : mapControl.getMapModel().getMapSquare(pos)) { - if (node.isHead() && ((matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString)) || (matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString)))) { - objectsToReplace.add(node); - } + for (final MapSquare<GameObject> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { + // find objects to replace + objectsToReplace.clear(); + for (final GameObject node : square) { + if (node.isHead() && ((matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString)) || (matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString)))) { + objectsToReplace.add(node); } + } - // actually replace the objects - for (final GameObject objectToDelete : objectsToReplace) { - final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(pos).iterator(); - GameObject prevArch = null; - GameObject node = null; - while (it.hasNext()) { - node = it.next(); + // actually replace the objects + for (final GameObject objectToDelete : objectsToReplace) { + final Iterator<GameObject> it = square.iterator(); + GameObject prevArch = null; + GameObject node = null; + while (it.hasNext()) { + node = it.next(); - if (node == objectToDelete) { - break; - } - - prevArch = node; + if (node == objectToDelete) { + break; } - assert node != null; - // first, delete the old arch - node.remove(); + prevArch = node; + } + assert node != null; - if (replaceArch != null && !deleteOnly) { - // insert replacement object - if (replaceArch.isMulti()) { - // multi's cannot be inserted properly, so we just put them ontop - replaceArch = replaceArch.getHead(); - mapControl.addArchToMap(replaceArch.getArchetypeName(), pos, false, false); + // first, delete the old arch + node.remove(); - // TODO: if from pickmap it could have special attributes -> copy them - } else { - mapControl.insertArchToMap(replaceArch, null, prevArch, pos, false); - } + if (replaceArch != null && !deleteOnly) { + // insert replacement object + if (replaceArch.isMulti()) { + // multi's cannot be inserted properly, so we just put them ontop + replaceArch = replaceArch.getHead(); + mapControl.addArchToMap(replaceArch.getArchetypeName(), new Point(square.getMapX(), square.getMapY()), false, false); + + // TODO: if from pickmap it could have special attributes -> copy them + } else { + mapControl.insertArchToMap(replaceArch, null, prevArch, new Point(square.getMapX(), square.getMapY()), false); } - replaceCount++; } + replaceCount++; } } + mapControl.getMapModel().endTransaction(); + // now the map and toolbars must be redrawn mapControl.repaint(); mainControl.getMainView().refreshMapTileList(); 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:55:32
|
Revision: 1135 http://svn.sourceforge.net/gridarta/?rev=1135&view=rev Author: akirschbaum Date: 2006-12-17 04:55:31 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-17 12:53:55 UTC (rev 1134) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-17 12:55:31 UTC (rev 1135) @@ -234,9 +234,9 @@ * @param fillBelow if true, the filling content is placed *below* the * existing map * @param seed MapControl of the random objects or <code>null</code> to use the currently selected Archetype. - * @param rand Percentage of filling (e.g. 100 for 100%, 10 for 10%). + * @param density Percentage of filling (e.g. 100 for 100%, 10 for 10%). */ - public void fill(final MapControl mapControl, final boolean fillBelow, final MapControl seed, final int rand) { + public void fill(final MapControl mapControl, final boolean fillBelow, final MapControl seed, final int density) { if (!mapControl.getMapViewFrame().isHighlight()) { return; // should actually never happen } @@ -266,7 +266,7 @@ } else { mapControl.getMapModel().beginTransaction("Fill"); // TODO; I18N/L10N for (final Point p : mapControl.getMapViewFrame().getView().getSelection()) { - if (rand != -1 && rand != 100 && rand < rnd.nextInt(100) + 1) { + if (density != -1 && density != 100 && density < rnd.nextInt(100) + 1) { continue; } final GameObject gameObject = archList.get(rnd.nextInt(archList.size())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |