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-04-29 18:30:25
|
Revision: 7675 http://gridarta.svn.sourceforge.net/gridarta/?rev=7675&view=rev Author: akirschbaum Date: 2010-04-29 18:30:18 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Order import statements. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:07:10 UTC (rev 7674) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:30:18 UTC (rev 7675) @@ -23,9 +23,9 @@ import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.IsoMapRenderer; import net.sf.gridarta.gui.map.renderer.IsoPickmapRenderer; +import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.map.renderer.SimpleIsoMapRenderer; -import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; import net.sf.gridarta.model.io.GameObjectParser; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:07:10 UTC (rev 7674) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:30:18 UTC (rev 7675) @@ -21,8 +21,8 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; +import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.gui.map.renderer.RendererFactory; -import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.map.grid.MapGrid; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:07:10 UTC (rev 7674) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 18:30:18 UTC (rev 7675) @@ -23,9 +23,9 @@ import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.IsoMapRenderer; import net.sf.gridarta.gui.map.renderer.IsoPickmapRenderer; +import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.map.renderer.SimpleIsoMapRenderer; -import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; import net.sf.gridarta.model.io.GameObjectParser; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-04-29 18:07:10 UTC (rev 7674) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-04-29 18:30:18 UTC (rev 7675) @@ -113,8 +113,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectUtils; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.model.map.mapcontrol.MapControlListener; -import net.sf.gridarta.model.map.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 18:07:18
|
Revision: 7674 http://gridarta.svn.sourceforge.net/gridarta/?rev=7674&view=rev Author: akirschbaum Date: 2010-04-29 18:07:10 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Close game object attributes dialogs when the associated game object is removed from the map. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/atrinik/ChangeLog 2010-04-29 18:07:10 UTC (rev 7674) @@ -1,5 +1,8 @@ 2010-04-29 Andreas Kirschbaum + * Close game object attributes dialogs when the associated game + object is removed from the map. + * Make "close all" work again. 2010-04-27 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/crossfire/ChangeLog 2010-04-29 18:07:10 UTC (rev 7674) @@ -1,5 +1,8 @@ 2010-04-29 Andreas Kirschbaum + * Close game object attributes dialogs when the associated game + object is removed from the map. + * Make "close all" work again. 2010-04-27 Andreas Kirschbaum 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-04-29 11:48:23 UTC (rev 7673) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -234,6 +234,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** The map grid listener to track changes in {@link #mapGrid}. */ Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/daimonin/ChangeLog 2010-04-29 18:07:10 UTC (rev 7674) @@ -1,5 +1,8 @@ 2010-04-29 Andreas Kirschbaum + * Close game object attributes dialogs when the associated game + object is removed from the map. + * Make "close all" work again. 2010-04-27 Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -352,6 +352,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { scheduleMapModel(mapModel); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -37,6 +37,7 @@ import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collection; +import java.util.Set; import javax.swing.AbstractButton; import javax.swing.Action; import javax.swing.BorderFactory; @@ -112,8 +113,12 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectUtils; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapcontrol.MapControlListener; +import net.sf.gridarta.model.map.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; +import net.sf.gridarta.model.map.validation.ErrorCollector; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.model.spells.GameObjectSpell; @@ -126,6 +131,7 @@ import net.sf.gridarta.textedit.textarea.TextAreaDefaults; import net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarkerFactory; import net.sf.gridarta.utils.CommonConstants; +import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.japi.swing.action.ActionBuilder; @@ -275,6 +281,12 @@ private final G gameObject; /** + * {@link #gameObject}'s initial map. + */ + @NotNull + private final MapModel<G, A, R> mapModel; + + /** * {@link #gameObject}'s archetype. */ @NotNull @@ -620,10 +632,74 @@ }; /** + * Tracks {@link #mapModel}'s map for changes: when the {@link #gameObject} + * is removed, cancels this dialog. + */ + @NotNull + private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { + + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + if (gameObject.getMapSquare() == null) { + setValue(cancelButton); + } + } + + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { + if (gameObject.getMapSquare() == null) { + setValue(cancelButton); + } + } + + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { + if (gameObject.getMapSquare() == null) { + setValue(cancelButton); + } + } + + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed() { + setValue(cancelButton); + } + + /** {@inheritDoc} */ + @Override + public void mapMetaChanged() { + // ignore + } + + }; + + /** * Create an AbstractGameObjectAttributesDialog. * @param gameObjectAttributesDialogFactory the associated factory * @param archetypeTypeSet Reference to the list of archetype types. - * @param gameObject GameObject to show dialog for. + * @param gameObject the game object to show dialog for; must be part of a + * map * @param parent the parent frame for showing dialog boxes * @param treasureListTree the treasure list tree to display * @param faceObjectProviders the face object providers for looking up @@ -663,6 +739,13 @@ this.textAreaDefaults = textAreaDefaults; archetype = gameObject.getArchetype(); + final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); + if (mapSquare == null) { + throw new IllegalArgumentException(); + } + mapModel = mapSquare.getMapModel(); + mapModel.addMapModelListener(mapModelListener); + archetypeType = archetypeTypeSet.getArchetypeType(gameObject); type = archetypeTypeSet.getArchetypeTypeIndex(archetypeType); @@ -724,6 +807,7 @@ super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { gameObjectAttributesDialogFactory.hideAttribDialog(gameObject); + mapModel.removeMapModelListener(mapModelListener); } } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -320,6 +320,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -154,6 +154,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -153,6 +153,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -125,6 +125,12 @@ updateTitle(); } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -167,6 +167,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -206,6 +206,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** The map grid listener to track changes in {@link #mapGrid}. */ Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -146,6 +146,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -476,6 +476,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void saved(@NotNull final DefaultMapControl<G, A, R> mapControl) { assert mapModel == mapControl.getMapModel(); addRecent(mapModel, null); Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -229,6 +229,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -109,6 +109,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -162,6 +162,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** The map manager listener. */ Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -373,6 +373,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed() { + // ignore + } + }; /** The archetype set listener used to detect archetype set state changes. */ Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -218,6 +218,9 @@ @Override public void mapClosed() { mapArchObject.removeMapArchObjectListener(mapArchObjectListener); + for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { + listener.mapClosed(); + } } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -92,4 +92,9 @@ */ void modifiedChanged(@NotNull MapModel<G, A, R> mapModel); + /** + * This map has been closed. + */ + void mapClosed(); + } // interface MapModelListener Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-04-29 11:48:23 UTC (rev 7673) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-04-29 18:07:10 UTC (rev 7674) @@ -116,6 +116,12 @@ /** {@inheritDoc} */ @Override + public void mapClosed() { + // ignore + } + + /** {@inheritDoc} */ + @Override public void mapMetaChanged() { result.append("mapMetaChanged"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 11:48:29
|
Revision: 7673 http://gridarta.svn.sourceforge.net/gridarta/?rev=7673&view=rev Author: akirschbaum Date: 2010-04-29 11:48:23 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Remove commented and outdated code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 11:47:19 UTC (rev 7672) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 11:48:23 UTC (rev 7673) @@ -259,8 +259,6 @@ currentMapControl = mapControl; - //StatusBar.getInstance().setLevelInfo(level); - for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { listener.currentMapChanged(currentMapControl); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 11:47:26
|
Revision: 7672 http://gridarta.svn.sourceforge.net/gridarta/?rev=7672&view=rev Author: akirschbaum Date: 2010-04-29 11:47:19 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Make "close all" work again. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/atrinik/ChangeLog 2010-04-29 11:47:19 UTC (rev 7672) @@ -1,3 +1,7 @@ +2010-04-29 Andreas Kirschbaum + + * Make "close all" work again. + 2010-04-27 Andreas Kirschbaum * Support autojoin when inserting game objects from pickmaps. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/crossfire/ChangeLog 2010-04-29 11:47:19 UTC (rev 7672) @@ -1,3 +1,7 @@ +2010-04-29 Andreas Kirschbaum + + * Make "close all" work again. + 2010-04-27 Andreas Kirschbaum * Support autojoin when inserting game objects from pickmaps. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/daimonin/ChangeLog 2010-04-29 11:47:19 UTC (rev 7672) @@ -1,3 +1,7 @@ +2010-04-29 Andreas Kirschbaum + + * Make "close all" work again. + 2010-04-27 Andreas Kirschbaum * Support autojoin when inserting game objects from pickmaps. Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -122,6 +122,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { final MapModel<G, A, R> mapModel = mapControl.getMapModel(); final MapModelListener<G, A, R> mapModelListener = mapModelListeners.remove(mapModel); if (mapModelListener != null) { Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -252,6 +252,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + }; /** The map model listener which is attached to {@link #currentMapControl}. */ Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -97,6 +97,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -190,6 +190,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -281,6 +281,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -134,12 +134,17 @@ public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { } + /** {@inheritDoc} */ + @Override + public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + getMapViewsInt(mapControl).closeAllViews(); + } + /** * {@inheritDoc} */ @Override - public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { - getMapViewsInt(mapControl).closeAllViews(); + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { assert getMapViews(mapControl) <= 0; mapViews.remove(mapControl); } Modified: trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -81,6 +81,12 @@ // ignore } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + }; /** Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -134,6 +134,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { mapViewsManager.removeMapViewsListener(mapControl, mapViewsListener); } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -89,6 +89,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { if (mapControl == mapView.getMapControl()) { mapView.getMapControl().getMapModel().removeMapModelListener(mapModelListener); mapManager.removeMapManagerListener(mapManagerListener); Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -120,6 +120,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { mapControl.addMapControlListener(mapControlListener); mapRendererReferences.remove(mapControl); } Modified: trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -79,6 +79,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { mapViewsManager.removeMapViewsListener(mapControl, mapViewsListener); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -136,6 +136,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { final MapTracker mapTracker = mapTrackers.remove(mapControl); if (mapTracker != null) { mapControl.getMapModel().removeMapModelListener(mapTracker); Modified: trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -159,6 +159,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { mapControl.removeMapControlListener(mapControlListener); } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -301,6 +301,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { if (!mapControl.isPickmap()) { mapControl.removeMapControlListener(mapControlListener); } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -182,6 +182,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { mapControl.getMapModel().removeMapModelListener(mapModelListener); } Modified: trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -162,6 +162,12 @@ /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { undoModels.remove(mapControl.getMapModel()); mapControl.getMapModel().removeMapTransactionListener(mapTransactionListener); } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -260,6 +260,12 @@ // ignore: a current map changed event will be generated } + /** {@inheritDoc} */ + @Override + public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + // ignore: a current map changed event will be generated + } + }; /** The map manager listener to detect created and closed map views. */ Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -151,6 +151,9 @@ if (currentMapControl == mapControl) { setCurrentMap(mapControls.isEmpty() ? null : mapControls.get(0)); } + for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { + listener.mapClosed(mapControl); + } mapControl.mapClosed(); } Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java 2010-04-29 11:34:34 UTC (rev 7671) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java 2010-04-29 11:47:19 UTC (rev 7672) @@ -33,7 +33,7 @@ * #mapCreated(MapControl, boolean)} - after a map has been created or opened <li>{@link * #currentMapChanged(MapControl)} - the newly created map now is the current * map - * <li>{@link #mapClosing(MapControl)} - the map has been closed </ul> + * <li>{@link #mapClosed(MapControl)} - the map has been closed </ul> * @author Andreas Kirschbaum */ public interface MapManagerListener<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends EventListener { @@ -53,9 +53,16 @@ void mapCreated(@NotNull MapControl<G, A, R> mapControl, boolean interactive); /** - * This event handler is called when a map is to be closed. + * This event handler is called when a map is to be closed. Afterwards + * {@link #mapClosed(MapControl)} will be called. * @param mapControl the map control that is to be closed */ void mapClosing(@NotNull MapControl<G, A, R> mapControl); + /** + * This event handler is called when a map has been closed. + * @param mapControl the map control that has been closed + */ + void mapClosed(@NotNull MapControl<G, A, R> mapControl); + } // interface MapManagerListener This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 11:34:40
|
Revision: 7671 http://gridarta.svn.sourceforge.net/gridarta/?rev=7671&view=rev Author: akirschbaum Date: 2010-04-29 11:34:34 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Inline function calls. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 09:44:48 UTC (rev 7670) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 11:34:34 UTC (rev 7671) @@ -105,7 +105,9 @@ public MapControl<G, A, R> newMap(@Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final File file, final boolean interactive) { final MapControl<G, A, R> mapControl = createMapControl(objects, mapArchObject, file); mapControls.add(mapControl); - fireMapCreatedEvent(mapControl, interactive); + for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { + listener.mapCreated(mapControl, interactive); + } if (interactive) { setCurrentMap(mapControl); } @@ -141,7 +143,9 @@ /** {@inheritDoc} */ @Override public void closeMap(@NotNull final MapControl<G, A, R> mapControl) { - fireMapClosingEvent(mapControl); + for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { + listener.mapClosing(mapControl); + } assert mapControl.getUseCounter() <= 0; mapControls.remove(mapControl); if (currentMapControl == mapControl) { @@ -254,7 +258,9 @@ //StatusBar.getInstance().setLevelInfo(level); - fireCurrentMapChangedEvent(); + for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { + listener.currentMapChanged(currentMapControl); + } } /** {@inheritDoc} */ @@ -306,34 +312,6 @@ } } - /** - * Notify all listeners about a created map. - * @param mapControl the created map - * @param interactive whether the map has been loaded interactively - */ - private void fireMapCreatedEvent(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { - listener.mapCreated(mapControl, interactive); - } - } - - /** - * Notify all listeners about a map to be closed. - * @param mapControl MapControl that's being closed. - */ - private void fireMapClosingEvent(@NotNull final MapControl<G, A, R> mapControl) { - for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { - listener.mapClosing(mapControl); - } - } - - /** Notify all listeners about a changed current map. */ - private void fireCurrentMapChangedEvent() { - for (final MapManagerListener<G, A, R> listener : listenerList.getListeners()) { - listener.currentMapChanged(currentMapControl); - } - } - /** {@inheritDoc} */ @Override public void addMapManagerListener(@NotNull final MapManagerListener<G, A, R> listener) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 09:44:55
|
Revision: 7670 http://gridarta.svn.sourceforge.net/gridarta/?rev=7670&view=rev Author: akirschbaum Date: 2010-04-29 09:44:48 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Fix spurious error messages introduced in previous commit. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:44:48 UTC (rev 7670) @@ -121,7 +121,12 @@ public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -135,7 +140,12 @@ mapArchObject.setDifficulty(1); final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:44:48 UTC (rev 7670) @@ -121,7 +121,12 @@ public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -134,7 +139,12 @@ public MapControl<GameObject, MapArchObject, Archetype> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:44:48 UTC (rev 7670) @@ -121,7 +121,12 @@ public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -135,7 +140,12 @@ mapArchObject.setDifficulty(1); final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); Modified: trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) +++ trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-04-29 09:44:48 UTC (rev 7670) @@ -111,7 +111,12 @@ public MapControl<TestGameObject, TestMapArchObject, TestArchetype> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @Nullable final File file) { final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = newMapModel(mapArchObject); if (objects != null) { - mapModel.addObjectListToMap(objects); + mapModel.beginTransaction("init"); + try { + mapModel.addObjectListToMap(objects); + } finally { + mapModel.endTransaction(); + } } final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = new DefaultMapControl<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 09:21:13
|
Revision: 7669 http://gridarta.svn.sourceforge.net/gridarta/?rev=7669&view=rev Author: akirschbaum Date: 2010-04-29 09:21:06 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Remove objects parameter from DefaultMapModel constructor. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControlFactory.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -119,7 +119,11 @@ @NotNull @Override public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), false, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); return mapControl; } @@ -129,7 +133,11 @@ @Override public MapControl<GameObject, MapArchObject, Archetype> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { mapArchObject.setDifficulty(1); - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), true, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); mapControl.getMapModel().resetModified(); return mapControl; @@ -138,8 +146,8 @@ /** {@inheritDoc} */ @NotNull @Override - public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject, @Nullable final List<GameObject> objects) { - return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, objects, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject) { + return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } } // class DefaultMapControlFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -119,7 +119,11 @@ @NotNull @Override public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), false, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); return mapControl; } @@ -128,7 +132,11 @@ @NotNull @Override public MapControl<GameObject, MapArchObject, Archetype> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), true, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); mapControl.getMapModel().resetModified(); return mapControl; @@ -137,8 +145,8 @@ /** {@inheritDoc} */ @NotNull @Override - public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject, @Nullable final List<GameObject> objects) { - return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, objects, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject) { + return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } } // class DefaultMapControlFactory Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -119,7 +119,11 @@ @NotNull @Override public MapControl<GameObject, MapArchObject, Archetype> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), false, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); return mapControl; } @@ -129,7 +133,11 @@ @Override public MapControl<GameObject, MapArchObject, Archetype> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @Nullable final File file) { mapArchObject.setDifficulty(1); - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(newMapModel(mapArchObject, objects), true, mapWriter, globalSettings); + final MapModel<GameObject, MapArchObject, Archetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); mapControl.getMapModel().resetModified(); return mapControl; @@ -138,8 +146,8 @@ /** {@inheritDoc} */ @NotNull @Override - public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject, @Nullable final List<GameObject> objects) { - return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, objects, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + public MapModel<GameObject, MapArchObject, Archetype> newMapModel(@NotNull final MapArchObject mapArchObject) { + return new DefaultMapModel<GameObject, MapArchObject, Archetype>(autojoinLists, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } } // class DefaultMapControlFactory Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -386,7 +386,7 @@ new MapCursorActions<G, A, R>(gameObjectAttributesDialogFactory, mapViewManager, selectedSquareControl, selectedSquareModel); final A mapArchObject = mapArchObjectFactory.newMapArchObject(false); mapArchObject.setMapName("cb"); - final MapModel<G, A, R> copyBufferMapModel = mapControlFactory.newMapModel(mapArchObject, null); + final MapModel<G, A, R> copyBufferMapModel = mapControlFactory.newMapModel(mapArchObject); final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode); final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, copyBufferMapModel, gameObjectFactory, insertionModeSet); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBufferMapModel, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet, archetypeChooserModel); Modified: trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControlFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControlFactory.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -57,11 +57,9 @@ /** * Creates a new {@link MapModel} instance. * @param mapArchObject the map arch object to use for the new map model - * @param objects the game objects to add to the new instance; may be - * <code>null</code> to add no game objects * @return the new map model instance */ @NotNull - MapModel<G, A, R> newMapModel(@NotNull A mapArchObject, @Nullable List<G> objects); + MapModel<G, A, R> newMapModel(@NotNull A mapArchObject); } // interface MapControlFactory Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -185,8 +185,6 @@ /** * Create an DefaultMapModel. * @param autojoinLists the autojoin lists instance to use - * @param objects the <code>GameObject</code> list of this map or - * <code>null</code> for an empty map * @param mapArchObject The MapArchObject to associate with this model. * @param archetypeChooserModel the archetype chooser control * @param activeEditType the active edit types @@ -195,7 +193,7 @@ * @param gameObjectMatchers the game object matchers to use * @param topmostInsertionMode the "topmost" insertion mode */ - public DefaultMapModel(@NotNull final AutojoinLists<G, A, R> autojoinLists, @Nullable final Iterable<G> objects, @NotNull final A mapArchObject, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final int activeEditType, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { + public DefaultMapModel(@NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final A mapArchObject, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final int activeEditType, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { this.mapArchObject = mapArchObject; this.autojoinLists = autojoinLists; this.archetypeChooserModel = archetypeChooserModel; @@ -210,9 +208,6 @@ beginTransaction("init"); try { clearMap(); - if (objects != null) { - addObjectListToMap(objects); - } } finally { endTransaction(); } Modified: trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -109,7 +109,11 @@ @NotNull @Override public MapControl<TestGameObject, TestMapArchObject, TestArchetype> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @Nullable final File file) { - final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = new DefaultMapControl<TestGameObject, TestMapArchObject, TestArchetype>(newMapModel(mapArchObject, objects), false, mapWriter, globalSettings); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = newMapModel(mapArchObject); + if (objects != null) { + mapModel.addObjectListToMap(objects); + } + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = new DefaultMapControl<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); return mapControl; } @@ -124,8 +128,8 @@ /** {@inheritDoc} */ @NotNull @Override - public MapModel<TestGameObject, TestMapArchObject, TestArchetype> newMapModel(@NotNull final TestMapArchObject mapArchObject, @Nullable final List<TestGameObject> objects) { - return new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, objects, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + public MapModel<TestGameObject, TestMapArchObject, TestArchetype> newMapModel(@NotNull final TestMapArchObject mapArchObject) { + return new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } } // class TestMapControlFactory Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-04-29 08:30:44 UTC (rev 7668) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-04-29 09:21:06 UTC (rev 7669) @@ -452,7 +452,7 @@ insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode); insertionModeSet.init(new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); assert archetypeChooserModel != null; - mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, null, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); result.setLength(0); mapModel.addMapModelListener(mapModelListener); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 08:30:50
|
Revision: 7668 http://gridarta.svn.sourceforge.net/gridarta/?rev=7668&view=rev Author: akirschbaum Date: 2010-04-29 08:30:44 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Rename parameter names. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:29:39 UTC (rev 7667) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:30:44 UTC (rev 7668) @@ -155,7 +155,7 @@ */ @NotNull @Override - public MapControl<G, A, R> openMapFile(@NotNull final File file, final boolean isInteractive) throws IOException { + public MapControl<G, A, R> openMapFile(@NotNull final File file, final boolean interactive) throws IOException { // First look whether the file isn't already open. // If so, return the previously loaded map. final File canonicalFile = getCanonicalFile(file); @@ -167,8 +167,8 @@ } } - final MapReader<G, A> decoder = decodeMapFile(file, isInteractive); - return newMap(decoder.getGameObjects(), decoder.getMapArchObject(), file, isInteractive); + final MapReader<G, A> decoder = decodeMapFile(file, interactive); + return newMap(decoder.getGameObjects(), decoder.getMapArchObject(), file, interactive); } /** @@ -189,14 +189,14 @@ /** * Load a map file. * @param file the map file to load - * @param isInteractive if set, may ask to delete undefined archetypes; if + * @param interactive if set, may ask to delete undefined archetypes; if * unset, keep undefined archetypes * @return the decoder objects containing the loaded map data, or * <code>null</code> if loading failed * @throws IOException if an I/O error occurs */ @NotNull - private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean isInteractive) throws IOException { + private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean interactive) throws IOException { final MapReader<G, A> decoder; try { decoder = mapReaderFactory.newMapReader(file); @@ -236,7 +236,7 @@ } } } - if (isInteractive && outOfMapBoundsDeleted > 0) { + if (interactive && outOfMapBoundsDeleted > 0) { fileControl.reportOutOfMapBoundsDeleted(file, outOfMapBoundsDeleted, outOfMapBoundsObjects); } Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 08:29:39 UTC (rev 7667) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 08:30:44 UTC (rev 7668) @@ -39,13 +39,13 @@ * Loads a map file. The returned instance must be freed with {@link * #release(MapControl)} when not needed anymore. * @param file the map file to load - * @param isInteractive if set, may ask to delete undefined archetypes; if + * @param interactive if set, may ask to delete undefined archetypes; if * unset, keep undefined archetypes * @return the map control, or <code>null</code> if loading failed * @throws IOException if an I/O error occurs */ @NotNull - MapControl<G, A, R> openMapFile(@NotNull File file, final boolean isInteractive) throws IOException; + MapControl<G, A, R> openMapFile(@NotNull File file, final boolean interactive) throws IOException; /** * Closes the given map, ignoring modified status. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 08:29:46
|
Revision: 7667 http://gridarta.svn.sourceforge.net/gridarta/?rev=7667&view=rev Author: akirschbaum Date: 2010-04-29 08:29:39 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Rename parameter names. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:26:52 UTC (rev 7666) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:29:39 UTC (rev 7667) @@ -102,11 +102,11 @@ /** {@inheritDoc} */ @NotNull @Override - public MapControl<G, A, R> newMap(@Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final File file, final boolean isInteractive) { + public MapControl<G, A, R> newMap(@Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final File file, final boolean interactive) { final MapControl<G, A, R> mapControl = createMapControl(objects, mapArchObject, file); mapControls.add(mapControl); - fireMapCreatedEvent(mapControl, isInteractive); - if (isInteractive) { + fireMapCreatedEvent(mapControl, interactive); + if (interactive) { setCurrentMap(mapControl); } return mapControl; Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 08:26:52 UTC (rev 7666) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 08:29:39 UTC (rev 7667) @@ -60,11 +60,11 @@ * @param mapArchObject the map arch object for the new map * @param file the map file, or <code>null</code> if the map was not yet * saved - * @param isInteractive if set, the new map becomes the current map + * @param interactive if set, the new map becomes the current map * @return the newly created map control */ @NotNull - MapControl<G, A, R> newMap(@Nullable List<G> objects, @NotNull A mapArchObject, @Nullable File file, boolean isInteractive); + MapControl<G, A, R> newMap(@Nullable List<G> objects, @NotNull A mapArchObject, @Nullable File file, boolean interactive); /** * Sets the given map as the current one. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 08:26:58
|
Revision: 7666 http://gridarta.svn.sourceforge.net/gridarta/?rev=7666&view=rev Author: akirschbaum Date: 2010-04-29 08:26:52 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Continue checking other opened maps if normalizing the path name for one map fails. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:11:35 UTC (rev 7665) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:26:52 UTC (rev 7666) @@ -158,19 +158,13 @@ public MapControl<G, A, R> openMapFile(@NotNull final File file, final boolean isInteractive) throws IOException { // First look whether the file isn't already open. // If so, return the previously loaded map. - try { - final File canonicalFile = file.getCanonicalFile(); - for (final MapControl<G, A, R> mapControl : mapControls) { - final File mapFile = mapControl.getMapModel().getMapFile(); - if (mapFile != null && canonicalFile.equals(mapFile.getCanonicalFile())) { - mapControl.acquire(); - return mapControl; - } + final File canonicalFile = getCanonicalFile(file); + for (final MapControl<G, A, R> mapControl : mapControls) { + final File mapFile = mapControl.getMapModel().getMapFile(); + if (mapFile != null && canonicalFile.equals(getCanonicalFile(mapFile))) { + mapControl.acquire(); + return mapControl; } - } catch (final IOException e) { - if (isInteractive) { - log.warn(ACTION_BUILDER.format("logCanonIOE", e)); - } } final MapReader<G, A> decoder = decodeMapFile(file, isInteractive); @@ -178,6 +172,21 @@ } /** + * Returns the canonical file name. + * @param file the input file + * @return the canonical file or the input file if an error occurs + */ + @NotNull + private static File getCanonicalFile(@NotNull final File file) { + try { + return file.getCanonicalFile(); + } catch (final IOException ex) { + log.warn(ACTION_BUILDER.format("logCanonIOE", ex)); + return file; + } + } + + /** * Load a map file. * @param file the map file to load * @param isInteractive if set, may ask to delete undefined archetypes; if This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 08:11:42
|
Revision: 7665 http://gridarta.svn.sourceforge.net/gridarta/?rev=7665&view=rev Author: akirschbaum Date: 2010-04-29 08:11:35 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Do not complain about unsaved maps when creating event script paths names. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/FileControl.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 trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 08:11:35 UTC (rev 7665) @@ -374,7 +374,6 @@ final File mapFile = mapControl.getMapModel().getMapFile(); if (mapFile == null) { - fileControl.reportNoMapPath(); return globalSettings.getMapsDirectory(); } Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 08:11:35 UTC (rev 7665) @@ -359,12 +359,6 @@ /** {@inheritDoc} */ @Override - public void reportNoMapPath() { - ACTION_BUILDER.showMessageDialog(parent, "createNewEventNoMapPath"); - } - - /** {@inheritDoc} */ - @Override public void reportOutOfMemory(@NotNull final File file) { ACTION_BUILDER.showMessageDialog(parent, "mapOutOfMemory", file); } Modified: trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java 2010-04-29 08:11:35 UTC (rev 7665) @@ -89,8 +89,6 @@ void reportOutOfMapBoundsDeleted(@NotNull File file, int outOfMapBoundsDeleted, @NotNull StringBuilder outOfMapBoundsObjects); - void reportNoMapPath(); - void reportOutOfMemory(@NotNull File file); } // class FileControl Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-04-29 08:11:35 UTC (rev 7665) @@ -352,9 +352,6 @@ confirmRevertPickmap.title=Revert pickmap? confirmRevertPickmap.message=If you revert the pickmap ''{0}''\n to its last saved state, all recent changes will be lost.\nDo you really want to revert this pickmap? -createNewEventNoMapPath.title=Can''t create script path -createNewEventNoMapPath.message=Can''t create script path from map. Perhaps you should save your map first. - goLocation.title=Goto Location goLocationOkay.text=Ok goLocationApply.text=Apply Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-04-29 08:11:35 UTC (rev 7665) @@ -331,9 +331,6 @@ confirmRevertPickmap.title=\xC4nderungen in Pickmap zur\xFCcknehmen? confirmRevertPickmap.message=Die letzten \xC4nderungen in der Pickmap ''{0}''\ngehen verlosen, wenn Sie die Datei neu laden.\nSind Sie sicher, dass die das wollen? -createNewEventNoMapPath.title=Kann Script-Pfad nicht ermitteln -createNewEventNoMapPath.message=Kann Script-Pfad nicht ermitteln, da die Karte noch nicht gespeichert ist. - goLocation.title=Cursor setzen goLocationOkay.text=OK goLocationApply.text=Anwenden Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-04-29 08:11:35 UTC (rev 7665) @@ -326,9 +326,6 @@ #confirmRevertPickmap.title= #confirmRevertPickmap.message= -#createNewEventNoMapPath.title= -#createNewEventNoMapPath.message= - #goLocation.title= #goLocationOkay.text= #goLocationApply.text= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-04-29 08:11:35 UTC (rev 7665) @@ -329,9 +329,6 @@ confirmRevertPickmap.title=\xC5terst\xE4ll plockkarta? confirmRevertPickmap.message=Om du \xE5terst\xE4ller plockkartan ''{0}''\ntill dess senaste sparade version kommer alla nyliga \xE4ndringar att f\xF6rloras.\nVill du verkligen \xE5terst\xE4lla plockkartan? -createNewEventNoMapPath.title=Kan inte skapa s\xF6kv\xE4g f\xF6r script -createNewEventNoMapPath.message=Kan inte utg\xE5 fr\xE5n kartans s\xF6kv\xE4g. Du kanske skall spara kartan f\xF6rst? - #goLocation.title= #goLocationOkay.text= #goLocationApply.text= Modified: trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java =================================================================== --- trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java 2010-04-29 02:40:26 UTC (rev 7664) +++ trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java 2010-04-29 08:11:35 UTC (rev 7665) @@ -104,12 +104,6 @@ /** {@inheritDoc} */ @Override - public void reportNoMapPath() { - throw new AssertionError(); - } - - /** {@inheritDoc} */ - @Override public void reportOutOfMemory(@NotNull final File file) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 02:40:33
|
Revision: 7664 http://gridarta.svn.sourceforge.net/gridarta/?rev=7664&view=rev Author: akirschbaum Date: 2010-04-29 02:40:26 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Replace null return values with exceptions. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java Modified: trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -233,8 +233,11 @@ return false; } - final MapControl<G, A, R> sourceMapControl = mapManager.openMapFile(sourceExitLocation.getFile(), false); - if (sourceMapControl == null) { + final MapControl<G, A, R> sourceMapControl; + try { + sourceMapControl = mapManager.openMapFile(sourceExitLocation.getFile(), false); + } catch (final IOException ex) { + fileControl.reportLoadError(sourceExitLocation.getFile(), ex.getMessage()); return false; } try { Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -21,6 +21,7 @@ import java.awt.Component; import java.io.File; +import java.io.IOException; import java.util.Set; import javax.swing.Action; import net.sf.gridarta.gui.map.mapview.MapView; @@ -350,7 +351,11 @@ return; } - mapManager.revert(mapControl); + try { + mapManager.revert(mapControl); + } catch (final IOException ex) { + fileControl.reportLoadError(mapControl.getMapModel().getMapFile(), ex.getMessage()); + } } /** Invoked when the user wants to close the map. */ Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -24,6 +24,7 @@ import java.awt.Point; import java.awt.Rectangle; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import javax.swing.Action; @@ -41,6 +42,7 @@ import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.shrinkmapsizedialog.ShrinkMapSizeDialogManager; +import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -201,6 +203,12 @@ @NotNull private final MapViewsManager<G, A, R> mapViewsManager; + /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + /** The current map view, or <code>null</code> if no map view is active. */ @Nullable private MapView<G, A, R> currentMapView; @@ -344,8 +352,9 @@ * @param mapViewSettings the map view settings instance to use * @param mapPathNormalizer the map path normalizer to use * @param mapViewsManager the map views + * @param fileControl the file control */ - public DefaultMapActions(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, final ExitMatcher<G, A, R> exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final int[] directionMap, final boolean allowRandomMapParameters, @NotNull final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public DefaultMapActions(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, final ExitMatcher<G, A, R> exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final int[] directionMap, final boolean allowRandomMapParameters, @NotNull final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final FileControl<G, A, R> fileControl) { this.parent = parent; this.helpParent = helpParent; this.exitMatcher = exitMatcher; @@ -357,6 +366,7 @@ this.mapViewSettings = mapViewSettings; this.mapPathNormalizer = mapPathNormalizer; this.mapViewsManager = mapViewsManager; + this.fileControl = fileControl; shrinkMapSizeDialogManager = new ShrinkMapSizeDialogManager<G, A, R>(mapViewManager); mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); @@ -716,8 +726,11 @@ return; } - final MapView<G, A, R> newMapView = mapViewsManager.openMapFileWithView(canonicalNewFile, null); - if (newMapView == null) { + final MapView<G, A, R> newMapView; + try { + newMapView = mapViewsManager.openMapFileWithView(canonicalNewFile, null); + } catch (final IOException ex) { + fileControl.reportLoadError(canonicalNewFile, ex.getMessage()); return; } Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -266,9 +266,10 @@ continue; } - mapControls[i] = loadMapControl(mapModel, path); - if (mapControls[i] == null) { - ACTION_BUILDER.showMessageDialog(this, "mapErrorPath2", path); + try { + mapControls[i] = loadMapControl(mapModel, path); + } catch (final IOException ex) { + ACTION_BUILDER.showMessageDialog(this, "mapErrorPath2", path); // XXX: ignores ex.getMessage() return; } } @@ -289,13 +290,13 @@ if (mapControls[index] == null) { final String tilePath = mapControl.getMapModel().getMapArchObject().getTilePath(mapLink.getLinkDirection()); if (tilePath.length() > 0) { - mapControls[index] = loadMapControl(mapControl.getMapModel(), tilePath); - if (mapControls[index] == null) { - if (ACTION_BUILDER.showQuestionDialog(this, "mapErrorPath2", tilePath)) { + try { + mapControls[index] = loadMapControl(mapControl.getMapModel(), tilePath); + repeatFlag = true; + } catch (final IOException ex) { + if (ACTION_BUILDER.showQuestionDialog(this, "mapErrorPath2", tilePath)) { // XXX: ignores ex.getMessage() return; } - } else { - repeatFlag = true; } } } @@ -381,9 +382,10 @@ * @param mapModel the map model for relative map paths * @param path the map path * @return the map control or <code>null</code> if the map cannot be loaded + * @throws IOException if an I/O error occurs */ @Nullable - private MapControl<G, A, R> loadMapControl(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String path) { + private MapControl<G, A, R> loadMapControl(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String path) throws IOException { final File file; try { file = mapPathNormalizer.normalizeMapPath(mapModel, path); Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -21,6 +21,7 @@ import java.awt.Point; import java.io.File; +import java.io.IOException; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.List; @@ -321,13 +322,11 @@ * @param viewPosition the view position to show initially; may be * <code>null</code> to show the top left corner * @return the map view, or <code>null</code> if loading failed + * @throws IOException if an I/O error occurs */ - @Nullable - public MapView<G, A, R> openMapFileWithView(@NotNull final File file, @Nullable final Point viewPosition) { + @NotNull + public MapView<G, A, R> openMapFileWithView(@NotNull final File file, @Nullable final Point viewPosition) throws IOException { final MapControl<G, A, R> mapControl = mapManager.openMapFile(file, true); - if (mapControl == null) { - return null; - } try { return newMapView(mapControl, viewPosition); } finally { Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -21,6 +21,7 @@ import java.awt.Image; import java.io.File; +import java.io.IOException; import java.lang.ref.SoftReference; import java.util.EnumMap; import java.util.HashMap; @@ -247,13 +248,15 @@ */ @NotNull private Image updateCaches(@NotNull final File mapFile, final ImageType imageType) { - final MapControl<G, A, R> mapControl = mapManager.openMapFile(mapFile, false); - if (mapControl != null) { + try { + final MapControl<G, A, R> mapControl = mapManager.openMapFile(mapFile, false); try { return updateCaches(mapFile, mapControl, imageType); } finally { mapManager.release(mapControl); } + } catch (final IOException ex) { + // ignore: do not update cached images } return entries.get(imageType).getDefaultImage(); Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -37,6 +37,7 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.gui.utils.MenuUtils; +import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -95,6 +96,12 @@ private final MapImageCache<G, A, R> mapImageCache; /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + + /** * Maps {@link MapControl} instances to associated {@link MapTracker} * instances. */ @@ -145,12 +152,14 @@ * @param recentMenu menu for managing the recent entries * @param globalSettings the global settings instance * @param mapImageCache the map image cache instance + * @param fileControl the file control */ - public RecentManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @Nullable final JMenu recentMenu, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache) { + public RecentManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @Nullable final JMenu recentMenu, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { this.mapViewsManager = mapViewsManager; this.recentMenu = recentMenu; this.globalSettings = globalSettings; this.mapImageCache = mapImageCache; + this.fileControl = fileControl; mapManager.addMapManagerListener(mapManagerListener); } @@ -170,7 +179,7 @@ } final String title = mapModel.getMapArchObject().getMapName(); - final Recent<G, A, R> recent = new Recent<G, A, R>(title, mapFile, globalSettings, mapViewsManager, mapImageCache); + final Recent<G, A, R> recent = new Recent<G, A, R>(title, mapFile, globalSettings, mapViewsManager, mapImageCache, fileControl); recents.remove(recent); // remove old entry to get new entry at first pos. recents.addFirst(recent); // Now remove those that are too many. @@ -211,7 +220,7 @@ public void initRecent() { final int numRecents = prefs.getInt("recentNum", 0); for (int i = 0; i < numRecents; i++) { - recents.add(new Recent<G, A, R>(i + 1, globalSettings, mapViewsManager, mapImageCache)); + recents.add(new Recent<G, A, R>(i + 1, globalSettings, mapViewsManager, mapImageCache, fileControl)); } updateRecent(recents); } @@ -259,6 +268,12 @@ private final MapImageCache<G, A, R> mapImageCache; /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + + /** * The map file. */ @NotNull @@ -271,14 +286,16 @@ * @param globalSettings the global settings instance * @param mapViewsManager the map views manager instance * @param mapImageCache the map image cache instance + * @param fileControl the file control */ - Recent(final String title, final File mapFile, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache) { + Recent(final String title, final File mapFile, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { super(title); this.mapFile = mapFile; this.title = title; this.globalSettings = globalSettings; this.mapViewsManager = mapViewsManager; this.mapImageCache = mapImageCache; + this.fileControl = fileControl; putValue(SHORT_DESCRIPTION, ACTION_BUILDER.format("recentItem.shortdescriptionformat", title, getShortFileName())); putValue(SMALL_ICON, getIcon()); } @@ -289,11 +306,13 @@ * @param globalSettings the global settings instance * @param mapViewsManager the map views manager instance * @param mapImageCache the map image cache instance + * @param fileControl the file control */ - Recent(final int index, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache) { + Recent(final int index, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { this.globalSettings = globalSettings; this.mapViewsManager = mapViewsManager; this.mapImageCache = mapImageCache; + this.fileControl = fileControl; title = prefs.get("recentTitle[" + Integer.toString(index - 1) + ']', null); mapFile = new File(prefs.get("recentFilename[" + Integer.toString(index - 1) + ']', null)); putValue(SHORT_DESCRIPTION, ACTION_BUILDER.format("recentItem.shortdescriptionformat", title, getShortFileName())); @@ -342,7 +361,11 @@ /** {@inheritDoc} */ @Override public void actionPerformed(final ActionEvent e) { - mapViewsManager.openMapFileWithView(mapFile, null); + try { + mapViewsManager.openMapFileWithView(mapFile, null); + } catch (final IOException ex) { + fileControl.reportLoadError(mapFile, ex.getMessage()); + } } /** Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -43,6 +43,7 @@ import net.sf.gridarta.mapfiles.MapFile; import net.sf.gridarta.mapfiles.MapFolder; import net.sf.gridarta.mapfiles.MapFolderTree; +import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -128,6 +129,12 @@ @NotNull private final MapViewsManager<G, A, R> mapViewsManager; + /** + * The {@link FileControl} to use. + */ + @NotNull + private FileControl<G, A, R> fileControl; + /** Action called for "add new pickmap". */ private final Action aAddNewPickmap = ACTION_BUILDER.createAction(true, "addNewPickmap", this); @@ -331,6 +338,11 @@ mapManager.addMapManagerListener(mapManagerListener); } + @Deprecated + public void setFileControl(@NotNull final FileControl<G, A, R> fileControl) { + this.fileControl = fileControl; + } + /** * Add a new pickmap. * @param mapSize the pickmap size in squares @@ -527,7 +539,12 @@ public void openPickmapMap() { final MapFile<G, A, R> mapFile = getOpenPickmapMap(); if (mapFile != null) { - mapViewsManager.openMapFileWithView(mapFile.getFile(), null); + final File file = mapFile.getFile(); + try { + mapViewsManager.openMapFileWithView(file, null); + } catch (final IOException ex) { + fileControl.reportLoadError(file, ex.getMessage()); + } } } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -399,6 +399,7 @@ scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, FileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); final MapManagerActions<G, A, R> mapManagerActions = new MapManagerActions<G, A, R>(fileControl); @@ -415,7 +416,7 @@ final ExitMatcher<G, A, R> exitMatcher = new ExitMatcher<G, A, R>(exitGameObjectMatcher); final MapPathNormalizer mapPathNormalizer = new MapPathNormalizer(globalSettings); final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer, mapViewsManager); - new DefaultMapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, FileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager); + new DefaultMapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, FileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); final LockedItemsControl<G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); @@ -481,7 +482,7 @@ log.warn("'main' menu bar does not define 'recent' menu."); recentManager = null; } else { - recentManager = new RecentManager<G, A, R>(mapManager, mapViewsManager, recentMenu, globalSettings, mapImageCache); + recentManager = new RecentManager<G, A, R>(mapManager, mapViewsManager, recentMenu, globalSettings, mapImageCache, fileControl); } final JMenu analyzeMenu = getMenu(menuBar, "analyze"); if (analyzeMenu == null) { @@ -596,9 +597,10 @@ * Loads a map file. * @param file the file to load * @return the map view of the loaded file or <code>null</code> + * @throws IOException if an I/O error occurs */ - @Nullable - public MapView<G, A, R> openFile(@NotNull final File file) { + @NotNull + public MapView<G, A, R> openFile(@NotNull final File file) throws IOException { final boolean isScriptFile = file.getName().toLowerCase().endsWith(scriptExtension); if (file.isFile()) { if (isScriptFile) { @@ -657,7 +659,12 @@ */ public void openFiles(final Iterable<String> filenames) { for (final String filename : filenames) { - openFile(new File(filename)); + final File file = new File(filename); + try { + openFile(file); + } catch (final IOException ex) { + fileControl.reportLoadError(file, ex.getMessage()); + } } } Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -151,15 +151,11 @@ } /** - * Load a map file. - * @param file the map file to load - * @param isInteractive if set, may ask to delete undefined archetypes; if - * unset, keep undefined archetypes - * @return the map control, or <code>null</code> if loading failed + * {@inheritDoc} */ - @Nullable + @NotNull @Override - public MapControl<G, A, R> openMapFile(@NotNull final File file, final boolean isInteractive) { + public MapControl<G, A, R> openMapFile(@NotNull final File file, final boolean isInteractive) throws IOException { // First look whether the file isn't already open. // If so, return the previously loaded map. try { @@ -178,10 +174,6 @@ } final MapReader<G, A> decoder = decodeMapFile(file, isInteractive); - if (decoder == null) { - return null; - } - return newMap(decoder.getGameObjects(), decoder.getMapArchObject(), file, isInteractive); } @@ -192,22 +184,15 @@ * unset, keep undefined archetypes * @return the decoder objects containing the loaded map data, or * <code>null</code> if loading failed + * @throws IOException if an I/O error occurs */ - @Nullable - private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean isInteractive) { + @NotNull + private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean isInteractive) throws IOException { final MapReader<G, A> decoder; try { decoder = mapReaderFactory.newMapReader(file); - } catch (final IOException e) { - if (isInteractive) { - fileControl.reportLoadError(file, e.getMessage()); - } - return null; } catch (final OutOfMemoryError ignore) { - if (isInteractive) { - fileControl.reportOutOfMemory(file); - } - return null; + throw new IOException("out of memory"); } int outOfMapBoundsDeleted = 0; @@ -354,17 +339,13 @@ /** {@inheritDoc} */ @Override - public void revert(@NotNull final MapControl<G, A, R> mapControl) { + public void revert(@NotNull final MapControl<G, A, R> mapControl) throws IOException { final File mapFile = mapControl.getMapModel().getMapFile(); if (mapFile == null) { return; } final MapReader<G, A> decoder = decodeMapFile(mapFile, false); - if (decoder == null) { - return; - } - final MapModel<G, A, R> mapModel = mapControl.getMapModel(); final A mapArchObject = mapModel.getMapArchObject(); mapModel.beginTransaction("revert"); Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -192,7 +192,11 @@ scriptEditControl.openScriptFile(file.getAbsolutePath()); } else { globalSettings.setCurrentDirectory(dir); - mapViewsManager.openMapFileWithView(file, null); + try { + mapViewsManager.openMapFileWithView(file, null); + } catch (final IOException ex) { + reportLoadError(file, ex.getMessage()); + } } } else if (!file.exists()) { if (isScriptFile) { Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:15:12 UTC (rev 7663) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:40:26 UTC (rev 7664) @@ -20,6 +20,7 @@ package net.sf.gridarta.mapmanager; import java.io.File; +import java.io.IOException; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -41,9 +42,10 @@ * @param isInteractive if set, may ask to delete undefined archetypes; if * unset, keep undefined archetypes * @return the map control, or <code>null</code> if loading failed + * @throws IOException if an I/O error occurs */ - @Nullable - MapControl<G, A, R> openMapFile(@NotNull File file, final boolean isInteractive); + @NotNull + MapControl<G, A, R> openMapFile(@NotNull File file, final boolean isInteractive) throws IOException; /** * Closes the given map, ignoring modified status. @@ -120,8 +122,9 @@ /** * Reverts one map. * @param mapControl the map to revert + * @throws IOException if an I/O error occurs */ - void revert(@NotNull MapControl<G, A, R> mapControl); + void revert(@NotNull MapControl<G, A, R> mapControl) throws IOException ; /** * Returns a guess for a script directory to use. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 02:15:18
|
Revision: 7663 http://gridarta.svn.sourceforge.net/gridarta/?rev=7663&view=rev Author: akirschbaum Date: 2010-04-29 02:15:12 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Make function private. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:13:06 UTC (rev 7662) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:15:12 UTC (rev 7663) @@ -194,7 +194,7 @@ * <code>null</code> if loading failed */ @Nullable - public MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean isInteractive) { + private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean isInteractive) { final MapReader<G, A> decoder; try { decoder = mapReaderFactory.newMapReader(file); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 02:13:13
|
Revision: 7662 http://gridarta.svn.sourceforge.net/gridarta/?rev=7662&view=rev Author: akirschbaum Date: 2010-04-29 02:13:06 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Remove MapManager.hasOpenedMap(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:10:51 UTC (rev 7661) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:13:06 UTC (rev 7662) @@ -123,12 +123,6 @@ protected abstract MapControl<G, A, R> createMapControl(@Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final File file); /** {@inheritDoc} */ - @Override - public boolean hasOpenedMap() { - return !mapControls.isEmpty(); - } - - /** {@inheritDoc} */ @Nullable @Override public MapControl<G, A, R> getOpenMap() { Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:10:51 UTC (rev 7661) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:13:06 UTC (rev 7662) @@ -93,13 +93,6 @@ MapControl<G, A, R> getCurrentMap(); /** - * Return whether at least one opened map exists. - * @return <code>true</code> if at least one opened map exists, or - * <code>false</code> if no opened map exists - */ - boolean hasOpenedMap(); - - /** * Returns one open map. * @return the map or <code>null</code> if no open maps exist */ Modified: trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java 2010-04-29 02:10:51 UTC (rev 7661) +++ trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java 2010-04-29 02:13:06 UTC (rev 7662) @@ -110,10 +110,10 @@ /** Perform an update. */ public void update() { - if (mapManager.hasOpenedMap()) { + if (mapManager.getOpenedMaps().isEmpty()) { + new Thread(new Updater(parentComponent, exiter, updateFileName)).start(); + } else { ACTION_BUILDER.showMessageDialog(parentComponent, "updateCloseMaps"); - } else { - new Thread(new Updater(parentComponent, exiter, updateFileName)).start(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 02:10:58
|
Revision: 7661 http://gridarta.svn.sourceforge.net/gridarta/?rev=7661&view=rev Author: akirschbaum Date: 2010-04-29 02:10:51 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Rename function name. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -449,7 +449,7 @@ selectedGameObject = gameObjectAttributesModel.getSelectedGameObject(); refreshDisplay(); - currentMapControl = mapManager.getCurrentMapControl(); + currentMapControl = mapManager.getCurrentMap(); if (currentMapControl != null) { final MapModel<G, A, R> mapModel = currentMapControl.getMapModel(); mapModel.addMapModelListener(mapModelListener); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/WarningsTab.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -161,7 +161,7 @@ super(gameObjectAttributesModel); this.mapViewsManager = mapViewsManager; errorListView = new ErrorListView<G, A, R>(selectedSquareView); - final MapControl<G, A, R> mapControl = mapManager.getCurrentMapControl(); + final MapControl<G, A, R> mapControl = mapManager.getCurrentMap(); currentMapModel = mapControl == null ? null : mapControl.getMapModel(); if (currentMapModel != null) { currentMapModel.addMapModelListener(mapModelListener); Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -234,7 +234,7 @@ this.fileControl = fileControl; this.mainView = mainView; mapManager.addMapManagerListener(mapManagerListener); - currentMapControl = mapManager.getCurrentMapControl(); + currentMapControl = mapManager.getCurrentMap(); if (currentMapControl != null) { currentMapControl.getMapModel().addMapModelListener(mapModelListener); } Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -51,7 +51,7 @@ if (value instanceof MapControl) { newVal = (((MapControl<?, ?, ?>) value).getMapModel().getMapArchObject().getMapName()); } else { - final MapControl<?, ?, ?> mapControl = mapManager.getCurrentMapControl(); + final MapControl<?, ?, ?> mapControl = mapManager.getCurrentMap(); final String mapName = mapControl != null ? mapControl.getMapModel().getMapArchObject().getMapName() : ""; newVal = "Current - " + mapName; } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -439,7 +439,7 @@ aReloadFaces = ACTION_BUILDER.createAction(true, "reloadFaces", this); aValidateMap = ACTION_BUILDER.createAction(true, "validateMap", this); mapManager.addMapManagerListener(mapManagerListener); - currentMapControl = mapManager.getCurrentMapControl(); + currentMapControl = mapManager.getCurrentMap(); mapViewManager.addMapViewManagerListener(mapViewManagerListener); currentMapView = mapViewManager.getActiveMapView(); archetypeSet.addArchetypeSetListener(archetypeSetListener); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -555,7 +555,7 @@ /** Calls for zooming preview tool. */ public void zoom() { - final MapControl<G, A, R> mapControl = mapManager.getCurrentMapControl(); + final MapControl<G, A, R> mapControl = mapManager.getCurrentMap(); if (mapControl == null) { JOptionPane.showMessageDialog(mainViewFrame, "No map loaded! Please load a map!!", "Error", JOptionPane.ERROR_MESSAGE); return; @@ -713,7 +713,7 @@ */ @ActionMethod public void cleanCompletelyBlockedSquares() { - final MapControl<G, A, R> mapControl = mapManager.getCurrentMapControl(); + final MapControl<G, A, R> mapControl = mapManager.getCurrentMap(); if (mapControl == null) { return; } Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -283,7 +283,7 @@ */ @Nullable @Override - public MapControl<G, A, R> getCurrentMapControl() { + public MapControl<G, A, R> getCurrentMap() { return currentMapControl; } Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -90,7 +90,7 @@ * @return The current map. */ @Nullable - MapControl<G, A, R> getCurrentMapControl(); + MapControl<G, A, R> getCurrentMap(); /** * Return whether at least one opened map exists. Modified: trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java =================================================================== --- trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java 2010-04-29 02:09:26 UTC (rev 7660) +++ trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java 2010-04-29 02:10:51 UTC (rev 7661) @@ -72,7 +72,7 @@ public Object getValue() { final String s = (String) super.getValue(); if ("[Current Map]".equals(s)) { - return mapManager.getCurrentMapControl(); + return mapManager.getCurrentMap(); } for (final MapControl<G, A, R> mapControl : mapManager.getOpenedMaps()) { @@ -81,7 +81,7 @@ } } - return mapManager.getCurrentMapControl(); + return mapManager.getCurrentMap(); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 02:09:33
|
Revision: 7660 http://gridarta.svn.sourceforge.net/gridarta/?rev=7660&view=rev Author: akirschbaum Date: 2010-04-29 02:09:26 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Move MapManager.confirmSaveChanges() to FileControl. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -49,6 +50,12 @@ private final MapManager<G, A, R> mapManager; /** + * The {@link FileControl} to use. + */ + @NotNull + private FileControl<G, A, R> fileControl; + + /** * The {@link MapViewFactory} to use. */ @NotNull @@ -153,6 +160,11 @@ pickmapManager.addMapManagerListener(mapManagerListener); } + @Deprecated + public void setFileControl(@NotNull final FileControl<G, A, R> fileControl) { + this.fileControl = fileControl; + } + /** * Adds a {@link MapViewsListener} to be notified of events. * @param mapControl the map control to attach to @@ -291,7 +303,7 @@ public void closeMapView(@NotNull final MapView<G, A, R> mapView) { final MapControl<G, A, R> mapControl = mapView.getMapControl(); if (getMapViews(mapControl) <= 1) { - if (!mapManager.confirmSaveChanges(mapControl)) { + if (!fileControl.confirmSaveChanges(mapControl)) { return; } closeView(mapView); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -399,6 +399,7 @@ scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, FileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + mapViewsManager.setFileControl(fileControl); new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); final MapManagerActions<G, A, R> mapManagerActions = new MapManagerActions<G, A, R>(fileControl); new MainActions<G, A, R>(replaceDialogManager, mainViewFrame, globalSettings, validators, mapViewSettings, archetypeSet, copyBuffer, copyBufferMapModel, objectChooser, mapManager, mapViewManager, resources, faceObjectProviders, gameObjectFactory, insertionModeSet, exiter); Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -25,7 +25,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import javax.swing.JOptionPane; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReader; @@ -147,23 +146,6 @@ /** {@inheritDoc} */ @Override - public boolean confirmSaveChanges(@NotNull final MapControl<G, A, R> mapControl) { - if (mapControl.getMapModel().isModified()) { - final int result = fileControl.confirmSaveChanges(mapControl.getMapModel().getMapArchObject().getMapName()); - if (result == JOptionPane.YES_OPTION) { - if (!fileControl.save(mapControl)) { - return false; - } - } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) { - return false; - } - } - - return true; - } - - /** {@inheritDoc} */ - @Override public void closeMap(@NotNull final MapControl<G, A, R> mapControl) { fireMapClosingEvent(mapControl); assert mapControl.getUseCounter() <= 0; Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -241,7 +241,7 @@ break; } - if (!mapManager.confirmSaveChanges(mapControl)) { + if (!confirmSaveChanges(mapControl)) { return false; } @@ -312,8 +312,19 @@ /** {@inheritDoc} */ @Override - public int confirmSaveChanges(@NotNull final String mapName) { - return ACTION_BUILDER.showConfirmDialog(parent, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", mapName); + public boolean confirmSaveChanges(@NotNull final MapControl<G, A, R> mapControl) { + if (mapControl.getMapModel().isModified()) { + final int result = ACTION_BUILDER.showConfirmDialog(parent, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", mapControl.getMapModel().getMapArchObject().getMapName()); + if (result == JOptionPane.YES_OPTION) { + if (!save(mapControl)) { + return false; + } + } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) { + return false; + } + } + + return true; } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -63,7 +63,13 @@ */ boolean saveAs(@NotNull MapControl<G, A, R> mapControl); - int confirmSaveChanges(@NotNull String mapName); + /** + * Asks the user whether to save changes of a map. Returns + * <code>true</code> (and does not ask the user) if the map is unmodified. + * @param mapControl the map + * @return whether closing the map is allowed + */ + boolean confirmSaveChanges(@NotNull MapControl<G, A, R> mapControl); /** * Reports an error while saving a map file to the user. Modified: trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -46,14 +46,6 @@ MapControl<G, A, R> openMapFile(@NotNull File file, final boolean isInteractive); /** - * Asks the user whether to save changes of a map. Returns - * <code>true</code> (and does not ask the user) if the map is unmodified. - * @param mapControl the map - * @return whether closing the map is allowed - */ - boolean confirmSaveChanges(@NotNull MapControl<G, A, R> mapControl); - - /** * Closes the given map, ignoring modified status. * @param mapControl the map to close */ Modified: trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java =================================================================== --- trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java 2010-04-29 00:36:56 UTC (rev 7659) +++ trunk/src/test/net/sf/gridarta/mapmanager/TestFileControl.java 2010-04-29 02:09:26 UTC (rev 7660) @@ -70,7 +70,7 @@ /** {@inheritDoc} */ @Override - public int confirmSaveChanges(@NotNull final String mapName) { + public boolean confirmSaveChanges(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-29 00:37:05
|
Revision: 7659 http://gridarta.svn.sourceforge.net/gridarta/?rev=7659&view=rev Author: akirschbaum Date: 2010-04-29 00:36:56 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Rename 'level' to 'map'. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.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/FlatPickmapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/gui/map/mapactions/DefaultMapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/RendererFactory.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/model/map/mapcontrol/DefaultMapControl.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControl.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java Added Paths: ----------- trunk/atrinik/resource/icons/NewMapIcon.gif trunk/atrinik/resource/icons/NewMapSmallIcon.gif trunk/atrinik/resource/icons/OpenMapIcon.gif trunk/atrinik/resource/icons/OpenMapSmallIcon.gif trunk/atrinik/resource/icons/SaveMapAsIcon.gif trunk/atrinik/resource/icons/SaveMapIcon.gif trunk/crossfire/resource/icons/NewMapIcon.gif trunk/crossfire/resource/icons/OpenMaplIcon.gif trunk/crossfire/resource/icons/SaveMapAsIcon.gif trunk/crossfire/resource/icons/SaveMapIcon.gif 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/SimpleFlatMapRenderer.java trunk/daimonin/resource/icons/NewMapIcon.gif trunk/daimonin/resource/icons/NewMapSmallIcon.gif trunk/daimonin/resource/icons/OpenMapIcon.gif trunk/daimonin/resource/icons/OpenMapSmallIcon.gif trunk/daimonin/resource/icons/SaveMapAsIcon.gif trunk/daimonin/resource/icons/SaveMapIcon.gif trunk/resource/icons/SaveMapAsSmallIcon.gif trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java Removed Paths: ------------- trunk/atrinik/resource/icons/NewLevelIcon.gif trunk/atrinik/resource/icons/NewLevelSmallIcon.gif trunk/atrinik/resource/icons/OpenLevelIcon.gif trunk/atrinik/resource/icons/OpenLevelSmallIcon.gif trunk/atrinik/resource/icons/SaveLevelAsIcon.gif trunk/atrinik/resource/icons/SaveLevelIcon.gif trunk/crossfire/resource/icons/NewLevelIcon.gif trunk/crossfire/resource/icons/OpenLevelIcon.gif trunk/crossfire/resource/icons/SaveLevelAsIcon.gif trunk/crossfire/resource/icons/SaveLevelIcon.gif trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatLevelRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatLevelRenderer.java trunk/daimonin/resource/icons/NewLevelIcon.gif trunk/daimonin/resource/icons/NewLevelSmallIcon.gif trunk/daimonin/resource/icons/OpenLevelIcon.gif trunk/daimonin/resource/icons/OpenLevelSmallIcon.gif trunk/daimonin/resource/icons/SaveLevelAsIcon.gif trunk/daimonin/resource/icons/SaveLevelIcon.gif trunk/resource/icons/SaveLevelAsSmallIcon.gif trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoLevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractLevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoLevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/LevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoLevelRenderer.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestLevelRenderer.java Deleted: trunk/atrinik/resource/icons/NewLevelIcon.gif =================================================================== (Binary files differ) Deleted: trunk/atrinik/resource/icons/NewLevelSmallIcon.gif =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/NewMapIcon.gif (from rev 7657, trunk/atrinik/resource/icons/NewLevelIcon.gif) =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/NewMapSmallIcon.gif (from rev 7657, trunk/atrinik/resource/icons/NewLevelSmallIcon.gif) =================================================================== (Binary files differ) Deleted: trunk/atrinik/resource/icons/OpenLevelIcon.gif =================================================================== (Binary files differ) Deleted: trunk/atrinik/resource/icons/OpenLevelSmallIcon.gif =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/OpenMapIcon.gif (from rev 7657, trunk/atrinik/resource/icons/OpenLevelIcon.gif) =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/OpenMapSmallIcon.gif (from rev 7657, trunk/atrinik/resource/icons/OpenLevelSmallIcon.gif) =================================================================== (Binary files differ) Deleted: trunk/atrinik/resource/icons/SaveLevelAsIcon.gif =================================================================== (Binary files differ) Deleted: trunk/atrinik/resource/icons/SaveLevelIcon.gif =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/SaveMapAsIcon.gif (from rev 7657, trunk/atrinik/resource/icons/SaveLevelAsIcon.gif) =================================================================== (Binary files differ) Copied: trunk/atrinik/resource/icons/SaveMapIcon.gif (from rev 7657, trunk/atrinik/resource/icons/SaveLevelIcon.gif) =================================================================== (Binary files differ) Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-04-28 19:06:17 UTC (rev 7658) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 2010-04-29 00:36:56 UTC (rev 7659) @@ -24,7 +24,8 @@ import net.sf.gridarta.gui.map.renderer.IsoMapRenderer; import net.sf.gridarta.gui.map.renderer.IsoPickmapRenderer; import net.sf.gridarta.gui.map.renderer.RendererFactory; -import net.sf.gridarta.gui.map.renderer.SimpleIsoLevelRenderer; +import net.sf.gridarta.gui.map.renderer.SimpleIsoMapRenderer; +import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; import net.sf.gridarta.model.io.GameObjectParser; @@ -38,7 +39,7 @@ import org.jetbrains.annotations.NotNull; /** - * Factory for creating {@link net.sf.gridarta.gui.map.renderer.LevelRenderer} + * Factory for creating {@link MapRenderer} * instances. * @author Andreas Kirschbaum */ @@ -111,8 +112,8 @@ /** {@inheritDoc} */ @NotNull @Override - public SimpleIsoLevelRenderer<GameObject, MapArchObject, Archetype> newSimpleLevelRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { - return new SimpleIsoLevelRenderer<GameObject, MapArchObject, Archetype>(Archetype.TYPE_SPAWN_POINT, mapModel, multiPositionData, isoMapSquareInfo, systemIcons.getUnknownSquareIcon()); + public SimpleIsoMapRenderer<GameObject, MapArchObject, Archetype> newSimpleMapRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { + return new SimpleIsoMapRenderer<GameObject, MapArchObject, Archetype>(Archetype.TYPE_SPAWN_POINT, mapModel, multiPositionData, isoMapSquareInfo, systemIcons.getUnknownSquareIcon()); } /** {@inheritDoc} */ Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-04-28 19:06:17 UTC (rev 7658) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-04-29 00:36:56 UTC (rev 7659) @@ -99,9 +99,9 @@ private final JTextField mapBackgroundMusic = new JTextField(); // name of soundfile - private final JFormattedTextField levelWidthField = new JFormattedTextField(); // len x + private final JFormattedTextField mapWidthField = new JFormattedTextField(); // len x - private final JFormattedTextField levelHeightField = new JFormattedTextField(); // len y + private final JFormattedTextField mapHeightField = new JFormattedTextField(); // len y private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor @@ -306,18 +306,18 @@ mapPanel.add(mapRegion, gbc); mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapWidth")), labelGbc); - levelWidthField.setColumns(5); - levelWidthField.setValue(mapModel.getMapSize().getWidth()); + mapWidthField.setColumns(5); + mapWidthField.setValue(mapModel.getMapSize().getWidth()); gbc.gridwidth = 1; gbc.weightx = 1.0; - mapPanel.add(levelWidthField, gbc); + mapPanel.add(mapWidthField, gbc); mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapHeight")), labelGbc); - levelHeightField.setColumns(5); - levelHeightField.setValue(mapModel.getMapSize().getHeight()); + mapHeightField.setColumns(5); + mapHeightField.setValue(mapModel.getMapSize().getHeight()); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 1.0; - mapPanel.add(levelHeightField, gbc); + mapPanel.add(mapHeightField, gbc); final Container p2 = new JPanel(new GridBagLayout()); gbc.gridwidth = 1; @@ -422,8 +422,8 @@ } /** - * Checks the given values and modifies the current level. - * @return <code>true</code> if the level properties were edited, + * Checks the given values and modifies the current map. + * @return <code>true</code> if the map properties were edited, * <code>false</code> if the parameters were wrong. */ private boolean modifyMapProperties() { @@ -437,8 +437,8 @@ final int enterY; try { // try to parse everything - final int width = parseProperty(levelWidthField.getText(), "Width"); - final int height = parseProperty(levelHeightField.getText(), "Height"); + final int width = parseProperty(mapWidthField.getText(), "Width"); + final int height = parseProperty(mapHeightField.getText(), "Height"); enterX = parseProperty(fieldEnterX.getText(), "Enter X"); enterY = parseProperty(fieldEnterY.getText(), "Enter Y"); swapTime = parseProperty(fieldSwapTime.getText(), "Swap Time"); @@ -543,8 +543,8 @@ mapName.setText(map.getMapName()); mapRegion.setText(map.getRegion()); mapBackgroundMusic.setText(map.getBackgroundMusic()); - levelWidthField.setText(Integer.toString(map.getMapSize().getWidth())); - levelHeightField.setText(Integer.toString(map.getMapSize().getHeight())); + mapWidthField.setText(Integer.toString(map.getMapSize().getWidth())); + mapHeightField.setText(Integer.toString(map.getMapSize().getHeight())); fieldEnterX.setText(Integer.toString(map.getEnterX())); fieldEnterY.setText(Integer.toString(map.getEnterY())); fieldSwapTime.setText(Integer.toString(map.getSwapTime())); Deleted: trunk/crossfire/resource/icons/NewLevelIcon.gif =================================================================== (Binary files differ) Copied: trunk/crossfire/resource/icons/NewMapIcon.gif (from rev 7657, trunk/crossfire/resource/icons/NewLevelIcon.gif) =================================================================== (Binary files differ) Deleted: trunk/crossfire/resource/icons/OpenLevelIcon.gif =================================================================== (Binary files differ) Copied: trunk/crossfire/resource/icons/OpenMaplIcon.gif (from rev 7657, trunk/crossfire/resource/icons/OpenLevelIcon.gif) =================================================================== (Binary files differ) Deleted: trunk/crossfire/resource/icons/SaveLevelAsIcon.gif =================================================================== (Binary files differ) Deleted: trunk/crossfire/resource/icons/SaveLevelIcon.gif =================================================================== (Binary files differ) Copied: trunk/crossfire/resource/icons/SaveMapAsIcon.gif (from rev 7657, trunk/crossfire/resource/icons/SaveLevelAsIcon.gif) =================================================================== (Binary files differ) Copied: trunk/crossfire/resource/icons/SaveMapIcon.gif (from rev 7657, trunk/crossfire/resource/icons/SaveLevelIcon.gif) =================================================================== (Binary files differ) Deleted: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatLevelRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatLevelRenderer.java 2010-04-28 19:06:17 UTC (rev 7658) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatLevelRenderer.java 2010-04-29 00:36:56 UTC (rev 7659) @@ -1,529 +0,0 @@ -/* - * 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.var.crossfire.gui.map.renderer; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.image.BufferedImage; -import java.io.File; -import java.util.Collection; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import net.sf.gridarta.gui.map.renderer.AbstractLevelRenderer; -import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.map.grid.MapGrid; -import net.sf.gridarta.model.map.grid.MapGridEvent; -import net.sf.gridarta.model.map.grid.MapGridListener; -import net.sf.gridarta.model.map.mapmodel.MapModel; -import net.sf.gridarta.model.map.mapmodel.MapModelListener; -import net.sf.gridarta.model.map.mapmodel.MapSquare; -import net.sf.gridarta.model.map.validation.ErrorCollector; -import net.sf.gridarta.model.map.validation.errors.ValidationError; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; -import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; -import net.sf.gridarta.utils.Size2D; -import net.sf.gridarta.var.crossfire.IGUIConstants; -import net.sf.gridarta.var.crossfire.model.archetype.Archetype; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * This is the default renderer of a map. It visualizes selections and - * validation errors. - * @author unknown - * @author <a href="mailto:ch...@ri...">Christian Hujer</a>. - * @author Andreas Kirschbaum - */ -public abstract class AbstractFlatLevelRenderer extends AbstractLevelRenderer<GameObject, MapArchObject, Archetype> { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ - @NotNull - protected final Point borderOffset = new Point(); - - /** - * The {@link MapModel} to render. - */ - @NotNull - private final MapModel<GameObject, MapArchObject, Archetype> mapModel; - - /** - * The {@link GridMapSquarePainter} to use. - */ - @NotNull - private final GridMapSquarePainter gridMapSquarePainter; - - @NotNull - private Size2D mapSize; - - @NotNull - private final MapGrid mapGrid; - - /** Used to avoid creation millions of points. */ - @NotNull - private final Point tmpPoint = new Point(); - - /** - * The {@link MapViewSettings} instance to use. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - @NotNull - private final Rectangle tmpRec = new Rectangle(); - - /** - * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. - */ - @NotNull - private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { - - /** {@inheritDoc} */ - @Override - public void gridVisibleChanged(final boolean gridVisible) { - forceRepaint(); - } - - /** {@inheritDoc} */ - @Override - public void smoothingChanged(final boolean smoothing) { - forceRepaint(); - } - - /** {@inheritDoc} */ - @Override - public void doubleFacesChanged(final boolean doubleFaces) { - // does not render double faces - } - - /** {@inheritDoc} */ - @Override - public void alphaTypeChanged(final int alphaType) { - // does not render alpha types - } - - /** {@inheritDoc} */ - @Override - public void editTypeChanged(final int editType) { - // changed game objects will be rendered - } - - /** {@inheritDoc} */ - @Override - public void autojoinChanged(final boolean autojoin) { - // does not affect rendering - } - - }; - - /** The map model listener to track changes in {@link #mapModel}. */ - @NotNull - private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { - - /** {@inheritDoc} */ - @Override - public void mapSizeChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final Size2D newSize) { - // ignore: will trigger an mapGridChanged() callback - } - - /** {@inheritDoc} */ - @Override - public void mapSquaresChanged(@NotNull final Set<MapSquare<GameObject, MapArchObject, Archetype>> mapSquares) { - final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); - for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : mapSquares) { - getSquaresToRepaint(mapSquare, toRepaint); - } - for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : toRepaint) { - paintSquare(mapSquare); - } - } - - /** {@inheritDoc} */ - @Override - public void mapObjectsChanged(@NotNull final Set<GameObject> gameObjects, @NotNull final Set<GameObject> transientGameObjects) { - final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); - for (final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> gameObject : gameObjects) { - if (!gameObject.isInContainer()) { - final MapSquare<GameObject, MapArchObject, Archetype> square = gameObject.getMapSquare(); - if (square != null) { - getSquaresToRepaint(square, toRepaint); - } - } - } - for (final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> gameObject : transientGameObjects) { - if (!gameObject.isInContainer()) { - final MapSquare<GameObject, MapArchObject, Archetype> square = gameObject.getMapSquare(); - if (square != null) { - getSquaresToRepaint(square, toRepaint); - } - } - } - for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : toRepaint) { - paintSquare(mapSquare); - } - } - - /** - * Determines the map squares to repaint. - * @param mapSquare the map square - * @param toRepaint the map squares to repaint; new map squares may be - * added - */ - private void getSquaresToRepaint(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> mapSquare, @NotNull final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint) { - if (mapViewSettings.isSmoothing()) { - final Point point = new Point(); - for (point.x = mapSquare.getMapX() - 1; point.x <= mapSquare.getMapX() + 1; point.x++) { - for (point.y = mapSquare.getMapY() - 1; point.y <= mapSquare.getMapY() + 1; point.y++) { - if (mapModel.isPointValid(point)) { - toRepaint.add(mapModel.getMapSquare(point)); - } - } - } - } else { - toRepaint.add(mapSquare); - } - } - - /** {@inheritDoc} */ - @Override - public void mapMetaChanged() { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void errorsChanged(@NotNull final ErrorCollector<GameObject, MapArchObject, Archetype> errors) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapFileChanged(@Nullable final File oldMapFile) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void modifiedChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { - // ignore - } - - }; - - /** The map grid listener to track changes in {@link #mapGrid}. */ - @NotNull - private final MapGridListener mapGridListener = new MapGridListener() { - - /** {@inheritDoc} */ - @Override - public void mapGridChanged(@NotNull final MapGridEvent e) { - final Rectangle recChange = mapGrid.getRecChange(); - updateSquares(recChange); - repaint(0L, borderOffset.x + recChange.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + recChange.y * IGUIConstants.SQUARE_HEIGHT, recChange.width * IGUIConstants.SQUARE_WIDTH, recChange.height * IGUIConstants.SQUARE_HEIGHT); - } - - /** {@inheritDoc} */ - @Override - public void mapGridResized(@NotNull final MapGridEvent e) { - resizeMapGrid(); - } - - }; - - /** - * Create a DefaultLevelRenderer. - * @param mapViewSettings the map view settings instance to use - * @param mapModel the map model to render - * @param mapGrid Grid to render - * @param borderSize the size of the map borders in pixel - * @param gridMapSquarePainter the grid square painter to use - * @param gameObjectParser the game object parser for creating tooltip - * information - */ - protected AbstractFlatLevelRenderer(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final MapGrid mapGrid, final int borderSize, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - super(mapModel, gameObjectParser); - this.mapViewSettings = mapViewSettings; - this.mapModel = mapModel; - this.gridMapSquarePainter = gridMapSquarePainter; - mapSize = this.mapModel.getMapSize(); - this.mapGrid = mapGrid; - - mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); - - setToolTipText("dummy"); - setFocusable(true); - borderOffset.setLocation(borderSize, borderSize); - } - - /** Finish initialization of this instance. */ - protected void init() { - resizeMapGrid(); - mapModel.addMapModelListener(mapModelListener); - mapGrid.addMapGridListener(mapGridListener); - } - - /** {@inheritDoc} */ - @Override - public void closeNotify() { - mapModel.removeMapModelListener(mapModelListener); - mapGrid.removeMapGridListener(mapGridListener); - mapViewSettings.removeMapViewSettingsListener(mapViewSettingsListener); - } - - /** {@inheritDoc} */ - @NotNull - @Override - public BufferedImage getFullImage() { - final int viewWidth = IGUIConstants.SQUARE_WIDTH * mapSize.getWidth(); - final int viewHeight = IGUIConstants.SQUARE_HEIGHT * mapSize.getHeight(); - - // first create a storing place for the image - final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); - final Graphics bufGrfx = bufImage.getGraphics(); - bufGrfx.setColor(Color.white); - bufGrfx.fillRect(0, 0, viewWidth, viewHeight); - - // paint the mapview into the image - final Point storeOffset = new Point(borderOffset); - try { - borderOffset.setLocation(0, 0); - paintComponent(bufGrfx, true, false); - } finally { - borderOffset.setLocation(storeOffset); - } - return bufImage; - } - - /** {@inheritDoc} */ - @Override - public abstract void paintComponent(@NotNull final Graphics g); - - /** {@inheritDoc} */ - @Override - public void forceRepaint() { - updateAll(); - repaint(); - } - - /** {@inheritDoc} */ - @NotNull - @Override - public Rectangle getSquareBounds(@NotNull final Point p) { - tmpRec.x = borderOffset.x + p.x * IGUIConstants.SQUARE_WIDTH; - tmpRec.y = borderOffset.y + p.y * IGUIConstants.SQUARE_HEIGHT; - tmpRec.width = IGUIConstants.SQUARE_WIDTH; - tmpRec.height = IGUIConstants.SQUARE_HEIGHT; - return tmpRec; - } - - /** - * Paint one square. - * @param square The square to paint. - */ - private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { - final int x = square.getMapX(); - final int y = square.getMapY(); - updateSquare(new Point(x, y)); - repaint(0L, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); - } - - /** - * Paints this component. - * @param grfx the graphics context to paint to - * @param isSnapshot true when this drawing is for a "screenshot"-image, - * false for normal drawing - * @param checkClip if set, omit squares outside <code>grfx</code>'s clip - * area - */ - protected void paintComponent(@NotNull final Graphics grfx, final boolean isSnapshot, final boolean checkClip) { - grfx.setColor(getBackground()); - grfx.fillRect(0, 0, getWidth(), getHeight()); - paintMap(grfx, checkClip); - if (!isSnapshot) { - paintMapGrid(grfx); - paintMapSelection(grfx); - } - } - - /** - * Paint the grid for one square. The grid is not painted if it is - * disabled. - * @param grfx the graphics context to draw in - * @param point the map coordinates of the square to draw - */ - protected void paintSquareGrid(@NotNull final Graphics grfx, @NotNull final Point point) { - if (mapViewSettings.isGridVisible()) { - grfx.drawLine(borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT); - grfx.drawLine(borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT); - } - } - - /** - * Paint the selection for one square. - * @param grfx the graphics context to draw in - * @param point map coordinates of the square to highlight - */ - protected void paintSquareSelection(@NotNull final Graphics grfx, @NotNull final Point point) { - final int gridFlags = mapGrid.getFlags(point.x, point.y); - gridMapSquarePainter.paint(grfx, gridFlags, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, this); - } - - /** - * Paint the whole map. - * @param grfx the graphics context to draw in - * @param checkClip if set, omit squares outside <code>grfx</code>'s clip - * area - */ - private void paintMap(@NotNull final Graphics grfx, final boolean checkClip) { - for (tmpPoint.y = 0; tmpPoint.y < mapGrid.getSize().getHeight(); tmpPoint.y++) { - final int y = borderOffset.y + tmpPoint.y * IGUIConstants.SQUARE_HEIGHT; - for (tmpPoint.x = 0; tmpPoint.x < mapGrid.getSize().getWidth(); tmpPoint.x++) { - final int x = borderOffset.x + tmpPoint.x * IGUIConstants.SQUARE_WIDTH; - if (!checkClip || grfx.hitClip(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT)) { - paintSquare(grfx, x, y, mapModel.getMapSquare(tmpPoint)); - } - } - } - } - - /** - * Paint the selection for the whole map. It's recommended to paint the - * complete selection after the map itself, otherwise map elements actually - * might hide selections. - * @param grfx Graphics for painting - */ - private void paintMapSelection(@NotNull final Graphics grfx) { - for (tmpPoint.y = 0; tmpPoint.y < mapSize.getHeight(); tmpPoint.y++) { - final int y = borderOffset.y + tmpPoint.y * IGUIConstants.SQUARE_HEIGHT; - for (tmpPoint.x = 0; tmpPoint.x < mapSize.getWidth(); tmpPoint.x++) { - final int x = borderOffset.x + tmpPoint.x * IGUIConstants.SQUARE_WIDTH; - if (grfx.hitClip(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT)) { - paintSquareSelection(grfx, tmpPoint); - } - } - } - } - - /** - * Paint the grid of the whole map. The grid is not painted if it is - * disabled. It's recommended to paint the complete grid after the map - * itself, otherwise map elements actually might hide parts of the grid. - * @param grfx Graphics for painting - */ - private void paintMapGrid(@NotNull final Graphics grfx) { - if (mapViewSettings.isGridVisible()) { - final Size2D tmpMapSize = mapGrid.getSize(); - final int mapWidth = tmpMapSize.getWidth(); - final int mapHeight = tmpMapSize.getHeight(); - for (int x = 0; x <= mapWidth; x++) { - grfx.drawLine(borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + mapHeight * IGUIConstants.SQUARE_HEIGHT); - } - for (int y = 0; y <= mapHeight; y++) { - grfx.drawLine(borderOffset.x, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + mapWidth * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT); - } - } - } - - /** {@inheritDoc} */ - @Nullable - @Override - public Point getSquareLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { - final int mapWidth = mapSize.getWidth(); - final int mapHeight = mapSize.getHeight(); - final int xm; - final int ym; - if (point.x >= borderOffset.x && point.x < mapWidth * IGUIConstants.SQUARE_WIDTH + borderOffset.x && point.y >= borderOffset.y && point.y < mapHeight * IGUIConstants.SQUARE_HEIGHT + borderOffset.y) { - xm = (point.x - borderOffset.x) / IGUIConstants.SQUARE_WIDTH; - ym = (point.y - borderOffset.y) / IGUIConstants.SQUARE_HEIGHT; - } else { - xm = -1; - ym = -1; - } - - if (xm < 0 || xm >= mapWidth || ym < 0 || ym >= mapHeight) { - return null; - } - if (retPoint != null) { - retPoint.setLocation(xm, ym); - return retPoint; - } - - return new Point(xm, ym); - } - - /** - * Resize the backing buffer to the new grid size. It will only be resized - * if the map is not a pickmap. - * @param size the new map size - */ - protected abstract void resizeBackBuffer(@NotNull final Dimension size); - - /** - * Paint one square. - * @param grfx the graphics context to draw to - * @param x The square coordinate to paint to. - * @param y The square coordinate to paint to. - * @param square The square to paint. - */ - protected abstract void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square); - - /** Update cached information to new map grid size. */ - private void resizeMapGrid() { - // define how much drawing space we need for the map - mapSize = mapGrid.getSize(); - final Dimension forcedSize = new Dimension(mapSize.getWidth() * IGUIConstants.SQUARE_WIDTH + 2 * borderOffset.x, mapSize.getHeight() * IGUIConstants.SQUARE_HEIGHT + 2 * borderOffset.y); - resizeBackBuffer(forcedSize); - setPreferredSize(forcedSize); - setMinimumSize(forcedSize); - revalidate(); - forceRepaint(); - } - - /** - * Callback function that is called when a square may have changed. - * @param point the coordinate of the changed square - */ - protected abstract void updateSquare(@NotNull final Point point); - - /** - * Callback function that is called when multiple squares may have changed. - * @param rectangle the coordinates of the changed squares - */ - protected abstract void updateSquares(@NotNull final Rectangle rectangle); - - /** Callback function that is called when any square may have changed. */ - protected abstract void updateAll(); - - /** {@inheritDoc} */ - @Override - public void setErroneousArchObjects(@NotNull final Map<GameObject, ValidationError<GameObject, MapArchObject, Archetype>> erroneousArchObjects) { - //XXX: save erroneousArchObjects - } - -} // class AbstractFlatLevelRenderer Copied: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java (from rev 7657, trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatLevelRenderer.java) =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java (rev 0) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-04-29 00:36:56 UTC (rev 7659) @@ -0,0 +1,529 @@ +/* + * 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.var.crossfire.gui.map.renderer; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import net.sf.gridarta.gui.map.renderer.AbstractMapRenderer; +import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.map.grid.MapGrid; +import net.sf.gridarta.model.map.grid.MapGridEvent; +import net.sf.gridarta.model.map.grid.MapGridListener; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.model.map.mapmodel.MapModelListener; +import net.sf.gridarta.model.map.mapmodel.MapSquare; +import net.sf.gridarta.model.map.validation.ErrorCollector; +import net.sf.gridarta.model.map.validation.errors.ValidationError; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; +import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; +import net.sf.gridarta.utils.Size2D; +import net.sf.gridarta.var.crossfire.IGUIConstants; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; +import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * This is the default renderer of a map. It visualizes selections and + * validation errors. + * @author unknown + * @author <a href="mailto:ch...@ri...">Christian Hujer</a>. + * @author Andreas Kirschbaum + */ +public abstract class AbstractFlatMapRenderer extends AbstractMapRenderer<GameObject, MapArchObject, Archetype> { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ + @NotNull + protected final Point borderOffset = new Point(); + + /** + * The {@link MapModel} to render. + */ + @NotNull + private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + + /** + * The {@link GridMapSquarePainter} to use. + */ + @NotNull + private final GridMapSquarePainter gridMapSquarePainter; + + @NotNull + private Size2D mapSize; + + @NotNull + private final MapGrid mapGrid; + + /** Used to avoid creation millions of points. */ + @NotNull + private final Point tmpPoint = new Point(); + + /** + * The {@link MapViewSettings} instance to use. + */ + @NotNull + private final MapViewSettings mapViewSettings; + + @NotNull + private final Rectangle tmpRec = new Rectangle(); + + /** + * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. + */ + @NotNull + private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { + + /** {@inheritDoc} */ + @Override + public void gridVisibleChanged(final boolean gridVisible) { + forceRepaint(); + } + + /** {@inheritDoc} */ + @Override + public void smoothingChanged(final boolean smoothing) { + forceRepaint(); + } + + /** {@inheritDoc} */ + @Override + public void doubleFacesChanged(final boolean doubleFaces) { + // does not render double faces + } + + /** {@inheritDoc} */ + @Override + public void alphaTypeChanged(final int alphaType) { + // does not render alpha types + } + + /** {@inheritDoc} */ + @Override + public void editTypeChanged(final int editType) { + // changed game objects will be rendered + } + + /** {@inheritDoc} */ + @Override + public void autojoinChanged(final boolean autojoin) { + // does not affect rendering + } + + }; + + /** The map model listener to track changes in {@link #mapModel}. */ + @NotNull + private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { + + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final Size2D newSize) { + // ignore: will trigger an mapGridChanged() callback + } + + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<GameObject, MapArchObject, Archetype>> mapSquares) { + final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); + for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : mapSquares) { + getSquaresToRepaint(mapSquare, toRepaint); + } + for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : toRepaint) { + paintSquare(mapSquare); + } + } + + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<GameObject> gameObjects, @NotNull final Set<GameObject> transientGameObjects) { + final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); + for (final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> gameObject : gameObjects) { + if (!gameObject.isInContainer()) { + final MapSquare<GameObject, MapArchObject, Archetype> square = gameObject.getMapSquare(); + if (square != null) { + getSquaresToRepaint(square, toRepaint); + } + } + } + for (final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> gameObject : transientGameObjects) { + if (!gameObject.isInContainer()) { + final MapSquare<GameObject, MapArchObject, Archetype> square = gameObject.getMapSquare(); + if (square != null) { + getSquaresToRepaint(square, toRepaint); + } + } + } + for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : toRepaint) { + paintSquare(mapSquare); + } + } + + /** + * Determines the map squares to repaint. + * @param mapSquare the map square + * @param toRepaint the map squares to repaint; new map squares may be + * added + */ + private void getSquaresToRepaint(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> mapSquare, @NotNull final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint) { + if (mapViewSettings.isSmoothing()) { + final Point point = new Point(); + for (point.x = mapSquare.getMapX() - 1; point.x <= mapSquare.getMapX() + 1; point.x++) { + for (point.y = mapSquare.getMapY() - 1; point.y <= mapSquare.getMapY() + 1; point.y++) { + if (mapModel.isPointValid(point)) { + toRepaint.add(mapModel.getMapSquare(point)); + } + } + } + } else { + toRepaint.add(mapSquare); + } + } + + /** {@inheritDoc} */ + @Override + public void mapMetaChanged() { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<GameObject, MapArchObject, Archetype> errors) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void modifiedChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { + // ignore + } + + }; + + /** The map grid listener to track changes in {@link #mapGrid}. */ + @NotNull + private final MapGridListener mapGridListener = new MapGridListener() { + + /** {@inheritDoc} */ + @Override + public void mapGridChanged(@NotNull final MapGridEvent e) { + final Rectangle recChange = mapGrid.getRecChange(); + updateSquares(recChange); + repaint(0L, borderOffset.x + recChange.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + recChange.y * IGUIConstants.SQUARE_HEIGHT, recChange.width * IGUIConstants.SQUARE_WIDTH, recChange.height * IGUIConstants.SQUARE_HEIGHT); + } + + /** {@inheritDoc} */ + @Override + public void mapGridResized(@NotNull final MapGridEvent e) { + resizeMapGrid(); + } + + }; + + /** + * Creates a new instance. + * @param mapViewSettings the map view settings instance to use + * @param mapModel the map model to render + * @param mapGrid Grid to render + * @param borderSize the size of the map borders in pixel + * @param gridMapSquarePainter the grid square painter to use + * @param gameObjectParser the game object parser for creating tooltip + * information + */ + protected AbstractFlatMapRenderer(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final MapGrid mapGrid, final int borderSize, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { + super(mapModel, gameObjectParser); + this.mapViewSettings = mapViewSettings; + this.mapModel = mapModel; + this.gridMapSquarePainter = gridMapSquarePainter; + mapSize = this.mapModel.getMapSize(); + this.mapGrid = mapGrid; + + mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); + + setToolTipText("dummy"); + setFocusable(true); + borderOffset.setLocation(borderSize, borderSize); + } + + /** Finish initialization of this instance. */ + protected void init() { + resizeMapGrid(); + mapModel.addMapModelListener(mapModelListener); + mapGrid.addMapGridListener(mapGridListener); + } + + /** {@inheritDoc} */ + @Override + public void closeNotify() { + mapModel.removeMapModelListener(mapModelListener); + mapGrid.removeMapGridListener(mapGridListener); + mapViewSettings.removeMapViewSettingsListener(mapViewSettingsListener); + } + + /** {@inheritDoc} */ + @NotNull + @Override + public BufferedImage getFullImage() { + final int viewWidth = IGUIConstants.SQUARE_WIDTH * mapSize.getWidth(); + final int viewHeight = IGUIConstants.SQUARE_HEIGHT * mapSize.getHeight(); + + // first create a storing place for the image + final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); + final Graphics bufGrfx = bufImage.getGraphics(); + bufGrfx.setColor(Color.white); + bufGrfx.fillRect(0, 0, viewWidth, viewHeight); + + // paint the mapview into the image + final Point storeOffset = new Point(borderOffset); + try { + borderOffset.setLocation(0, 0); + paintComponent(bufGrfx, true, false); + } finally { + borderOffset.setLocation(storeOffset); + } + return bufImage; + } + + /** {@inheritDoc} */ + @Override + public abstract void paintComponent(@NotNull final Graphics g); + + /** {@inheritDoc} */ + @Override + public void forceRepaint() { + updateAll(); + repaint(); + } + + /** {@inheritDoc} */ + @NotNull + @Override + public Rectangle getSquareBounds(@NotNull final Point p) { + tmpRec.x = borderOffset.x + p.x * IGUIConstants.SQUARE_WIDTH; + tmpRec.y = borderOffset.y + p.y * IGUIConstants.SQUARE_HEIGHT; + tmpRec.width = IGUIConstants.SQUARE_WIDTH; + tmpRec.height = IGUIConstants.SQUARE_HEIGHT; + return tmpRec; + } + + /** + * Paint one square. + * @param square The square to paint. + */ + private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { + final int x = square.getMapX(); + final int y = square.getMapY(); + updateSquare(new Point(x, y)); + repaint(0L, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); + } + + /** + * Paints this component. + * @param grfx the graphics context to paint to + * @param isSnapshot true when this drawing is for a "screenshot"-image, + * false for normal drawing + * @param checkClip if set, omit squares outside <code>grfx</code>'s clip + * area + */ + protected void paintComponent(@NotNull final Graphics grfx, final boolean isSnapshot, final boolean checkClip) { + grfx.setColor(getBackground()); + grfx.fillRect(0, 0, getWidth(), getHeight()); + paintMap(grfx, checkClip); + if (!isSnapshot) { + paintMapGrid(grfx); + paintMapSelection(grfx); + } + } + + /** + * Paint the grid for one square. The grid is not painted if it is + * disabled. + * @param grfx the graphics context to draw in + * @param point the map coordinates of the square to draw + */ + protected void paintSquareGrid(@NotNull final Graphics grfx, @NotNull final Point point) { + if (mapViewSettings.isGridVisible()) { + grfx.drawLine(borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT); + grfx.drawLine(borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT); + } + } + + /** + * Paint the selection for one square. + * @param grfx the graphics context to draw in + * @param point map coordinates of the square to highlight + */ + protected void paintSquareSelection(@NotNull final Graphics grfx, @NotNull final Point point) { + final int gridFlags = mapGrid.getFlags(point.x, point.y); + gridMapSquarePainter.paint(grfx, gridFlags, borderOffset.x + point.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + point.y * IGUIConstants.SQUARE_HEIGHT, this); + } + + /** + * Paint the whole map. + * @param grfx the graphics context to draw in + * @param checkClip if set, omit squares outside <code>grfx</code>'s clip + * area + */ + private void paintMap(@NotNull final Graphics grfx, final boolean checkClip) { + for (tmpPoint.y = 0; tmpPoint.y < mapGrid.getSize().getHeight(); tmpPoint.y++) { + final int y = borderOffset.y + tmpPoint.y * IGUIConstants.SQUARE_HEIGHT; + for (tmpPoint.x = 0; tmpPoint.x < mapGrid.getSize().getWidth(); tmpPoint.x++) { + final int x = borderOffset.x + tmpPoint.x * IGUIConstants.SQUARE_WIDTH; + if (!checkClip || grfx.hitClip(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT)) { + paintSquare(grfx, x, y, mapModel.getMapSquare(tmpPoint)); + } + } + } + } + + /** + * Paint the selection for the whole map. It's recommended to paint the + * complete selection after the map itself, otherwise map elements actually + * might hide selections. + * @param grfx Graphics for painting + */ + private void paintMapSelection(@NotNull final Graphics grfx) { + for (tmpPoint.y = 0; tmpPoint.y < mapSize.getHeight(); tmpPoint.y++) { + final int y = borderOffset.y + tmpPoint.y * IGUIConstants.SQUARE_HEIGHT; + for (tmpPoint.x = 0; tmpPoint.x < mapSize.getWidth(); tmpPoint.x++) { + final int x = borderOffset.x + tmpPoint.x * IGUIConstants.SQUARE_WIDTH; + if (grfx.hitClip(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT)) { + paintSquareSelection(grfx, tmpPoint); + } + } + } + } + + /** + * Paint the grid of the whole map. The grid is not painted if it is + * disabled. It's recommended to paint the complete grid after the map + * itself, otherwise map elements actually might hide parts of the grid. + * @param grfx Graphics for painting + */ + private void paintMapGrid(@NotNull final Graphics grfx) { + if (mapViewSettings.isGridVisible()) { + final Size2D tmpMapSize = mapGrid.getSize(); + final int mapWidth = tmpMapSize.getWidth(); + final int mapHeight = tmpMapSize.getHeight(); + for (int x = 0; x <= mapWidth; x++) { + grfx.drawLine(borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + mapHeight * IGUIConstants.SQUARE_HEIGHT); + } + for (int y = 0; y <= mapHeight; y++) { + grfx.drawLine(borderOffset.x, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + mapWidth * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT); + } + } + } + + /** {@inheritDoc} */ + @Nullable + @Override + public Point getSquareLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + final int xm; + final int ym; + if (point.x >= borderOffset.x && point.x < mapWidth * IGUIConstants.SQUARE_WIDTH + borderOffset.x && point.y >= borderOffset.y && point.y < mapHeight * IGUIConstants.SQUARE_HEIGHT + borderOffset.y) { + xm = (point.x - borderOffset.x) / IGUIConstants.SQUARE_WIDTH; + ym = (point.y - borderOffset.y) / IGUIConstants.SQUARE_HEIGHT; + } else { + xm = -1; + ym = -1; + } + + if (xm < 0 || xm >= mapWidth || ym < 0 || ym >= mapHeight) { + return null; + } + if (retPoint != null) { + retPoint.setLocation(xm, ym); + return retPoint; + } + + return new Point(xm, ym); + } + + /** + * Resize the backing buffer to the new grid size. It will only be resized + * if the map is not a pickmap. + * @param size the new map size + */ + protected abstract void resizeBackBuffer(@NotNull final Dimension size); + + /** + * Paint one square. + * @param grfx the graphics context to draw to + * @param x The square coordinate to paint to. + * @param y The square coordinate to paint to. + * @param square The square to paint. + */ + protected abstract void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square); + + /** Update cached information to new map grid size. */ + private void resizeMapGrid() { + // define how much drawing space we need for the map + mapSize = mapGrid.getSize(); + final Dimension forcedSize = new Dimension(mapSize.getWidth() * IGUIConstants.SQUARE_WIDTH + 2 * borderOffset.x, mapSize.getHeight() * IGUIConstants.SQUARE_HEIGHT + 2 * borderOffset.y); + resizeBackBuffer(forcedSize); + setPreferredSize(forcedSize); + setMinimumSize(forcedSize); + revalidate(); + forceRepaint(); + } + + /** + * Callback function that is called when a square may have changed. + * @param point the coordinate of the changed square + */ + protected abstract void updateSquare(@NotNull final Point point); + + /** + * Callback function that is called when multiple squares may have changed. + * @param rectangle the coordinates of the changed squares + */ + protected abstract void updateSquares(@NotNull final Rectangle rectangle); + + /** Callback function that is called when any square may have changed. */ + protected abstract void updateAll(); + + /** {@inheritDoc} */ + @Override + public void setErroneousArchObjects(@NotNull final Map<GameObject, ValidationError<GameObject, MapArchObject, A... [truncated message content] |
From: <aki...@us...> - 2010-04-28 19:06:23
|
Revision: 7658 http://gridarta.svn.sourceforge.net/gridarta/?rev=7658&view=rev Author: akirschbaum Date: 2010-04-28 19:06:17 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove AbstractMapManager.closeMapControl(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-28 17:05:58 UTC (rev 7657) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-04-28 19:06:17 UTC (rev 7658) @@ -165,7 +165,13 @@ /** {@inheritDoc} */ @Override public void closeLevel(@NotNull final MapControl<G, A, R> mapControl) { - closeMapControl(mapControl); + fireMapClosingEvent(mapControl); + assert mapControl.getUseCounter() <= 0; + mapControls.remove(mapControl); + if (currentMapControl == mapControl) { + setCurrentLevel(mapControls.isEmpty() ? null : mapControls.get(0)); + } + mapControl.levelCloseNotify(); } /** @@ -423,22 +429,8 @@ public void release(@NotNull final MapControl<G, A, R> mapControl) { mapControl.release(); if (mapControl.getUseCounter() <= 0) { - closeMapControl(mapControl); + closeLevel(mapControl); } } - /** - * Frees a {@link MapControl} instance. - * @param mapControl the map control instance - */ - private void closeMapControl(@NotNull final MapControl<G, A, R> mapControl) { - fireMapClosingEvent(mapControl); - assert mapControl.getUseCounter() <= 0; - mapControls.remove(mapControl); - if (currentMapControl == mapControl) { - setCurrentLevel(mapControls.isEmpty() ? null : mapControls.get(0)); - } - mapControl.levelCloseNotify(); - } - } // class AbstractMapManager This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-28 17:06:05
|
Revision: 7657 http://gridarta.svn.sourceforge.net/gridarta/?rev=7657&view=rev Author: akirschbaum Date: 2010-04-28 17:05:58 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove unused parameters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -201,8 +201,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -154,8 +154,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -202,8 +202,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -56,7 +56,6 @@ import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; -import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.filter.NamedFilterList; @@ -64,7 +63,6 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.CacheFiles; import net.sf.gridarta.model.io.DefaultMapReaderFactory; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.maparchobject.MapArchObjectFactory; @@ -152,15 +150,9 @@ * ignoring the user's settings * @param globalSettings the global settings to use * @param configSourceFactory the config source factory to use - * @param mapViewSettings the map view settings to use * @param pathManager the path manager to use * @param gameObjectMatchers the game object matchers to use - * @param archFaceProvider the arch face provider to use - * @param faceObjects the face objects to use - * @param faceObjectProviders the face object providers to use - * @param gameObjectParser the game object parser to use * @param gameObjectFactory the game object factory to use - * @param animationObjects the animation objects to use * @param archetypeTypeSet the archetype type set to use * @param archetypeSet the archetype set to use * @param archetypeChooserModel the archetype chooser model to use @@ -169,14 +161,13 @@ * @param scriptModel the script model * @param validators the map validators * @param scriptedEventEditor the scripted event editor - * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use * @param pluginParameterFactory the plugin parameter factory to use */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -95,15 +95,9 @@ * @param errorView the error view for reporting errors * @param globalSettings the global settings to use * @param configSourceFactory the config source factory to use - * @param mapViewSettings the map view settings * @param pathManager the path manager to use * @param gameObjectMatchers the game object matchers to use - * @param archFaceProvider the arch face provider to use - * @param faceObjects the face objects to use - * @param faceObjectProviders the face object providers to use - * @param gameObjectParser the game object parser to use * @param gameObjectFactory the game object factory to use - * @param animationObjects the animation objects to use * @param archetypeTypeSet the archetype type set to use * @param archetypeSet the archetype set to use * @param archetypeChooserModel the archetype chooser model to use @@ -112,7 +106,6 @@ * @param scriptModel the script model * @param validators the map validators * @param scriptedEventEditor the scripted event editor - * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use @@ -121,7 +114,7 @@ * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); /** * Returns the offset for drawing double faces. @@ -382,7 +375,6 @@ * @param animationObjects the animation objects * @param archetypeChooserModel the archetype chooser model * @param scriptedEventEditor the scripted event editor - * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:56:12 UTC (rev 7656) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 17:05:58 UTC (rev 7657) @@ -268,7 +268,7 @@ final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList); try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-28 16:56:19
|
Revision: 7656 http://gridarta.svn.sourceforge.net/gridarta/?rev=7656&view=rev Author: akirschbaum Date: 2010-04-28 16:56:12 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove DefaultMainControl.pluginParameterFactory. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -97,6 +97,7 @@ import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; +import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; @@ -200,8 +201,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ @@ -512,7 +513,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -523,7 +524,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -89,6 +89,7 @@ import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; +import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.utils.GUIUtils; @@ -153,8 +154,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ @@ -369,7 +370,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new int[] { CommonConstants.NORTH, @@ -380,7 +381,7 @@ CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, - }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -97,6 +97,7 @@ import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; +import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; @@ -201,8 +202,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ @@ -513,7 +514,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -524,7 +525,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -134,9 +134,6 @@ private final ScriptArchDataUtils<G, A, R> scriptArchDataUtils; @NotNull - private final PluginParameterFactory<G, A, R> pluginParameterFactory; - - @NotNull private final ScriptArchUtils scriptArchUtils; /** @@ -177,8 +174,9 @@ * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use + * @param pluginParameterFactory the plugin parameter factory to use */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -296,7 +294,6 @@ XMLSpellLoader.load(errorView, globalSettings.getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); } - pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList); final File scriptsFile = new File(globalSettings.getMapsDirectory(), scriptsDir); final ScriptModelParser<G, A, R> scriptModelParser = new ScriptModelParser<G, A, R>(pluginParameterFactory); new ScriptModelLoader<G, A, R>(scriptModelParser).loadScripts(errorView, scriptsFile, scriptModel); @@ -356,9 +353,10 @@ * @param gameObjectSpells the game object spells to use * @param numberSpells the number spells to use * @param attributeRangeChecker the attribute range checker to use + * @param pluginParameterFactory the plugin parameter factory to use * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { + public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -74,6 +74,7 @@ import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; +import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; @@ -116,10 +117,11 @@ * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use + * @param pluginParameterFactory the plugin parameter factoy to use * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); /** * Returns the offset for drawing double faces. @@ -385,10 +387,11 @@ * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use + * @param pluginParameterFactory the plugin parameter factory to use * @return the new instance */ @NotNull - GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull PluginParameterFactory<G, A, R> pluginParameterFactory); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:47:13 UTC (rev 7655) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:56:12 UTC (rev 7656) @@ -92,6 +92,7 @@ import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; +import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; @@ -265,8 +266,9 @@ final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); + final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList); try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); + mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { @@ -287,13 +289,13 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); + returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapCont... [truncated message content] |
From: <aki...@us...> - 2010-04-28 16:47:20
|
Revision: 7655 http://gridarta.svn.sourceforge.net/gridarta/?rev=7655&view=rev Author: akirschbaum Date: 2010-04-28 16:47:13 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove DefaultMainControl.gameObjectSpells. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -90,6 +90,7 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; @@ -199,8 +200,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -511,7 +512,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -522,7 +523,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -82,6 +82,7 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; @@ -152,8 +153,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -368,7 +369,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new int[] { CommonConstants.NORTH, @@ -379,7 +380,7 @@ CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, - }, defaultFilterList, resources, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -90,6 +90,7 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; @@ -200,8 +201,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -512,7 +513,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -523,7 +524,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, numberSpells, attributeRangeChecker); + }, defaultFilterList, resources, gameObjectSpells, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -125,9 +125,6 @@ private final TreasureTree treasureTree; @NotNull - private final Spells<GameObjectSpell<G, A, R>> gameObjectSpells; - - @NotNull private final ScriptArchEditor<G, A, R> scriptArchEditor; @NotNull @@ -178,9 +175,10 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -242,7 +240,6 @@ } final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : globalSettings.getConfigSource(); treasureTree = TreasureLoader.parseTreasures(errorView, specialTreasureLists, configSource, globalSettings); - gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final ArchetypeAttributeFactory<G, A, R> archetypeAttributeFactory = new DefaultArchetypeAttributeFactory<G, A, R>(); final ArchetypeAttributeParser<G, A, R> archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(archetypeAttributeFactory); final ArchetypeTypeParser<G, A, R> archetypeTypeParser = new ArchetypeTypeParser<G, A, R>(archetypeAttributeParser); @@ -356,11 +353,12 @@ * @param directionMap maps relative direction to map window direction * @param defaultFilterList the default filter list * @param resources the resources + * @param gameObjectSpells the game object spells to use * @param numberSpells the number spells to use * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { + public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -67,6 +67,7 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; @@ -113,11 +114,12 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); /** * Returns the offset for drawing double faces. @@ -381,11 +383,12 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param gameObjectSpells the game object spells to use * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ @NotNull - GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:36:41 UTC (rev 7654) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:47:13 UTC (rev 7655) @@ -85,6 +85,7 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.DefaultConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; @@ -262,9 +263,10 @@ final AbstractResources<G, A, R> resources = editorFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); final DefaultMainControl<G, A, R> mainControl; final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); + final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { @@ -285,13 +287,13 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, gameObjectSpells, attributeRangeChecker); } else { try { switch (mode) { case NORMAL: try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); + returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapC... [truncated message content] |
From: <aki...@us...> - 2010-04-28 16:36:48
|
Revision: 7654 http://gridarta.svn.sourceforge.net/gridarta/?rev=7654&view=rev Author: akirschbaum Date: 2010-04-28 16:36:41 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove DefaultMainControl.attributeRangeChecker. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -199,8 +199,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -511,7 +511,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -522,7 +522,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, numberSpells); + }, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -152,8 +152,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -368,7 +368,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new int[] { CommonConstants.NORTH, @@ -379,7 +379,7 @@ CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, - }, defaultFilterList, resources, numberSpells); + }, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -200,8 +200,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ @@ -512,7 +512,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker) { return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -523,7 +523,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources, numberSpells); + }, defaultFilterList, resources, numberSpells, attributeRangeChecker); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -122,9 +122,6 @@ private static final Category log = Logger.getLogger(DefaultMainControl.class); @NotNull - private final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); - - @NotNull private final TreasureTree treasureTree; @NotNull @@ -181,8 +178,9 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param attributeRangeChecker the attribute range checker to use */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -359,9 +357,10 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells) { + public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -113,10 +113,11 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); /** * Returns the offset for drawing double faces. @@ -380,10 +381,11 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param attributeRangeChecker the attribute range checker to use * @return the new instance */ @NotNull - GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:16:01 UTC (rev 7653) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:36:41 UTC (rev 7654) @@ -94,6 +94,7 @@ import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; +import net.sf.gridarta.validation.checks.AttributeRangeChecker; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.apache.log4j.Category; @@ -261,8 +262,9 @@ final AbstractResources<G, A, R> resources = editorFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); final DefaultMainControl<G, A, R> mainControl; final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); + final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); + mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { @@ -283,13 +285,13 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells); + returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } else { try { switch (mode) { case NORMAL: try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells); + returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells, attributeRangeChecker); } catch (final Exception ex) { log.fatal(ex.getMessage(), ex); returnCode = 1; @@ -369,16 +371,17 @@ * @param defaultFilterList the default filter list * @param resources the resources * @param numberSpells the number spells to use + * @param attributeRangeChecker the attribute range checker to use * @return return code suitable for passing to {@link System#exit(int)} */ - private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells) { + private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { final GUIMainControl<G, A, R>[] tmp2 = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; final Runnable runnable2 = new Runnable() { /** {@inheritDoc} */ @... [truncated message content] |
From: <aki...@us...> - 2010-04-28 16:16:09
|
Revision: 7653 http://gridarta.svn.sourceforge.net/gridarta/?rev=7653&view=rev Author: akirschbaum Date: 2010-04-28 16:16:01 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Remove DefaultMainControl.numberSpells. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -90,6 +90,8 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.NumberSpell; +import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; @@ -197,8 +199,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ @@ -509,7 +511,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -520,7 +522,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources); + }, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -82,6 +82,8 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.NumberSpell; +import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; @@ -150,8 +152,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ @@ -366,7 +368,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new int[] { CommonConstants.NORTH, @@ -377,7 +379,7 @@ CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, - }, defaultFilterList, resources); + }, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -90,6 +90,8 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.NumberSpell; +import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; @@ -198,8 +200,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ @@ -510,7 +512,7 @@ /** {@inheritDoc} */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells) { return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubdirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new int[] { CommonConstants.NORTH_EAST, @@ -521,7 +523,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList, resources); + }, defaultFilterList, resources, numberSpells); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -131,9 +131,6 @@ private final Spells<GameObjectSpell<G, A, R>> gameObjectSpells; @NotNull - private final Spells<NumberSpell> numberSpells; - - @NotNull private final ScriptArchEditor<G, A, R> scriptArchEditor; @NotNull @@ -183,8 +180,9 @@ * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list * @param resources the resources + * @param numberSpells the number spells to use */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -247,7 +245,6 @@ final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : globalSettings.getConfigSource(); treasureTree = TreasureLoader.parseTreasures(errorView, specialTreasureLists, configSource, globalSettings); gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); - numberSpells = new Spells<NumberSpell>(); final ArchetypeAttributeFactory<G, A, R> archetypeAttributeFactory = new DefaultArchetypeAttributeFactory<G, A, R>(); final ArchetypeAttributeParser<G, A, R> archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(archetypeAttributeFactory); final ArchetypeTypeParser<G, A, R> archetypeTypeParser = new ArchetypeTypeParser<G, A, R>(archetypeAttributeParser); @@ -361,9 +358,10 @@ * @param directionMap maps relative direction to map window direction * @param defaultFilterList the default filter list * @param resources the resources + * @param numberSpells the number spells to use * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources) { + public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells) { return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -67,6 +67,8 @@ import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.NumberSpell; +import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; @@ -110,10 +112,11 @@ * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list * @param resources the resources + * @param numberSpells the number spells to use * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull GlobalSettings globalSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewSettings mapViewSettings, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ArchFaceProvider archFaceProvider, @NotNull FaceObjects faceObjects, @NotNull FaceObjectProviders faceObjectProviders, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells); /** * Returns the offset for drawing double faces. @@ -376,10 +379,11 @@ * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list * @param resources the resources + * @param numberSpells the number spells to use * @return the new instance */ @NotNull - GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull FilterControl<G, A, R> filterControl, @NotNull ScriptExecutor<G, A, R> scriptExecutor, @NotNull ScriptParameters scriptParameters, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull MapManager<G, A, R> pickmapManager, @NotNull MapControlFactory<G, A, R> mapControlFactory, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull FaceObjects faceObjects, @NotNull GlobalSettings globalSettings, @NotNull MapViewSettings mapViewSettings, @NotNull FaceObjectProviders faceObjectProviders, @NotNull PathManager pathManager, @NotNull InsertionMode<G, A, R> topmostInsertionMode, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull SystemIcons systemIcons, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull DelegatingMapValidator<G, A, R> validators, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull ScriptModel<G, A, R> scriptModel, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull NamedFilterList defaultFilterList, @NotNull AbstractResources<G, A, R> resources, @NotNull Spells<NumberSpell> numberSpells); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 11:34:41 UTC (rev 7652) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 16:16:01 UTC (rev 7653) @@ -85,6 +85,8 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.DefaultConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.spells.NumberSpell; +import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; @@ -258,8 +260,9 @@ final AbstractArchetypeParser<G, A, R, ?> archetypeParser = editorFactory.newArchetypeParser(errorView, gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, globalSettings); final AbstractResources<G, A, R> resources = editorFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); final DefaultMainControl<G, A, R> mainControl; + final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); try { - mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources); + mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectFactory, animationObjects, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, defaultFilterList, resources, numberSpells); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { @@ -280,13 +283,13 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources); + returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells); } else { try { switch (mode) { case NORMAL: try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources); + returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, defaultFilterList, resources, numberSpells); } catch (final Exception ex) { log.fatal(ex.getMessage(), ex); returnCode = 1; @@ -365,16 +368,17 @@ * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list * @param resources the resources + * @param numberSpells the number spells to use * @return return code suitable for passing to {@link System#exit(int)} */ - private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources) { + private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> m... [truncated message content] |
From: <aki...@us...> - 2010-04-28 11:34:48
|
Revision: 7652 http://gridarta.svn.sourceforge.net/gridarta/?rev=7652&view=rev Author: akirschbaum Date: 2010-04-28 11:34:41 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Move ScriptArchDataUtils.addEventsToJList() to ScriptArchUtils. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -29,9 +29,11 @@ /** * Creates a new instance. * @param eventTypes the event types + * @param subtypeAttribute the attribute name for the subtype field + * @param eventTypeNo the object type for event objects */ - public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes) { - super(eventTypes); + public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes, @NotNull final String subtypeAttribute, final int eventTypeNo) { + super(eventTypes, subtypeAttribute, eventTypeNo); } /** {@inheritDoc} */ Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -399,7 +399,7 @@ @NotNull @Override public DefaultScriptArchUtils newScriptArchUtils(@NotNull final ArchetypeTypeList eventTypes) { - return new DefaultScriptArchUtils(eventTypes); + return new DefaultScriptArchUtils(eventTypes, "sub_type", Archetype.TYPE_EVENT_OBJECT); } /** {@inheritDoc} */ @@ -420,7 +420,7 @@ @NotNull @Override public ScriptArchDataUtils<GameObject, MapArchObject, Archetype> newScriptArchDataUtils(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor) { - return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); + return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>(Archetype.TYPE_EVENT_OBJECT, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -29,9 +29,11 @@ /** * Creates a new instance. * @param eventTypes the event types + * @param subtypeAttribute the attribute name for the subtype field + * @param eventTypeNo the object type for event objects */ - public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes) { - super(eventTypes); + public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes, @NotNull final String subtypeAttribute, final int eventTypeNo) { + super(eventTypes, subtypeAttribute, eventTypeNo); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -275,7 +275,7 @@ @NotNull @Override public DefaultScriptArchUtils newScriptArchUtils(@NotNull final ArchetypeTypeList eventTypes) { - return new DefaultScriptArchUtils(eventTypes); + return new DefaultScriptArchUtils(eventTypes, "subtype", Archetype.TYPE_EVENT_CONNECTOR); } /** {@inheritDoc} */ @@ -296,7 +296,7 @@ @NotNull @Override public ScriptArchDataUtils<GameObject, MapArchObject, Archetype> newScriptArchDataUtils(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor) { - return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>("subtype", Archetype.TYPE_EVENT_CONNECTOR, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); + return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>(Archetype.TYPE_EVENT_CONNECTOR, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -29,9 +29,11 @@ /** * Creates a new instance. * @param eventTypes the event types + * @param subtypeAttribute the attribute name for the subtype field + * @param eventTypeNo the object type for event objects */ - public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes) { - super(eventTypes); + public DefaultScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes, @NotNull final String subtypeAttribute, final int eventTypeNo) { + super(eventTypes, subtypeAttribute, eventTypeNo); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -401,7 +401,7 @@ @NotNull @Override public DefaultScriptArchUtils newScriptArchUtils(@NotNull final ArchetypeTypeList eventTypes) { - return new DefaultScriptArchUtils(eventTypes); + return new DefaultScriptArchUtils(eventTypes, "sub_type", Archetype.TYPE_EVENT_OBJECT); } /** {@inheritDoc} */ @@ -422,7 +422,7 @@ @NotNull @Override public ScriptArchDataUtils<GameObject, MapArchObject, Archetype> newScriptArchDataUtils(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor) { - return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); + return new ScriptArchDataUtils<GameObject, MapArchObject, Archetype>(Archetype.TYPE_EVENT_OBJECT, scriptArchUtils, scriptedEventFactory, scriptedEventEditor); } /** {@inheritDoc} */ @NotNull Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -41,6 +41,7 @@ import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.scripts.ScriptArchData; +import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -89,6 +90,12 @@ private final ScriptArchData<G, A, R> scriptArchData; /** + * The {@link ScriptArchUtils} to use. + */ + @NotNull + private final ScriptArchUtils scriptArchUtils; + + /** * The {@link ScriptArchDataUtils} to use. */ @NotNull @@ -118,14 +125,16 @@ * @param scriptArchEditor the script arch editor instance to use * @param scriptArchData the script arch data instance to use * @param scriptArchDataUtils the script arch data utils to use + * @param scriptArchUtils the script arch utils to use */ - public EventsTab(@NotNull final Frame parent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils) { + public EventsTab(@NotNull final Frame parent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils) { super(gameObjectAttributesModel); this.parent = parent; this.mapManager = mapManager; this.scriptArchEditor = scriptArchEditor; this.scriptArchData = scriptArchData; this.scriptArchDataUtils = scriptArchDataUtils; + this.scriptArchUtils = scriptArchUtils; refresh(gameObjectAttributesModel.getSelectedGameObject()); } @@ -185,7 +194,7 @@ } else { setTabSeverity(Severity.MODIFIED); eventList.removeAll(); - scriptArchDataUtils.addEventsToJList(eventList, gameObject); + scriptArchUtils.addEventsToJList(eventList, gameObject); aEventAddNew.setEnabled(true); aEventEditData.setEnabled(true); aEventEdit.setEnabled(true); @@ -237,7 +246,7 @@ setEventPanelButtonState(true, false, false, false); } else { setEventPanelButtonState(true, true, true, true); - scriptArchDataUtils.addEventsToJList(eventList, selectedHead); + scriptArchUtils.addEventsToJList(eventList, selectedHead); } } finally { mapModel.endTransaction(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -74,6 +74,7 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.scripts.ScriptArchData; +import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.utils.ExiterListener; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.utils.Size2D; @@ -505,17 +506,18 @@ * @param scriptArchEditor the script arch editor instance to use * @param scriptArchData the script arch data instance to use * @param scriptArchDataUtils the script arch data utils to use + * @param scriptArchUtils the script arch utils to use * @param archetypeTypeSet the archetype type set instance * @param mapManager the map manager instance * @param faceObjectProviders the face object providers to use * @param systemIcons the system icons for creating icons * @param mapViewsManager the map views */ - public void createTabs(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, final LockedItemsControl<G, A, R> lockedItemsControl, @NotNull final GameObjectMatcher monsterMatcher, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final Frame parent, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapManager<G, A, R> mapManager, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public void createTabs(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, final LockedItemsControl<G, A, R> lockedItemsControl, @NotNull final GameObjectMatcher monsterMatcher, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final Frame parent, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapManager<G, A, R> mapManager, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { addTabInt(new TextEditorTab<G, A, R>(gameObjectAttributesModel, gameObjectTextEditor)); addTab(new ArchTab<G, A, R>(archetypeTypeSet, gameObjectAttributesModel), 0); addTab(new MsgTextTab<G, A, R>(gameObjectAttributesModel), 0); - addTab(new EventsTab<G, A, R>(parent, mapManager, gameObjectAttributesModel, scriptArchEditor, scriptArchData, scriptArchDataUtils), 0); + addTab(new EventsTab<G, A, R>(parent, mapManager, gameObjectAttributesModel, scriptArchEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils), 0); addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, systemIcons), 0); addTab(new ConnectionsTab<G, A, R>(mapViewManager, delayedMapModelListenerManager, gameObjectAttributesModel), 1); addTab(new LockedItemsTab<G, A, R>(lockedItemsControl, gameObjectAttributesModel), 1); Modified: trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -23,6 +23,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Vector; +import javax.swing.JList; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.utils.Pair; import org.jetbrains.annotations.NotNull; @@ -31,6 +35,19 @@ public abstract class AbstractScriptArchUtils implements ScriptArchUtils { /** + * The attribute name for the subtype field. + * @serial + */ + @NotNull + private final String subtypeAttribute; + + /** + * The object type for event objects. + * @serial + */ + private final int eventTypeNo; + + /** * Maps event type to event name. */ @NotNull @@ -51,8 +68,12 @@ /** * Creates a new instance. * @param eventTypes the event types + * @param subtypeAttribute the attribute name for the subtype field + * @param eventTypeNo the object type for event objects */ - protected AbstractScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes) { + protected AbstractScriptArchUtils(@NotNull final Iterable<Pair<Integer, String>> eventTypes, @NotNull final String subtypeAttribute, final int eventTypeNo) { + this.subtypeAttribute = subtypeAttribute; + this.eventTypeNo = eventTypeNo; for (final Pair<Integer, String> pair : eventTypes) { final int eventType = pair.getFirst(); final String eventName = pair.getSecond(); @@ -109,4 +130,22 @@ return eventNames.toArray(new String[eventNames.size()]); } + /** + * {@inheritDoc} + */ + @Override + public void addEventsToJList(@NotNull final JList list, @NotNull final Iterable<? extends GameObject<?, ?, ?>> gameObject) { + //cher: JList expects Vector, so we MUST use an obsolete concrete collection. + // noinspection UseOfObsoleteCollectionType + final Vector<String> content = new Vector<String>(); + for (final BaseObject<?, ?, ?, ?> tmp : gameObject) { + if (tmp.getTypeNo() == eventTypeNo) { + content.add(" " + typeName(tmp.getAttributeInt(subtypeAttribute))); + } + } + + list.setListData(content); + list.setSelectedIndex(0); + } + } // class AbstractScriptArchUtils Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -20,13 +20,11 @@ package net.sf.gridarta.gui.scripts; import java.awt.Frame; -import java.util.Vector; import javax.swing.JList; import javax.swing.JOptionPane; import net.sf.gridarta.gui.gameobjectattributespanel.EventsTab; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.scripts.ScriptArchUtils; @@ -50,13 +48,6 @@ private static final Category log = Logger.getLogger(ScriptArchDataUtils.class); /** - * The attribute name for the subtype field. - * @serial - */ - @NotNull - private final String subtypeAttribute; - - /** * The object type for event objects. * @serial */ @@ -82,14 +73,12 @@ /** * Creates a new instance. - * @param subtypeAttribute the attribute name for the subtype field * @param eventTypeNo the object type for event objects * @param scriptArchUtils the script arch utils instance to use * @param scriptedEventFactory the scripted event factory instance to use * @param scriptedEventEditor the scripted event editor to use */ - public ScriptArchDataUtils(@NotNull final String subtypeAttribute, final int eventTypeNo, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory<G, A, R> scriptedEventFactory, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor) { - this.subtypeAttribute = subtypeAttribute; + public ScriptArchDataUtils(final int eventTypeNo, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory<G, A, R> scriptedEventFactory, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor) { this.eventTypeNo = eventTypeNo; this.scriptArchUtils = scriptArchUtils; this.scriptedEventFactory = scriptedEventFactory; @@ -97,26 +86,6 @@ } /** - * Set all ScriptedEvents to appear in the given JList This method should be - * fast because it may be executed when user clicks on map objects. - * @param list JList - * @param gameObject the game object to operate on - */ - public void addEventsToJList(@NotNull final JList list, @NotNull final Iterable<G> gameObject) { - //cher: JList expects Vector, so we MUST use an obsolete concrete collection. - // noinspection UseOfObsoleteCollectionType - final Vector<String> content = new Vector<String>(); - for (final BaseObject<G, A, R, ?> tmp : gameObject) { - if (tmp.getTypeNo() == eventTypeNo) { - content.add(" " + scriptArchUtils.typeName(tmp.getAttributeInt(subtypeAttribute))); - } - } - - list.setListData(content); - list.setSelectedIndex(0); - } - - /** * If there is a scripted event of the specified type, the script pad is * opened and the appropriate script displayed. * @param eventIndex index of event in the owner's inventory @@ -154,7 +123,7 @@ if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + scriptArchUtils.typeName(event.getEventType()) + "\" event which is\n" + "linked to the script: '" + event.getScriptPath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { // remove this event from the GameObject oldEvent.remove(); - addEventsToJList(panelList, gameObject); // update panel JList + scriptArchUtils.addEventsToJList(panelList, gameObject); // update panel JList } } } else { Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -145,6 +145,9 @@ @NotNull private final PluginParameterFactory<G, A, R> pluginParameterFactory; + @NotNull + private final ScriptArchUtils scriptArchUtils; + /** * Creates a new instance. * @param scriptFileFilter the file filter for script files @@ -266,7 +269,7 @@ if (eventTypeSet == null) { eventTypeSet = new ArchetypeTypeList(); } - final ScriptArchUtils scriptArchUtils = editorFactory.newScriptArchUtils(eventTypeSet); + scriptArchUtils = editorFactory.newScriptArchUtils(eventTypeSet); final ScriptedEventFactory<G, A, R> scriptedEventFactory = editorFactory.newScriptedEventFactory(scriptArchUtils, gameObjectFactory, scriptedEventEditor, archetypeSet); scriptArchEditor = new DefaultScriptArchEditor<G, A, R>(scriptedEventFactory, scriptExtension, scriptName, scriptArchUtils, scriptFileFilter, globalSettings, mapManager, pathManager); scriptedEventEditor.setScriptArchEditor(scriptArchEditor); @@ -361,7 +364,7 @@ * @return the new instance */ public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final int[] directionMap, @NotNull final NamedFilterList defaultFilterList, @NotNull final AbstractResources<G, A, R> resources) { - return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); + return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, defaultFilterList, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } } // class DefaultMainControl Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -137,6 +137,7 @@ import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; import net.sf.gridarta.model.scripts.ScriptArchData; +import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.model.spells.GameObjectSpell; @@ -320,6 +321,7 @@ * @param scriptedEventEditor the scripted event editor to use * @param scriptArchData the script arch data to use * @param scriptArchDataUtils the script arch data utils to use + * @param scriptArchUtils the script arch utils to use * @param autoValidatorDefault whether the auto validator is enabled by * @param allowRandomMapParameters whether exit paths may point to random * map parameters @@ -341,7 +343,7 @@ * @param scriptExecutor the script executor to use * @param scriptParameters the script parameters to use */ - public GUIMainControl(final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final int[] lockedItemsTypeNumbers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AnimationObjects animationObjects, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, final boolean autoValidatorDefault, @Nullable final String spellFile, final boolean allowRandomMapParameters, @NotNull final int[] directionMap, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final NamedFilterList defaultFilterList, final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final PathManager pathManager, @NotNull final CacheFiles cacheFiles, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters) { + public GUIMainControl(final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final int[] lockedItemsTypeNumbers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AnimationObjects animationObjects, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchData<G, A, R> scriptArchData, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, final boolean autoValidatorDefault, @Nullable final String spellFile, final boolean allowRandomMapParameters, @NotNull final int[] directionMap, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final NamedFilterList defaultFilterList, final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final PathManager pathManager, @NotNull final CacheFiles cacheFiles, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters) { this.configSourceFactory = configSourceFactory; this.rendererFactory = rendererFactory; this.mapManager = mapManager; @@ -459,7 +461,7 @@ } else { scriptControl.getView().setMenu(pluginsMenu); } - gameObjectAttributesControl.createTabs(mapViewManager, delayedMapModelListenerManager, faceObjects, animationObjects, lockedItemsControl, monsterMatcher, selectedSquareView, mainViewFrame, scriptArchEditor, scriptArchData, scriptArchDataUtils, archetypeTypeSet, mapManager, faceObjectProviders, systemIcons, mapViewsManager); + gameObjectAttributesControl.createTabs(mapViewManager, delayedMapModelListenerManager, faceObjects, animationObjects, lockedItemsControl, monsterMatcher, selectedSquareView, mainViewFrame, scriptArchEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, archetypeTypeSet, mapManager, faceObjectProviders, systemIcons, mapViewsManager); new ArchetypeValidator(animationObjects, faceObjects, errorView).validate(archetypeSet); new AnimationValidator(faceObjects, errorView).validate(animationObjects); Modified: trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2010-04-28 10:50:35 UTC (rev 7651) +++ trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2010-04-28 11:34:41 UTC (rev 7652) @@ -19,6 +19,8 @@ package net.sf.gridarta.model.scripts; +import javax.swing.JList; +import net.sf.gridarta.model.gameobject.GameObject; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -55,4 +57,12 @@ @NotNull String[] getEventNames(); + /** + * Set all ScriptedEvents to appear in the given JList This method should be + * fast because it may be executed when user clicks on map objects. + * @param list JList + * @param gameObject the game object to operate on + */ + void addEventsToJList(@NotNull final JList list, @NotNull final Iterable<? extends GameObject<?, ?, ?>> gameObject); + } // interface ScriptArchUtils This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-28 10:50:41
|
Revision: 7651 http://gridarta.svn.sourceforge.net/gridarta/?rev=7651&view=rev Author: akirschbaum Date: 2010-04-28 10:50:35 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-04-28 10:42:28 UTC (rev 7650) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-04-28 10:50:35 UTC (rev 7651) @@ -46,6 +46,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ScriptArchDataUtils.class); /** @@ -101,7 +102,7 @@ * @param list JList * @param gameObject the game object to operate on */ - public void addEventsToJList(final JList list, @NotNull final Iterable<G> gameObject) { + public void addEventsToJList(@NotNull final JList list, @NotNull final Iterable<G> gameObject) { //cher: JList expects Vector, so we MUST use an obsolete concrete collection. // noinspection UseOfObsoleteCollectionType final Vector<String> content = new Vector<String>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |