From: <aki...@us...> - 2010-04-23 20:28:04
|
Revision: 7601 http://gridarta.svn.sourceforge.net/gridarta/?rev=7601&view=rev Author: akirschbaum Date: 2010-04-23 20:27:57 +0000 (Fri, 23 Apr 2010) Log Message: ----------- Move code from DefaultMapPropertiesDialogFactory to MapPropertiesDialog. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-04-23 20:27:02 UTC (rev 7600) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-04-23 20:27:57 UTC (rev 7601) @@ -20,9 +20,7 @@ package net.sf.gridarta.var.atrinik.gui.mappropertiesdialog; import java.awt.Component; -import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; @@ -91,15 +89,7 @@ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); - final JDialog dialog = pane.createDialog(parent, ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName())); - pane.dialog = dialog; - dialog.getRootPane().setDefaultButton(pane.okButton); - dialog.setResizable(true); - dialog.setModal(false); - dialog.setVisible(true); - if (!pane.mapTilePaneEnabled) { - ACTION_BUILDER.showOnetimeMessageDialog(dialog, JOptionPane.WARNING_MESSAGE, "mapTilesNoMapFileNoMapTilePane"); - } + pane.showDialog(parent); } } // class DefaultMapPropertiesDialogFactory 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-23 20:27:02 UTC (rev 7600) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-04-23 20:27:57 UTC (rev 7601) @@ -34,6 +34,7 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComponent; +import javax.swing.JDialog; import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JLabel; @@ -87,7 +88,7 @@ private final MapModel<GameObject, MapArchObject, Archetype> mapModel; - public Window dialog = null; + private Window dialog = null; // input components, see MapArchObject for expl. of purpose private final JTextArea mapDescription = new JTextArea(4, 4); // the msg text/arch text @@ -141,7 +142,7 @@ private final AbstractButton checkboxPlugins = new JCheckBox(); /** JButton for ok. */ - public final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** JButton for cancel. */ private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); @@ -150,7 +151,7 @@ private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** Whether the map tile pane was enabled. */ - public final boolean mapTilePaneEnabled; + private final boolean mapTilePaneEnabled; /** * Creates a map-options dialog. @@ -569,4 +570,21 @@ mapTilePane.restoreMapProperties(); } + /** + * Creates and displays the map properties dialog. + * @param parentComponent the parent component of the dialog + */ + public void showDialog(final Component parentComponent) { + final String title = ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName()); + final JDialog window = createDialog(parentComponent, title); + dialog = window; + window.getRootPane().setDefaultButton(okButton); + window.setResizable(true); + window.setModal(false); + window.setVisible(true); + if (!mapTilePaneEnabled) { + ACTION_BUILDER.showOnetimeMessageDialog(window, WARNING_MESSAGE, "mapTilesNoMapFileNoMapTilePane"); + } + } + } // class MapPropertiesDialog Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-04-23 20:27:02 UTC (rev 7600) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-04-23 20:27:57 UTC (rev 7601) @@ -20,9 +20,7 @@ package net.sf.gridarta.var.crossfire.gui.mappropertiesdialog; import java.awt.Component; -import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; @@ -91,15 +89,7 @@ @Override public void showDialog(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer, mapViewsManager); - final JDialog dialog = pane.createDialog(parent, ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName())); - pane.dialog = dialog; - dialog.getRootPane().setDefaultButton(pane.okButton); - dialog.setResizable(true); - dialog.setModal(false); - dialog.setVisible(true); - if (!pane.mapTilePaneEnabled) { - ACTION_BUILDER.showOnetimeMessageDialog(dialog, JOptionPane.WARNING_MESSAGE, "mapTilesNoMapFileNoMapTilePane"); - } + pane.showDialog(parent); } } // class DefaultMapPropertiesDialogFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-04-23 20:27:02 UTC (rev 7600) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-04-23 20:27:57 UTC (rev 7601) @@ -29,6 +29,7 @@ import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JCheckBox; +import javax.swing.JDialog; import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JLabel; @@ -79,7 +80,7 @@ private final MapModel<GameObject, MapArchObject, Archetype> mapModel; - public Window dialog = null; + private Window dialog = null; /** * The {@link GridBagConstraints} for label fields before text input @@ -161,7 +162,7 @@ private final JTextField fieldSkySetting = new JFormattedTextField(); // sky setting /** JButton for ok. */ - public final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** JButton for cancel. */ private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); @@ -170,7 +171,7 @@ private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** Whether the map tile pane was enabled. */ - public final boolean mapTilePaneEnabled; + private final boolean mapTilePaneEnabled; /** * Creates a map-options dialog. @@ -639,4 +640,21 @@ mapTilePane.restoreMapProperties(); } + /** + * Creates and displays the map properties dialog. + * @param parentComponent the parent component of the dialog + */ + public void showDialog(final Component parentComponent) { + final String title = ACTION_BUILDER.format("mapTitle", mapModel.getMapArchObject().getMapName(), mapModel.getMapArchObject().getMapName()); + final JDialog window = createDialog(parentComponent, title); + dialog = window; + window.getRootPane().setDefaultButton(okButton); + window.setResizable(true); + window.setModal(false); + window.setVisible(true); + if (!mapTilePaneEnabled) { + ACTION_BUILDER.showOnetimeMessageDialog(window, WARNING_MESSAGE, "mapTilesNoMapFileNoMapTilePane"); + } + } + } // class MapPropertiesDialog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-23 20:44:04
|
Revision: 7606 http://gridarta.svn.sourceforge.net/gridarta/?rev=7606&view=rev Author: akirschbaum Date: 2010-04-23 20:43:58 +0000 (Fri, 23 Apr 2010) Log Message: ----------- Remove redundant function declarations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/Archetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/Archetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/Archetype.java 2010-04-23 20:43:32 UTC (rev 7605) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/Archetype.java 2010-04-23 20:43:58 UTC (rev 7606) @@ -99,12 +99,6 @@ int TYPE_CONNECTION_SENSOR = 134; - int getMultiShapeID(); - - int getMultiPartNr(); - - boolean isLowestPart(); - /** * {@inheritDoc} */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/Archetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/Archetype.java 2010-04-23 20:43:32 UTC (rev 7605) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/Archetype.java 2010-04-23 20:43:58 UTC (rev 7606) @@ -99,12 +99,6 @@ int TYPE_CONNECTION_SENSOR = 134; - int getMultiShapeID(); - - int getMultiPartNr(); - - boolean isLowestPart(); - /** * {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-04-23 20:43:32 UTC (rev 7605) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-04-23 20:43:58 UTC (rev 7606) @@ -81,13 +81,6 @@ void addFirst(@NotNull G gameObject); /** - * Get the name of this Archetype. All Archetypes have a name. - * @return The name of this Archetype. - */ - @NotNull - String getArchetypeName(); - - /** * Set the archetype name. * @param archetypeName the archetype name */ Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-04-23 20:43:32 UTC (rev 7605) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-04-23 20:43:58 UTC (rev 7606) @@ -273,13 +273,6 @@ void setArchetype(@NotNull R archetype); /** - * Get the name of this Archetype. All Archetypes have a name. - * @return The name of this Archetype. - */ - @NotNull - String getArchetypeName(); - - /** * Set the archetype name. * @param archetypeName the archetype name */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-23 22:48:52
|
Revision: 7618 http://gridarta.svn.sourceforge.net/gridarta/?rev=7618&view=rev Author: akirschbaum Date: 2010-04-23 22:48:45 +0000 (Fri, 23 Apr 2010) Log Message: ----------- Remove dependency DefaultFilterControl -> MapViewsManager. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -33,6 +33,8 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; +import net.sf.gridarta.model.filter.ConfigEvent; +import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.map.grid.MapGrid; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -128,6 +130,18 @@ this.mapViewSettings = mapViewSettings; this.smoothingRenderer = smoothingRenderer; init(); + final ConfigListener configListener = new ConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(final ConfigEvent event) { + forceRepaint(); + } + + }; + this.filterControl.addConfigListener(configListener); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -21,7 +21,6 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.filter.ConfigEvent; import net.sf.gridarta.model.filter.ConfigListener; @@ -31,6 +30,7 @@ import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; /** @@ -59,17 +59,18 @@ private final NamedFilterConfig[] highlightConfig; /** - * The {@link MapViewsManager} instance. + * The {@link ConfigListener}s to notify. */ - @NotNull - private MapViewsManager<G, A, R> mapViewsManager; + private final EventListenerList2<ConfigListener> configListeners = new EventListenerList2<ConfigListener>(ConfigListener.class); private final ConfigListener configListener = new ConfigListener() { /** {@inheritDoc} */ @Override public void configChanged(final ConfigEvent event) { - mapViewsManager.refreshAllMaps(); + for (final ConfigListener listener : configListeners.getListeners()) { + listener.configChanged(event); + } } }; @@ -93,13 +94,21 @@ } /** - * @param mapViewsManager the map views manager instance + * {@inheritDoc} */ - @Deprecated - public void init(@NotNull final MapViewsManager<G, A, R> mapViewsManager) { - this.mapViewsManager = mapViewsManager; + @Override + public void addConfigListener(@NotNull final ConfigListener listener) { + configListeners.add(listener); } + /** + * {@inheritDoc} + */ + @Override + public void removeConfigListener(@NotNull final ConfigListener listener) { + configListeners.remove(listener); + } + /** {@inheritDoc} */ @Override public void createMenuEntries(final JMenu menu) { Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -21,6 +21,7 @@ import javax.swing.JMenu; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -33,6 +34,18 @@ int MAX_HIGHLIGHT = 3; + /** + * Adds a {@link ConfigListener} to be notified about changes. + * @param listener the config listener + */ + void addConfigListener(@NotNull ConfigListener listener); + + /** + * Removes a {@link ConfigListener} to be notified about changes. + * @param listener the config listener + */ + void removeConfigListener(@NotNull ConfigListener listener); + void createMenuEntries(JMenu menu); void newSquare(@NotNull FilterState filterState); Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -26,6 +26,8 @@ import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.filter.FilterState; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.filter.ConfigEvent; +import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; @@ -111,6 +113,18 @@ emptySquareIcon = systemIcons.getEmptySquareIcon(); this.mapViewSettings = mapViewSettings; this.isoMapSquareInfo = isoMapSquareInfo; + final ConfigListener configListener = new ConfigListener() { + + /** + * {@inheritDoc} + */ + @Override + public void configChanged(final ConfigEvent event) { + forceRepaint(); + } + + }; + this.filterControl.addConfigListener(configListener); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -216,11 +216,10 @@ final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); - final DefaultFilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); + final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, gameObjectParser, faceObjectProviders, systemIcons); final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); final MapViewsManager<G, A, R> mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory); - filterControl.init(mapViewsManager); final DefaultMainControl<G, A, R> mainControl; try { mainControl = editorFactory.newMainControl(mode == Mode.COLLECT_ARCHES, errorView, systemIcons, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectParserFactory, gameObjectFactory, animationObjects, archetypeTypeSet); @@ -249,7 +248,7 @@ break; case BATCH_PNG: - returnCode = new BatchPngCommand(args2, new ImageCreatorFactory<G, A, R>(systemIcons).newImageCreator(editorFactory, mapViewsManager)).execute(); + returnCode = new BatchPngCommand(args2, new ImageCreatorFactory<G, A, R>(systemIcons).newImageCreator(editorFactory)).execute(); break; case SINGLE_PNG: @@ -257,7 +256,7 @@ throw new SyntaxErrorException("input output"); } - returnCode = new SinglePngCommand(new File(args2.get(0)), new File(args2.get(1)), new ImageCreatorFactory<G, A, R>(systemIcons).newImageCreator(editorFactory, mapViewsManager)).execute(); + returnCode = new SinglePngCommand(new File(args2.get(0)), new File(args2.get(1)), new ImageCreatorFactory<G, A, R>(systemIcons).newImageCreator(editorFactory)).execute(); break; case CREATE_THUMBS: Modified: trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -22,7 +22,7 @@ import java.util.HashSet; import java.util.Set; import net.sf.gridarta.gui.filter.DefaultFilterControl; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.map.renderer.ImageCreator; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.mapmanager.DefaultMapManager; @@ -84,11 +84,10 @@ /** * Creates a new {@link ImageCreator} instance. * @param editorFactory the editor factory to use - * @param mapViewsManager the map views * @return the new instance */ @NotNull - public ImageCreator<G, A, R> newImageCreator(@NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public ImageCreator<G, A, R> newImageCreator(@NotNull final EditorFactory<G, A, R> editorFactory) { final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); final GlobalSettings globalSettings = editorFactory.newGlobalSettings(configSourceFactory); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); @@ -114,8 +113,7 @@ final MapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); final Set<NamedGameObjectMatcher> matchers = new HashSet<NamedGameObjectMatcher>(); final NamedFilterList defaultNamedFilterList = new NamedFilterList(matchers); - final DefaultFilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); - filterControl.init(mapViewsManager); + final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, gameObjectParser, faceObjectProviders, systemIcons); return new ImageCreator<G, A, R>(mapManager, rendererFactory); } Modified: trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java 2010-04-23 22:37:32 UTC (rev 7617) +++ trunk/src/test/net/sf/gridarta/gui/filter/TestFilterControl.java 2010-04-23 22:48:45 UTC (rev 7618) @@ -21,6 +21,7 @@ import javax.swing.JMenu; import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.filter.ConfigListener; import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; @@ -34,6 +35,18 @@ /** {@inheritDoc} */ @Override + public void addConfigListener(@NotNull final ConfigListener listener) { + throw new AssertionError(); + } + + /** {@inheritDoc} */ + @Override + public void removeConfigListener(@NotNull final ConfigListener listener) { + throw new AssertionError(); + } + + /** {@inheritDoc} */ + @Override public void createMenuEntries(final JMenu menu) { 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-24 08:33:13
|
Revision: 7619 http://gridarta.svn.sourceforge.net/gridarta/?rev=7619&view=rev Author: akirschbaum Date: 2010-04-24 08:33:05 +0000 (Sat, 24 Apr 2010) Log Message: ----------- Reorder initialization code. 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/GUIMainControl.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-23 22:48:45 UTC (rev 7618) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-24 08:33:05 UTC (rev 7619) @@ -50,6 +50,7 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; +import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; @@ -67,9 +68,11 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; +import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; import net.sf.gridarta.model.io.MapWriter; @@ -89,6 +92,9 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.resource.AbstractResources; +import net.sf.gridarta.script.ScriptExecutor; +import net.sf.gridarta.script.ScriptModel; +import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; @@ -192,18 +198,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final SystemIcons systemIcons, @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 GameObjectParserFactory<GameObject, MapArchObject, Archetype> gameObjectParserFactory, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, -1, IGUIConstants.SCRIPTS_DIR, errorView, false, - new int[] { - CommonConstants.NORTH_EAST, - CommonConstants.SOUTH_EAST, - CommonConstants.SOUTH_WEST, - CommonConstants.NORTH_WEST, - CommonConstants.EAST, - CommonConstants.SOUTH, - CommonConstants.WEST, - CommonConstants.NORTH, - }, this, forceReadFromFiles, systemIcons, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectParserFactory, gameObjectFactory, animationObjects, archetypeTypeSet); + 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) { + 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); } /** {@inheritDoc} */ @@ -514,8 +510,18 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl) { - return mainControl.createGUIMainControl(true, 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, mapViewsManager, rendererFactory, filterControl); + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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, mapViewsManager, 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, + CommonConstants.SOUTH_EAST, + CommonConstants.SOUTH_WEST, + CommonConstants.NORTH_WEST, + CommonConstants.EAST, + CommonConstants.SOUTH, + CommonConstants.WEST, + CommonConstants.NORTH, + }, defaultFilterList); } /** {@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-23 22:48:45 UTC (rev 7618) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-24 08:33:05 UTC (rev 7619) @@ -45,6 +45,7 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; +import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; @@ -61,7 +62,9 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.DirectoryCacheFiles; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; @@ -81,6 +84,9 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.resource.AbstractResources; +import net.sf.gridarta.script.ScriptExecutor; +import net.sf.gridarta.script.ScriptModel; +import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.utils.GUIUtils; @@ -145,18 +151,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final SystemIcons systemIcons, @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 GameObjectParserFactory<GameObject, MapArchObject, Archetype> gameObjectParserFactory, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, 0, IGUIConstants.SCRIPTS_DIR, errorView, true, - new int[] { - CommonConstants.NORTH, - CommonConstants.EAST, - CommonConstants.SOUTH, - CommonConstants.WEST, - CommonConstants.NORTH_EAST, - CommonConstants.SOUTH_EAST, - CommonConstants.SOUTH_WEST, - CommonConstants.NORTH_WEST, - }, this, false, systemIcons, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectParserFactory, gameObjectFactory, animationObjects, archetypeTypeSet); + 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) { + 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); } /** {@inheritDoc} */ @@ -371,8 +367,18 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl) { - return mainControl.createGUIMainControl(false, 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, mapViewsManager, rendererFactory, filterControl); + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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, mapViewsManager, 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, + CommonConstants.EAST, + CommonConstants.SOUTH, + CommonConstants.WEST, + CommonConstants.NORTH_EAST, + CommonConstants.SOUTH_EAST, + CommonConstants.SOUTH_WEST, + CommonConstants.NORTH_WEST, + }, defaultFilterList); } /** {@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-23 22:48:45 UTC (rev 7618) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-24 08:33:05 UTC (rev 7619) @@ -50,6 +50,7 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; +import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; @@ -67,9 +68,11 @@ import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.filter.NamedFilterList; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; +import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; import net.sf.gridarta.model.io.MapWriter; @@ -89,6 +92,9 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.resource.AbstractResources; +import net.sf.gridarta.script.ScriptExecutor; +import net.sf.gridarta.script.ScriptModel; +import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; @@ -193,18 +199,8 @@ /** {@inheritDoc} */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final SystemIcons systemIcons, @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 GameObjectParserFactory<GameObject, MapArchObject, Archetype> gameObjectParserFactory, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, -1, IGUIConstants.SCRIPTS_DIR, errorView, false, - new int[] { - CommonConstants.NORTH_EAST, - CommonConstants.SOUTH_EAST, - CommonConstants.SOUTH_WEST, - CommonConstants.NORTH_WEST, - CommonConstants.EAST, - CommonConstants.SOUTH, - CommonConstants.WEST, - CommonConstants.NORTH, - }, this, forceReadFromFiles, systemIcons, globalSettings, configSourceFactory, mapViewSettings, pathManager, gameObjectMatchers, archFaceProvider, faceObjects, faceObjectProviders, gameObjectParser, gameObjectParserFactory, gameObjectFactory, animationObjects, archetypeTypeSet); + 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) { + 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); } /** {@inheritDoc} */ @@ -515,8 +511,18 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl) { - return mainControl.createGUIMainControl(true, 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, mapViewsManager, rendererFactory, filterControl); + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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, mapViewsManager, 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, + CommonConstants.SOUTH_EAST, + CommonConstants.SOUTH_WEST, + CommonConstants.NORTH_WEST, + CommonConstants.EAST, + CommonConstants.SOUTH, + CommonConstants.WEST, + CommonConstants.NORTH, + }, defaultFilterList); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-23 22:48:45 UTC (rev 7618) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-24 08:33:05 UTC (rev 7619) @@ -40,13 +40,10 @@ import net.sf.gridarta.gui.scripts.ScriptArchEditor; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.mapmanager.AbstractMapManager; -import net.sf.gridarta.mapmanager.DefaultMapManager; -import net.sf.gridarta.mapmanager.DefaultPickmapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeFactory; @@ -69,21 +66,15 @@ 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.DefaultMapWriter; import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.io.GameObjectParserFactory; -import net.sf.gridarta.model.io.MapArchObjectParserFactory; -import net.sf.gridarta.model.io.MapWriter; import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.map.mapcontrol.MapControlFactory; import net.sf.gridarta.model.map.mapmodel.InsertionMode; -import net.sf.gridarta.model.map.mapmodel.TopmostInsertionMode; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.GameObjectMatchers; -import net.sf.gridarta.model.match.NamedGameObjectMatcher; import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; @@ -100,9 +91,11 @@ import net.sf.gridarta.model.treasurelist.TreasureTree; import net.sf.gridarta.model.treasurelist.TreasureTreeNode; import net.sf.gridarta.resource.AbstractResources; +import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptModelLoader; import net.sf.gridarta.script.ScriptModelParser; +import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.IOUtils; @@ -130,100 +123,13 @@ /** The Logger for printing log messages. */ private static final Category log = Logger.getLogger(DefaultMainControl.class); - /** - * The file extension for script files. - */ @NotNull - private final String scriptExtension; - - private final int undefinedSpellIndex; - - /** - * The plugin scripts directory. - */ - @NotNull - private final String scriptsDir; - - /** - * Whether exit paths may point to random map parameters. - */ - private final boolean allowRandomMapParameters; - - /** - * Maps relative direction to map window direction. - */ - @NotNull - private final int[] directionMap; - - /** - * The {@link GameObjectFactory} instance. - */ - @NotNull - private final GameObjectFactory<G, A, R> gameObjectFactory; - - /** - * The global settings instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - @NotNull - private final ArchetypeSet<G, A, R> archetypeSet; - - @NotNull - private final MapViewSettings mapViewSettings; - - @NotNull - private final MapControlFactory<G, A, R> mapControlFactory; - - @NotNull - private final DefaultMapReaderFactory<G, A, R> mapReaderFactory; - - /** The map manager. */ - private final AbstractMapManager<G, A, R> mapManager; - - /** - * The pickmap manager. - */ - private final MapManager<G, A, R> pickmapManager; - - /** - * The {@link PathManager} for converting path names. - */ - @NotNull - private final PathManager pathManager; - - /** - * The {@link SystemIcons} for creating icons. - */ - @NotNull - private final SystemIcons systemIcons; - - /** - * The "topmost" {@link InsertionMode} instance. - */ - @NotNull - private final InsertionMode<G, A, R> topmostInsertionMode; - - @NotNull - private final FaceObjects faceObjects; - - @NotNull private final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); - /** The map validators. */ - private final DelegatingMapValidator<G, A, R> validators; - @NotNull - private final MapArchObjectFactory<A> mapArchObjectFactory; - - @NotNull private final AbstractResources<G, A, R> resources; @NotNull - private final AnimationObjects animationObjects; - - @NotNull private final TreasureTree treasureTree; @NotNull @@ -233,41 +139,17 @@ private final Spells<NumberSpell> numberSpells; @NotNull - private final ArchetypeTypeSet<G, A, R> archetypeTypeSet; - - @NotNull - private final FileFilter scriptFileFilter; - - @NotNull - private final GameObjectMatchers gameObjectMatchers; - - @NotNull - private final ScriptModel<G, A, R> scriptModel = new ScriptModel<G, A, R>(); - - @NotNull - private final ArchetypeChooserModel<G, A, R> archetypeChooserModel = new ArchetypeChooserModel<G, A, R>(); - - @NotNull private final ScriptArchEditor<G, A, R> scriptArchEditor; @NotNull - private final ScriptedEventEditor<G, A, R> scriptedEventEditor; - - @NotNull private final ScriptArchData<G, A, R> scriptArchData; @NotNull private final ScriptArchDataUtils<G, A, R> scriptArchDataUtils; @NotNull - private final FaceObjectProviders faceObjectProviders; - - @NotNull private final PluginParameterFactory<G, A, R> pluginParameterFactory; - @NotNull - private final NamedFilterList defaultFilterList; - /** * Creates a new instance. * @param scriptFileFilter the file filter for script files @@ -277,16 +159,11 @@ * not collect game objects spells * @param spellFile the spell file name to load or <code>null</code> to not * load numbered spells - * @param undefinedSpellIndex the index for no spell * @param scriptsDir the plugin scripts directory * @param errorView the error view to add errors to - * @param allowRandomMapParameters whether exit paths may point to random - * map parameters - * @param directionMap maps relative direction to map window direction * @param editorFactory the editor factory to use * @param forceReadFromFiles if set, read resources from individual files * ignoring the user's settings - * @param systemIcons the system icons for creating icons * @param globalSettings the global settings to use * @param configSourceFactory the config source factory to use * @param mapViewSettings the map view settings to use @@ -296,40 +173,19 @@ * @param faceObjects the face objects to use * @param faceObjectProviders the face object providers to use * @param gameObjectParser the game object parser to use - * @param gameObjectParserFactory the game object parser factory 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 + * @param autojoinLists the autojoin lists to use + * @param mapManager the map manager + * @param scriptModel the script model + * @param validators the map validators + * @param scriptedEventEditor the scripted event editor + * @param defaultFilterList the default filter list */ - public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, final int undefinedSpellIndex, @NotNull final String scriptsDir, final ErrorView errorView, final boolean allowRandomMapParameters, @NotNull final int[] directionMap, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final SystemIcons systemIcons, @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 GameObjectParserFactory<G, A, R> gameObjectParserFactory, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet) { - this.scriptFileFilter = scriptFileFilter; - this.scriptExtension = scriptExtension; - this.undefinedSpellIndex = undefinedSpellIndex; - this.scriptsDir = scriptsDir; - this.allowRandomMapParameters = allowRandomMapParameters; - this.directionMap = directionMap; - this.systemIcons = systemIcons; - this.globalSettings = globalSettings; - this.mapViewSettings = mapViewSettings; - this.pathManager = pathManager; - this.gameObjectMatchers = gameObjectMatchers; - this.faceObjects = faceObjects; - this.faceObjectProviders = faceObjectProviders; - this.gameObjectFactory = gameObjectFactory; - this.animationObjects = animationObjects; - this.archetypeTypeSet = archetypeTypeSet; - mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); - final MapArchObjectParserFactory<A> mapArchObjectParserFactory = editorFactory.newMapArchObjectParserFactory(); - final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser); - mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, archetypeSet, mapViewSettings); - final MapWriter<G, A, R> mapWriter = new DefaultMapWriter<G, A, R>(mapArchObjectParserFactory, gameObjectParser); - final AutojoinLists<G, A, R> autojoinLists = new AutojoinLists<G, A, R>(mapViewSettings); - topmostInsertionMode = new TopmostInsertionMode<G, A, R>(); - mapControlFactory = editorFactory.newMapControlFactory(archetypeChooserModel, autojoinLists, mapViewSettings, mapWriter, gameObjectFactory, gameObjectMatchers, globalSettings, topmostInsertionMode); - mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); - pickmapManager = new DefaultPickmapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); - scriptedEventEditor = new ScriptedEventEditor<G, A, R>(globalSettings); + 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) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -337,7 +193,6 @@ log.fatal("Cannot create XML parser: " + ex.getMessage()); throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } - validators = new DelegatingMapValidator<G, A, R>(); try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml"); final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, url); @@ -452,7 +307,6 @@ XMLSpellLoader.load(errorView, globalSettings.getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); } - defaultFilterList = new NamedFilterList(Collections.<NamedGameObjectMatcher>emptyList()); 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); @@ -462,7 +316,13 @@ /** * Creates a new {@link GUIMainControl} instance. + * @param scriptFileFilter the file filter for script files + * @param scriptExtension the file extension for script files * @param createDirectionPane whether the direction panel should be created + * @param mapManager the map manager + * @param pickmapManager the pickmap manager + * @param archetypeSet the archetype set + * @param mapControlFactory the map control factory * @param compassIcon the icon to display in the selected square view; * <code>null</code> to not show an icon * @param gridartaJarFilename the filename of the editor's .jar file @@ -479,10 +339,35 @@ * @param mapViewsManager the map views * @param rendererFactory the renderer factory * @param filterControl the filter control to use + * @param scriptExecutor the script executor to use + * @param scriptParameters the script parameters to use + * @param faceObjects the face objects + * @param globalSettings the global settings + * @param mapViewSettings the map view settings + * @param faceObjectProviders the face object providers + * @param pathManager the path manager + * @param topmostInsertionMode the "topmost" insertion mode + * @param gameObjectFactory the game object factory + * @param systemIcons the system icons for creating icons + * @param undefinedSpellIndex the index for no spell + * @param archetypeTypeSet the archetype type set + * @param mapArchObjectFactory the map arch object factory to use + * @param mapReaderFactory the map reader factory to use + * @param validators the map validators + * @param gameObjectMatchers the game object matchers + * @param scriptsDir the plugin scripts directory + * @param scriptModel the script model + * @param animationObjects the animation objects + * @param archetypeChooserModel the archetype chooser model + * @param allowRandomMapParameters whether exit paths may point to random + * map parameters + * @param scriptedEventEditor the scripted event editor + * @param directionMap maps relative direction to map window direction + * @param defaultFilterList the default filter list * @return the new instance */ - public GUIMainControl<G, A, R> createGUIMainControl(final boolean createDirectionPane, @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 MapViewsManager<G, A, R> mapViewsManager, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl) { - 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, mapViewsManager, rendererFactory, filterControl); + 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 MapViewsManager<G, A, R> mapViewsManager, @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) { + 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, mapViewsManager, rendererFactory, filterControl, scriptExecutor, scriptParameters); } @Deprecated Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-23 22:48:45 UTC (rev 7618) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-24 08:33:05 UTC (rev 7619) @@ -30,6 +30,7 @@ import net.sf.gridarta.gui.prefs.AppPrefsModel; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; +import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -46,8 +47,10 @@ 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; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; import net.sf.gridarta.model.io.MapArchObjectParserFactory; @@ -66,6 +69,9 @@ import net.sf.gridarta.model.settings.ConfigSourceFactory; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.resource.AbstractResources; +import net.sf.gridarta.script.ScriptExecutor; +import net.sf.gridarta.script.ScriptModel; +import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; @@ -84,7 +90,6 @@ * @param forceReadFromFiles whether the current config source should be * ignored * @param errorView the error view for reporting errors - * @param systemIcons the system icons for creating icons * @param globalSettings the global settings to use * @param configSourceFactory the config source factory to use * @param mapViewSettings the map view settings @@ -94,14 +99,21 @@ * @param faceObjects the face objects to use * @param faceObjectProviders the face object providers to use * @param gameObjectParser the game object parser to use - * @param gameObjectParserFactory the game object parser factory 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 + * @param autojoinLists the autojoin lists to use + * @param mapManager the map manager + * @param scriptModel the script model + * @param validators the map validators + * @param scriptedEventEditor the scripted event editor + * @param defaultFilterList the default filter list * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull SystemIcons systemIcons, @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 GameObjectParserFactory<G, A, R> gameObjectParserFactory, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet<G, A, R> archetypeTypeSet); + 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); /** * Returns the offset for drawing double faces. @@ -337,10 +349,34 @@ * @param mapViewsManager the map views * @param rendererFactory the renderer factory * @param filterControl the filter control + * @param scriptExecutor the script executor to use + * @param scriptParameters the script parameters to use + * @param mapManager the map manager + * @param pickmapManager the pickmap manager + * @param mapControlFactory the map control factory + * @param archetypeSet the archetype set + * @param faceObjects the face objects + * @param globalSettings the global settings + * @param mapViewSettings the map view settings + * @param faceObjectProviders the face object providers + * @param pathManager the path manager + * @param topmostInsertionMode the "topmost" insertion mode + * @param gameObjectFactory the game object factory + * @param systemIcons the system icons for creating icons + * @param archetypeTypeSet the archetyp... [truncated message content] |
From: <aki...@us...> - 2010-04-24 08:41:32
|
Revision: 7620 http://gridarta.svn.sourceforge.net/gridarta/?rev=7620&view=rev Author: akirschbaum Date: 2010-04-24 08:41:24 +0000 (Sat, 24 Apr 2010) Log Message: ----------- Remove DefaultMainControl.getResources(). 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-24 08:33:05 UTC (rev 7619) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -198,8 +198,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) { - 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); + 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); } /** {@inheritDoc} */ @@ -510,7 +510,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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { 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, mapViewsManager, 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 +521,7 @@ CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, - }, defaultFilterList); + }, defaultFilterList, resources); } /** {@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-24 08:33:05 UTC (rev 7619) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -151,8 +151,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) { - 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); + 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); } /** {@inheritDoc} */ @@ -367,7 +367,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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { 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, mapViewsManager, 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, @@ -378,7 +378,7 @@ CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, - }, defaultFilterList); + }, defaultFilterList, resources); } /** {@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-24 08:33:05 UTC (rev 7619) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -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) { - 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); + 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); } /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { + 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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { 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, mapViewsManager, 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); + }, defaultFilterList, resources); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-24 08:33:05 UTC (rev 7619) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -42,7 +42,6 @@ import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; @@ -127,9 +126,6 @@ private final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(); @NotNull - private final AbstractResources<G, A, R> resources; - - @NotNull private final TreasureTree treasureTree; @NotNull @@ -184,8 +180,9 @@ * @param validators the map validators * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list + * @param resources the 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) { + 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) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -253,7 +250,6 @@ final ArchetypeAttributeParser<G, A, R> archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(archetypeAttributeFactory); final ArchetypeTypeParser<G, A, R> archetypeTypeParser = new ArchetypeTypeParser<G, A, R>(archetypeAttributeParser); final ArchetypeTypeSetParser<G, A, R> archetypeTypeSetParser = new ArchetypeTypeSetParser<G, A, R>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); - final AbstractArchetypeParser<G, A, R, ?> archetypeParser = editorFactory.newArchetypeParser(errorView, gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, globalSettings); ArchetypeTypeList eventTypeSet = null; try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); @@ -278,7 +274,6 @@ scriptArchData = editorFactory.newScriptArchData(scriptedEventFactory); scriptArchDataUtils = editorFactory.newScriptArchDataUtils(scriptArchUtils, scriptedEventFactory, scriptedEventEditor); gameObjectFactory.setScriptArchData(scriptArchData); - resources = editorFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); final long timeStart = System.currentTimeMillis(); if (log.isInfoEnabled()) { log.info("Start to load archetypes..."); @@ -364,16 +359,11 @@ * @param scriptedEventEditor the scripted event editor * @param directionMap maps relative direction to map window direction * @param defaultFilterList the default filter list + * @param resources the resources * @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 MapViewsManager<G, A, R> mapViewsManager, @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) { + 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 MapViewsManager<G, A, R> mapViewsManager, @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, mapViewsManager, rendererFactory, filterControl, scriptExecutor, scriptParameters); } - @Deprecated - @NotNull - public AbstractResources<G, A, R> getResources() { - return resources; - } - } // class DefaultMainControl Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-24 08:33:05 UTC (rev 7619) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -110,10 +110,11 @@ * @param validators the map validators * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list + * @param resources the resources * @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); + 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); /** * Returns the offset for drawing double faces. @@ -373,10 +374,11 @@ * @param archetypeChooserModel the archetype chooser model * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list + * @param resources the resources * @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 MapViewsManager<G, A, R> mapViewsManager, @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); + GUIMainControl<G, A, R> createGUIMainControl(@NotNull DefaultMainControl<G, A, R> mainControl, @NotNull ErrorView errorView, @NotNull GUIUtils guiUtils, @NotNull ConfigSourceFactory configSourceFactory, @NotNull MapViewsManager<G, A, R> mapViewsManager, @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); /** * 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-24 08:33:05 UTC (rev 7619) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-24 08:41:24 UTC (rev 7620) @@ -56,6 +56,7 @@ import net.sf.gridarta.mapmanager.DefaultPickmapManager; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetype.ArchetypeSet; @@ -87,6 +88,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.resource.AbstractResources; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; @@ -259,9 +261,11 @@ final DelegatingMapValidator<G, A, R> validators = new DelegatingMapValidator<G, A, R>(); final ScriptedEventEditor<G, A, R> scriptedEventEditor = new ScriptedEventEditor<G, A, R>(globalSettings); final NamedFilterList defaultFilterList = new NamedFilterList(Collections.<NamedGameObjectMatcher>emptyList()); + 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; 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); + 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); } catch (final RuntimeException ex) { log.fatal(ex.getMessage(), ex); if (doExit) { @@ -282,13 +286,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, mapViewsManager, 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); + returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, mapViewsManager, 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); } else { try { switch (mode) { case NORMAL: try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, mapViewsManager, 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); + returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, mapViewsManager, 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); } catch (final Exception ex) { log.fatal(ex.getMessage(), ex); returnCode = 1; @@ -312,7 +316,7 @@ break; case COLLECT_ARCHES: - returnCode = new CollectArchesCommand(mainControl.getResources(), globalSettings).execute(); + returnCode = new CollectArchesCommand(resources, globalSettings).execute(); break; default: @@ -367,16 +371,17 @@ * @param archetypeChooserModel the archetype chooser model * @param scriptedEventEditor the scripted event editor * @param defaultFilterList the default filter list + * @param resources the resources * @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 MapViewsManager<G, A, R> mapViewsManager, @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) { + 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 MapViewsManager<G, A, R> mapViewsManager, @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 Sys... [truncated message content] |
From: <aki...@us...> - 2010-04-24 18:46:04
|
Revision: 7624 http://gridarta.svn.sourceforge.net/gridarta/?rev=7624&view=rev Author: akirschbaum Date: 2010-04-24 18:45:57 +0000 (Sat, 24 Apr 2010) Log Message: ----------- Do not extend JFrame. 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/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/mainactions/Exiter.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.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-24 08:56:42 UTC (rev 7623) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -34,7 +34,6 @@ import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.gui.misc.MainView; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefs; import net.sf.gridarta.gui.prefs.AppPrefsModel; @@ -457,7 +456,7 @@ /** {@inheritDoc} */ @Override - public void deleteLibraries(@NotNull final MainView<GameObject, MapArchObject, Archetype> mainView) { + public void deleteLibraries(@NotNull final Component parent) { // Delete libraries. final File libs = new File(System.getProperty("user.dir"), "lib"); final CharSequence libsString = ACTION_BUILDER.getString("oldLibs.okayLibs"); @@ -472,7 +471,7 @@ } } } - if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { + if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { Arrays.sort(libFiles); for (final File libFile : libFiles) { libFile.delete(); 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-24 08:56:42 UTC (rev 7623) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -29,7 +29,6 @@ import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.gui.misc.MainView; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefs; import net.sf.gridarta.gui.prefs.AppPrefsModel; @@ -337,7 +336,7 @@ /** {@inheritDoc} */ @Override - public void deleteLibraries(@NotNull final MainView<GameObject, MapArchObject, Archetype> mainView) { + public void deleteLibraries(@NotNull final Component parent) { } /** {@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-24 08:56:42 UTC (rev 7623) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -34,7 +34,6 @@ import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.gui.misc.MainView; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefs; import net.sf.gridarta.gui.prefs.AppPrefsModel; @@ -458,7 +457,7 @@ /** {@inheritDoc} */ @Override - public void deleteLibraries(@NotNull final MainView<GameObject, MapArchObject, Archetype> mainView) { + public void deleteLibraries(@NotNull final Component parent) { // Delete libraries. final File libs = new File(System.getProperty("user.dir"), "lib"); final CharSequence libsString = ACTION_BUILDER.getString("oldLibs.okayLibs"); @@ -473,7 +472,7 @@ } } } - if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { + if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { Arrays.sort(libFiles); for (final File libFile : libFiles) { libFile.delete(); Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-04-24 08:56:42 UTC (rev 7623) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -30,11 +30,13 @@ import java.awt.event.WindowEvent; import java.awt.geom.RectangularShape; import java.util.prefs.Preferences; +import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JMenuBar; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSplitPane; +import javax.swing.WindowConstants; import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.utils.GSplitPane; import net.sf.gridarta.model.archetype.Archetype; @@ -45,21 +47,17 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Main window of the level editor. Contains the desktop for the map windows * (internal frames) and the tools. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo shouldn't extend JFrame + * @author Andreas Kirschbaum */ -public class MainView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JFrame { +public class MainView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** * The action builder. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); @@ -100,6 +98,12 @@ */ private static final String DIVIDER_LOCATION_KEY3 = "MainWindow.dividerLocation3"; + /** + * The main window of the editor. + */ + @NotNull + private final JFrame frame; + private GSplitPane splitPane; private GSplitPane splitDownPane; @@ -152,21 +156,34 @@ * @param statusBar the status bar instance * @param buildNumber the application's build number * @param mapDesktop the map desktop to show + * @param icon the application's icon or <code>null</code> for default */ - public MainView(@NotNull final ActionListener exitAction, @NotNull final Component statusBar, @NotNull final String buildNumber, @NotNull final Component mapDesktop) { - super(ACTION_BUILDER.format("mainWindow.title", buildNumber)); + public MainView(@NotNull final ActionListener exitAction, @NotNull final Component statusBar, @NotNull final String buildNumber, @NotNull final Component mapDesktop, @Nullable final ImageIcon icon) { + frame = new JFrame(ACTION_BUILDER.format("mainWindow.title", buildNumber)); this.mapDesktop = mapDesktop; - add(statusBar, BorderLayout.SOUTH); - setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener(new WindowAdapter() { + frame.add(statusBar, BorderLayout.SOUTH); + frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { exitAction.actionPerformed(new ActionEvent(e.getSource(), 0, null)); } }); + if (icon != null) { + frame.setIconImage(icon.getImage()); + } } /** + * Returns the main window. + * @return the main window + */ + @NotNull + public JFrame getFrame() { + return frame; + } + + /** * Initializes (builds) this view. * @param gameObjectAttributesPanel the game object attributes panel * @param selectedSquareView the selected square view @@ -180,7 +197,7 @@ this.gameObjectAttributesPanel = gameObjectAttributesPanel; this.selectedSquareView = selectedSquareView; // calculate some default values in case there is no settings file - final RectangularShape screen = getGraphicsConfiguration().getBounds(); + final RectangularShape screen = frame.getGraphicsConfiguration().getBounds(); final int defwidth = (int) (0.9 * screen.getWidth()); final int defheight = (int) (0.9 * screen.getHeight()); @@ -189,17 +206,17 @@ final Container toolbarPanel = new JPanel(new BorderLayout()); toolbarPanel.add(mainToolbar, BorderLayout.NORTH); toolbarPanel.add(createCenterPanel(globalSettings.isMapSquareListBottom(), leftPanel), BorderLayout.CENTER); - add(toolbarPanel, BorderLayout.CENTER); + frame.add(toolbarPanel, BorderLayout.CENTER); - setJMenuBar(menuBar); + frame.setJMenuBar(menuBar); // set bounds (location and size) of the main frame - setBounds( + frame.setBounds( prefs.getInt(WINDOW_X, (int) (screen.getX() + (screen.getWidth() - defwidth) / 2.0)), prefs.getInt(WINDOW_Y, (int) (screen.getY() + (screen.getHeight() - defheight) / 2.0)), prefs.getInt(WINDOW_WIDTH, defwidth), prefs.getInt(WINDOW_HEIGHT, defheight)); - setExtendedState(prefs.getInt(WINDOW_STATE, getExtendedState())); + frame.setExtendedState(prefs.getInt(WINDOW_STATE, frame.getExtendedState())); } /** @@ -244,7 +261,7 @@ /** Notifies that the application is about to exit. */ public void appExitNotify() { // Store the location and size - final Rectangle bounds = getBounds(); + final Rectangle bounds = frame.getBounds(); prefs.putInt(WINDOW_X, bounds.x); prefs.putInt(WINDOW_Y, bounds.y); prefs.putInt(WINDOW_WIDTH, bounds.width); @@ -252,7 +269,7 @@ splitPane.saveLocation(); splitDownPane.saveLocation(); splitRightPane.saveLocation(); - prefs.putInt(WINDOW_STATE, getExtendedState()); + prefs.putInt(WINDOW_STATE, frame.getExtendedState()); } /** @@ -260,7 +277,7 @@ */ public void handleThrowable(final Throwable t) { Toolkit.getDefaultToolkit().beep(); - JOptionPane.showMessageDialog(this, t.getMessage(), "Error", JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(frame, t.getMessage(), "Error", JOptionPane.WARNING_MESSAGE); } /** @@ -268,7 +285,7 @@ * @return the default width */ private int getDefaultWidth() { - final RectangularShape screen = getGraphicsConfiguration().getBounds(); + final RectangularShape screen = frame.getGraphicsConfiguration().getBounds(); return (int) (0.9 * screen.getWidth()); } @@ -277,7 +294,7 @@ * @return the default height */ private int getDefaultHeight() { - final RectangularShape screen = getGraphicsConfiguration().getBounds(); + final RectangularShape screen = frame.getGraphicsConfiguration().getBounds(); return (int) (0.9 * screen.getHeight()); } Modified: trunk/src/app/net/sf/gridarta/mainactions/Exiter.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/Exiter.java 2010-04-24 08:56:42 UTC (rev 7623) +++ trunk/src/app/net/sf/gridarta/mainactions/Exiter.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -125,7 +125,7 @@ Thread.currentThread().interrupt(); log.warn("DelayedMapModelListenerManager was interrupted"); } - mainView.setEnabled(false); + mainView.getFrame().setEnabled(false); mainView.appExitNotify(); gameObjectAttributesControl.appExitNotify(); leftPanel.appExitNotify(); @@ -145,7 +145,7 @@ /** {@inheritDoc} */ @Override public void run() { - mainView.dispose(); + mainView.getFrame().dispose(); } }); } catch (final InterruptedException ex) { Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-24 08:56:42 UTC (rev 7623) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -25,7 +25,6 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.gui.misc.MainView; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefsModel; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; @@ -317,7 +316,10 @@ @NotNull MapPropertiesDialogFactory<G, A, R> newMapPropertiesDialogFactory(@NotNull GlobalSettings globalSettings, @NotNull MapManager<G, A, R> mapManager, @NotNull MapPathNormalizer mapPathNormalizer, @NotNull MapViewsManager<G, A, R> mapViewsManager); - void deleteLibraries(@NotNull MainView<G, A, R> mainView); + /** + * @param parent the parent component for dialogs + */ + void deleteLibraries(@NotNull Component parent); /** * Creates a new {@link NewMapDialogFactory} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-24 08:56:42 UTC (rev 7623) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-24 18:45:57 UTC (rev 7624) @@ -31,6 +31,7 @@ import java.util.prefs.Preferences; import javax.swing.Action; import javax.swing.ImageIcon; +import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; @@ -360,18 +361,16 @@ final MapDesktop<G, A, R> mapDesktop = new MapDesktop<G, A, R>(mapViewManager, mapManager, mapImageCache, mapViewsManager); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); final MapFolderTree<G, A, R> mapFolderTree = new MapFolderTree<G, A, R>(globalSettings.getPickmapDir()); - mainView = new MainView<G, A, R>(exitAction, statusBar, getBuildNumberAsString(), mapDesktop); final ImageIcon icon = systemIcons.getAppIcon(); - if (icon != null) { - mainView.setIconImage(icon.getImage()); - } - newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, mapArchObjectFactory, mainView); + mainView = new MainView<G, A, R>(exitAction, statusBar, getBuildNumberAsString(), mapDesktop, icon); + final JFrame mainViewFrame = mainView.getFrame(); + newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, mapArchObjectFactory, mainViewFrame); final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); - pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainView, pickmapManager, mapViewsManager); + pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainViewFrame, pickmapManager, mapViewsManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); - final CFTreasureListTree<G, A, R> treasureListTree = new CFTreasureListTree<G, A, R>(treasureTree, mainView, archetypeSet, faceObjectProviders, systemIcons); - final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainView, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers); + final CFTreasureListTree<G, A, R> treasureListTree = new CFTreasureListTree<G, A, R>(treasureTree, mainViewFrame, archetypeSet, faceObjectProviders, systemIcons); + final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainViewFrame, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, archetypeChooserModel, pickmapChooserModel); newMapDialogFactory.setObjectChooser(objectChooser); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); @@ -383,18 +382,18 @@ final MapModel<G, A, R> copyBufferMapModel = mapControlFactory.newMapModel(mapArchObject, null); 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>(mainView, copyBufferMapModel, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); - new About(mainView); - scriptEditControl = new ScriptEditControl(scriptFileFilter, scriptExtension, mainView, globalSettings.getMapsDirectory(), prefs); + final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBufferMapModel, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); + new About(mainViewFrame); + scriptEditControl = new ScriptEditControl(scriptFileFilter, scriptExtension, mainViewFrame, globalSettings.getMapsDirectory(), prefs); final TextAreaDefaults textAreaDefaults = new TextAreaDefaults(scriptEditControl); gameObjectAttributesDialogFactory.setTextAreaDefaults(textAreaDefaults); scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainView, FileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); - new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainView); + fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, FileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); final MapManagerActions<G, A, R> mapManagerActions = new MapManagerActions<G, A, R>(fileControl); - final MainActions<G, A, R> mainActions = new MainActions<G, A, R>(replaceDialogManager, mainView, globalSettings, validators, mapViewSettings, archetypeSet, copyBuffer, copyBufferMapModel, objectChooser, mapManager, mapViewManager, resources, faceObjectProviders, gameObjectFactory, insertionModeSet); + final MainActions<G, A, R> mainActions = new MainActions<G, A, R>(replaceDialogManager, mainViewFrame, globalSettings, validators, mapViewSettings, archetypeSet, copyBuffer, copyBufferMapModel, objectChooser, mapManager, mapViewManager, resources, faceObjectProviders, gameObjectFactory, insertionModeSet); final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("system_wall", "wall"); final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, new File(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml")); @@ -407,7 +406,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>(mainView, mainView, 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); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager); final LockedItemsControl<G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); @@ -416,14 +415,14 @@ final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory, gameObjectMatchers); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, defaultFilterList, mapManager, faceObjectProviders); final File scriptsFile = new File(globalSettings.getMapsDirectory(), scriptsDir); - scriptControl = new ScriptController<G, A, R>(filterControl, scriptParameters, mainView, pluginParameterViewFactory, scriptsFile, scriptModel, pluginParameterFactory, scriptExecutor, systemIcons); + scriptControl = new ScriptController<G, A, R>(filterControl, scriptParameters, mainViewFrame, pluginParameterViewFactory, scriptsFile, scriptModel, pluginParameterFactory, scriptExecutor, systemIcons); final ObjectChoiceDisplay<G, A, R> objectChoiceDisplay = new ObjectChoiceDisplay<G, A, R>(archetypeTypeSet, objectChooser); final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); final LeftPanel leftPanel = new LeftPanel(objectChooser, toolPalette, objectChoiceDisplay); exiter = new Exiter(delayedMapModelListenerManager, mainView, gameObjectAttributesControl, leftPanel, scriptEditControl, mainActions); - final UpdaterManager updaterManager = new UpdaterManager(exiter, mapManager, mainView, gridartaJarFilename); + final UpdaterManager updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); updaterManager.startup(); - new FindArchetypesDialogManager<G, A, R>(mainView, archetypeChooserControl, objectChooser, archetypeTypeSet); + new FindArchetypesDialogManager<G, A, R>(mainViewFrame, archetypeChooserControl, objectChooser, archetypeTypeSet); new UndoControl<G, A, R>(mapManager, gameObjectFactory, gameObjectMatchers); final JMenuBar menuBar = ACTION_BUILDER.createMenuBar(true, "main"); final MainToolbar mainToolbar = new MainToolbar(globalSettings); @@ -456,7 +455,7 @@ } else { scriptControl.getView().setMenu(pluginsMenu); } - gameObjectAttributesControl.createTabs(mapViewManager, delayedMapModelListenerManager, faceObjects, animationObjects, lockedItemsControl, monsterMatcher, selectedSquareView, mainView, scriptArchEditor, scriptArchData, scriptArchDataUtils, archetypeTypeSet, mapManager, faceObjectProviders, systemIcons, mapViewsManager); + gameObjectAttributesControl.createTabs(mapViewManager, delayedMapModelListenerManager, faceObjects, animationObjects, lockedItemsControl, monsterMatcher, selectedSquareView, mainViewFrame, scriptArchEditor, scriptArchData, scriptArchDataUtils, archetypeTypeSet, mapManager, faceObjectProviders, systemIcons, mapViewsManager); new ArchetypeValidator(animationObjects, faceObjects, errorView).validate(archetypeSet); new AnimationValidator(faceObjects, errorView).validate(animationObjects); @@ -468,7 +467,7 @@ globalSettings.setAutoPopupDocu(false); } - editorFactory.deleteLibraries(mainView); + editorFactory.deleteLibraries(mainViewFrame); final JMenu recentMenu = getMenu(menuBar, "recent"); @Nullable final RecentManager<G, A, R> recentManager; if (recentMenu == null) { @@ -486,7 +485,7 @@ new MapUserListenerManager<G, A, R>(toolPalette, mapViewsManager, mapManager, pickmapManager); if (archetypeSet.getArchetypeCount() == 0) { - ACTION_BUILDER.showMessageDialog(mainView, "loadArchesNoArchfiles"); + ACTION_BUILDER.showMessageDialog(mainViewFrame, "loadArchesNoArchfiles"); } else { new Loader<G, A, R>(errorView, mapFolderTree, mapReaderFactory, pickmapManager, mapViewsManager).load(); if (!pickmapChooserModel.isEmpty()) { @@ -529,7 +528,7 @@ /** Open the online help window. */ public void onlineHelp() { - new Help(mainView, "start.html").setVisible(true); + new Help(mainView.getFrame(), "start.html").setVisible(true); } /** Runs the garbage collection. */ @@ -557,14 +556,14 @@ * front. */ public void tod() { - TipOfTheDayManager.show(mainView); + TipOfTheDayManager.show(mainView.getFrame()); } /** Calls for zooming preview tool. */ public void zoom() { final MapControl<G, A, R> mapControl = mapManager.getCurrentMapControl(); if (mapControl == null) { - JOptionPane.showMessageDialog(mainView, "No map loaded! Please load a map!!", "Error", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(mainView.getFrame(), "No map loaded! Please load a map!!", "Error", JOptionPane.ERROR_MESSAGE); return; } new MapPreview(rendererFactory.newSimpleLevelRenderer(mapControl.getMapModel()).getFullImage()); @@ -579,7 +578,7 @@ if (prefsGroup == null) { prefsGroup = editorFactory.createPreferencesGroup(globalSettings, validators, appPrefsModel, exitConnectorModel, configSourceFactory); } - PreferencesPane.showPreferencesDialog(mainView, prefsGroup, false); + PreferencesPane.showPreferencesDialog(mainView.getFrame(), prefsGroup, false); } /** Invoked when user wants to exit from the program. */ @@ -632,7 +631,7 @@ @Deprecated @NotNull public Component getMainView() { - return mainView; + return mainView.getFrame(); } /** Control the server. */ @@ -640,11 +639,11 @@ public void controlServer() { if (controlServer == null) { controlServer = new ProcessRunner("controlServer", appPrefsModel.getServer()); - ACTION_BUILDER.showOnetimeMessageDialog(mainView, JOptionPane.WARNING_MESSAGE, "controlServerWarning"); + ACTION_BUILDER.showOnetimeMessageDialog(mainView.getFrame(), JOptionPane.WARNING_MESSAGE, "controlServerWarning"); } else { controlServer.setCommand(appPrefsModel.getServer()); } - controlServer.showDialog(mainView); + controlServer.showDialog(mainView.getFrame()); } /** Control the client. */ @@ -655,7 +654,7 @@ } else { controlClient.setCommand(appPrefsModel.getClient()); } - controlClient.showDialog(mainView); + controlClient.showDialog(mainView.getFrame()); } /** @@ -720,7 +719,7 @@ @ActionMethod public void collectSpells() { if (spellUtils != null) { - spellUtils.importSpells(globalSettings.getConfigurationDirectory(), mainView); + spellUtils.importSpells(globalSettings.getConfigurationDirectory(), mainView.getFrame()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-25 08:46:02
|
Revision: 7626 http://gridarta.svn.sourceforge.net/gridarta/?rev=7626&view=rev Author: akirschbaum Date: 2010-04-25 08:45:55 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Extract code from GUIMainControl into HelpActions. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -36,7 +36,7 @@ view.menu=resetView - gridVisible doubleFaces - prevWindow nextWindow plugins.menu=- editPlugins - savePlugins importPlugin window.menu=closeAll -help.menu=onlineHelp tod about update +help.menu=showHelp tipOfTheDay about update mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -36,7 +36,7 @@ view.menu=resetView - gridVisible smoothing - prevWindow nextWindow plugins.menu=- editPlugins - savePlugins importPlugin window.menu=closeAll -help.menu=onlineHelp tod about update +help.menu=showHelp tipOfTheDay about update mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -36,7 +36,7 @@ view.menu=resetView - gridVisible doubleFaces - prevWindow nextWindow plugins.menu=- editPlugins - savePlugins importPlugin window.menu=closeAll -help.menu=onlineHelp tod about update +help.menu=showHelp tipOfTheDay about update mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/action.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -124,9 +124,9 @@ scriptEditFile.menu=scriptEditNewScript scriptEditOpen - scriptEditSave scriptEditSaveAs - scriptEditClose scriptEditCloseAll scriptEditEdit.menu=scriptEditUndo scriptEditRedo - scriptEditCut scriptEditCopy scriptEditPaste - scriptEditFind scriptEditReplace scriptEditFindAgain -onlineHelp.icon=general/Help16 +showHelp.icon=general/Help16 -tod.icon=general/TipOfTheDay16 +tipOfTheDay.icon=general/TipOfTheDay16 about.icon=general/About16 Added: trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java 2010-04-25 08:45:55 UTC (rev 7626) @@ -0,0 +1,64 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.misc; + +import java.awt.Frame; +import net.sf.gridarta.gui.help.Help; +import net.sf.japi.swing.action.ActionMethod; +import net.sf.japi.swing.tod.TipOfTheDayManager; +import org.jetbrains.annotations.NotNull; + +/** + * Actions that are related to displaying help information. + * @author Andreas Kirschbaum + */ +public class HelpActions { + + /** + * The main view {@link Frame}. + */ + @NotNull + private final Frame mainViewFrame; + + /** + * Creates a new instance. + * @param mainViewFrame the main view frame + */ + public HelpActions(@NotNull final Frame mainViewFrame) { + this.mainViewFrame = mainViewFrame; + } + + /** + * Action for creating a new project. + */ + @ActionMethod + public void showHelp() { + new Help(mainViewFrame, "start.html").setVisible(true); + } + + /** + * Action for creating a new project. + */ + @ActionMethod + public void tipOfTheDay() { + TipOfTheDayManager.show(mainViewFrame); + } + +} // class StartActions Property changes on: trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-04-25 08:45:55 UTC (rev 7626) @@ -39,8 +39,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.settings.GlobalSettings; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -52,11 +50,6 @@ */ public class MainView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { - /** - * The action builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - /** Preferences. */ private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); @@ -96,14 +89,14 @@ /** * Constructs the main view and registers the given main controller. + * @param frame the main window of the editor * @param exitAction the action to execute when the window is closed * @param statusBar the status bar instance - * @param buildNumber the application's build number * @param mapDesktop the map desktop to show * @param icon the application's icon or <code>null</code> for default */ - public MainView(@NotNull final ActionListener exitAction, @NotNull final Component statusBar, @NotNull final String buildNumber, @NotNull final Component mapDesktop, @Nullable final ImageIcon icon) { - frame = new JFrame(ACTION_BUILDER.format("mainWindow.title", buildNumber)); + public MainView(@NotNull final JFrame frame, @NotNull final ActionListener exitAction, @NotNull final Component statusBar, @NotNull final Component mapDesktop, @Nullable final ImageIcon icon) { + this.frame = frame; this.mapDesktop = mapDesktop; frame.add(statusBar, BorderLayout.SOUTH); frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-25 08:45:55 UTC (rev 7626) @@ -51,7 +51,6 @@ import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; -import net.sf.gridarta.gui.help.Help; import net.sf.gridarta.gui.io.FileFilters; import net.sf.gridarta.gui.map.MapFileActions; import net.sf.gridarta.gui.map.cursor.MapCursorActions; @@ -71,6 +70,7 @@ import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.mapuserlistener.MapUserListenerManager; import net.sf.gridarta.gui.misc.About; +import net.sf.gridarta.gui.misc.HelpActions; import net.sf.gridarta.gui.misc.LeftPanel; import net.sf.gridarta.gui.misc.MainToolbar; import net.sf.gridarta.gui.misc.MainView; @@ -162,7 +162,6 @@ import net.sf.japi.swing.action.ActionMethod; import net.sf.japi.swing.prefs.PreferencesGroup; import net.sf.japi.swing.prefs.PreferencesPane; -import net.sf.japi.swing.tod.TipOfTheDayManager; import net.sf.japi.util.ThrowableHandler; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -362,8 +361,10 @@ final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); final MapFolderTree<G, A, R> mapFolderTree = new MapFolderTree<G, A, R>(globalSettings.getPickmapDir()); final ImageIcon icon = systemIcons.getAppIcon(); - mainView = new MainView<G, A, R>(exitAction, statusBar, getBuildNumberAsString(), mapDesktop, icon); - final JFrame mainViewFrame = mainView.getFrame(); + final JFrame mainViewFrame = new JFrame(ACTION_BUILDER.format("mainWindow.title", getBuildNumberAsString())); + final HelpActions helpActions = new HelpActions(mainViewFrame); + ACTION_BUILDER.createActions(true, helpActions, "showHelp", "tipOfTheDay"); + mainView = new MainView<G, A, R>(mainViewFrame, exitAction, statusBar, mapDesktop, icon); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, mapArchObjectFactory, mainViewFrame); final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); @@ -463,7 +464,7 @@ if (globalSettings.isAutoPopupDocu()) { // do an automated help popup because the docu version has increased // (people won't notice the docu otherwise - nobody expects a docu in opensource) - onlineHelp(); + helpActions.showHelp(); globalSettings.setAutoPopupDocu(false); } @@ -526,11 +527,6 @@ newLevel(); } - /** Open the online help window. */ - public void onlineHelp() { - new Help(mainView.getFrame(), "start.html").setVisible(true); - } - /** Runs the garbage collection. */ @ActionMethod public void gc() { @@ -551,14 +547,6 @@ fileControl.openFile(false); } - /** - * Invoked to show the next tip of the day or bring the tip of the day to - * front. - */ - public void tod() { - TipOfTheDayManager.show(mainView.getFrame()); - } - /** Calls for zooming preview tool. */ public void zoom() { final MapControl<G, A, R> mapControl = mapManager.getCurrentMapControl(); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -733,12 +733,12 @@ help.text=Help help.mnemonic=H -onlineHelp.text=Help -onlineHelp.mnemonic=H -onlineHelp.accel=F1 +showHelp.text=Help +showHelp.mnemonic=H +showHelp.accel=F1 -tod.text=Tip Of The Day... -tod.mnemonic=T +tipOfTheDay.text=Tip Of The Day... +tipOfTheDay.mnemonic=T about.text=About... about.mnemonic=A Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -682,11 +682,11 @@ help.text=Hilfe help.mnemonic=H -onlineHelp.text=Hilfe -onlineHelp.mnemonic=H +showHelp.text=Hilfe +showHelp.mnemonic=H -tod.text=Tipp des Tages... -tod.mnemonic=T +tipOfTheDay.text=Tipp des Tages... +tipOfTheDay.mnemonic=T about.text=\xDCber... about.mnemonic=B Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -677,11 +677,11 @@ help.text=Aide help.mnemonic=D -onlineHelp.text=Aide -onlineHelp.mnemonic=A +showHelp.text=Aide +showHelp.mnemonic=A -#tod.text= -#tod.mnemonic= +#tipOfTheDay.text= +#tipOfTheDay.mnemonic= about.text=\xC0 propos... about.mnemonic=P Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-04-24 21:18:21 UTC (rev 7625) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-04-25 08:45:55 UTC (rev 7626) @@ -681,11 +681,11 @@ help.text=Hj\xE4lp help.mnemonic=H -onlineHelp.text=Inbyggd hj\xE4lp -onlineHelp.mnemonic=H +showHelp.text=Inbyggd hj\xE4lp +showHelp.mnemonic=H -tod.text=Dagens tips... -tod.mnemonic=T +tipOfTheDay.text=Dagens tips... +tipOfTheDay.mnemonic=T about.text=Om... about.mnemonic=O This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-25 21:08:40
|
Revision: 7631 http://gridarta.svn.sourceforge.net/gridarta/?rev=7631&view=rev Author: akirschbaum Date: 2010-04-25 21:08:32 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Extract AnimationObjectsReader from DefaultAnimationObjects. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -39,6 +39,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.io.AnimationObjectsReader; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; @@ -211,7 +212,7 @@ final String animPath = pair.getFirst(); final File animFile = pair.getSecond(); try { - animationObjects.loadAnims(errorViewCollector, animPath, animFile, "anim ", false); + AnimationObjectsReader.loadAnims(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); } catch (final IOException ex) { errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); } catch (final AnimationParseException ex) { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -38,6 +38,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.io.AnimationObjectsReader; 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; @@ -207,7 +208,7 @@ try { final Reader in = new BufferedReader(isr); try { - animationObjects.loadAnims(errorViewCollector, in, "animation ", true, filename, null); + AnimationObjectsReader.loadAnims(animationObjects, errorViewCollector, in, "animation ", true, filename, null); } finally { in.close(); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -39,6 +39,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.io.AnimationObjectsReader; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -211,7 +212,7 @@ final String animPath = pair.getFirst(); final File animFile = pair.getSecond(); try { - animationObjects.loadAnims(errorViewCollector, animPath, animFile, "anim ", false); + AnimationObjectsReader.loadAnims(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); } catch (final IOException ex) { errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); } catch (final AnimationParseException ex) { Modified: trunk/src/app/net/sf/gridarta/model/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/anim/AnimationObjects.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/src/app/net/sf/gridarta/model/anim/AnimationObjects.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -19,15 +19,9 @@ package net.sf.gridarta.model.anim; -import java.io.File; -import java.io.IOException; -import java.io.Reader; -import java.util.Map; import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.data.NamedObjects; -import net.sf.gridarta.model.errorview.ErrorViewCollector; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * AnimationObjects is a container for {@link AnimationObject}s. @@ -45,43 +39,4 @@ */ void addAnimationObject(@NotNull String animName, @NotNull String list, @NotNull String path) throws DuplicateAnimationException, IllegalAnimationException; - /** - * Loads animations from a file. - * @param errorViewCollector the error view collector for reporting errors - * @param path the animation path - * @param animFile file to load animations from - * @param startKey the key that begins an animation block; it must end with - * a space character - * @param ignoreOtherText if set, ignore all text outside animation - * definitions - * @throws IOException in case of I/O errors - * @throws java.io.FileNotFoundException in case the file couldn't be - * opened - * @throws AnimationParseException in case parsing the animation reveals - * errors - */ - void loadAnims(@NotNull ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull File animFile, @NotNull String startKey, boolean ignoreOtherText) throws IOException, AnimationParseException; - - /** - * Loads any number of animations from a reader. It is not neccessary to - * provide a BufferedReader for buffering. This method will always wrap the - * supplied <var>reader</var> with a BufferedReader if the supplied reader - * isn't already a BufferedReader itself. - * @param errorViewCollector the error view collector for reporting errors - * @param reader Reader to load animations from - * @param startKey the key that begins an animation block; it must end with - * a space character - * @param ignoreOtherText if set, ignore all text outside animation - * definitions - * @param path Path relative to the arch directory, used to create tree - * information; either <code>animations</code> or this parameter must be - * non-<code>null</code> - * @param animations maps animation name to animation path; either - * <code>path</code> or this parameter must be non-<code>null</code> - * @throws IOException in case of I/O errors - * @throws AnimationParseException in case parsing the animation reveals - * errors - */ - void loadAnims(@NotNull ErrorViewCollector errorViewCollector, Reader reader, @NotNull String startKey, boolean ignoreOtherText, @Nullable String path, @Nullable Map<String, String> animations) throws IOException, AnimationParseException; - } // interface AnimationObjects Modified: trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -19,27 +19,19 @@ package net.sf.gridarta.model.anim; -import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; -import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStreamReader; import java.io.OutputStreamWriter; -import java.io.Reader; -import java.util.Map; import net.sf.gridarta.model.data.AbstractNamedObjects; import net.sf.gridarta.model.data.IllegalNamedObjectException; import net.sf.gridarta.model.data.NamedObject; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Abstract base implementation of {@link AnimationObjects}. @@ -70,17 +62,6 @@ this.animTreeFile = animTreeFile; } - /** {@inheritDoc} */ - @Override - public void loadAnims(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws IOException, AnimationParseException { - final Reader in = new InputStreamReader(new FileInputStream(animFile), IOUtils.MAP_ENCODING); - try { - loadAnims(errorViewCollector, in, startKey, ignoreOtherText, path, null); - } finally { - in.close(); - } - } - /** * Adds a new animation object. * @param animName name of the animation object to add @@ -102,69 +83,6 @@ } } - /** {@inheritDoc} */ - @SuppressWarnings({ "IOResourceOpenedButNotSafelyClosed" }) - @Override - public void loadAnims(@NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path, @Nullable final Map<String, String> animations) throws IOException, AnimationParseException { - if (path == null && animations == null) { - throw new IllegalArgumentException(); - } - if (path != null && animations != null) { - throw new IllegalArgumentException(); - } - final BufferedReader in = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); - boolean inAnim = false; - String animName = null; - final StringBuilder animText = new StringBuilder(); - String line2; - int lineNumber; - for (lineNumber = 1; (line2 = in.readLine()) != null; lineNumber++) { - final String line = line2.trim(); - if (line.startsWith("#") || line.length() == 0) { - /* ignore comment lines. */ - } else if (line.startsWith(startKey)) { - if (inAnim) { - throw new AnimationParseException("mina", line, lineNumber); - } - inAnim = true; - animName = line.substring(startKey.length()); - animText.setLength(0); - } else if ("mina".equals(line)) { - if (!inAnim) { - throw new AnimationParseException(startKey + "...", line, lineNumber); - } - inAnim = false; - final String animPath; - if (path != null) { - animPath = path; - } else { - assert animations != null; - final String tmp = animations.get(animName); - if (tmp == null) { - errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "no path found for animation: " + animName); - animPath = "/" + animName; - } else { - animPath = tmp; - } - } - try { - addAnimationObject(animName, animText.toString(), animPath); - } catch (final DuplicateAnimationException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "duplicate animation: " + animName); - } catch (final IllegalAnimationException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "illegal animation: " + ex.getAnimationObject().getPath()); - } - } else if (inAnim) { - animText.append(line).append('\n'); - } else if (!ignoreOtherText) { - throw new AnimationParseException(startKey + "...", line, lineNumber); - } - } - if (inAnim) { - throw new AnimationParseException("mina", null, lineNumber); - } - } - /** * {@inheritDoc} Collects the Animations. The animation data is written to * "animations". The tree information for the editor is written to Added: trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java (rev 0) +++ trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -0,0 +1,158 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.io; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Map; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.AnimationParseException; +import net.sf.gridarta.model.anim.DuplicateAnimationException; +import net.sf.gridarta.model.anim.IllegalAnimationException; +import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.utils.IOUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Utility class for reading {@link AnimationObjects} from files. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ +public class AnimationObjectsReader { + + /** + * Private constructor to prevent instantiation. + */ + private AnimationObjectsReader() { + } + + /** + * Loads animations from a file. + * @param animationObjects the animation objects to update + * @param errorViewCollector the error view collector for reporting errors + * @param path the animation path + * @param animFile file to load animations from + * @param startKey the key that begins an animation block; it must end with + * a space character + * @param ignoreOtherText if set, ignore all text outside animation + * definitions + * @throws IOException in case of I/O errors + * @throws java.io.FileNotFoundException in case the file couldn't be + * opened + * @throws AnimationParseException in case parsing the animation reveals + * errors + */ + public static void loadAnims(@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws IOException, AnimationParseException { + final Reader in = new InputStreamReader(new FileInputStream(animFile), IOUtils.MAP_ENCODING); + try { + loadAnims(animationObjects, errorViewCollector, in, startKey, ignoreOtherText, path, null); + } finally { + in.close(); + } + } + + /** + * Loads any number of animations from a reader. It is not neccessary to + * provide a BufferedReader for buffering. This method will always wrap the + * supplied <var>reader</var> with a BufferedReader if the supplied reader + * isn't already a BufferedReader itself. + * @param animationObjects the animation objects to update + * @param errorViewCollector the error view collector for reporting errors + * @param reader Reader to load animations from + * @param startKey the key that begins an animation block; it must end with + * a space character + * @param ignoreOtherText if set, ignore all text outside animation + * definitions + * @param path Path relative to the arch directory, used to create tree + * information; either <code>animations</code> or this parameter must be + * non-<code>null</code> + * @param animations maps animation name to animation path; either + * <code>path</code> or this parameter must be non-<code>null</code> + * @throws IOException in case of I/O errors + * @throws AnimationParseException in case parsing the animation reveals + * errors + */ + public static void loadAnims(@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path, @Nullable final Map<String, String> animations) throws IOException, AnimationParseException { + if (path == null && animations == null) { + throw new IllegalArgumentException(); + } + if (path != null && animations != null) { + throw new IllegalArgumentException(); + } + final BufferedReader in = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); + boolean inAnim = false; + String animName = null; + final StringBuilder animText = new StringBuilder(); + String line2; + int lineNumber; + for (lineNumber = 1; (line2 = in.readLine()) != null; lineNumber++) { + final String line = line2.trim(); + if (line.startsWith("#") || line.length() == 0) { + /* ignore comment lines. */ + } else if (line.startsWith(startKey)) { + if (inAnim) { + throw new AnimationParseException("mina", line, lineNumber); + } + inAnim = true; + animName = line.substring(startKey.length()); + animText.setLength(0); + } else if ("mina".equals(line)) { + if (!inAnim) { + throw new AnimationParseException(startKey + "...", line, lineNumber); + } + inAnim = false; + final String animPath; + if (path != null) { + animPath = path; + } else { + assert animations != null; + final String tmp = animations.get(animName); + if (tmp == null) { + errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "no path found for animation: " + animName); + animPath = "/" + animName; + } else { + animPath = tmp; + } + } + try { + animationObjects.addAnimationObject(animName, animText.toString(), animPath); + } catch (final DuplicateAnimationException ex) { + errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "duplicate animation: " + animName); + } catch (final IllegalAnimationException ex) { + errorViewCollector.addWarning(ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, "illegal animation: " + ex.getAnimationObject().getPath()); + } + } else if (inAnim) { + animText.append(line).append('\n'); + } else if (!ignoreOtherText) { + throw new AnimationParseException(startKey + "...", line, lineNumber); + } + } + if (inAnim) { + throw new AnimationParseException("mina", null, lineNumber); + } + } + +} // class AnimationObjectsReader Property changes on: trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java 2010-04-25 13:56:12 UTC (rev 7630) +++ trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java 2010-04-25 21:08:32 UTC (rev 7631) @@ -42,6 +42,7 @@ import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.face.IllegalFaceException; import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.AnimationObjectsReader; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.action.ActionBuilder; @@ -115,7 +116,7 @@ try { final Reader bufferedReader = new BufferedReader(reader); try { - animationObjects.loadAnims(errorViewCollector, bufferedReader, "anim ", false, null, animations); + AnimationObjectsReader.loadAnims(animationObjects, errorViewCollector, bufferedReader, "anim ", false, null, animations); } finally { bufferedReader.close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-04-27 20:49:41
|
Revision: 7646 http://gridarta.svn.sourceforge.net/gridarta/?rev=7646&view=rev Author: akirschbaum Date: 2010-04-27 20:49:35 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Support autojoin when inserting game objects from pickmaps. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooserTab.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/atrinik/ChangeLog 2010-04-27 20:49:35 UTC (rev 7646) @@ -1,3 +1,7 @@ +2010-04-27 Andreas Kirschbaum + + * Support autojoin when inserting game objects from pickmaps. + 2010-04-23 Andreas Kirschbaum * Allow undo/redo of reverted maps. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/crossfire/ChangeLog 2010-04-27 20:49:35 UTC (rev 7646) @@ -1,3 +1,7 @@ +2010-04-27 Andreas Kirschbaum + + * Support autojoin when inserting game objects from pickmaps. + 2010-04-23 Andreas Kirschbaum * Allow undo/redo of reverted maps. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/daimonin/ChangeLog 2010-04-27 20:49:35 UTC (rev 7646) @@ -1,3 +1,7 @@ +2010-04-27 Andreas Kirschbaum + + * Support autojoin when inserting game objects from pickmaps. + 2010-04-23 Andreas Kirschbaum * Allow undo/redo of reverted maps. Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2010-04-27 20:49:35 UTC (rev 7646) @@ -20,7 +20,6 @@ package net.sf.gridarta.gui.archetypechooser; import java.awt.Component; -import java.awt.Point; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -33,12 +32,9 @@ import net.sf.gridarta.model.archetypechooser.ArchetypeChooserFolder; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserPanel; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.model.map.mapmodel.InsertionMode; -import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -141,14 +137,6 @@ /** {@inheritDoc} */ @Nullable @Override - public G insertSelectedObject(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point pos, final boolean allowMany, @NotNull final InsertionMode<G, A, R> insertionMode) { - final BaseObject<G, A, R, ?> selectedArchetype = getSelection(); - return selectedArchetype == null ? null : mapModel.insertBaseObject(selectedArchetype, pos, allowMany, true, insertionMode, archetypeChooserModel.getDirection()); - } - - /** {@inheritDoc} */ - @Nullable - @Override public R getSelection() { final ArchetypeChooserPanel<G, A, R> selectedPanel = archetypeChooserModel.getSelectedPanel(); return selectedPanel != null ? selectedPanel.getSelectedFolder().getSelectedArchetype() : null; // XXX: should not cast Archetype -> GameObject Modified: trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/src/app/net/sf/gridarta/gui/objectchooser/DefaultObjectChooser.java 2010-04-27 20:49:35 UTC (rev 7646) @@ -308,7 +308,16 @@ @Nullable @Override public G insertSelectedObject(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point pos, final boolean allowMany, final InsertionMode<G, A, R> insertionMode) { - return activeTab == null ? null : activeTab.insertSelectedObject(mapModel, pos, allowMany, insertionMode); + if (activeTab == null) { + return null; + } + + final BaseObject<G, A, R, ?> selectedArchetype = activeTab.getSelection(); + if (selectedArchetype == null) { + return null; + } + + return mapModel.insertBaseObject(selectedArchetype, pos, allowMany, true, insertionMode, archetypeChooserModel.getDirection()); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooserTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooserTab.java 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/src/app/net/sf/gridarta/gui/objectchooser/ObjectChooserTab.java 2010-04-27 20:49:35 UTC (rev 7646) @@ -20,14 +20,11 @@ package net.sf.gridarta.gui.objectchooser; import java.awt.Component; -import java.awt.Point; import java.util.List; 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.map.mapmodel.InsertionMode; -import net.sf.gridarta.model.map.mapmodel.MapModel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -58,19 +55,6 @@ boolean isMatching(G gameObject); /** - * Adds the selected game object to a map. - * @param mapModel the map model to add to - * @param pos the location to add to - * @param allowMany whether to allow multiple copies of the inserted game - * object - * @param insertionMode the insertion mode to use - * @return the inserted game object, or <code>null</code> if nothing was - * inserted - */ - @Nullable - G insertSelectedObject(@NotNull MapModel<G, A, R> mapModel, @NotNull Point pos, boolean allowMany, @NotNull InsertionMode<G, A, R> insertionMode); - - /** * Returns the selected game object. * @return one of the selected game objects or <code>null</code> if no game * objects are selected Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-27 20:14:08 UTC (rev 7645) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-04-27 20:49:35 UTC (rev 7646) @@ -20,7 +20,6 @@ package net.sf.gridarta.gui.pickmapchooser; import java.awt.Component; -import java.awt.Point; import java.io.File; import java.io.IOException; import java.util.Collection; @@ -47,7 +46,6 @@ import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; 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.io.MapReaderFactory; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -55,7 +53,6 @@ import net.sf.gridarta.model.map.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapcontrol.MapControlListener; -import net.sf.gridarta.model.map.mapmodel.InsertionMode; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; @@ -496,14 +493,6 @@ } /** {@inheritDoc} */ - @Nullable - @Override - public G insertSelectedObject(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point pos, final boolean allowMany, @NotNull final InsertionMode<G, A, R> insertionMode) { - final BaseObject<G, A, R, ?> gameObject = getSelection(); - return gameObject == null ? null : mapModel.insertBaseObject(gameObject, pos, allowMany, false, insertionMode, null); - } - - /** {@inheritDoc} */ @NotNull @Override public List<G> getSelections() { 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:39:30
|
Revision: 7649 http://gridarta.svn.sourceforge.net/gridarta/?rev=7649&view=rev Author: akirschbaum Date: 2010-04-28 10:39:23 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Move creation of MapViewsManager instance from GridartaEditor into GUIMainControl. 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/GUIMainControl.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-27 21:42:37 UTC (rev 7648) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -509,8 +509,8 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { - 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, mapViewsManager, 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, + 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) { + 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, CommonConstants.SOUTH_EAST, 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-27 21:42:37 UTC (rev 7648) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -366,8 +366,8 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { - 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, mapViewsManager, 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, + 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) { + 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, CommonConstants.EAST, 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-27 21:42:37 UTC (rev 7648) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -510,8 +510,8 @@ /** {@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 MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @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) { - 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, mapViewsManager, 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, + 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) { + 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, CommonConstants.SOUTH_EAST, Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-27 21:42:37 UTC (rev 7648) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -33,7 +33,6 @@ import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.io.FileFilters; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.scripts.DefaultScriptArchEditor; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; @@ -331,7 +330,6 @@ * @param errorView the error view to add errors to * @param cacheFiles the cache files for icon and preview images * @param configSourceFactory the config source factory to use - * @param mapViewsManager the map views * @param rendererFactory the renderer factory * @param filterControl the filter control to use * @param scriptExecutor the script executor to use @@ -362,8 +360,8 @@ * @param resources the resources * @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 MapViewsManager<G, A, R> mapViewsManager, @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, mapViewsManager, rendererFactory, filterControl, scriptExecutor, scriptParameters); + 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); } } // class DefaultMainControl Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-27 21:42:37 UTC (rev 7648) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -349,7 +349,6 @@ * @param errorView the error view to add errors to * @param guiUtils the gui utils for creating icons * @param configSourceFactory the config source factory - * @param mapViewsManager the map views * @param rendererFactory the renderer factory * @param filterControl the filter control * @param scriptExecutor the script executor to use @@ -380,7 +379,7 @@ * @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 MapViewsManager<G, A, R> mapViewsManager, @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); /** * Creates a new {@link AbstractResources} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-27 21:42:37 UTC (rev 7648) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -55,6 +55,7 @@ import net.sf.gridarta.gui.map.cursor.MapCursorActions; import net.sf.gridarta.gui.map.mapactions.DefaultMapActions; import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewManager; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.ImageCreator; @@ -340,11 +341,12 @@ * @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, @Deprecated @NotNull final MapViewsManager<G, A, R> mapViewsManager, @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, 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; - this.mapViewsManager = mapViewsManager; + final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); + mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory); this.globalSettings = globalSettings; this.editorFactory = editorFactory; this.scriptExtension = scriptExtension; Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-27 21:42:37 UTC (rev 7648) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-04-28 10:39:23 UTC (rev 7649) @@ -43,8 +43,6 @@ import net.sf.gridarta.gui.errorview.DefaultErrorView; import net.sf.gridarta.gui.filter.DefaultFilterControl; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.map.mapview.MapViewFactory; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.misc.SplashScreen; import net.sf.gridarta.gui.prefs.GUIPrefs; @@ -241,8 +239,6 @@ final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, gameObjectParser, faceObjectProviders, systemIcons); - final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); - final MapViewsManager<G, A, R> mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); @@ -284,13 +280,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, mapViewsManager, 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); } else { try { switch (mode) { case NORMAL: try { - returnCode = runNormal(args2, mainControl, editorFactory, splashScreen, errorView, guiUtils, configSourceFactory, mapViewsManager, 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); } catch (final Exception ex) { log.fatal(ex.getMessage(), ex); returnCode = 1; @@ -343,7 +339,6 @@ * @param guiUtils the gui utils to use * @param configSourceFactory the config source factory to use * @param rendererFactory the renderer factory to use - * @param mapViewsManager the map views manager to use * @param filterControl the filter control to use * @param scriptExecutor the script executor to use * @param scriptParameters the script parameters to use @@ -372,14 +367,14 @@ * @param resources the resources * @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 MapViewsManager<G, A, R> mapViewsManager, @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> 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) { final GUIMainControl<G, A, R>[] tmp2 = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; final Runnable runnable2 = new Runnable() { /** {@inheritDoc} */ @Override public void run() { - tmp2[0] = editorFactory.createGUIMainControl(mainControl, errorView, guiUtils, configSourceFactory, mapViewsManager, 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); + tmp2[0] = editorFactory.createGUIMainControl(mainControl, 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); } }; @@ -464,7 +459,6 @@ * @param errorView the error view to add errors to * @param guiUtils the gui utils to use * @param configSourceFactory the config source factory to use - * @param mapViewsManager the map views manager to use * @param rendererFactory the renderer factory to use * @param filterControl the filter control to use * @param scriptExecutor the script executor to use @@ -494,14 +488,14 @@ * @param resources the resources * @return return code suitable for passing to {@link System#exit(int)} */ - private int runNormal(@NotNull final Iterable<String> args, @NotNull final DefaultMainControl<G, A, R> mainControl, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final SplashScreen splashScreen, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @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 runNormal(@NotNull final Iterable<String> args, @NotNull final DefaultMainControl<G, A, R> mainControl, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final SplashScreen splashScreen, @NotNull final ErrorView errorView, @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) { final GUIMainControl<G, A, R>[] guiMainControl = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; final Runnable runnable = new Runnable() { /** {@inheritDoc} */ @Override public void run() { - guiMainControl[0] = editorFactory.createGUIMainControl(mainControl, errorView, guiUtils, configSourceFactory, mapViewsManager, 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); + guiMainControl[0] = editorFactory.createGUIMainControl(mainControl, 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); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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 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 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: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: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 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-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-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 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 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 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 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-05-01 15:05:00
|
Revision: 7678 http://gridarta.svn.sourceforge.net/gridarta/?rev=7678&view=rev Author: akirschbaum Date: 2010-05-01 15:04:53 +0000 (Sat, 01 May 2010) Log Message: ----------- Mark loaded or reverted maps as unmodified. 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/mapmanager/AbstractMapManager.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-05-01 13:17:17 UTC (rev 7677) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-05-01 15:04:53 UTC (rev 7678) @@ -127,6 +127,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -146,6 +147,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } 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-05-01 13:17:17 UTC (rev 7677) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-05-01 15:04:53 UTC (rev 7678) @@ -127,6 +127,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -145,6 +146,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } 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-05-01 13:17:17 UTC (rev 7677) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-05-01 15:04:53 UTC (rev 7678) @@ -127,6 +127,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); @@ -146,6 +147,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); mapControl.getMapModel().setMapFile(file); Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-05-01 13:17:17 UTC (rev 7677) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-05-01 15:04:53 UTC (rev 7678) @@ -350,6 +350,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } /** {@inheritDoc} */ Modified: trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-05-01 13:17:17 UTC (rev 7677) +++ trunk/src/test/net/sf/gridarta/model/map/mapcontrol/TestMapControlFactory.java 2010-05-01 15:04:53 UTC (rev 7678) @@ -117,6 +117,7 @@ } finally { mapModel.endTransaction(); } + mapModel.resetModified(); } 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-05-05 10:43:38
|
Revision: 7681 http://gridarta.svn.sourceforge.net/gridarta/?rev=7681&view=rev Author: akirschbaum Date: 2010-05-05 10:43:30 +0000 (Wed, 05 May 2010) Log Message: ----------- Change location of game object attributes editor: it is now a tab in the game object attributes panel. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/atrinik/ChangeLog 2010-05-05 10:43:30 UTC (rev 7681) @@ -1,3 +1,8 @@ +2010-05-05 Andreas Kirschbaum + + * Change location of game object attributes editor: it is now a + tab in the game object attributes panel. + 2010-04-29 Andreas Kirschbaum * Close game object attributes dialogs when the associated game Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/crossfire/ChangeLog 2010-05-05 10:43:30 UTC (rev 7681) @@ -1,3 +1,8 @@ +2010-05-05 Andreas Kirschbaum + + * Change location of game object attributes editor: it is now a + tab in the game object attributes panel. + 2010-04-29 Andreas Kirschbaum * Close game object attributes dialogs when the associated game Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/daimonin/ChangeLog 2010-05-05 10:43:30 UTC (rev 7681) @@ -1,3 +1,8 @@ +2010-05-05 Andreas Kirschbaum + + * Change location of game object attributes editor: it is now a + tab in the game object attributes panel. + 2010-04-29 Andreas Kirschbaum * Close game object attributes dialogs when the associated game Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-05 10:43:30 UTC (rev 7681) @@ -24,8 +24,6 @@ import java.awt.Frame; import java.awt.GridLayout; import java.awt.Point; -import java.awt.Toolkit; -import java.awt.geom.Dimension2D; import java.io.File; import java.util.Collection; import java.util.HashSet; @@ -35,7 +33,6 @@ import javax.swing.Action; import javax.swing.JButton; import javax.swing.JPanel; -import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.SwingConstants; import net.sf.gridarta.delayedmapmodel.DelayedMapModelListenerManager; @@ -50,7 +47,6 @@ import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModelListener; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; -import net.sf.gridarta.gui.utils.GSplitPane; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.anim.AnimationObjects; @@ -73,8 +69,6 @@ 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.Exiter; -import net.sf.gridarta.utils.ExiterListener; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.utils.SystemIcons; @@ -172,17 +166,6 @@ */ private boolean isInAutoApplyArchPanelChanges = false; - /** - * The preferences key for stroing the location of the {@link #splitPane}. - */ - private static final String MAPARCHPANEL_LOCATION_KEY = "MainWindowMapArchPanel.dividerLocation"; - - /** - * The split pane separating the game object attributes panel and the - * game object attributes editor. - */ - private final GSplitPane splitPane; - /** Action for "apply changes". */ private final Action aMapArchApply = ACTION_BUILDER.createAction(false, "mapArchApply", this); @@ -429,9 +412,8 @@ * @param gameObjectFactory the game object factory for creating new game * objects * @param gameObjectMatchers the game object matchers to use - * @param exiter the exiter instance */ - public GameObjectAttributesControl(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final Exiter exiter) { + public GameObjectAttributesControl(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final SelectedSquareView<G, A, R> selectedSquareView, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { super(new BorderLayout()); this.gameObjectAttributesModel = gameObjectAttributesModel; this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; @@ -443,12 +425,9 @@ tabbedPane = new JTabbedPane(SwingConstants.LEFT); add(tabbedPane, BorderLayout.CENTER); - final JPanel mapArchPanel = new JPanel(); + final Container mapArchPanel = new JPanel(); mapArchPanel.setLayout(new BorderLayout()); - splitPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapArchPanel, gameObjectTextEditor, MAPARCHPANEL_LOCATION_KEY, getMapArchPanelLocation()); - splitPane.setContinuousLayout(true); - splitPane.setResizeWeight(1.0); - tabbedPane.add(splitPane, "Game Object"); + tabbedPane.add(mapArchPanel, "Game Object"); final Container buttonPanel = createButtonPanel(); buttonPanel.setLayout(new GridLayout(0, 1)); @@ -472,35 +451,6 @@ mapPanel.setLayout(new BorderLayout()); mapPanel.add(panelDesktop[MAP_PANEL], BorderLayout.CENTER); tabbedPane.add(mapPanel, "Map"); - - final ExiterListener exiterListener = new ExiterListener() { - - /** - * {@inheritDoc} - */ - @Override - public void preExitNotify() { - // ignore - } - - /** - * {@inheritDoc} - */ - @Override - public void appExitNotify() { - splitPane.saveLocation(); - } - - /** - * {@inheritDoc} - */ - @Override - public void waitExitNotify() { - // ignore - } - - }; - exiter.addExiterListener(exiterListener); } /** @@ -524,11 +474,11 @@ * @param errorListView the error list view */ 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 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 ErrorListView<G, A, R> errorListView) { - 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, scriptArchUtils), 0); addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, systemIcons), 0); + addTab(new TextEditorTab<G, A, R>(gameObjectAttributesModel, gameObjectTextEditor), 0); addTab(new ConnectionsTab<G, A, R>(mapViewManager, delayedMapModelListenerManager, gameObjectAttributesModel), 1); addTab(new LockedItemsTab<G, A, R>(lockedItemsControl, gameObjectAttributesModel), 1); addTab(new MonstersTab<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher, gameObjectAttributesModel), 1); @@ -747,13 +697,4 @@ return buttonPanel; } - /** - * Calculates the default value for {@link #MAPARCHPANEL_LOCATION_KEY}. - * @return the default split pane location - */ - private static int getMapArchPanelLocation() { - final Dimension2D screen = Toolkit.getDefaultToolkit().getScreenSize(); - return (int) (0.49 * screen.getWidth()); - } - } // class GameObjectAttributesControl Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-05 10:43:30 UTC (rev 7681) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.gameobjectattributespanel; +import java.awt.BorderLayout; import javax.swing.JPanel; import net.sf.gridarta.gui.gameobjecttexteditor.GameObjectTextEditor; import net.sf.gridarta.model.archetype.Archetype; @@ -61,8 +62,8 @@ @NotNull @Override public JPanel createPanel() { - final JPanel panel = new JPanel(); - panel.add(gameObjectTextEditor); + final JPanel panel = new JPanel(new BorderLayout()); + panel.add(gameObjectTextEditor, BorderLayout.CENTER); return panel; } @@ -70,6 +71,7 @@ @Override protected void refresh(@Nullable final G gameObject) { gameObjectTextEditor.refreshDisplay(gameObject); + setTabSeverity(gameObject == null || gameObject.getObjectText().isEmpty() ? Severity.DEFAULT : Severity.MODIFIED); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-05 10:13:26 UTC (rev 7680) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-05 10:43:30 UTC (rev 7681) @@ -424,7 +424,7 @@ final LockedItemsControl<G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); final SelectedSquareView<G, A, R> selectedSquareView = selectedSquareControl.getSelectedSquareView(); - final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory, gameObjectMatchers, exiter); + final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory, gameObjectMatchers); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, defaultFilterList, mapManager, faceObjectProviders); final File scriptsFile = new File(globalSettings.getMapsDirectory(), scriptsDir); scriptControl = new ScriptController<G, A, R>(filterControl, scriptParameters, mainViewFrame, pluginParameterViewFactory, scriptsFile, scriptModel, pluginParameterFactory, scriptExecutor, systemIcons); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-07 19:24:10
|
Revision: 7696 http://gridarta.svn.sourceforge.net/gridarta/?rev=7696&view=rev Author: akirschbaum Date: 2010-05-07 19:24:03 +0000 (Fri, 07 May 2010) Log Message: ----------- Add keyboard shortcut (CTRL-ALT-E) to activate the game object text editor. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.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 Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/atrinik/ChangeLog 2010-05-07 19:24:03 UTC (rev 7696) @@ -1,3 +1,8 @@ +2010-05-07 Andreas Kirschbaum + + * Add keyboard shortcut (CTRL-ALT-E) to activate the game object + text editor. + 2010-05-06 Andreas Kirschbaum * Change GUI of main window. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -27,7 +27,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/crossfire/ChangeLog 2010-05-07 19:24:03 UTC (rev 7696) @@ -1,3 +1,8 @@ +2010-05-07 Andreas Kirschbaum + + * Add keyboard shortcut (CTRL-ALT-E) to activate the game object + text editor. + 2010-05-06 Andreas Kirschbaum * Change GUI of main window. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -27,7 +27,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches - reloadFaces - viewTreasurelists Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/daimonin/ChangeLog 2010-05-07 19:24:03 UTC (rev 7696) @@ -1,3 +1,8 @@ +2010-05-07 Andreas Kirschbaum + + * Add keyboard shortcut (CTRL-ALT-E) to activate the game object + text editor. + 2010-05-06 Andreas Kirschbaum * Change GUI of main window. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -27,7 +27,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -242,6 +242,12 @@ /** {@inheritDoc} */ @Override + public void requestFocus() { + archNameField.requestFocusInWindow(); + } + + /** {@inheritDoc} */ + @Override protected void apply(@NotNull final G gameObject) { gameObject.setAttributeString(Archetype.NAME, archNameField.getText()); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -108,6 +108,12 @@ @NotNull private final JPanel panel = new JPanel(); + /** + * The {@link JScrollPane} displaying all event.s + */ + @NotNull + private final JScrollPane ssa; + private final Action aEventAddNew = ACTION_BUILDER.createAction(false, "eventAddNew", this); private final Action aEventEditData = ACTION_BUILDER.createAction(false, "eventEditData", this); @@ -144,7 +150,7 @@ this.scriptArchUtils = scriptArchUtils; // create ScrollPane for jlist scrolling - final JScrollPane ssa = new JScrollPane(eventList); + ssa = new JScrollPane(eventList); ssa.setBorder(new EtchedBorder()); ssa.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); ssa.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); @@ -187,6 +193,12 @@ /** {@inheritDoc} */ @Override + public void requestFocus() { + ssa.requestFocusInWindow(); + } + + /** {@inheritDoc} */ + @Override protected void refresh(@Nullable final G gameObject) { selectedGameObject = gameObject; if (gameObject == null || !gameObject.isScripted()) { Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -309,6 +309,12 @@ /** {@inheritDoc} */ @Override + public void requestFocus() { + faceComponent.requestFocusInWindow(); + } + + /** {@inheritDoc} */ + @Override protected void apply(@NotNull final G gameObject) { final String faceName = normalizeFace(faceComponent.getFaceName()); @Nullable final String faceName2; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -451,6 +451,18 @@ } /** + * Selects a tab. The tab must exist. + * @param tab the tab + */ + public void selectTab(@NotNull final GameObjectAttributesTab<G, A, R> tab) { + if (!tabs.contains(tab)) { + throw new IllegalArgumentException(); + } + + panelDesktop.setSelectedComponent(tab.getPanel()); + } + + /** * Sets the tab color of a tab. * @param tab the tab * @param tabSeverity the tab severity Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -79,4 +79,9 @@ @NotNull Severity getTabSeverity(); + /** + * Sets the focus to this component. + */ + void requestFocus(); + } // interface GameObjectAttributesTab Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -128,6 +128,12 @@ /** {@inheritDoc} */ @Override + public void requestFocus() { + archTextArea.requestFocusInWindow(); + } + + /** {@inheritDoc} */ + @Override protected void apply(@NotNull final G gameObject) { gameObject.setMsgText(getMsgText(gameObject)); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -78,6 +78,12 @@ /** {@inheritDoc} */ @Override + public void requestFocus() { + gameObjectTextEditor.getTextPane().requestFocusInWindow(); + } + + /** {@inheritDoc} */ + @Override protected void apply(@NotNull final G gameObject) { gameObjectTextEditor.applyChanges(gameObject); } Modified: trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -21,12 +21,14 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControlListener; +import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.gui.utils.borderpanel.Location; import net.sf.gridarta.gui.utils.tabbedpanel.Tab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; /** @@ -36,6 +38,19 @@ public class GameObjectTab<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Tab { /** + * The {@link GameObjectAttributesControl} to display. + */ + @NotNull + private final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl; + + /** + * The {@link GameObjectAttributesTab} that displays the game object text + * editor. + */ + @NotNull + private final GameObjectAttributesTab<G, A, R> textEditorTab; + + /** * Creates a new instance. * @param ident the tab's identication string * @param gameObjectAttributesControl the game object attributes control to @@ -43,9 +58,13 @@ * @param location the tab's location * @param index the tab's index for ordering * @param defaultOpen the tab's default opened status + * @param textEditorTab the game object attributes tab that displays the + * game object text editor */ - public GameObjectTab(@NotNull final String ident, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Location location, final int index, final boolean defaultOpen) { + public GameObjectTab(@NotNull final String ident, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Location location, final int index, final boolean defaultOpen, @NotNull final GameObjectAttributesTab<G, A, R> textEditorTab) { super(ident, gameObjectAttributesControl, location, index, defaultOpen); + this.gameObjectAttributesControl = gameObjectAttributesControl; + this.textEditorTab = textEditorTab; final GameObjectAttributesControlListener gameObjectAttributesControlListener = new GameObjectAttributesControlListener() { /** @@ -61,4 +80,14 @@ setSeverity(gameObjectAttributesControl.getSeverity()); } + /** + * Action method to open the game object text editor. + */ + @ActionMethod + public void gameObjectTextEditor() { + getButton().setSelected(true); + gameObjectAttributesControl.selectTab(textEditorTab); + textEditorTab.requestFocus(); + } + } // class WarningsTab Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-07 19:24:03 UTC (rev 7696) @@ -55,6 +55,7 @@ import net.sf.gridarta.gui.gameobjectattributespanel.FaceTab; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; +import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.gameobjectattributespanel.MsgTextTab; import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; import net.sf.gridarta.gui.io.FileFilters; @@ -443,10 +444,15 @@ new UndoControl<G, A, R>(mapManager, gameObjectFactory, gameObjectMatchers); final UpdaterManager updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); updaterManager.startup(); + + final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel); + final Tab gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true, textEditorTab); + ACTION_BUILDER.createAction(true, "gameObjectTextEditor", gameObjectTab); + final JMenuBar menuBar = ACTION_BUILDER.createMenuBar(true, "main"); final MainToolbar mainToolbar = new MainToolbar(globalSettings); mainView = new MainView(mainViewFrame, exitAction, statusBar, mapDesktop, icon, exiter, menuBar, mainToolbar.getComponent()); - mainView.addTab(new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true)); + mainView.addTab(gameObjectTab); mainView.addTab(new Tab("selectedSquare", selectedSquareView, Location.RIGHT, 1, true)); mainView.addTab(new Tab("tools", toolPalette, Location.LEFT, 2, false)); mainView.addTab(new Tab("objects", objectChooser, Location.LEFT, 3, true)); @@ -483,7 +489,7 @@ gameObjectAttributesControl.addTab(new MsgTextTab<G, A, R>(gameObjectAttributesModel)); gameObjectAttributesControl.addTab(new EventsTab<G, A, R>(mainViewFrame, mapManager, gameObjectAttributesModel, scriptArchEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils)); gameObjectAttributesControl.addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, systemIcons)); - gameObjectAttributesControl.addTab(new TextEditorTab<G, A, R>(gameObjectAttributesModel)); + gameObjectAttributesControl.addTab(textEditorTab); mainView.addTab(new Tab("monsters", new MonsterControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher).getView(), Location.BOTTOM, 4, false)); mainView.addTab(new Tab("connections", new ConnectionControl<G, A, R>(mapViewManager, delayedMapModelListenerManager).getView(), Location.BOTTOM, 5, false)); mainView.addTab(new Tab("lockedItems", lockedItemsControl.getView(), Location.BOTTOM, 6, false)); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -175,7 +175,10 @@ deleteUnknownObjects.text=Delete unknown objects +gameObjectTextEditor.text=Open Game Object Text Editor +gameObjectTextEditor.accel=ctrl alt pressed E + # Plugins plugins.text=Plugins Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -157,7 +157,9 @@ deleteUnknownObjects.text=Undefinierte Objekte l\xF6schen +gameObjectTextEditor.text=\xD6ffne Objekttext-Editor + # Plugins plugins.text=Plugins Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -152,7 +152,9 @@ #deleteUnknownObjects.text= +#gameObjectTextEditor.text= + # Plugins #plugins.text= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-07 19:09:59 UTC (rev 7695) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-07 19:24:03 UTC (rev 7696) @@ -152,7 +152,9 @@ #deleteUnknownObjects.text= +#gameObjectTextEditor.text= + # Plugins #plugins.text= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |