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...> - 2010-09-08 05:49:21
|
Revision: 8635 http://gridarta.svn.sourceforge.net/gridarta/?rev=8635&view=rev Author: akirschbaum Date: 2010-09-08 05:49:14 +0000 (Wed, 08 Sep 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-09-07 19:35:35 UTC (rev 8634) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-09-08 05:49:14 UTC (rev 8635) @@ -26,7 +26,7 @@ /** * A {@link Component} that permanently displays another {@link Component} and - * optionally displays more components on the borders. The layout is similar to + * optionally displays more components on the borders. The layout is similar to * {@link java.awt.BorderLayout} but includes {@link javax.swing.JSplitPane * JSplitPanes}. * @author Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-09-07 19:35:35 UTC (rev 8634) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-09-08 05:49:14 UTC (rev 8635) @@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable; /** - * A {@link Component} that always displays another components and optionally a + * A {@link Component} that always displays another component and optionally a * number of tabs around it. Each tab has an associated component which is shown * while the tab is active. * @author Andreas Kirschbaum This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-07 19:35:42
|
Revision: 8634 http://gridarta.svn.sourceforge.net/gridarta/?rev=8634&view=rev Author: akirschbaum Date: 2010-09-07 19:35:35 +0000 (Tue, 07 Sep 2010) Log Message: ----------- Fix "Move To" actions for tabs in main window. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-09-01 18:31:10 UTC (rev 8633) +++ trunk/atrinik/ChangeLog 2010-09-07 19:35:35 UTC (rev 8634) @@ -1,3 +1,7 @@ +2010-09-06 Andreas Kirschbaum + + * Fix "Move To" actions for tabs in main window. + 2010-09-01 Andreas Kirschbaum * Hide internal actions for menu bars from Configure Shortcuts. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-09-01 18:31:10 UTC (rev 8633) +++ trunk/crossfire/ChangeLog 2010-09-07 19:35:35 UTC (rev 8634) @@ -1,3 +1,7 @@ +2010-09-06 Andreas Kirschbaum + + * Fix "Move To" actions for tabs in main window. + 2010-09-01 Andreas Kirschbaum * Hide internal actions for menu bars from Configure Shortcuts. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-09-01 18:31:10 UTC (rev 8633) +++ trunk/daimonin/ChangeLog 2010-09-07 19:35:35 UTC (rev 8634) @@ -1,3 +1,7 @@ +2010-09-06 Andreas Kirschbaum + + * Fix "Move To" actions for tabs in main window. + 2010-09-01 Andreas Kirschbaum * Hide internal actions for menu bars from Configure Shortcuts. Added: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java 2010-09-07 19:35:35 UTC (rev 8634) @@ -0,0 +1,86 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.utils.tabbedpanel; + +import net.sf.gridarta.gui.utils.borderpanel.Location; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * Defines {@link ActionMethod ActionMethods} to move tab locations. + * @author Andreas Kirschbaum + */ +public class MoveToActions { + + /** + * The tab. + */ + @NotNull + private final Tab tab; + + /** + * The {@link TabbedPanel} to forward to. + */ + @NotNull + private final TabbedPanel tabbedPanel; + + /** + * Creates a new instance. + * @param tab the tab + * @param tabbedPanel the tabbed panel to forward to + */ + public MoveToActions(@NotNull final Tab tab, @NotNull final TabbedPanel tabbedPanel) { + this.tab = tab; + this.tabbedPanel = tabbedPanel; + } + + /** + * Action method to move the menu to {@link Location#TOP}. + */ + @ActionMethod + public void tabButtonMoveToTop() { + tabbedPanel.moveTab(tab, Location.TOP); + } + + /** + * Action method to move the menu to {@link Location#BOTTOM}. + */ + @ActionMethod + public void tabButtonMoveToBottom() { + tabbedPanel.moveTab(tab, Location.BOTTOM); + } + + /** + * Action method to move the menu to {@link Location#LEFT}. + */ + @ActionMethod + public void tabButtonMoveToLeft() { + tabbedPanel.moveTab(tab, Location.LEFT); + } + + /** + * Action method to move the menu to {@link Location#RIGHT}. + */ + @ActionMethod + public void tabButtonMoveToRight() { + tabbedPanel.moveTab(tab, Location.RIGHT); + } + +} // class MoveToActions Property changes on: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-09-01 18:31:10 UTC (rev 8633) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-09-07 19:35:35 UTC (rev 8634) @@ -32,7 +32,6 @@ import net.sf.gridarta.gui.utils.borderpanel.Location; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -180,7 +179,7 @@ * @param tab the tab * @param location the location */ - private void moveTab(@NotNull final Tab tab, @NotNull final Location location) { + public void moveTab(@NotNull final Tab tab, @NotNull final Location location) { if (tabs.get(tab.getButton()) == null) { throw new IllegalArgumentException(); } @@ -229,11 +228,12 @@ private void fillContextMenu(@NotNull final Tab tab) { final JMenu moveToMenu = tab.getMoveToMenu(); MenuUtils.removeAll(moveToMenu); - final MoveToActions moveToActions = new MoveToActions(tab); + final MoveToActions moveToActions = new MoveToActions(tab, this); final Location location = tab.getLocation(); for (final Location thisLocation : Location.values()) { if (thisLocation != location) { - moveToMenu.add(ACTION_BUILDER.createAction(false, "tabButtonMoveTo" + thisLocation.getName(), moveToActions)); + final String XXX = "tabButtonMoveTo" + thisLocation.getName(); + moveToMenu.add(ACTION_BUILDER.createAction(true, XXX, moveToActions)); } } } @@ -266,57 +266,4 @@ openTabs.remove(tab.getComponent()); } - /** - * Defines {@link ActionMethod ActionMethods} to move tab locations. - * @author Andreas Kirschbaum - */ - private class MoveToActions { - - /** - * The tab. - */ - @NotNull - private final Tab tab; - - /** - * Creates a new instance. - * @param tab the tab - */ - private MoveToActions(@NotNull final Tab tab) { - this.tab = tab; - } - - /** - * Action method to move the menu to {@link Location#TOP}. - */ - @ActionMethod - public void tabButtonMoveToTop() { - moveTab(tab, Location.TOP); - } - - /** - * Action method to move the menu to {@link Location#BOTTOM}. - */ - @ActionMethod - public void tabButtonMoveToBottom() { - moveTab(tab, Location.BOTTOM); - } - - /** - * Action method to move the menu to {@link Location#LEFT}. - */ - @ActionMethod - public void tabButtonMoveToLeft() { - moveTab(tab, Location.LEFT); - } - - /** - * Action method to move the menu to {@link Location#RIGHT}. - */ - @ActionMethod - public void tabButtonMoveToRight() { - moveTab(tab, Location.RIGHT); - } - - } // class MoveToActions } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 18:31:16
|
Revision: 8633 http://gridarta.svn.sourceforge.net/gridarta/?rev=8633&view=rev Author: akirschbaum Date: 2010-09-01 18:31:10 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Include game object description, map name, and location in map transaction error messages. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-09-01 18:13:39 UTC (rev 8632) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-09-01 18:31:10 UTC (rev 8633) @@ -379,7 +379,7 @@ @Override public void beginSquareChange(@NotNull final MapSquare<G, A, R> mapSquare) { if (transactionDepth == 0) { - log.error("beginSquareChange: square is about to change outside a transaction"); + log.error("beginSquareChange: square (" + mapSquare + ") is about to change outside a transaction"); return; } @@ -392,7 +392,7 @@ @Override public void endSquareChange(@NotNull final MapSquare<G, A, R> mapSquare) { if (transactionDepth == 0) { - log.error("endSquareChange: square was changed outside a transaction"); + log.error("endSquareChange: square (" + mapSquare + ") was changed outside a transaction"); final Set<MapSquare<G, A, R>> mapSquares = new HashSet<MapSquare<G, A, R>>(1); mapSquares.add(mapSquare); fireMapSquaresChangedEvent(mapSquares); @@ -409,7 +409,7 @@ @Override public void beginGameObjectChange(@NotNull final G gameObject) { if (transactionDepth == 0) { - log.error("beginGameObjectChange: game object is about to change outside a transaction"); + log.error("beginGameObjectChange: game object (" + gameObject.getBestName() + "@" + gameObject.getMapSquare() + ") is about to change outside a transaction"); return; } @@ -424,7 +424,7 @@ @Override public void endGameObjectChange(@NotNull final G gameObject) { if (transactionDepth == 0) { - log.error("endGameObjectChange: game object was changed outside a transaction"); + log.error("endGameObjectChange: game object (" + gameObject.getBestName() + "@" + gameObject.getMapSquare() + ") was changed outside a transaction"); final Set<G> gameObjects = new HashSet<G>(1); gameObjects.add(gameObject); fireGameObjectsChangedEvent(gameObjects, Collections.<G>emptySet()); @@ -441,7 +441,7 @@ @Override public void transientGameObjectChange(@NotNull final G gameObject) { if (transactionDepth == 0) { - log.error("transientGameObjectChange: game object was changed outside a transaction"); + log.error("transientGameObjectChange: game object (" + gameObject.getBestName() + "@" + gameObject.getMapSquare() + ") was changed outside a transaction"); final Set<G> gameObjects = new HashSet<G>(1); gameObjects.add(gameObject); fireGameObjectsChangedEvent(Collections.<G>emptySet(), gameObjects); Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2010-09-01 18:13:39 UTC (rev 8632) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2010-09-01 18:31:10 UTC (rev 8633) @@ -268,4 +268,13 @@ return System.identityHashCode(mapModel) + 13 * mapX + 65537 * mapY; } + /** + * {@inheritDoc}} + */ + @NotNull + @Override + public String toString() { + return mapModel.getMapArchObject().getMapName() + ":" + mapX + "/" + mapY; + } + } // class MapSquare This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 18:13:46
|
Revision: 8632 http://gridarta.svn.sourceforge.net/gridarta/?rev=8632&view=rev Author: akirschbaum Date: 2010-09-01 18:13:39 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Hide internal actions for menu bars from Configure Shortcuts. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) +++ trunk/atrinik/ChangeLog 2010-09-01 18:13:39 UTC (rev 8632) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide internal actions for menu bars from Configure Shortcuts. + * Hide script editor actions from Configure Shortcuts. * Hide actions not applicable for Atrinik from Configure Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) +++ trunk/crossfire/ChangeLog 2010-09-01 18:13:39 UTC (rev 8632) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide internal actions for menu bars from Configure Shortcuts. + * Hide script editor actions from Configure Shortcuts. * Hide actions not applicable for Crossfire from Configure Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) +++ trunk/daimonin/ChangeLog 2010-09-01 18:13:39 UTC (rev 8632) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide internal actions for menu bars from Configure Shortcuts. + * Hide script editor actions from Configure Shortcuts. * Hide actions not applicable for Daimonin from Configure Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java 2010-09-01 18:12:22 UTC (rev 8631) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java 2010-09-01 18:13:39 UTC (rev 8632) @@ -22,12 +22,12 @@ import java.awt.Component; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.prefs.AbstractPreferences; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -38,6 +38,7 @@ import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.ActionUtils; import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.DummyAction; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -64,7 +65,7 @@ * The action names to hide. */ @NotNull - private final Set<String> ignoreActions = new HashSet<String>(); + private final Collection<String> ignoreActions = new HashSet<String>(); /** * A {@link Comparator} that compares {@link Action Actions} by name. @@ -242,13 +243,10 @@ final ActionMap actionMap = actionBuilder.getActionMap(); for (final Object key : actionMap.allKeys()) { if (key instanceof String) { - final String actionName = (String) key; - if (!ignoreActions.contains(actionName)) { - final Action action = actionMap.get(key); - assert action != null; - if (isValidAction(action)) { - result.add(action); - } + final Action action = actionMap.get(key); + assert action != null; + if (isValidAction(action)) { + result.add(action); } } } @@ -261,13 +259,19 @@ * @param action the action to check * @return whether the action is valid */ - private static boolean isValidAction(@NotNull final Action action) { + private boolean isValidAction(@NotNull final Action action) { + if (action instanceof DummyAction) { + return false; + } + + final String id; try { - ActionUtils.getActionId(action); - return true; + id = ActionUtils.getActionId(action); } catch (final IllegalArgumentException ignored) { return false; } + + return !ignoreActions.contains(id); } } // class ShortcutsManager This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 18:12:29
|
Revision: 8631 http://gridarta.svn.sourceforge.net/gridarta/?rev=8631&view=rev Author: akirschbaum Date: 2010-09-01 18:12:22 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Hide script editor actions from Configure Shortcuts. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/atrinik/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide script editor actions from Configure Shortcuts. + * Hide actions not applicable for Atrinik from Configure Shortcuts. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-09-01 18:12:22 UTC (rev 8631) @@ -152,4 +152,5 @@ # Actions not to be shown in Configure Shortcuts -shortcutsIgnoreActions=smoothing +shortcutsIgnoreActions=smoothing \ + scriptEditClose scriptEditCloseAll scriptEditCopy scriptEditCut scriptEditFind scriptEditFindAgain scriptEditNewScript scriptEditOpen scriptEditPaste scriptEditRedo scriptEditReplace scriptEditSave scriptEditSaveAs scriptEditUndo Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/crossfire/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide script editor actions from Configure Shortcuts. + * Hide actions not applicable for Crossfire from Configure Shortcuts. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-09-01 18:12:22 UTC (rev 8631) @@ -133,4 +133,5 @@ # Actions not to be shown in Configure Shortcuts -shortcutsIgnoreActions=doubleFaces cleanCompletelyBlockedSquares collectSpells +shortcutsIgnoreActions=doubleFaces cleanCompletelyBlockedSquares collectSpells \ + scriptEditClose scriptEditCloseAll scriptEditCopy scriptEditCut scriptEditFind scriptEditFindAgain scriptEditNewScript scriptEditOpen scriptEditPaste scriptEditRedo scriptEditReplace scriptEditSave scriptEditSaveAs scriptEditUndo Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/daimonin/ChangeLog 2010-09-01 18:12:22 UTC (rev 8631) @@ -1,5 +1,7 @@ 2010-09-01 Andreas Kirschbaum + * Hide script editor actions from Configure Shortcuts. + * Hide actions not applicable for Daimonin from Configure Shortcuts. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-09-01 18:12:22 UTC (rev 8631) @@ -152,4 +152,5 @@ # Actions not to be shown in Configure Shortcuts -shortcutsIgnoreActions=smoothing +shortcutsIgnoreActions=smoothing \ + scriptEditClose scriptEditCloseAll scriptEditCopy scriptEditCut scriptEditFind scriptEditFindAgain scriptEditNewScript scriptEditOpen scriptEditPaste scriptEditRedo scriptEditReplace scriptEditSave scriptEditSaveAs scriptEditUndo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 17:50:54
|
Revision: 8630 http://gridarta.svn.sourceforge.net/gridarta/?rev=8630&view=rev Author: akirschbaum Date: 2010-09-01 17:50:47 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Hide actions not applicable for an editor variant from Configure Shortcuts. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/atrinik/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Hide actions not applicable for Atrinik from Configure + Shortcuts. + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and "Delete Current Pickmap Folder". Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) @@ -149,3 +149,7 @@ ####################### # Various Log Messages logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} + + +# Actions not to be shown in Configure Shortcuts +shortcutsIgnoreActions=smoothing Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/crossfire/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Hide actions not applicable for Crossfire from Configure + Shortcuts. + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and "Delete Current Pickmap Folder". Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) @@ -130,3 +130,7 @@ about.title=About Gridarta for Crossfire about=<html><h1 align="center">Gridarta for Crossfire</h1><p>Editor for Crossfire MMORPG maps and arches</p><table><tr><td valign="top" align="right" width="50%">Copyright \xA9 2001-2010</td><td width="50%">Michael Toennies<br>Andreas Vogl<br>Peter Plischewsky<br>Gecko<br>Christian Hujer<br>Daniel Viegas<br>Andreas Kirschbaum</td></tr><tr><td align="right">Java version:</td><td>{0}</td></tr><tr><td align="right">Version:</td><td>{1}</td></tr><tr><td align="right">by:</td><td>{2}</td></tr><tr><td align="right">at:</td><td>{3}</td></tr></table></html> + + +# Actions not to be shown in Configure Shortcuts +shortcutsIgnoreActions=doubleFaces cleanCompletelyBlockedSquares collectSpells Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/daimonin/ChangeLog 2010-09-01 17:50:47 UTC (rev 8630) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Hide actions not applicable for Daimonin from Configure + Shortcuts. + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and "Delete Current Pickmap Folder". Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-09-01 17:50:47 UTC (rev 8630) @@ -149,3 +149,7 @@ ####################### # Various Log Messages logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} + + +# Actions not to be shown in Configure Shortcuts +shortcutsIgnoreActions=smoothing Modified: trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-09-01 17:50:47 UTC (rev 8630) @@ -65,7 +65,7 @@ /** {@inheritDoc} */ @Override public void visit(@NotNull final NamedGameObjectMatcherFilterConfig filterConfig) { - menuItem = new JCheckBoxMenuItem(ACTION_BUILDER.createToggle(true, "enabled", filterConfig)); + menuItem = new JCheckBoxMenuItem(ACTION_BUILDER.createToggle(false, "enabled", filterConfig)); } }; Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java 2010-09-01 06:39:19 UTC (rev 8629) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsManager.java 2010-09-01 17:50:47 UTC (rev 8630) @@ -21,10 +21,13 @@ import java.awt.Component; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import java.util.prefs.AbstractPreferences; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -32,6 +35,7 @@ import javax.swing.ActionMap; import javax.swing.KeyStroke; import net.sf.gridarta.MainControl; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.ActionUtils; import net.sf.japi.swing.action.ActionBuilder; import org.jetbrains.annotations.NotNull; @@ -57,6 +61,12 @@ private static final String PREFERENCES_COMMENT_PREFIX = "prefs." + PREFERENCES_SHORTCUT_PREFIX; /** + * The action names to hide. + */ + @NotNull + private final Set<String> ignoreActions = new HashSet<String>(); + + /** * A {@link Comparator} that compares {@link Action Actions} by name. */ @NotNull @@ -88,6 +98,8 @@ public ShortcutsManager(@NotNull final ActionBuilder actionBuilder) { this.actionBuilder = actionBuilder; + ignoreActions.addAll(Arrays.asList(ActionBuilderUtils.getString(actionBuilder, "shortcutsIgnoreActions").split(" +"))); + for (final Action action : this) { final Object acceleratorKey = action.getValue(Action.ACCELERATOR_KEY); if (acceleratorKey != null) { @@ -230,10 +242,13 @@ final ActionMap actionMap = actionBuilder.getActionMap(); for (final Object key : actionMap.allKeys()) { if (key instanceof String) { - final Action action = actionMap.get(key); - assert action != null; - if (isValidAction(action)) { - result.add(action); + final String actionName = (String) key; + if (!ignoreActions.contains(actionName)) { + final Action action = actionMap.get(key); + assert action != null; + if (isValidAction(action)) { + result.add(action); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 06:39:26
|
Revision: 8629 http://gridarta.svn.sourceforge.net/gridarta/?rev=8629&view=rev Author: akirschbaum Date: 2010-09-01 06:39:19 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Make "Lock All Pickmaps" affect "Create Pickmap Folder" and "Delete Current Pickmap Folder". Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-09-01 06:28:24 UTC (rev 8628) +++ trunk/atrinik/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and + "Delete Current Pickmap Folder". + * Remove unused "Inventory:" element from game object attributes dialogs. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-09-01 06:28:24 UTC (rev 8628) +++ trunk/crossfire/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and + "Delete Current Pickmap Folder". + * Remove unused "Inventory:" element from game object attributes dialogs. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-09-01 06:28:24 UTC (rev 8628) +++ trunk/daimonin/ChangeLog 2010-09-01 06:39:19 UTC (rev 8629) @@ -1,5 +1,8 @@ 2010-09-01 Andreas Kirschbaum + * Make "Lock All Pickmaps" affect "Create Pickmap Folder" and + "Delete Current Pickmap Folder". + * Remove unused "Inventory:" element from game object attributes dialogs. Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-09-01 06:28:24 UTC (rev 8628) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-09-01 06:39:19 UTC (rev 8629) @@ -31,6 +31,8 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; +import net.sf.gridarta.model.pickmapsettings.PickmapSettingsListener; import net.sf.gridarta.utils.ActionUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -56,6 +58,12 @@ private final MapFolderTree<G, A, R> mapFolderTree; /** + * The {@link PickmapSettings} to use. + */ + @NotNull + private final PickmapSettings pickmapSettings; + + /** * The factory for creating new pickmap folders. */ @NotNull @@ -86,6 +94,12 @@ private MapFolder<G, A, R> activeMapFolder; /** + * Action for "create folder". + */ + @NotNull + private final Action aCreateFolderAction; + + /** * Action called for "delete active folder". */ private final Action aDeletePickmapFolder; @@ -118,8 +132,25 @@ }; /** + * The {@link PickmapSettingsListener} attached to {@link #pickmapSettings}. + */ + @NotNull + private final PickmapSettingsListener pickmapSettingsListener = new PickmapSettingsListener() { + + /** + * {@inheritDoc} + */ + @Override + public void lockedChanged(final boolean locked) { + refresh(); + } + + }; + + /** * Creates a new instance. * @param mapFolderTree the model to operate on + * @param pickmapSettings the pickmap settings to use * @param newMapDialogFactory the factory for creating new pickmap folders * @param createFolderKey the action key for "create folder" * @param deleteFolderKey the action key for "delete folder" @@ -128,15 +159,17 @@ * @param deleteFolderNotEmptyKey the dialog key for "delete folder not * empty" */ - public MapFolderTreeActions(@NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String createFolderKey, @NotNull final String deleteFolderKey, @NotNull final String confirmDeleteFolderKey, @NotNull final String deleteFolderNotEmptyKey) { + public MapFolderTreeActions(@NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String createFolderKey, @NotNull final String deleteFolderKey, @NotNull final String confirmDeleteFolderKey, @NotNull final String deleteFolderNotEmptyKey) { this.mapFolderTree = mapFolderTree; + this.pickmapSettings = pickmapSettings; this.newMapDialogFactory = newMapDialogFactory; this.confirmDeleteFolderKey = confirmDeleteFolderKey; this.deleteFolderNotEmptyKey = deleteFolderNotEmptyKey; mapFolderTree.addModelListener(mapFolderTreeListener); activeMapFolder = mapFolderTree.getActiveMapFolder(); - ActionUtils.newAction(ACTION_BUILDER, "Pickmap", this, createFolderKey); + aCreateFolderAction = ActionUtils.newAction(ACTION_BUILDER, "Pickmap", this, createFolderKey); aDeletePickmapFolder = ActionUtils.newAction(ACTION_BUILDER, "Pickmap", this, deleteFolderKey); + pickmapSettings.addPickmapSettingsListener(pickmapSettingsListener); refresh(); } @@ -155,6 +188,7 @@ * Updates the actions' states. */ private void refresh() { + aCreateFolderAction.setEnabled(doCreateFolder(false)); aDeletePickmapFolder.setEnabled(doDeletePickmapFolder(false)); if (folderMenu == null) { @@ -176,10 +210,27 @@ */ @ActionMethod public void createPickmapFolder() { - newMapDialogFactory.showNewPickmapFolderDialog(mapFolderTree, activeMapFolder); + doCreateFolder(true); } /** + * Executes the "create folder" action. + * @param performAction whether the action should be performed + * @return whether the action was or can be performed + */ + private boolean doCreateFolder(final boolean performAction) { + if (pickmapSettings.isLocked()) { + return false; + } + + if (performAction) { + newMapDialogFactory.showNewPickmapFolderDialog(mapFolderTree, activeMapFolder); + } + + return true; + } + + /** * Action callback function to delete the current pickmap folder. */ @ActionMethod @@ -193,6 +244,10 @@ * @return whether the action was or can be performed */ private boolean doDeletePickmapFolder(final boolean performAction) { + if (pickmapSettings.isLocked()) { + return false; + } + final MapFolder<G, A, R> mapFolder = activeMapFolder; if (mapFolder == null || mapFolder.getParent() == null) { return false; Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-09-01 06:28:24 UTC (rev 8628) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-09-01 06:39:19 UTC (rev 8629) @@ -507,7 +507,7 @@ //noinspection ResultOfObjectAllocationIgnored new UndoControl<G, A, R>(mapManager, gameObjectFactory, gameObjectMatchers); final Action exitAction = ActionUtils.newAction(ACTION_BUILDER, "Other", this, "exit"); - final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); + final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); //noinspection ResultOfObjectAllocationIgnored new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 06:28:32
|
Revision: 8628 http://gridarta.svn.sourceforge.net/gridarta/?rev=8628&view=rev Author: akirschbaum Date: 2010-09-01 06:28:24 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Extract PickmapSettings from PickmapChooserControl; removes some cyclic dependencies involving PickmapChooserControl. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/ trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java Added: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -0,0 +1,101 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.pickmapsettings; + +import net.sf.gridarta.utils.EventListenerList2; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base class for {@link PickmapSettings} implementations. + * @author Andreas Kirschbaum + */ +public abstract class AbstractPickmapSettings implements PickmapSettings { + + /** + * The MapViewSettingsListeners to inform of changes. + */ + @NotNull + private final EventListenerList2<PickmapSettingsListener> listenerList = new EventListenerList2<PickmapSettingsListener>(PickmapSettingsListener.class); + + /** + * The immutable state. + */ + private boolean locked = loadLocked(); + + /** + * {@inheritDoc} + */ + @Override + public void addPickmapSettingsListener(@NotNull final PickmapSettingsListener listener) { + listenerList.add(listener); + } + + /** + * {@inheritDoc} + */ + @Override + public void removePickmapSettingsListener(@NotNull final PickmapSettingsListener listener) { + listenerList.remove(listener); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isLocked() { + return locked; + } + + /** + * {@inheritDoc} + */ + @Override + public void setLocked(final boolean locked) { + if (this.locked == locked) { + return; + } + + this.locked = locked; + saveLocked(locked); + fireLockedChanged(); + } + + /** + * Informs all registered listeners that the immutrable state has changed. + */ + private void fireLockedChanged() { + for (final PickmapSettingsListener listener : listenerList.getListeners()) { + listener.lockedChanged(locked); + } + } + + /** + * Loads the default value for {@link #locked}. + * @return the default value + */ + protected abstract boolean loadLocked(); + + /** + * Saves the {@link #locked} value. + * @param locked the locked value + */ + protected abstract void saveLocked(final boolean locked); + +} // class AbstractPickmapSettings Property changes on: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -0,0 +1,62 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.pickmapsettings; + +import java.util.prefs.Preferences; +import net.sf.gridarta.MainControl; +import org.jetbrains.annotations.NotNull; + +/** + * Default {@link PickmapSettings} implementation. Attributes are retained + * across editor restarts. The attributes are stored in the {@link + * Preferences}. + * @author Andreas Kirschbaum + */ +public class DefaultPickmapSettings extends AbstractPickmapSettings { + + /** + * Key for saving {@link #locked} state in preferences. + */ + @NotNull + private static final String LOCKED_KEY = "pickmapSettings.locked"; + + /** + * Preferences. + */ + @NotNull + private static final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + + /** + * {@inheritDoc} + */ + @Override + protected boolean loadLocked() { + return preferences.getBoolean(LOCKED_KEY, false); + } + + /** + * {@inheritDoc} + */ + @Override + protected void saveLocked(final boolean locked) { + preferences.putBoolean(LOCKED_KEY, locked); + } + +} // class DefaultPickmapSettings Property changes on: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -0,0 +1,54 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.pickmapsettings; + +import org.jetbrains.annotations.NotNull; + +/** + * Container for settings that affect pickmaps. + * @author Andreas Kirschbaum + */ +public interface PickmapSettings { + + /** + * Adds a {@link PickmapSettingsListener} to be notified about changes. + * @param listener the listener to add + */ + void addPickmapSettingsListener(@NotNull PickmapSettingsListener listener); + + /** + * Removes a {@link PickmapSettingsListener} to be notified about changes. + * @param listener the listener to remove + */ + void removePickmapSettingsListener(@NotNull PickmapSettingsListener listener); + + /** + * Returns whether pickmaps are immutable. + * @return whether pickmaps are immutable + */ + boolean isLocked(); + + /** + * Sets whether pickmaps are immutable. + * @param locked whether pickmaps are immutable + */ + void setLocked(boolean locked); + +} // interface PickmapSettings Property changes on: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -0,0 +1,37 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.pickmapsettings; + +import java.util.EventListener; + +/** + * Interface for event listeners that are interested in changes on {@link + * PickmapSettings}. + * @author Andreas Kirschbaum + */ +public interface PickmapSettingsListener extends EventListener { + + /** + * This event handler is called when the immutable state has changed. + * @param locked the new immutable state + */ + void lockedChanged(boolean locked); + +} // interface PickmapSettingsListener Property changes on: trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -30,7 +30,6 @@ import javax.swing.JPanel; import net.sf.gridarta.gui.map.event.MouseOpEvent; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; import net.sf.gridarta.gui.utils.SwingUtils; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -41,6 +40,7 @@ import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -138,10 +138,10 @@ private final ObjectChooser<G, A, R> objectChooser; /** - * The PickmapChooserControl to use. + * The {@link PickmapSettings} to use. */ @NotNull - private final PickmapChooserControl<G, A, R> pickmapChooserControl; + private final PickmapSettings pickmapSettings; /** * The action for "ignore walls". @@ -187,16 +187,16 @@ * Create a DeletionTool. * @param mapViewSettings the map view settings instance * @param objectChooser the object chooser to use - * @param pickmapChooserControl the pickmap chooser control to use + * @param pickmapSettings the pickmap settings to use * @param floorGameObjectMatcher the floor matcher to use * @param wallGameObjectMatcher the wall matcher to use * @param monsterGameObjectMatcher the monster matcher to use */ - public DeletionTool(@NotNull final MapViewSettings mapViewSettings, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher) { + public DeletionTool(@NotNull final MapViewSettings mapViewSettings, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapSettings pickmapSettings, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher) { super("deletion"); this.mapViewSettings = mapViewSettings; this.objectChooser = objectChooser; - this.pickmapChooserControl = pickmapChooserControl; + this.pickmapSettings = pickmapSettings; this.floorGameObjectMatcher = floorGameObjectMatcher; this.wallGameObjectMatcher = wallGameObjectMatcher; this.monsterGameObjectMatcher = monsterGameObjectMatcher; @@ -237,7 +237,7 @@ * @param mapControl map control of map to delete arch from */ private void deleteArch(final Point mapLoc, final MapControl<G, A, R> mapControl) { - if (mapControl.isPickmap() && pickmapChooserControl.isLockAllPickmaps()) { + if (mapControl.isPickmap() && pickmapSettings.isLocked()) { return; } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -28,7 +28,6 @@ import javax.swing.JPanel; import net.sf.gridarta.gui.map.event.MouseOpEvent; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.utils.SwingUtils; @@ -41,6 +40,7 @@ import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -108,10 +108,10 @@ private final ObjectChooser<G, A, R> objectChooser; /** - * The PickmapChooserControl to use. + * The {@link PickmapSettings} to use. */ @NotNull - private final PickmapChooserControl<G, A, R> pickmapChooserControl; + private final PickmapSettings pickmapSettings; /** * The {@link InsertionModeSet} to use. @@ -124,15 +124,15 @@ * @param selectedSquareView the selected square view * @param selectedSquareModel the selected square model * @param objectChooser the ObjectChooser to use - * @param pickmapChooserControl the pickmap chooser control to use + * @param pickmapSettings the pickmap settings to use * @param insertionModeSet the insertion mode set to use */ - public InsertionTool(@NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public InsertionTool(@NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapSettings pickmapSettings, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { super("insertion"); this.selectedSquareView = selectedSquareView; this.selectedSquareModel = selectedSquareModel; this.objectChooser = objectChooser; - this.pickmapChooserControl = pickmapChooserControl; + this.pickmapSettings = pickmapSettings; this.insertionModeSet = insertionModeSet; } @@ -160,7 +160,7 @@ */ private void doInsert(final MouseOpEvent<G, A, R> e, final boolean isPressed) { final MapControl<G, A, R> mapControl = e.getMapControl(); - if (mapControl.isPickmap() && pickmapChooserControl.isLockAllPickmaps()) { + if (mapControl.isPickmap() && pickmapSettings.isLocked()) { return; } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -28,7 +28,6 @@ import net.sf.gridarta.gui.map.event.MouseOpEvent; import net.sf.gridarta.gui.map.event.MouseOpListener; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.model.archetype.Archetype; @@ -37,6 +36,7 @@ import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -81,17 +81,17 @@ * @param selectedSquareView the selected square view * @param selectedSquareModel the selected square model * @param objectChooser the object chooser to use - * @param pickmapChooserControl the pickmap chooser control to use + * @param pickmapSettings the pickmap settings to use * @param floorGameObjectMatcher the floor matcher to use * @param wallGameObjectMatcher the wall matcher to use * @param monsterGameObjectMatcher the monster matcher to use * @param insertionModeSet the insertion mode set to use */ - public ToolPalette(@NotNull final MapViewSettings mapViewSettings, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public ToolPalette(@NotNull final MapViewSettings mapViewSettings, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapSettings pickmapSettings, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { super(new BorderLayout()); - lmbSelector = new ToolSelector<G, A, R>("selection", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); - mmbSelector = new ToolSelector<G, A, R>("deletion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); - rmbSelector = new ToolSelector<G, A, R>("insertion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); + lmbSelector = new ToolSelector<G, A, R>("selection", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapSettings, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); + mmbSelector = new ToolSelector<G, A, R>("deletion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapSettings, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); + rmbSelector = new ToolSelector<G, A, R>("insertion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapSettings, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mouse"), BorderLayout.NORTH); final Container mouseTabs = new JTabbedPane(); mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "left"), lmbSelector); Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -36,7 +36,6 @@ import javax.swing.JToggleButton; import net.sf.gridarta.gui.map.event.MouseOpListener; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.model.archetype.Archetype; @@ -45,6 +44,7 @@ import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -115,18 +115,18 @@ * @param selectedSquareView the selected square view * @param selectedSquareModel the selected square model * @param objectChooser the object chooser to use - * @param pickmapChooserControl the pickmap chooser control to use + * @param pickmapSettings the pickmap settings to use * @param floorGameObjectMatcher the floor matcher to use * @param wallGameObjectMatcher the wall matcher to use * @param monsterGameObjectMatcher the monster matcher to use * @param insertionModeSet the insertion mode set to use */ - public ToolSelector(@NotNull final String defaultTool, @NotNull final MapViewSettings mapViewSettings, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public ToolSelector(@NotNull final String defaultTool, @NotNull final MapViewSettings mapViewSettings, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final PickmapSettings pickmapSettings, @Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher monsterGameObjectMatcher, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { createUI(); addTool(new VoidTool<G, A, R>(), defaultTool); addTool(new SelectionTool<G, A, R>(objectChooser, insertionModeSet), defaultTool); - addTool(new DeletionTool<G, A, R>(mapViewSettings, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher), defaultTool); - addTool(new InsertionTool<G, A, R>(selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, insertionModeSet), defaultTool); + addTool(new DeletionTool<G, A, R>(mapViewSettings, objectChooser, pickmapSettings, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher), defaultTool); + addTool(new InsertionTool<G, A, R>(selectedSquareView, selectedSquareModel, objectChooser, pickmapSettings, insertionModeSet), defaultTool); } /** Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -27,13 +27,11 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.prefs.Preferences; import javax.swing.Action; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; @@ -56,6 +54,8 @@ import net.sf.gridarta.model.mapcontrol.MapControlListener; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; +import net.sf.gridarta.model.pickmapsettings.PickmapSettingsListener; import net.sf.gridarta.model.validation.ErrorCollector; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.ActionUtils; @@ -94,6 +94,12 @@ private final PickmapChooserModel<G, A, R> pickmapChooserModel; /** + * The {@link PickmapSettings} to use. + */ + @NotNull + private final PickmapSettings pickmapSettings; + + /** * The {@link MapArchObjectFactory} instance. */ @NotNull @@ -118,16 +124,6 @@ private final MapFolderTree<G, A, R> mapFolderTree; /** - * Preferences. - */ - private static final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); - - /** - * Key for "all pickmaps are locked". - */ - private static final String PICKMAPS_LOCKED = "pickmapsLocked"; - - /** * The factory for creating new pickmaps. */ @NotNull @@ -195,11 +191,6 @@ private MapControl<G, A, R> currentPickmapControl = null; /** - * Set if all pickmaps are locked. - */ - private boolean lockAllPickmaps = false; - - /** * Set if the pickmap panel is active. */ private boolean active = false; @@ -345,8 +336,25 @@ }; /** + * The {@link PickmapSettingsListener} attached to {@link #pickmapSettings}. + */ + @NotNull + private final PickmapSettingsListener pickmapSettingsListener = new PickmapSettingsListener() { + + /** + * {@inheritDoc} + */ + @Override + public void lockedChanged(final boolean locked) { + refresh(); + } + + }; + + /** * Create a PickmapChooserControl. * @param pickmapChooserModel the pickmap chooser model to control + * @param pickmapSettings the pickmap settings to use * @param newMapDialogFactory the factory for creating new pickmaps * @param mapArchObjectFactory the map arch object factory instance * @param mapReaderFactory the map reader factory instance @@ -356,8 +364,9 @@ * @param pickmapManager the pickmap manager for loading pickmaps * @param mapViewsManager the map views */ - public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { this.pickmapChooserModel = pickmapChooserModel; + this.pickmapSettings = pickmapSettings; this.mapArchObjectFactory = mapArchObjectFactory; this.mapReaderFactory = mapReaderFactory; this.mapFolderTree = mapFolderTree; @@ -365,13 +374,13 @@ this.newMapDialogFactory = newMapDialogFactory; this.pickmapManager = pickmapManager; this.mapViewsManager = mapViewsManager; - lockAllPickmaps = preferences.getBoolean(PICKMAPS_LOCKED, false); ACTION_BUILDER.createToggles(true, this, "lockAllPickmaps"); pickmapChooserModel.addPickmapChooserListener(pickmapChooserModelListener); view = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree); refresh(); view.addChangeListener(changeListener); mapManager.addMapManagerListener(mapManagerListener); + pickmapSettings.addPickmapSettingsListener(pickmapSettingsListener); } /** @@ -463,8 +472,9 @@ * Return whether all pickmaps are locked. * @return <code>true</code> if all pickmaps are locked */ + @ActionMethod public boolean isLockAllPickmaps() { - return lockAllPickmaps; + return pickmapSettings.isLocked(); } /** @@ -671,7 +681,7 @@ * <code>false</code> otherwise */ private boolean isAddNewPickmapEnabled() { - return !lockAllPickmaps; + return !pickmapSettings.isLocked(); } /** @@ -681,7 +691,7 @@ */ @Nullable private MapFile<G, A, R> getOpenPickmapMap() { - if (lockAllPickmaps || !active) { + if (pickmapSettings.isLocked() || !active) { return null; } return currentMapFile; @@ -694,7 +704,7 @@ */ @Nullable private MapFile<G, A, R> getDeletePickmap() { - if (lockAllPickmaps || !active) { + if (pickmapSettings.isLocked() || !active) { return null; } return currentMapFile; @@ -707,7 +717,7 @@ */ @Nullable private MapFile<G, A, R> getSavePickmap() { - if (lockAllPickmaps || !active) { + if (pickmapSettings.isLocked() || !active) { return null; } @@ -725,7 +735,7 @@ */ @Nullable private MapFile<G, A, R> getRevertPickmap() { - if (lockAllPickmaps || !active) { + if (pickmapSettings.isLocked() || !active) { return null; } @@ -766,14 +776,9 @@ * Set whether all pickmaps are locked. * @param lockAllPickmaps <code>true</code> if all pickmaps are locked */ + @ActionMethod public void setLockAllPickmaps(final boolean lockAllPickmaps) { - if (this.lockAllPickmaps == lockAllPickmaps) { - return; - } - - this.lockAllPickmaps = lockAllPickmaps; - preferences.putBoolean(PICKMAPS_LOCKED, this.lockAllPickmaps); - refresh(); + pickmapSettings.setLocked(lockAllPickmaps); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-09-01 06:24:01 UTC (rev 8627) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-09-01 06:28:24 UTC (rev 8628) @@ -152,6 +152,8 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; +import net.sf.gridarta.model.pickmapsettings.DefaultPickmapSettings; +import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; @@ -447,7 +449,8 @@ mainViewFrame = new JFrame(ACTION_BUILDER.format("mainWindow.title", getBuildNumberAsString())); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, mapArchObjectFactory, mainViewFrame); final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); - pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainViewFrame, pickmapManager, mapViewsManager); + final PickmapSettings pickmapSettings = new DefaultPickmapSettings(); + pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainViewFrame, pickmapManager, mapViewsManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); final CFTreasureListTree<G, A, R> treasureListTree = new CFTreasureListTree<G, A, R>(treasureTree, mainViewFrame, archetypeSet, faceObjectProviders, systemIcons); final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); @@ -491,7 +494,7 @@ final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, mapManager, faceObjectProviders); final File scriptsFile = new File(globalSettings.getMapsDirectory(), scriptsDir); scriptControl = new ScriptController<G, A, R>(filterControl, scriptParameters, mainViewFrame, pluginParameterViewFactory, scriptsFile, scriptModel, pluginParameterFactory, scriptExecutor, systemIcons); - final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); + final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapSettings, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 06:24:07
|
Revision: 8627 http://gridarta.svn.sourceforge.net/gridarta/?rev=8627&view=rev Author: akirschbaum Date: 2010-09-01 06:24:01 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Remove unneeded final modifiers. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java 2010-09-01 06:23:41 UTC (rev 8626) +++ trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java 2010-09-01 06:24:01 UTC (rev 8627) @@ -34,7 +34,7 @@ * This event handler is called when the grid visibility has changed. * @param gridVisible the new grid visibility */ - void gridVisibleChanged(final boolean gridVisible); + void gridVisibleChanged(boolean gridVisible); /** * This event handler is called when the smoothing setting has changed. @@ -47,13 +47,13 @@ * changed. * @param doubleFaces the new double faces visibility */ - void doubleFacesChanged(final boolean doubleFaces); + void doubleFacesChanged(boolean doubleFaces); /** * This event handler is called when the alpha type setting has changed. * @param alphaType the new alpha type setting */ - void alphaTypeChanged(final int alphaType); + void alphaTypeChanged(int alphaType); /** * The edit types value has changed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 06:23:47
|
Revision: 8626 http://gridarta.svn.sourceforge.net/gridarta/?rev=8626&view=rev Author: akirschbaum Date: 2010-09-01 06:23:41 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Remove redundant comments. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2010-09-01 05:45:39 UTC (rev 8625) +++ trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2010-09-01 06:23:41 UTC (rev 8626) @@ -99,9 +99,7 @@ } /** - * Get the visibility of the grid. - * @return visibility of the grid (<code>true</code> for visible, - * <code>false</code> for invisible) + * {@inheritDoc} */ @Override public boolean isGridVisible() { @@ -109,9 +107,7 @@ } /** - * Set the visibility of the grid. - * @param gridVisible new visibility of the grid (<code>true</code> for - * making the grid visible, <code>false</code> for invisible) + * {@inheritDoc} */ @Override public void setGridVisible(final boolean gridVisible) { @@ -125,8 +121,7 @@ } /** - * Returns the smoothing setting. - * @return the smoothing setting + * {@inheritDoc} */ @Override public boolean isSmoothing() { @@ -134,8 +129,7 @@ } /** - * Sets the smoothing setting. - * @param smoothing the new smoothing setting + * {@inheritDoc} */ @Override public void setSmoothing(final boolean smoothing) { @@ -149,9 +143,7 @@ } /** - * Get whether double faces are drawn double height. - * @return <code>true</code> if double faces are drawn double height, - * otherwise <code>false</code> + * {@inheritDoc} */ @Override public boolean isDoubleFaces() { @@ -159,8 +151,7 @@ } /** - * Sets whether double faces should be drawn double height. - * @param doubleFaces whether double faces should be drawn double height + * {@inheritDoc} */ @Override public void setDoubleFaces(final boolean doubleFaces) { @@ -174,10 +165,7 @@ } /** - * Returns whether the specified edit type is to be shown transparent. - * @param v edit type to check - * @return <code>true</code> if to be displayed transparent, otherwise - * <code>false</code> + * {@inheritDoc} */ @Override public boolean isAlphaType(final int v) { @@ -185,10 +173,7 @@ } /** - * Sets whether the specified edit type is to be shown transparent. - * @param v edit type to set - * @param state state, <code>true</code> to make edit type <code>v</code> - * transparent, <code>false</code> for opaque + * {@inheritDoc} */ @Override public void setAlphaType(final int v, final boolean state) { @@ -202,7 +187,7 @@ } /** - * Clear the transparency. + * {@inheritDoc} */ @Override public void clearAlpha() { @@ -212,8 +197,7 @@ } /** - * Returns the currently set edit type. - * @return the currently set edit type. + * {@inheritDoc} */ @Override public int getEditType() { @@ -236,9 +220,7 @@ } /** - * Set the map view to hide squares of the given type. (If no edit type is - * set, everything is displayed) - * @param editType edit type bitmask of types to hide + * {@inheritDoc} */ @Override public void unsetEditType(final int editType) { @@ -252,10 +234,7 @@ } /** - * Get information on the current state of edit type. Are squares of type - * 'editType' displayed? - * @param editType are squares of this type displayed? - * @return <code>true</code> if these squares are currently displayed + * {@inheritDoc} */ @Override public boolean isEditType(final int editType) { @@ -264,10 +243,7 @@ } /** - * Get information whether the gameObject is edited. Are squares of type 'v' - * displayed? - * @param gameObject are squares of this type displayed? - * @return true if these squares are currently displayed + * {@inheritDoc} */ @Override public boolean isEditType(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { @@ -275,10 +251,7 @@ } /** - * Returns whether a editType value is set so that not all squares are - * displayed. - * @return <code>true</code> if a editType value is set, otherwise - * <code>false</code>. + * {@inheritDoc} */ @Override public boolean isEditTypeSet() { @@ -286,8 +259,7 @@ } /** - * Toggle an edit type. - * @param editType the edit type to toggle + * {@inheritDoc} */ @Override public void toggleEditType(final int editType) { @@ -299,8 +271,7 @@ } /** - * Returns whether "autojoin" is enabled. - * @return the autojoin state + * {@inheritDoc} */ @Override public boolean isAutojoin() { @@ -308,8 +279,7 @@ } /** - * Sets the "autojoin" state. - * @param autojoin if set, enable autojoining + * {@inheritDoc} */ @Override public void setAutojoin(final boolean autojoin) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-09-01 05:45:45
|
Revision: 8625 http://gridarta.svn.sourceforge.net/gridarta/?rev=8625&view=rev Author: akirschbaum Date: 2010-09-01 05:45:39 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Remove unused "Inventory:" element from game object attributes dialogs. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) +++ trunk/atrinik/ChangeLog 2010-09-01 05:45:39 UTC (rev 8625) @@ -1,3 +1,8 @@ +2010-09-01 Andreas Kirschbaum + + * Remove unused "Inventory:" element from game object attributes + dialogs. + 2010-08-31 Andreas Kirschbaum * Add option to skip squares in "random fill" that contain similar Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) +++ trunk/crossfire/ChangeLog 2010-09-01 05:45:39 UTC (rev 8625) @@ -1,3 +1,8 @@ +2010-09-01 Andreas Kirschbaum + + * Remove unused "Inventory:" element from game object attributes + dialogs. + 2010-08-31 Andreas Kirschbaum * Add option to skip squares in "random fill" that contain similar Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) +++ trunk/daimonin/ChangeLog 2010-09-01 05:45:39 UTC (rev 8625) @@ -1,3 +1,8 @@ +2010-09-01 Andreas Kirschbaum + + * Remove unused "Inventory:" element from game object attributes + dialogs. + 2010-08-31 Andreas Kirschbaum * Add option to skip squares in "random fill" that contain similar Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-08-31 20:36:46 UTC (rev 8624) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-09-01 05:45:39 UTC (rev 8625) @@ -52,13 +52,10 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JTextPane; -import javax.swing.JViewport; -import javax.swing.ScrollPaneConstants; import javax.swing.SwingConstants; import javax.swing.filechooser.FileFilter; import javax.swing.text.BadLocationException; @@ -842,11 +839,7 @@ // first split top-left and -right final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); final JComponent leftPane = buildHeader(archetypeTypeSet.getArchetypeTypeIndex(archetypeType), archetypeType); - final JScrollPane rightPane = buildInv(); - //Create a split pane with the two scroll panes in it. - final Component splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPane, rightPane); - // Now split horizontally buildAttribute(); centerPanel = new JPanel(cardLayout); @@ -866,7 +859,7 @@ gbc.fill = GridBagConstraints.BOTH; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weighty = 0.0; - contentPanel.add(splitPane, gbc); + contentPanel.add(leftPane, gbc); gbc.weighty = 1.0; contentPanel.add(centerPanel, gbc); @@ -1010,26 +1003,6 @@ } /** - * Constructs the upper right part of the attribute dialog, containing the - * object's inventory. - * @return a <code>JScrollPane</code> with the upper right part of the - * dialog window - */ - @NotNull - private static JScrollPane buildInv() { - final JPanel inv = new JPanel(); // the final thing, in a panel - inv.add(new JLabel("Inventory:")); // create label - - final JScrollPane scrollPane = new JScrollPane(inv); - scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - scrollPane.setSize(80, 70); - - return scrollPane; - } - - /** * Constructs the central part of the attribute dialog, containing the * object's gameObject attributes. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-31 20:36:54
|
Revision: 8624 http://gridarta.svn.sourceforge.net/gridarta/?rev=8624&view=rev Author: akirschbaum Date: 2010-08-31 20:36:46 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Add option to skip squares in "random fill" that contain similar game objects. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/floodfill/ trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/atrinik/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) @@ -1,3 +1,8 @@ +2010-08-31 Andreas Kirschbaum + + * Add option to skip squares in "random fill" that contain similar + game objects. + 2010-08-30 Andreas Kirschbaum * Do not generate game object attributes redundant with archetype. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/crossfire/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) @@ -1,3 +1,8 @@ +2010-08-31 Andreas Kirschbaum + + * Add option to skip squares in "random fill" that contain similar + game objects. + 2010-08-30 Andreas Kirschbaum * Do not generate game object attributes redundant with archetype. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/daimonin/ChangeLog 2010-08-31 20:36:46 UTC (rev 8624) @@ -1,3 +1,8 @@ +2010-08-31 Andreas Kirschbaum + + * Add option to skip squares in "random fill" that contain similar + game objects. + 2010-08-30 Andreas Kirschbaum * Do not generate game object attributes redundant with archetype. Modified: trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2010-08-31 20:36:46 UTC (rev 8624) @@ -20,7 +20,10 @@ package net.sf.gridarta.model.floodfill; import java.awt.Point; +import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; @@ -28,8 +31,10 @@ import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.utils.RandomUtils; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Utility class implementing fill operations on map instances. @@ -50,8 +55,10 @@ * @param insertionMode the insertion mode to use * @param gameObjects the game objects to fill with * @param density the fill density in percent; -1 to disable + * @param noAdjacent whether squares are skipped if an adjacent squares is + * not free */ - public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void fill(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point[] selection, @NotNull final InsertionMode<G, A, R> insertionMode, @NotNull final List<? extends BaseObject<G, A, R, ?>> gameObjects, final int density) { + public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void fill(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point[] selection, @NotNull final InsertionMode<G, A, R> insertionMode, @NotNull final List<? extends BaseObject<G, A, R, ?>> gameObjects, final int density, final boolean noAdjacent) { if (selection.length <= 0) { return; } @@ -60,6 +67,16 @@ return; } + @Nullable final Set<String> archetypeNames; + if (noAdjacent) { + archetypeNames = new HashSet<String>(); + for (final BaseObject<?, ?, ?, ?> baseObject : gameObjects) { + archetypeNames.add(baseObject.getArchetype().getArchetypeName()); + } + } else { + archetypeNames = null; + } + mapModel.beginTransaction("Fill"); // TODO; I18N/L10N try { for (final Point p : selection) { @@ -67,6 +84,14 @@ continue; } final BaseObject<G, A, R, ?> gameObject = gameObjects.get(RandomUtils.rnd.nextInt(gameObjects.size())); + if (archetypeNames != null) { + final Archetype<G, A, R> archetype = gameObject.getArchetype(); + final int w = archetype.getSizeX(); + final int h = archetype.getSizeY(); + if (containsArchetype(mapModel, archetypeNames, p, w, h)) { + continue; + } + } mapModel.insertBaseObject(gameObject, p, false, false, insertionMode); } } finally { @@ -75,6 +100,41 @@ } /** + * Checks whether an area and its adjacent squares of a map does contain an + * archetype. + * @param mapModel the map model to check + * @param archetypeNames the archetype names to check for + * @param p the top left corner of the area to check + * @param w the width of the area to check + * @param h the height of the area to check + * @return whether a similar game object was found + */ + private static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> boolean containsArchetype(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<String> archetypeNames, @NotNull final Point p, final int w, final int h) { + final Point pos = new Point(); + for (int dy = -1; dy < h+1; dy++) { + pos.y = p.y + dy; + for (int dx = -1; dx < w+1; dx++) { + pos.x = p.x + dx; + final MapSquare<G, A, R> mapSquare; + // This exception is expected at the border of the map. + //noinspection ProhibitedExceptionCaught + try { + mapSquare = mapModel.getMapSquare(pos); + } catch (final ArrayIndexOutOfBoundsException ignored) { + continue; + } + + for (final GameObject<G, A, R> gameObject : mapSquare) { + if (archetypeNames.contains(gameObject.getHead().getArchetype().getArchetypeName())) { + return true; + } + } + } + } + return false; + } + + /** * Flood-fill the the map, starting at the cursor position. * @param mapModel the map to fill * @param start the starting location Added: trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java 2010-08-31 20:36:46 UTC (rev 8624) @@ -0,0 +1,83 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.floodfill; + +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; +import net.sf.gridarta.model.mapmodel.InsertionMode; +import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.TestMapModelCreator; +import net.sf.gridarta.model.mapmodel.TestMapModelHelper; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link FillUtils}. + * @author Andreas Kirschbaum + */ +public class FillUtilsTest { + + /** + * Checks that {@link FillUtils#fill(MapModel, Point[], InsertionMode, List, + * int, boolean)} works correctly when skipping adjacent squares. + * @throws DuplicateArchetypeException if the test fails + * @throws CannotInsertGameObjectException if the test fails + */ + @Test + public void testFillAdjacent() throws CannotInsertGameObjectException, DuplicateArchetypeException { + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + final TestMapModelHelper mapModelHelper = mapModelCreator.newMapModelCreator(); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(4, 5); + + final TestArchetype head = mapModelCreator.getArchetype("2x2a"); + head.setAttributeInt(BaseObject.TYPE, 1); + final TestArchetype tail1 = mapModelCreator.getArchetype("2x2b"); + tail1.setMultiX(1); + head.addTailPart(tail1); + final TestArchetype tail2 = mapModelCreator.getArchetype("2x2c"); + tail2.setMultiY(1); + head.addTailPart(tail2); + final TestArchetype tail3 = mapModelCreator.getArchetype("2x2d"); + tail3.setMultiX(1); + tail3.setMultiY(1); + head.addTailPart(tail3); + + mapModel.beginTransaction("TEST"); + mapModelHelper.insertArchetype(mapModel, new Point(0, 2), head, false); + + final Point[] selection = { new Point(2, 0), }; + final List<TestGameObject> gameObjects = new ArrayList<TestGameObject>(); + gameObjects.add(mapModelCreator.getGameObjectFactory().createGameObject(head)); + + FillUtils.fill(mapModel, selection, mapModelCreator.getInsertionModeSet().getTopmostInsertionMode(), gameObjects, 100, true); + Assert.assertTrue(mapModel.getMapSquare(new Point(2, 0)).isEmpty()); + + FillUtils.fill(mapModel, selection, mapModelCreator.getInsertionModeSet().getTopmostInsertionMode(), gameObjects, 100, false); + Assert.assertFalse(mapModel.getMapSquare(new Point(2, 0)).isEmpty()); + } + +} // class FillUtilsTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-08-31 20:36:46 UTC (rev 8624) @@ -204,7 +204,7 @@ throw new AssertionError(); } final MapView<G, A, R> mapView = e.getMapView(); - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); } } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-08-31 20:36:46 UTC (rev 8624) @@ -29,7 +29,6 @@ import java.util.Set; import javax.swing.Action; import javax.swing.JFrame; -import javax.swing.JOptionPane; import net.sf.gridarta.commands.Collector; import net.sf.gridarta.gui.copybuffer.CopyBuffer; import net.sf.gridarta.gui.map.mapview.MapView; @@ -71,7 +70,6 @@ import net.sf.gridarta.utils.ActionUtils; import net.sf.gridarta.utils.Exiter; import net.sf.gridarta.utils.ExiterListener; -import net.sf.gridarta.utils.NumberUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.validation.DelegatingMapValidator; import net.sf.japi.swing.action.ActionBuilder; @@ -336,6 +334,12 @@ private final Action aValidateMap; /** + * The {@link RandomFillDialog} instance. + */ + @NotNull + private final RandomFillDialog randomFillDialog = new RandomFillDialog(); + + /** * The last known active map, or <code>null</code> if no map is active. */ @Nullable @@ -1515,7 +1519,7 @@ * @param insertionMode the insertion mode to use */ private void fill(@NotNull final MapView<G, A, R> mapView, @NotNull final InsertionMode<G, A, R> insertionMode) { - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); } /** @@ -1524,32 +1528,14 @@ * @param insertionMode the insertion mode to use */ private void fillRandom(@NotNull final MapView<G, A, R> mapView, @NotNull final InsertionMode<G, A, R> insertionMode) { - final int rand = getFillDensity("Random fill"); - if (rand >= 0) { - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), rand); + if (!randomFillDialog.showRandomFillDialog(parent)) { + return; } - } - /** - * Asks the user for the fill density. - * @param title the title for the dialog box - * @return the fill density or <code>-1</code> if the dialog was cancelled - */ - private int getFillDensity(@NotNull final String title) { - String input = "100"; - while (true) { - input = (String) JOptionPane.showInputDialog(parent, "Enter a fill density between 1-100", title, JOptionPane.QUESTION_MESSAGE, null, null, input); - if (input == null) { - return -1; - } - - final int rand = NumberUtils.parseInt(input); - if (rand < 1 || rand > 100) { - JOptionPane.showMessageDialog(parent, "The fill density must be between 1-100.", "Illegal Value.", JOptionPane.ERROR_MESSAGE); - } else { - return rand; - } - } + final int fillDensity = randomFillDialog.getFillDensity(); + final boolean noAdjacent = randomFillDialog.isRandomFillSkipAdjacentSquares(); + final Point[] selection = mapView.getMapViewBasic().getSelection(); + FillUtils.fill(mapView.getMapControl().getMapModel(), selection, insertionMode, objectChooser.getSelections(), fillDensity, noAdjacent); } } // class MainActions Added: trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java 2010-08-31 20:36:46 UTC (rev 8624) @@ -0,0 +1,289 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.mainactions; + +import java.awt.Component; +import java.awt.Dialog; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; +import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.TextComponentUtils; +import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.gridarta.utils.NumberUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import net.sf.japi.swing.action.ToggleAction; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Displays a dialog asking for parameters for the "random fill" function. + * @author Andreas Kirschbaum + */ +public class RandomFillDialog { + + /** + * Action Builder to create Actions. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link JOptionPane} instance used to create dialogs. + */ + @NotNull + private final JOptionPane optionPane = new JOptionPane(); + + /** + * The "OK" button. + */ + @NotNull + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "randomFillOkay", this)); + + /** + * The "Cancel" button. + */ + @NotNull + private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "randomFillCancel", this)); + + /** + * The text field for specifying the fill density. + */ + @NotNull + private final JTextComponent fillDensityTextField = new JTextField(16); + + /** + * The {@link JDialog} instance or <code>null</code> if not yet created. + */ + @Nullable + private JDialog dialog = null; + + /** + * Whether adjacent squares are checked. + */ + private boolean skipAdjacentSquares = false; + + /** + * Creates a new instance. + */ + public RandomFillDialog() { + okButton.setDefaultCapable(true); + optionPane.setOptions(new Object[] { okButton, cancelButton }); + final JPanel panel = new JPanel(); + panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); + panel.setBorder(GUIConstants.DIALOG_BORDER); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "randomFillDensity.text"))); + panel.add(fillDensityTextField); + panel.add(Box.createVerticalStrut(5)); + final ToggleAction skipAdjacentSquaresAction = (ToggleAction) ACTION_BUILDER.createToggle(false, "randomFillSkipAdjacentSquares", this); + panel.add(skipAdjacentSquaresAction.createCheckBox()); + optionPane.setMessage(panel); + + fillDensityTextField.setText(ActionBuilderUtils.getString(ACTION_BUILDER, "randomFillDensity.default")); + TextComponentUtils.setAutoSelectOnFocus(fillDensityTextField); + final DocumentListener documentListener = new DocumentListener() { + + /** {@inheritDoc} */ + @Override + public void insertUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void removeUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void changedUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + }; + + fillDensityTextField.getDocument().addDocumentListener(documentListener); + } + + /** + * The {@link WindowListener} attached to {@link #dialog} to call {@link + * JOptionPane#selectInitialValue()} after the dialog has been shown. + */ + @NotNull + private final WindowListener windowListener = new WindowListener() { + + /** + * {@inheritDoc} + */ + @Override + public void windowOpened(final WindowEvent e) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void windowClosing(final WindowEvent e) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void windowClosed(final WindowEvent e) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void windowIconified(final WindowEvent e) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void windowDeiconified(final WindowEvent e) { + // ignore + } + + /** + * {@inheritDoc} + */ + @Override + public void windowActivated(final WindowEvent e) { + fillDensityTextField.requestFocusInWindow(); + assert dialog != null; + dialog.removeWindowListener(windowListener); + } + + /** + * {@inheritDoc} + */ + @Override + public void windowDeactivated(final WindowEvent e) { + // ignore + } + + }; + + /** + * Updates the enabled state of the "OK" button depending on the dialog's + * contents. + */ + private void updateOkButton() { + okButton.setEnabled(isOkButtonEnabled()); + } + + /** + * Displays the random fill dialog. + * @param parent the parent component for the dialog + * @return whether the dialog was closed with "OK" + */ + public boolean showRandomFillDialog(@NotNull final Component parent) { + final JDialog tmpDialog; + if (dialog == null) { + tmpDialog = optionPane.createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "randomFillTitle")); + dialog = tmpDialog; + tmpDialog.getRootPane().setDefaultButton(okButton); + optionPane.selectInitialValue(); + tmpDialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL); + } else { + tmpDialog = dialog; + } + okButton.setEnabled(isOkButtonEnabled()); + tmpDialog.addWindowListener(windowListener); + tmpDialog.setVisible(true); + tmpDialog.removeWindowListener(windowListener); + return optionPane.getValue() == okButton; + } + + /** + * Action method to close the dialog with "OK". + */ + @ActionMethod + public void randomFillOkay() { + if (isOkButtonEnabled()) { + optionPane.setValue(okButton); + } + } + + /** + * Action method for "skip adjacent squares" action. + * @return whether the checkbox is checked + */ + @ActionMethod + public boolean isRandomFillSkipAdjacentSquares() { + return skipAdjacentSquares; + } + + /** + * Action method for "skip adjacent squares" action. + * @param skipAdjacentSquares whether the checkbox is checked + */ + @ActionMethod + public void setRandomFillSkipAdjacentSquares(final boolean skipAdjacentSquares) { + this.skipAdjacentSquares = skipAdjacentSquares; + } + + /** + * Action method to close the dialog with "Cancel". + */ + @ActionMethod + public void randomFillCancel() { + optionPane.setValue(cancelButton); + } + + /** + * Returns whether the "OK" button is enabled. + * @return whether the "OK" button is enabled + */ + private boolean isOkButtonEnabled() { + final int fillDensity = getFillDensity(); + return 0 < fillDensity && fillDensity <= 100; + } + + /** + * Returns the fill density. + * @return the fill density + */ + public int getFillDensity() { + return NumberUtils.parseInt(fillDensityTextField.getText()); + } + +} // class RandomFillDialog Property changes on: trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-08-31 20:36:46 UTC (rev 8624) @@ -1638,3 +1638,14 @@ createBookmark.description=Description: createBookmarkOk.text=Create createBookmarkCancel.text=Cancel + + +#################### +# Random Fill Dialog +randomFillTitle=Random Fill +randomFillDensity.text=Enter a fill density between 1-100: +randomFillDensity.default=10 +randomFillSkipAdjacentSquares.text=Skip if adjacent square is filled +randomFillSkipAdjacentSquares.shortdescription=If checked, do not fill squares for which an adjacent square contains a similar game object. +randomFillOkay.text=Ok +randomFillCancel.text=Cancel Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-08-31 20:36:46 UTC (rev 8624) @@ -1427,3 +1427,13 @@ createBookmark.description=Beschreibung: createBookmarkOk.text=OK createBookmarkCancel.text=Abbruch + + +#################### +# Random Fill Dialog +randomFillTitle=Z\xFCf\xE4llig F\xFCllen +randomFillDensity.text=F\xFClldichte in % (1-100): +randomFillSkipAdjacentSquares.text=Angrenzende Felder nicht f\xFCllen +randomFillSkipAdjacentSquares.shortdescription=Ignoriert Felder f\xFCr die ein angrenzendes Feld bereits ein \xE4hnliches Objekt enth\xE4lt. +randomFillOkay.text=OK +randomFillCancel.text=Abbrechen Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-08-31 20:36:46 UTC (rev 8624) @@ -1410,3 +1410,13 @@ #createBookmark.description= #createBookmarkOk.text= #createBookmarkCancel.text= + + +#################### +# Random Fill Dialog +#randomFillTitle= +#randomFillDensity.text= +#randomFillSkipAdjacentSquares.text= +#randomFillSkipAdjacentSquares.shortdescription= +#randomFillOkay.text= +#randomFillCancel.text= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-08-31 20:08:36 UTC (rev 8623) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-08-31 20:36:46 UTC (rev 8624) @@ -1415,3 +1415,13 @@ #createBookmark.description= #createBookmarkOk.text= #createBookmarkCancel.text= + + +#################### +# Random Fill Dialog +#randomFillTitle= +#randomFillDensity.text= +#randomFillSkipAdjacentSquares.text= +#randomFillSkipAdjacentSquares.shortdescription= +randomFillOkay.text=Ok +randomFillCancel.text=Avbryt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-31 20:08:43
|
Revision: 8623 http://gridarta.svn.sourceforge.net/gridarta/?rev=8623&view=rev Author: akirschbaum Date: 2010-08-31 20:08:36 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Remove trailing whitespace. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-08-31 06:42:00 UTC (rev 8622) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-08-31 20:08:36 UTC (rev 8623) @@ -1502,7 +1502,7 @@ objectChooser.captionType=Type: objectChooser.captionTile=Tile: objectChooser.tileSingle=single -objectChooser.randomPick= -random pick- +objectChooser.randomPick= -random pick- objectChooser.tileSize=<html><span style=\"color:green;\"> multi</span> ({0} parts) ({1},{2})</html> #################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-31 06:42:06
|
Revision: 8622 http://gridarta.svn.sourceforge.net/gridarta/?rev=8622&view=rev Author: akirschbaum Date: 2010-08-31 06:42:00 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Weaken type. Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java Modified: trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-08-30 18:30:27 UTC (rev 8621) +++ trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-08-31 06:42:00 UTC (rev 8622) @@ -382,7 +382,7 @@ final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new TestAnimationObjects(); final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final TestArchetype archetype1 = newArchetype("arch", "a 1\nb 0\nc 2", faceObjectProviders, animationObjects); - final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = new TestGameObject(archetype1, faceObjectProviders, animationObjects); + final BaseObject<?, ?, ?, ?> gameObject = new TestGameObject(archetype1, faceObjectProviders, animationObjects); Assert.assertEquals("", gameObject.getAttributeString("a", false)); Assert.assertEquals("", gameObject.getAttributeString("b", false)); Assert.assertEquals("", gameObject.getAttributeString("c", false)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-30 18:30:35
|
Revision: 8621 http://gridarta.svn.sourceforge.net/gridarta/?rev=8621&view=rev Author: akirschbaum Date: 2010-08-30 18:30:27 +0000 (Mon, 30 Aug 2010) Log Message: ----------- Do not generate game object attributes redundant with archetype. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SysObjectNotOnLayerZeroError.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/TypesBoxItemListener.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/atrinik/ChangeLog 2010-08-30 18:30:27 UTC (rev 8621) @@ -1,3 +1,7 @@ +2010-08-30 Andreas Kirschbaum + + * Do not generate game object attributes redundant with archetype. + 2010-08-26 Andreas Kirschbaum * Fix memory leak when browsing maps. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -73,7 +73,7 @@ public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); } @@ -85,7 +85,7 @@ public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -199,7 +199,7 @@ protected final void setEventData(@NotNull final String pluginName, @NotNull final String scriptPath, @NotNull final String options) { final int eventType = getEventType(); event.setObjectText(""); - event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); + event.setAttributeInt(subtypeAttribute, eventType); event.setAttributeString(BaseObject.NAME, pluginName); event.setAttributeString(SCRIPT_PATH, scriptPath); event.setAttributeString(OPTIONS, options); Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -97,7 +97,7 @@ @Override public GameObject newEventGameObject(final int eventType) throws UndefinedEventArchetypeException { final GameObject eventGameObject = super.newEventGameObject(eventType); - eventGameObject.setAttributeString(subtypeAttribute, Integer.toString(eventType)); + eventGameObject.setAttributeInt(subtypeAttribute, eventType); return eventGameObject; } Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/crossfire/ChangeLog 2010-08-30 18:30:27 UTC (rev 8621) @@ -1,3 +1,7 @@ +2010-08-30 Andreas Kirschbaum + + * Do not generate game object attributes redundant with archetype. + 2010-08-26 Andreas Kirschbaum * Fix memory leak when browsing maps. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -69,11 +69,9 @@ */ @Override public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { - final String elevation = gameObject.getAttributeString(ELEVATION, false); - if (elevation.length() != 0) { - setAttributeString(ELEVATION, elevation); - gameObject.removeAttribute(ELEVATION); - } + final int elevation = gameObject.getAttributeInt(ELEVATION, false); + setAttributeInt(ELEVATION, elevation); + gameObject.removeAttribute(ELEVATION); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -196,7 +196,7 @@ protected void setEventData(@NotNull final String pluginName, @NotNull final String scriptPath, @NotNull final String options) { final int eventType = getEventType(); event.setObjectText(""); - event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); + event.setAttributeInt(subtypeAttribute, eventType); event.setAttributeString(PLUGIN_NAME, pluginName); event.setAttributeString(OPTIONS, scriptPath); event.setAttributeString(BaseObject.NAME, options); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -78,7 +78,7 @@ public GameObject newGameObject(final int elevation) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects); if (elevation != 0) { - gameObject.setAttributeString(GameObject.ELEVATION, Integer.toString(elevation)); + gameObject.setAttributeInt(GameObject.ELEVATION, elevation); } return gameObject; } Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/daimonin/ChangeLog 2010-08-30 18:30:27 UTC (rev 8621) @@ -1,3 +1,7 @@ +2010-08-30 Andreas Kirschbaum + + * Do not generate game object attributes redundant with archetype. + 2010-08-26 Andreas Kirschbaum * Fix memory leak when browsing maps. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -73,7 +73,7 @@ public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); } @@ -85,7 +85,7 @@ public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -199,7 +199,7 @@ protected void setEventData(@NotNull final String pluginName, @NotNull final String scriptPath, @NotNull final String options) { final int eventType = getEventType(); event.setObjectText(""); - event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); + event.setAttributeInt(subtypeAttribute, eventType); event.setAttributeString(BaseObject.NAME, pluginName); event.setAttributeString(SCRIPT_PATH, scriptPath); event.setAttributeString(OPTIONS, options); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -97,7 +97,7 @@ @Override public GameObject newEventGameObject(final int eventType) throws UndefinedEventArchetypeException { final GameObject eventGameObject = super.newEventGameObject(eventType); - eventGameObject.setAttributeString(subtypeAttribute, Integer.toString(eventType)); + eventGameObject.setAttributeInt(subtypeAttribute, eventType); return eventGameObject; } Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -377,6 +377,33 @@ * {@inheritDoc} */ @Override + public void setAttributeInt(@NotNull final String attributeName, final int value) { + final String attributeNameWithSpace = attributeName.trim() + " "; + final boolean sameAsInArchetype = getArchetype().getAttributeInt(attributeName) == value; + boolean exists = false; + final StringBuilder result = new StringBuilder(); + for (final String line : StringUtils.PATTERN_END_OF_LINE.split(getObjectText(), 0)) { + if (line.length() == 0) { + // skip empty lines that occur due to split on empty object texts. + } else if (!line.startsWith(attributeNameWithSpace)) { + result.append(line).append('\n'); + } else { + exists = true; + if (!sameAsInArchetype) { + result.append(attributeNameWithSpace).append(value).append('\n'); + } + } + } + if (!exists && !sameAsInArchetype) { + result.append(attributeNameWithSpace).append(value).append('\n'); + } + setObjectText(result.toString()); + } + + /** + * {@inheritDoc} + */ + @Override public void removeAttribute(@NotNull final String attributeName) { final String attributeNameWithSpace = attributeName.trim() + " "; // attributeName must be followed by space Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -203,6 +203,13 @@ void setAttributeString(@NotNull String attributeName, @NotNull String value); /** + * Sets an int value attribute. + * @param attributeName the name of the attribute to update + * @param value the new value + */ + void setAttributeInt(@NotNull String attributeName, int value); + + /** * Remove the String of an arch attribute from the objectText. * @param attributeName search for "attributeName <string>" */ Modified: trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -110,8 +110,8 @@ } } gameObject.setAttributeString("slaying", mapPath); - gameObject.setAttributeString("hp", Integer.toString(x)); - gameObject.setAttributeString("sp", Integer.toString(y)); + gameObject.setAttributeInt("hp", x); + gameObject.setAttributeInt("sp", y); if (updateName) { gameObject.setAttributeString(BaseObject.NAME, mapName); } Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -783,7 +783,7 @@ return null; } - final Object direction = effectiveArchetype.usesDirection() ? archetypeChooserModel.getDirection() : null; + final Integer direction = effectiveArchetype.usesDirection() ? archetypeChooserModel.getDirection() : null; final List<G> parts = new ArrayList<G>(); for (R archetypePart = effectiveArchetype; archetypePart != null; archetypePart = archetypePart.getMultiNext()) { @@ -795,7 +795,7 @@ part = archetypePart.newInstance(gameObjectFactory); } if (direction != null) { - part.setAttributeString(BaseObject.DIRECTION, direction.toString()); + part.setAttributeInt(BaseObject.DIRECTION, direction); } if (parts.isEmpty()) { gameObjectMatchers.updateEditType(part, activeEditType); Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/SysObjectNotOnLayerZeroError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/SysObjectNotOnLayerZeroError.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/SysObjectNotOnLayerZeroError.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -53,7 +53,7 @@ public void correct(@NotNull final Component parentComponent) { // TODO: Ask user for (final BaseObject<G, A, R, ?> gameObject : getGameObjects()) { - gameObject.setAttributeString("layer", "0"); + gameObject.setAttributeInt("layer", 0); } } Modified: trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -374,6 +374,49 @@ } /** + * Checks that {@link AbstractBaseObject#setAttributeInt(String, int)} works + * as expected. + */ + @Test + public void testSetAttributeInt1() { + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new TestAnimationObjects(); + final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); + final TestArchetype archetype1 = newArchetype("arch", "a 1\nb 0\nc 2", faceObjectProviders, animationObjects); + final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = new TestGameObject(archetype1, faceObjectProviders, animationObjects); + Assert.assertEquals("", gameObject.getAttributeString("a", false)); + Assert.assertEquals("", gameObject.getAttributeString("b", false)); + Assert.assertEquals("", gameObject.getAttributeString("c", false)); + Assert.assertEquals("", gameObject.getAttributeString("d", false)); + + gameObject.setAttributeInt("a", 1); + gameObject.setAttributeInt("b", 0); + gameObject.setAttributeInt("c", 2); + gameObject.setAttributeInt("d", 0); + Assert.assertEquals("", gameObject.getAttributeString("a", false)); + Assert.assertEquals("", gameObject.getAttributeString("b", false)); + Assert.assertEquals("", gameObject.getAttributeString("c", false)); + Assert.assertEquals("", gameObject.getAttributeString("d", false)); + + gameObject.setAttributeInt("a", 0); + gameObject.setAttributeInt("b", 1); + gameObject.setAttributeInt("c", 0); + gameObject.setAttributeInt("d", 2); + Assert.assertEquals("0", gameObject.getAttributeString("a", false)); + Assert.assertEquals("1", gameObject.getAttributeString("b", false)); + Assert.assertEquals("0", gameObject.getAttributeString("c", false)); + Assert.assertEquals("2", gameObject.getAttributeString("d", false)); + + gameObject.setAttributeInt("a", 1); + gameObject.setAttributeInt("b", 0); + gameObject.setAttributeInt("c", 2); + gameObject.setAttributeInt("d", 0); + Assert.assertEquals("", gameObject.getAttributeString("a", false)); + Assert.assertEquals("", gameObject.getAttributeString("b", false)); + Assert.assertEquals("", gameObject.getAttributeString("c", false)); + Assert.assertEquals("", gameObject.getAttributeString("d", false)); + } + + /** * Checks that the {@link BaseObject#NAME} attribute of an {@link * GameObject} contains the expected value. * @param gameObject the game object to check Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -107,15 +107,15 @@ this.gameObjectFactory = gameObjectFactory; floorArchetype = new TestArchetype("floor", faceObjectProviders, animationObjects); - floorArchetype.setAttributeString(BaseObject.TYPE, Integer.toString(FLOOR_TYPE)); + floorArchetype.setAttributeInt(BaseObject.TYPE, FLOOR_TYPE); archetypeSet.addArchetype(floorArchetype); exitArchetype = new TestArchetype("exit", faceObjectProviders, animationObjects); - exitArchetype.setAttributeString(BaseObject.TYPE, Integer.toString(EXIT_TYPE)); + exitArchetype.setAttributeInt(BaseObject.TYPE, EXIT_TYPE); archetypeSet.addArchetype(exitArchetype); mob21Archetype = new TestArchetype("mob21", faceObjectProviders, animationObjects); - mob21Archetype.setAttributeString(BaseObject.TYPE, Integer.toString(MOB_TYPE)); + mob21Archetype.setAttributeInt(BaseObject.TYPE, MOB_TYPE); archetypeSet.addArchetype(mob21Archetype); final TestArchetype mob21bArchetype = new TestArchetype("mob21b", faceObjectProviders, animationObjects); mob21bArchetype.setMultiX(1); Modified: trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -111,7 +111,7 @@ @NotNull private static TestArchetype newArchetype(@NotNull final String archetypeName, final int typeNo, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects) { final TestArchetype archetype = new TestArchetype(archetypeName, faceObjectProviders, animationObjects); - archetype.setAttributeString(BaseObject.TYPE, Integer.toString(typeNo)); + archetype.setAttributeInt(BaseObject.TYPE, typeNo); return archetype; } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -1286,7 +1286,7 @@ // --- parsing succeeded, now we write it into the gameObject/map --- final int typeNo = gameObject.getTypeNo(); gameObject.setObjectText(newArchText.toString()); - gameObject.setAttributeString(BaseObject.TYPE, Integer.toString(typeNo)); + gameObject.setAttributeInt(BaseObject.TYPE, typeNo); if (newMsg[0] != null) { // set new msg text only when it is not equal to Archetype Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/TypesBoxItemListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/TypesBoxItemListener.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/TypesBoxItemListener.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -154,7 +154,7 @@ archetypeType = newType; // change the gameObject to be of the new type: - gameObject.setAttributeString(BaseObject.TYPE, Integer.toString(newType.getTypeNo())); + gameObject.setAttributeInt(BaseObject.TYPE, newType.getTypeNo()); dialogAttributes.clear(); type = typeComboBox.getSelectedIndex(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -473,7 +473,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Change object attributes"); try { - selectedGameObject.setAttributeString(BaseObject.DIRECTION, Integer.toString(direction)); + selectedGameObject.setAttributeInt(BaseObject.DIRECTION, direction); } finally { mapModel.endTransaction(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-08-26 07:57:35 UTC (rev 8620) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-08-30 18:30:27 UTC (rev 8621) @@ -121,7 +121,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Change object attributes"); try { - gameObject.setAttributeString(BaseObject.DIRECTION, Integer.toString(dir)); + gameObject.setAttributeInt(BaseObject.DIRECTION, dir); } finally { mapModel.endTransaction(); } @@ -356,7 +356,7 @@ if (isAnimated == (gameObject.getArchetype().getAttributeInt("is_animated") != 0)) { gameObject.removeAttribute("is_animated"); } else { - gameObject.setAttributeString("is_animated", isAnimated ? "1" : "0"); + gameObject.setAttributeInt("is_animated", isAnimated ? 1 : 0); } final String animSpeed = animSpeedTextField.getText().trim(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-26 07:57:46
|
Revision: 8620 http://gridarta.svn.sourceforge.net/gridarta/?rev=8620&view=rev Author: akirschbaum Date: 2010-08-26 07:57:35 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Fix memory leak when browsing maps. Modified Paths: -------------- branches/0.8/atrinik/ChangeLog branches/0.8/crossfire/ChangeLog branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java branches/0.8/daimonin/ChangeLog branches/0.8/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java Property Changed: ---------------- branches/0.8/ branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire/ branches/0.8/daimonin/src/app/net/sf/gridarta/var/daimonin/ branches/0.8/daimonin/src/test/net/sf/gridarta/var/daimonin/ branches/0.8/lib/bsh-LICENSE branches/0.8/lib/bsh-classgen-2.0b4.jar branches/0.8/lib/bsh-commands-2.0b4.jar branches/0.8/lib/bsh-core-2.0b4.jar branches/0.8/lib/bsh-util-2.0b4.jar branches/0.8/lib/jdom.jar branches/0.8/lib/jdom.jar-LICENSE branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java branches/0.8/model/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java branches/0.8/model/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java branches/0.8/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java branches/0.8/resource/icons/CreateImageSmallIcon.gif branches/0.8/resource/icons/Dir1.gif branches/0.8/resource/icons/Dir2.gif branches/0.8/resource/icons/Dir3.gif branches/0.8/resource/icons/Dir4.gif branches/0.8/resource/icons/Dir5.gif branches/0.8/resource/icons/Dir6.gif branches/0.8/resource/icons/Dir7.gif branches/0.8/resource/icons/Dir8.gif branches/0.8/resource/icons/EditPluginSmallIcon.gif branches/0.8/resource/icons/EmptySmallIcon.gif branches/0.8/resource/icons/ImportPluginSmallIcon.gif branches/0.8/resource/icons/SaveMapAsSmallIcon.gif branches/0.8/resource/icons/auto_run_small_icon.gif branches/0.8/resource/icons/close_tab_small_icon.gif branches/0.8/resource/icons/development/Application24.gif branches/0.8/resource/icons/development/Host16.gif branches/0.8/resource/icons/development/Host24.gif branches/0.8/resource/icons/development/Jar16.gif branches/0.8/resource/icons/development/Server16.gif branches/0.8/resource/icons/development/Server24.gif branches/0.8/resource/icons/filter_small_icon.gif branches/0.8/resource/icons/general/About16.gif branches/0.8/resource/icons/general/Copy16.gif branches/0.8/resource/icons/general/Cut16.gif branches/0.8/resource/icons/general/Delete16.gif branches/0.8/resource/icons/general/Edit16.gif branches/0.8/resource/icons/general/Help16.gif branches/0.8/resource/icons/general/History16.gif branches/0.8/resource/icons/general/New16.gif branches/0.8/resource/icons/general/Open16.gif branches/0.8/resource/icons/general/Paste16.gif branches/0.8/resource/icons/general/Preferences16.gif branches/0.8/resource/icons/general/Preferences24.gif branches/0.8/resource/icons/general/Properties16.gif branches/0.8/resource/icons/general/Redo16.gif branches/0.8/resource/icons/general/Refresh16.gif branches/0.8/resource/icons/general/Remove16.gif branches/0.8/resource/icons/general/Replace16.gif branches/0.8/resource/icons/general/Save16.gif branches/0.8/resource/icons/general/Save24.gif branches/0.8/resource/icons/general/SaveAs16.gif branches/0.8/resource/icons/general/Search16.gif branches/0.8/resource/icons/general/TipOfTheDay16.gif branches/0.8/resource/icons/general/Undo16.gif branches/0.8/resource/icons/general/Zoom16.gif branches/0.8/resource/icons/media/ branches/0.8/resource/icons/run_plugin_small_icon.gif branches/0.8/resource/log4j.properties branches/0.8/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java branches/0.8/src/app/net/sf/gridarta/gui/filter/ branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java branches/0.8/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java branches/0.8/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java branches/0.8/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java branches/0.8/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java branches/0.8/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java branches/0.8/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java branches/0.8/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java branches/0.8/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java branches/0.8/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java branches/0.8/src/app/net/sf/gridarta/gui/script/ClosingIcon.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptController.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptEditor.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptManager.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptView.java branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java branches/0.8/src/app/net/sf/gridarta/gui/script/StackLayout.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/BooleanParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/DoubleParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/FilterParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/IntegerParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ParameterDescriptionEditor.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ParameterNameEditor.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ParameterTypeEditor.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/StringParameterView.java branches/0.8/src/app/net/sf/gridarta/gui/utils/MenuUtils.java branches/0.8/src/app/net/sf/gridarta/mapfiles/DuplicateMapFolderException.java branches/0.8/src/app/net/sf/gridarta/mapfiles/DuplicatePickmapException.java branches/0.8/src/app/net/sf/gridarta/mapfiles/InvalidNameException.java branches/0.8/src/app/net/sf/gridarta/mapfiles/Loader.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFile.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFileNameComparator.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFolder.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFolderListener.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFolderNotEmptyException.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFolderTree.java branches/0.8/src/app/net/sf/gridarta/mapfiles/MapFolderTreeListener.java branches/0.8/src/app/net/sf/gridarta/script/BshThread.java branches/0.8/src/app/net/sf/gridarta/script/Script.java branches/0.8/src/app/net/sf/gridarta/script/ScriptExecException.java branches/0.8/src/app/net/sf/gridarta/script/ScriptModel.java branches/0.8/src/app/net/sf/gridarta/script/ScriptModelListener.java branches/0.8/src/app/net/sf/gridarta/script/ScriptParameters.java branches/0.8/src/app/net/sf/gridarta/script/ScriptRunMode.java branches/0.8/src/app/net/sf/gridarta/script/parameter/ branches/0.8/utils/src/app/net/sf/gridarta/utils/ConfigFileUtils.java branches/0.8/utils/src/app/net/sf/gridarta/utils/GUIUtils.java branches/0.8/utils/src/app/net/sf/gridarta/utils/IOUtils.java branches/0.8/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java branches/0.8/utils/src/app/net/sf/gridarta/utils/WrappingStringBuilder.java branches/0.8/utils/src/app/net/sf/gridarta/utils/XmlHelper.java branches/0.8/utils/src/test/net/sf/gridarta/utils/WrappingStringBuilderTest.java Property changes on: branches/0.8 ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update:5966-5991 /trunk:2-5965,8361,8366,8395 + /streams/cher-japi-update:5966-5991 /trunk:2-5965,8361,8366,8395,8619 Modified: branches/0.8/atrinik/ChangeLog =================================================================== --- branches/0.8/atrinik/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) +++ branches/0.8/atrinik/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Fix memory leak when browsing maps. + 2010-06-28 Andreas Kirschbaum * Release 0.8.1 Modified: branches/0.8/crossfire/ChangeLog =================================================================== --- branches/0.8/crossfire/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) +++ branches/0.8/crossfire/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Fix memory leak when browsing maps. + 2010-06-28 Andreas Kirschbaum * Release 0.8.1 Property changes on: branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/crossfire/src/app/net/sf/gridarta/var/crossfire:5966-5991 /trunk/crossfire/src/app/net/sf/gridarta/var/crossfire:8361,8366,8395 + /streams/cher-japi-update/crossfire/src/app/net/sf/gridarta/var/crossfire:5966-5991 /trunk/crossfire/src/app/net/sf/gridarta/var/crossfire:8361,8366,8395,8619 Modified: branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 07:37:13 UTC (rev 8619) +++ branches/0.8/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 07:57:35 UTC (rev 8620) @@ -128,6 +128,23 @@ private final SmoothingRenderer smoothingRenderer; /** + * The {@link FilterConfigListener} attached to {@link #filterControl} to + * repaint all after config changes. + */ + @NotNull + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + forceRepaint(); + } + + }; + + /** * Creates a new instance. * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use @@ -147,17 +164,6 @@ this.mapViewSettings = mapViewSettings; this.smoothingRenderer = smoothingRenderer; init(); - final FilterConfigListener filterConfigListener = new FilterConfigListener() { - - /** - * {@inheritDoc} - */ - @Override - public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { - forceRepaint(); - } - - }; this.filterControl.addConfigListener(filterConfigListener); } @@ -165,6 +171,15 @@ * {@inheritDoc} */ @Override + public void closeNotify() { + super.closeNotify(); + filterControl.removeConfigListener(filterConfigListener); + } + + /** + * {@inheritDoc} + */ + @Override protected void updateSquare(@NotNull final Point point) { if (!mapModel.getMapArchObject().isPointValid(point)) { return; Modified: branches/0.8/daimonin/ChangeLog =================================================================== --- branches/0.8/daimonin/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) +++ branches/0.8/daimonin/ChangeLog 2010-08-26 07:57:35 UTC (rev 8620) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Fix memory leak when browsing maps. + 2010-06-28 Andreas Kirschbaum * Release 0.8.1 Property changes on: branches/0.8/daimonin/src/app/net/sf/gridarta/var/daimonin ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/daimonin/src/app/net/sf/gridarta/var/daimonin:5966-5991 /trunk/daimonin/src/app/net/sf/gridarta/var/daimonin:8361,8366,8395 + /streams/cher-japi-update/daimonin/src/app/net/sf/gridarta/var/daimonin:5966-5991 /trunk/daimonin/src/app/net/sf/gridarta/var/daimonin:8361,8366,8395,8619 Property changes on: branches/0.8/daimonin/src/test/net/sf/gridarta/var/daimonin ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/daimonin/src/test/net/sf/gridarta/var/daimonin:5966-5991 /trunk/daimonin/src/test/net/sf/gridarta/var/daimonin:8361,8366,8395 + /streams/cher-japi-update/daimonin/src/test/net/sf/gridarta/var/daimonin:5966-5991 /trunk/daimonin/src/test/net/sf/gridarta/var/daimonin:8361,8366,8395,8619 Property changes on: branches/0.8/lib/bsh-LICENSE ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/bsh-LICENSE:5966-5991 /trunk/lib/bsh-LICENSE:8361,8366,8395 + /streams/cher-japi-update/lib/bsh-LICENSE:5966-5991 /trunk/lib/bsh-LICENSE:8361,8366,8395,8619 Property changes on: branches/0.8/lib/bsh-classgen-2.0b4.jar ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/bsh-classgen-2.0b4.jar:5966-5991 /trunk/lib/bsh-classgen-2.0b4.jar:8361,8366,8395 + /streams/cher-japi-update/lib/bsh-classgen-2.0b4.jar:5966-5991 /trunk/lib/bsh-classgen-2.0b4.jar:8361,8366,8395,8619 Property changes on: branches/0.8/lib/bsh-commands-2.0b4.jar ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/bsh-commands-2.0b4.jar:5966-5991 /trunk/lib/bsh-commands-2.0b4.jar:8361,8366,8395 + /streams/cher-japi-update/lib/bsh-commands-2.0b4.jar:5966-5991 /trunk/lib/bsh-commands-2.0b4.jar:8361,8366,8395,8619 Property changes on: branches/0.8/lib/bsh-core-2.0b4.jar ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/bsh-core-2.0b4.jar:5966-5991 /trunk/lib/bsh-core-2.0b4.jar:8361,8366,8395 + /streams/cher-japi-update/lib/bsh-core-2.0b4.jar:5966-5991 /trunk/lib/bsh-core-2.0b4.jar:8361,8366,8395,8619 Property changes on: branches/0.8/lib/bsh-util-2.0b4.jar ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/bsh-util-2.0b4.jar:5966-5991 /trunk/lib/bsh-util-2.0b4.jar:8361,8366,8395 + /streams/cher-japi-update/lib/bsh-util-2.0b4.jar:5966-5991 /trunk/lib/bsh-util-2.0b4.jar:8361,8366,8395,8619 Property changes on: branches/0.8/lib/jdom.jar ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/jdom.jar:5966-5991 /trunk/lib/jdom.jar:8361,8366,8395 + /streams/cher-japi-update/lib/jdom.jar:5966-5991 /trunk/lib/jdom.jar:8361,8366,8395,8619 Property changes on: branches/0.8/lib/jdom.jar-LICENSE ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/lib/jdom.jar-LICENSE:5966-5991 /trunk/lib/jdom.jar-LICENSE:8361,8366,8395 + /streams/cher-japi-update/lib/jdom.jar-LICENSE:5966-5991 /trunk/lib/jdom.jar-LICENSE:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeAttribute.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeAttribute.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeType.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeType.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeTypeSet.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/ArchetypeTypeSet.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/CAttribBitmask.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/archtype/CAttribBitmask.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/autojoin/AutojoinList.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/autojoin/AutojoinList.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/autojoin/AutojoinLists.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/autojoin/AutojoinLists.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java:8361,8366,8395,8619 Property changes on: branches/0.8/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gameobject/DefaultGameObject.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gameobject/DefaultGameObject.java:5966-5991 /trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/CreateImageSmallIcon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/CreateImageSmallIcon.gif:5966-5991 /trunk/resource/icons/CreateImageSmallIcon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/CreateImageSmallIcon.gif:5966-5991 /trunk/resource/icons/CreateImageSmallIcon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir1.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir1.gif:5966-5991 /trunk/resource/icons/Dir1.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir1.gif:5966-5991 /trunk/resource/icons/Dir1.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir2.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir2.gif:5966-5991 /trunk/resource/icons/Dir2.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir2.gif:5966-5991 /trunk/resource/icons/Dir2.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir3.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir3.gif:5966-5991 /trunk/resource/icons/Dir3.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir3.gif:5966-5991 /trunk/resource/icons/Dir3.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir4.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir4.gif:5966-5991 /trunk/resource/icons/Dir4.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir4.gif:5966-5991 /trunk/resource/icons/Dir4.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir5.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir5.gif:5966-5991 /trunk/resource/icons/Dir5.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir5.gif:5966-5991 /trunk/resource/icons/Dir5.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir6.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir6.gif:5966-5991 /trunk/resource/icons/Dir6.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir6.gif:5966-5991 /trunk/resource/icons/Dir6.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir7.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir7.gif:5966-5991 /trunk/resource/icons/Dir7.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir7.gif:5966-5991 /trunk/resource/icons/Dir7.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/Dir8.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/Dir8.gif:5966-5991 /trunk/resource/icons/Dir8.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/Dir8.gif:5966-5991 /trunk/resource/icons/Dir8.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/EditPluginSmallIcon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/EditPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/EditPluginSmallIcon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/EditPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/EditPluginSmallIcon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/EmptySmallIcon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/EmptySmallIcon.gif:5966-5991 /trunk/resource/icons/EmptySmallIcon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/EmptySmallIcon.gif:5966-5991 /trunk/resource/icons/EmptySmallIcon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/ImportPluginSmallIcon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/ImportPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/ImportPluginSmallIcon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/ImportPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/ImportPluginSmallIcon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/SaveMapAsSmallIcon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/SaveLevelAsSmallIcon.gif:5966-5991 /trunk/resource/icons/SaveMapAsSmallIcon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/SaveLevelAsSmallIcon.gif:5966-5991 /trunk/resource/icons/SaveMapAsSmallIcon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/auto_run_small_icon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/AutorunSmallIcon.gif:5966-5991 /trunk/resource/icons/auto_run_small_icon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/AutorunSmallIcon.gif:5966-5991 /trunk/resource/icons/auto_run_small_icon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/close_tab_small_icon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/CloseTabSmallIcon.gif:5966-5991 /trunk/resource/icons/close_tab_small_icon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/CloseTabSmallIcon.gif:5966-5991 /trunk/resource/icons/close_tab_small_icon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Application24.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Application24.gif:5966-5991 /trunk/resource/icons/development/Application24.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Application24.gif:5966-5991 /trunk/resource/icons/development/Application24.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Host16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Host16.gif:5966-5991 /trunk/resource/icons/development/Host16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Host16.gif:5966-5991 /trunk/resource/icons/development/Host16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Host24.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Host24.gif:5966-5991 /trunk/resource/icons/development/Host24.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Host24.gif:5966-5991 /trunk/resource/icons/development/Host24.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Jar16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Jar16.gif:5966-5991 /trunk/resource/icons/development/Jar16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Jar16.gif:5966-5991 /trunk/resource/icons/development/Jar16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Server16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Server16.gif:5966-5991 /trunk/resource/icons/development/Server16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Server16.gif:5966-5991 /trunk/resource/icons/development/Server16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/development/Server24.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/development/Server24.gif:5966-5991 /trunk/resource/icons/development/Server24.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/development/Server24.gif:5966-5991 /trunk/resource/icons/development/Server24.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/filter_small_icon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/FilterSmallIcon.gif:5966-5991 /trunk/resource/icons/filter_small_icon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/FilterSmallIcon.gif:5966-5991 /trunk/resource/icons/filter_small_icon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/About16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/About16.gif:5966-5991 /trunk/resource/icons/general/About16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/About16.gif:5966-5991 /trunk/resource/icons/general/About16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Copy16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Copy16.gif:5966-5991 /trunk/resource/icons/general/Copy16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Copy16.gif:5966-5991 /trunk/resource/icons/general/Copy16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Cut16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Cut16.gif:5966-5991 /trunk/resource/icons/general/Cut16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Cut16.gif:5966-5991 /trunk/resource/icons/general/Cut16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Delete16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Delete16.gif:5966-5991 /trunk/resource/icons/general/Delete16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Delete16.gif:5966-5991 /trunk/resource/icons/general/Delete16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Edit16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Edit16.gif:5966-5991 /trunk/resource/icons/general/Edit16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Edit16.gif:5966-5991 /trunk/resource/icons/general/Edit16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Help16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Help16.gif:5966-5991 /trunk/resource/icons/general/Help16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Help16.gif:5966-5991 /trunk/resource/icons/general/Help16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/History16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/History16.gif:5966-5991 /trunk/resource/icons/general/History16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/History16.gif:5966-5991 /trunk/resource/icons/general/History16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/New16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/New16.gif:5966-5991 /trunk/resource/icons/general/New16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/New16.gif:5966-5991 /trunk/resource/icons/general/New16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Open16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Open16.gif:5966-5991 /trunk/resource/icons/general/Open16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Open16.gif:5966-5991 /trunk/resource/icons/general/Open16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Paste16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Paste16.gif:5966-5991 /trunk/resource/icons/general/Paste16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Paste16.gif:5966-5991 /trunk/resource/icons/general/Paste16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Preferences16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Preferences16.gif:5966-5991 /trunk/resource/icons/general/Preferences16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Preferences16.gif:5966-5991 /trunk/resource/icons/general/Preferences16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Preferences24.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Preferences24.gif:5966-5991 /trunk/resource/icons/general/Preferences24.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Preferences24.gif:5966-5991 /trunk/resource/icons/general/Preferences24.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Properties16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Properties16.gif:5966-5991 /trunk/resource/icons/general/Properties16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Properties16.gif:5966-5991 /trunk/resource/icons/general/Properties16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Redo16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Redo16.gif:5966-5991 /trunk/resource/icons/general/Redo16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Redo16.gif:5966-5991 /trunk/resource/icons/general/Redo16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Refresh16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Refresh16.gif:5966-5991 /trunk/resource/icons/general/Refresh16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Refresh16.gif:5966-5991 /trunk/resource/icons/general/Refresh16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Remove16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Remove16.gif:5966-5991 /trunk/resource/icons/general/Remove16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Remove16.gif:5966-5991 /trunk/resource/icons/general/Remove16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Replace16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Replace16.gif:5966-5991 /trunk/resource/icons/general/Replace16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Replace16.gif:5966-5991 /trunk/resource/icons/general/Replace16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Save16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Save16.gif:5966-5991 /trunk/resource/icons/general/Save16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Save16.gif:5966-5991 /trunk/resource/icons/general/Save16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Save24.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Save24.gif:5966-5991 /trunk/resource/icons/general/Save24.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Save24.gif:5966-5991 /trunk/resource/icons/general/Save24.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/SaveAs16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/SaveAs16.gif:5966-5991 /trunk/resource/icons/general/SaveAs16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/SaveAs16.gif:5966-5991 /trunk/resource/icons/general/SaveAs16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Search16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Search16.gif:5966-5991 /trunk/resource/icons/general/Search16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Search16.gif:5966-5991 /trunk/resource/icons/general/Search16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/TipOfTheDay16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/TipOfTheDay16.gif:5966-5991 /trunk/resource/icons/general/TipOfTheDay16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/TipOfTheDay16.gif:5966-5991 /trunk/resource/icons/general/TipOfTheDay16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Undo16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Undo16.gif:5966-5991 /trunk/resource/icons/general/Undo16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Undo16.gif:5966-5991 /trunk/resource/icons/general/Undo16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/general/Zoom16.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/general/Zoom16.gif:5966-5991 /trunk/resource/icons/general/Zoom16.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/general/Zoom16.gif:5966-5991 /trunk/resource/icons/general/Zoom16.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/media ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/media:5966-5991 /trunk/resource/icons/media:8361,8366,8395 + /streams/cher-japi-update/resource/icons/media:5966-5991 /trunk/resource/icons/media:8361,8366,8395,8619 Property changes on: branches/0.8/resource/icons/run_plugin_small_icon.gif ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/resource/icons/RunPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/run_plugin_small_icon.gif:8361,8366,8395 + /streams/cher-japi-update/resource/icons/RunPluginSmallIcon.gif:5966-5991 /trunk/resource/icons/run_plugin_small_icon.gif:8361,8366,8395,8619 Property changes on: branches/0.8/resource/log4j.properties ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/crossfire/resource/log4j.properties:5966-5991 /trunk/resource/log4j.properties:8361,8366,8395 + /streams/cher-japi-update/crossfire/resource/log4j.properties:5966-5991 /trunk/resource/log4j.properties:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/archetypechooser/DisplayMode.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/filter ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/filter:5966-5991 /trunk/src/app/net/sf/gridarta/gui/filter:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/filter:5966-5991 /trunk/src/app/net/sf/gridarta/gui/filter:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java:8361,8366,8395,8619 Modified: branches/0.8/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- branches/0.8/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-08-26 07:37:13 UTC (rev 8619) +++ branches/0.8/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-08-26 07:57:35 UTC (rev 8620) @@ -92,6 +92,23 @@ private final int[] yPoints = new int[4]; /** + * The {@link FilterConfigListener} attached to {@link #filterControl} to + * repaint all after config changes. + */ + @NotNull + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + forceRepaint(); + } + + }; + + /** * Creates a new instance. * @param spawnPointTypeNo the game object type number for spawn points * @param mapViewSettings the map view settings instance to use @@ -112,17 +129,6 @@ emptySquareIcon = systemIcons.getEmptySquareIcon(); this.mapViewSettings = mapViewSettings; this.isoMapSquareInfo = isoMapSquareInfo; - final FilterConfigListener filterConfigListener = new FilterConfigListener() { - - /** - * {@inheritDoc} - */ - @Override - public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { - forceRepaint(); - } - - }; this.filterControl.addConfigListener(filterConfigListener); } @@ -130,6 +136,15 @@ * {@inheritDoc} */ @Override + public void closeNotify() { + super.closeNotify(); + filterControl.removeConfigListener(filterConfigListener); + } + + /** + * {@inheritDoc} + */ + @Override protected void clearBackground(@NotNull final Graphics g) { } Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooser.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/CloseableTabbedPane.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ClosingIcon.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ClosingIcon.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ClosingIcon.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ClosingIcon.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ClosingIcon.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptController.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/script/ScriptController.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/script/ScriptController.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptEditor.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptEditor.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptEditor.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptEditor.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptEditor.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptManager.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptManager.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptManager.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptManagerFactory.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptView.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptView.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptView.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptView.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptView.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/StackLayout.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/StackLayout.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/StackLayout.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/StackLayout.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/StackLayout.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java ___________________________________________________________________ Modified: svn:mergeinfo - /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java:8361,8366,8395 + /streams/cher-japi-update/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java:5966-5991 /trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java:8361,8366,8395,8619 Property changes on: branches/0.8/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java ____... [truncated message content] |
From: <aki...@us...> - 2010-08-26 07:37:19
|
Revision: 8619 http://gridarta.svn.sourceforge.net/gridarta/?rev=8619&view=rev Author: akirschbaum Date: 2010-08-26 07:37:13 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Fix memory leak when browsing maps. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-26 06:10:58 UTC (rev 8618) +++ trunk/atrinik/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) @@ -1,5 +1,7 @@ 2010-08-26 Andreas Kirschbaum + * Fix memory leak when browsing maps. + * Correctly update window menu when using 'enter xyz map' actions. 2010-08-14 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-08-26 06:10:58 UTC (rev 8618) +++ trunk/crossfire/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) @@ -1,5 +1,7 @@ 2010-08-26 Andreas Kirschbaum + * Fix memory leak when browsing maps. + * Correctly update window menu when using 'enter xyz map' actions. 2010-07-24 Andreas Kirschbaum Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 06:10:58 UTC (rev 8618) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 07:37:13 UTC (rev 8619) @@ -128,6 +128,23 @@ private final SmoothingRenderer smoothingRenderer; /** + * The {@link FilterConfigListener} attached to {@link #filterControl} to + * repaint all after config changes. + */ + @NotNull + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + forceRepaint(); + } + + }; + + /** * Creates a new instance. * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use @@ -147,17 +164,6 @@ this.mapViewSettings = mapViewSettings; this.smoothingRenderer = smoothingRenderer; init(); - final FilterConfigListener filterConfigListener = new FilterConfigListener() { - - /** - * {@inheritDoc} - */ - @Override - public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { - forceRepaint(); - } - - }; this.filterControl.addConfigListener(filterConfigListener); } @@ -165,6 +171,15 @@ * {@inheritDoc} */ @Override + public void closeNotify() { + super.closeNotify(); + filterControl.removeConfigListener(filterConfigListener); + } + + /** + * {@inheritDoc} + */ + @Override protected void updateSquare(@NotNull final Point point) { if (!mapModel.getMapArchObject().isPointValid(point)) { return; Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-26 06:10:58 UTC (rev 8618) +++ trunk/daimonin/ChangeLog 2010-08-26 07:37:13 UTC (rev 8619) @@ -1,5 +1,7 @@ 2010-08-26 Andreas Kirschbaum + * Fix memory leak when browsing maps. + * Correctly update window menu when using 'enter xyz map' actions. 2010-08-05 Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-08-26 06:10:58 UTC (rev 8618) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-08-26 07:37:13 UTC (rev 8619) @@ -92,6 +92,23 @@ private final int[] yPoints = new int[4]; /** + * The {@link FilterConfigListener} attached to {@link #filterControl} to + * repaint all after config changes. + */ + @NotNull + private final FilterConfigListener filterConfigListener = new FilterConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { + forceRepaint(); + } + + }; + + /** * Creates a new instance. * @param spawnPointTypeNo the game object type number for spawn points * @param mapViewSettings the map view settings instance to use @@ -112,17 +129,6 @@ emptySquareIcon = systemIcons.getEmptySquareIcon(); this.mapViewSettings = mapViewSettings; this.isoMapSquareInfo = isoMapSquareInfo; - final FilterConfigListener filterConfigListener = new FilterConfigListener() { - - /** - * {@inheritDoc} - */ - @Override - public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { - forceRepaint(); - } - - }; this.filterControl.addConfigListener(filterConfigListener); } @@ -130,6 +136,15 @@ * {@inheritDoc} */ @Override + public void closeNotify() { + super.closeNotify(); + filterControl.removeConfigListener(filterConfigListener); + } + + /** + * {@inheritDoc} + */ + @Override protected void clearBackground(@NotNull final Graphics g) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-26 06:11:05
|
Revision: 8618 http://gridarta.svn.sourceforge.net/gridarta/?rev=8618&view=rev Author: akirschbaum Date: 2010-08-26 06:10:58 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Dispose Graphics objects as soon as possible. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-08-26 05:41:18 UTC (rev 8617) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-08-26 06:10:58 UTC (rev 8618) @@ -347,16 +347,20 @@ // first create a storing place for the image final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); final Graphics graphics = bufImage.getGraphics(); - graphics.setColor(Color.white); - graphics.fillRect(0, 0, viewWidth, viewHeight); + try { + graphics.setColor(Color.white); + graphics.fillRect(0, 0, viewWidth, viewHeight); - // paint the map view into the image - final Point storeOffset = new Point(borderOffset); - try { - borderOffset.setLocation(0, 0); - paintComponent(graphics, true, false); + // paint the map view into the image + final Point storeOffset = new Point(borderOffset); + try { + borderOffset.setLocation(0, 0); + paintComponent(graphics, true, false); + } finally { + borderOffset.setLocation(storeOffset); + } } finally { - borderOffset.setLocation(storeOffset); + graphics.dispose(); } return bufImage; } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 05:41:18 UTC (rev 8617) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-08-26 06:10:58 UTC (rev 8618) @@ -176,9 +176,13 @@ } final Graphics g = backBuffer.getGraphics(); - paintSquare(g, getBorderOffsetX() + point.x * IGUIConstants.SQUARE_WIDTH, getBorderOffsetY() + point.y * IGUIConstants.SQUARE_HEIGHT, mapModel.getMapSquare(point)); - paintSquareGrid(g, point); - paintSquareSelection(g, point); + try { + paintSquare(g, getBorderOffsetX() + point.x * IGUIConstants.SQUARE_WIDTH, getBorderOffsetY() + point.y * IGUIConstants.SQUARE_HEIGHT, mapModel.getMapSquare(point)); + paintSquareGrid(g, point); + paintSquareSelection(g, point); + } finally { + g.dispose(); + } } /** @@ -212,7 +216,12 @@ return; } - paintComponent(backBuffer.getGraphics(), false, false); + final Graphics graphics = backBuffer.getGraphics(); + try { + paintComponent(graphics, false, false); + } finally { + graphics.dispose(); + } } /** @@ -257,8 +266,12 @@ return; } final Graphics g = newBackBuffer.getGraphics(); - g.setColor(getBackground()); - g.fillRect(0, 0, size.width, size.height); + try { + g.setColor(getBackground()); + g.fillRect(0, 0, size.width, size.height); + } finally { + g.dispose(); + } backBufferRef = new SoftReference<BufferedImage>(newBackBuffer); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-08-26 05:41:18 UTC (rev 8617) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-08-26 06:10:58 UTC (rev 8618) @@ -106,7 +106,12 @@ final int viewWidth = mapSize.getWidth() * IGUIConstants.SQUARE_WIDTH; final int viewHeight = mapSize.getHeight() * IGUIConstants.SQUARE_HEIGHT; final BufferedImage image = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); - paintComponent(image.getGraphics()); + final Graphics g = image.getGraphics(); + try { + paintComponent(g); + } finally { + g.dispose(); + } return image; } Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-08-26 05:41:18 UTC (rev 8617) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-08-26 06:10:58 UTC (rev 8618) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.mapimagecache; +import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.File; @@ -152,7 +153,12 @@ return; } final BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - bufferedImage.getGraphics().drawImage(image, 0, 0, null); + final Graphics graphics = bufferedImage.getGraphics(); + try { + graphics.drawImage(image, 0, 0, null); + } finally { + graphics.dispose(); + } try { ImageIO.write(bufferedImage, "png", imageFile); Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-08-26 05:41:18 UTC (rev 8617) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-08-26 06:10:58 UTC (rev 8618) @@ -242,7 +242,12 @@ img = (RenderedImage) image; } else { final BufferedImage img2 = new BufferedImage(image.getWidth(this), image.getHeight(this), BufferedImage.TYPE_INT_ARGB); - paintComponent(img2.getGraphics()); + final Graphics g = img2.getGraphics(); + try { + paintComponent(g); + } finally { + g.dispose(); + } img = img2; } ImageIO.write(img, "png", file); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-26 05:41:24
|
Revision: 8617 http://gridarta.svn.sourceforge.net/gridarta/?rev=8617&view=rev Author: akirschbaum Date: 2010-08-26 05:41:18 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Correctly update window menu when using 'enter xyz map' actions. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-26 05:20:16 UTC (rev 8616) +++ trunk/atrinik/ChangeLog 2010-08-26 05:41:18 UTC (rev 8617) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Correctly update window menu when using 'enter xyz map' actions. + 2010-08-14 Andreas Kirschbaum * Do not anymore load maps/**/*.art or maps/**/*.trs files. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-08-26 05:20:16 UTC (rev 8616) +++ trunk/crossfire/ChangeLog 2010-08-26 05:41:18 UTC (rev 8617) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Correctly update window menu when using 'enter xyz map' actions. + 2010-07-24 Andreas Kirschbaum * Remove the "Apply" button from game object attributes panel as Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-26 05:20:16 UTC (rev 8616) +++ trunk/daimonin/ChangeLog 2010-08-26 05:41:18 UTC (rev 8617) @@ -1,3 +1,7 @@ +2010-08-26 Andreas Kirschbaum + + * Correctly update window menu when using 'enter xyz map' actions. + 2010-08-05 Andreas Kirschbaum * Insert "direction" attribute only if the archetype supports a Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java 2010-08-26 05:20:16 UTC (rev 8616) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java 2010-08-26 05:41:18 UTC (rev 8617) @@ -69,13 +69,13 @@ /** {@inheritDoc} */ @Override public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) { - // ignore + rebuildWindowMenu(); } /** {@inheritDoc} */ @Override public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) { - // ignore + rebuildWindowMenu(); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-26 05:20:22
|
Revision: 8616 http://gridarta.svn.sourceforge.net/gridarta/?rev=8616&view=rev Author: akirschbaum Date: 2010-08-26 05:20:16 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Update project files to fix plugin scripts not working when Gridarta is started from the IDE. Modified Paths: -------------- trunk/atrinik.iml trunk/crossfire.iml trunk/daimonin.iml Modified: trunk/atrinik.iml =================================================================== --- trunk/atrinik.iml 2010-08-14 07:51:40 UTC (rev 8615) +++ trunk/atrinik.iml 2010-08-26 05:20:16 UTC (rev 8616) @@ -85,6 +85,15 @@ </library> </orderEntry> <orderEntry type="module" module-name="model" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> </component> </module> Modified: trunk/crossfire.iml =================================================================== --- trunk/crossfire.iml 2010-08-14 07:51:40 UTC (rev 8615) +++ trunk/crossfire.iml 2010-08-26 05:20:16 UTC (rev 8616) @@ -122,6 +122,15 @@ </library> </orderEntry> <orderEntry type="module" module-name="model" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> </component> </module> Modified: trunk/daimonin.iml =================================================================== --- trunk/daimonin.iml 2010-08-14 07:51:40 UTC (rev 8615) +++ trunk/daimonin.iml 2010-08-26 05:20:16 UTC (rev 8616) @@ -85,6 +85,15 @@ </library> </orderEntry> <orderEntry type="module" module-name="model" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> </component> </module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-14 07:51:46
|
Revision: 8615 http://gridarta.svn.sourceforge.net/gridarta/?rev=8615&view=rev Author: akirschbaum Date: 2010-08-14 07:51:40 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Do not anymore load maps/**/*.trs files. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-14 07:45:01 UTC (rev 8614) +++ trunk/atrinik/ChangeLog 2010-08-14 07:51:40 UTC (rev 8615) @@ -1,6 +1,6 @@ 2010-08-14 Andreas Kirschbaum - * Do not anymore load maps/**/*.art files. + * Do not anymore load maps/**/*.art or maps/**/*.trs files. 2010-08-05 Andreas Kirschbaum Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-08-14 07:45:01 UTC (rev 8614) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-08-14 07:51:40 UTC (rev 8615) @@ -39,9 +39,7 @@ # - ARCH_DIRECTORY individual files in archetype directory (set in settings # dialog) configSource.COLLECTED.treasures.0=${COLLECTED}/treasures -configSource.COLLECTED.treasures.1=${MAPS} configSource.ARCH_DIRECTORY.treasures.0=${COLLECTED}/treasures -configSource.ARCH_DIRECTORY.treasures.1=${MAPS} configSource.image.name=atrinik.0 configSource.face.name=bmaps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-14 07:45:07
|
Revision: 8614 http://gridarta.svn.sourceforge.net/gridarta/?rev=8614&view=rev Author: akirschbaum Date: 2010-08-14 07:45:01 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Do not anymore load maps/**/*.art files. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-11 17:21:26 UTC (rev 8613) +++ trunk/atrinik/ChangeLog 2010-08-14 07:45:01 UTC (rev 8614) @@ -1,3 +1,7 @@ +2010-08-14 Andreas Kirschbaum + + * Do not anymore load maps/**/*.art files. + 2010-08-05 Andreas Kirschbaum * Insert "direction" attribute only if the archetype supports a Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-08-11 17:21:26 UTC (rev 8613) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-08-14 07:45:01 UTC (rev 8614) @@ -154,7 +154,6 @@ final ArtifactParser<GameObject, MapArchObject, Archetype> artifactParser = new ArtifactParser<GameObject, MapArchObject, Archetype>(archetypeSet, errorView, archetypeParser, invObjects); final File artifactsFile = new File(collectedDirectory, IGUIConstants.ARTIFACTS_FILE); artifactParser.loadArchesFromArtifacts(artifactsFile, "Artifacts", "artifacts"); - artifactParser.loadArchesFromArtifacts(mapsDirectory, "Artifacts", "maps"); } } // class DefaultResources This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2010-08-11 17:21:32
|
Revision: 8613 http://gridarta.svn.sourceforge.net/gridarta/?rev=8613&view=rev Author: smacky Date: 2010-08-11 17:21:26 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Revert debut commit. This is !&?@ing ridiculous. Modified Paths: -------------- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-08-11 17:03:53 UTC (rev 8612) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-08-11 17:21:26 UTC (rev 8613) @@ -45,7 +45,7 @@ configSource.image.name=daimonin.0 configSource.face.name=bmaps -configSource.face.output=%1$d %3$s +configSource.face.output=%1$05d %3$s configSource.facetree.name=facetree configSource.facetree.input=^(.*) configSource.facetree.output=%2$s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2010-08-11 17:03:59
|
Revision: 8612 http://gridarta.svn.sourceforge.net/gridarta/?rev=8612&view=rev Author: smacky Date: 2010-08-11 17:03:53 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Do not produce bmaps index of specific width. Modified Paths: -------------- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-08-05 17:02:56 UTC (rev 8611) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-08-11 17:03:53 UTC (rev 8612) @@ -45,7 +45,7 @@ configSource.image.name=daimonin.0 configSource.face.name=bmaps -configSource.face.output=%1$05d %3$s +configSource.face.output=%1$d %3$s configSource.facetree.name=facetree configSource.facetree.input=^(.*) configSource.facetree.output=%2$s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-08-05 17:03:03
|
Revision: 8611 http://gridarta.svn.sourceforge.net/gridarta/?rev=8611&view=rev Author: akirschbaum Date: 2010-08-05 17:02:56 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Insert "direction" attribute only if the archetype supports a direction. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/atrinik/ChangeLog 2010-08-05 17:02:56 UTC (rev 8611) @@ -1,3 +1,8 @@ +2010-08-05 Andreas Kirschbaum + + * Insert "direction" attribute only if the archetype supports a + direction. + 2010-07-27 Andreas Kirschbaum * Default loading config from 'archetype directory' rather than Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/daimonin/ChangeLog 2010-08-05 17:02:56 UTC (rev 8611) @@ -1,3 +1,8 @@ +2010-08-05 Andreas Kirschbaum + + * Insert "direction" attribute only if the archetype supports a + direction. + 2010-07-24 Andreas Kirschbaum * Remove the "Apply" button from game object attributes panel as Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-08-05 17:02:56 UTC (rev 8611) @@ -783,7 +783,7 @@ return null; } - final Object direction = archetypeChooserModel.getDirection(); + final Object direction = effectiveArchetype.usesDirection() ? archetypeChooserModel.getDirection() : null; final List<G> parts = new ArrayList<G>(); for (R archetypePart = effectiveArchetype; archetypePart != null; archetypePart = archetypePart.getMultiNext()) { Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-08-05 17:02:56 UTC (rev 8611) @@ -36,7 +36,13 @@ */ private static final long serialVersionUID = 1L; + /** + * The return value of {@link #usesDirection()}. + */ + private boolean usesDirection = false; + + /** * Creates a new instance. * @param archetypeName the name of the base archetype * @param faceObjectProviders the face object providers for looking up @@ -61,10 +67,18 @@ */ @Override public boolean usesDirection() { - return false; + return usesDirection; } /** + * Sets the return value of {@link #usesDirection()}. + * @param usesDirection the return value + */ + public void setUsesDirection(final boolean usesDirection) { + this.usesDirection = usesDirection; + } + + /** * {@inheritDoc} */ @NotNull Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2010-08-05 17:02:56 UTC (rev 8611) @@ -343,6 +343,34 @@ } /** + * Test case for {@link DefaultMapModel#getAllGameObjects()}: the {@link + * BaseObject#DIRECTION} attribute is set only if the inserted object + * supports a direction. + */ + @Test + public void testUpdateDirectionOnInsert() { + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + mapModelCreator.getArchetypeChooserModel().setDirection(2); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = newMapModel(mapModelCreator); + final BaseObject<TestGameObject, TestMapArchObject, TestArchetype, TestArchetype> archetypeWithoutDirection = mapModelCreator.getArchetype("arch_without"); + final TestArchetype archetypeWithDirection = mapModelCreator.getArchetype("arch_with"); + archetypeWithDirection.setUsesDirection(true); + + mapModel.beginTransaction("TEST"); + mapModel.getMapArchObject().setMapSize(new Size2D(1, 1)); + final TestGameObject gameObjectWithout = mapModel.insertBaseObject(archetypeWithoutDirection, new Point(0, 0), true, false, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + final TestGameObject gameObjectWith = mapModel.insertBaseObject(archetypeWithDirection, new Point(0, 0), true, false, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModel.endTransaction(); + + Assert.assertNotNull(gameObjectWithout); + Assert.assertFalse(archetypeWithoutDirection.usesDirection()); + Assert.assertEquals(0, gameObjectWithout.getAttributeInt(BaseObject.DIRECTION)); + Assert.assertNotNull(gameObjectWith); + Assert.assertTrue(archetypeWithDirection.usesDirection()); + Assert.assertEquals(2, gameObjectWith.getAttributeInt(BaseObject.DIRECTION)); + } + + /** * Records a change event. * @param name the event name * @param mapSquares the changed map squares Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-08-02 18:44:42 UTC (rev 8610) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-08-05 17:02:56 UTC (rev 8611) @@ -274,4 +274,13 @@ return autojoinLists; } + /** + * Returns the {@link ArchetypeChooserModel} instance. + * @return the archetype chooser model instance + */ + @NotNull + public ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> getArchetypeChooserModel() { + return archetypeChooserModel; + } + } // class TestMapModelCreator This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |