From: <aki...@us...> - 2013-10-09 20:02:49
|
Revision: 9419 http://sourceforge.net/p/gridarta/code/9419 Author: akirschbaum Date: 2013-10-09 20:02:44 +0000 (Wed, 09 Oct 2013) Log Message: ----------- Remove some parameters from GUIMainControl's contructor. Modified Paths: -------------- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-09 19:39:29 UTC (rev 9418) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-09 20:02:44 UTC (rev 9419) @@ -22,6 +22,7 @@ import java.awt.Component; import java.io.IOException; import java.net.URL; +import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.dialog.mapproperties.MapPropertiesDialogFactory; import net.sf.gridarta.gui.dialog.newmap.NewMapDialogFactory; @@ -480,7 +481,7 @@ @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 PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @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 archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ScriptArchDataUtils<GameObject, MapArchObject, Archetype> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptArchEditor<GameObject, MapArchObject, Archetype> scriptArchEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", GuiFileFilters.mapFileFilter, GuiFileFilters.pythonFileFilter, validators, resources, gameObjectMatchers, errorView, 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, }, IGUIConstants.SCRIPTS_DIR, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); + return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, validators, resources, gameObjectMatchers, errorView, guiUtils, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); } /** @@ -596,4 +597,47 @@ return false; } + /** + * {@inheritDoc} + */ + @Override + public ImageIcon getCompassIcon(@NotNull final GUIUtils guiUtils) { + return guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getGridartaJarFilename() { + return "AtrinikEditor.jar"; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public FileFilter getMapFileFilter() { + return GuiFileFilters.mapFileFilter; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public int[] getLockedItemsTypeNumbers() { + return 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, }; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAutoValidatorDefault() { + return PREFERENCES_VALIDATOR_AUTO_DEFAULT; + } + } Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-09 19:39:29 UTC (rev 9418) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-09 20:02:44 UTC (rev 9419) @@ -20,6 +20,7 @@ package net.sf.gridarta.var.crossfire.maincontrol; import java.awt.Component; +import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.dialog.mapproperties.MapPropertiesDialogFactory; import net.sf.gridarta.gui.dialog.newmap.NewMapDialogFactory; @@ -388,7 +389,7 @@ @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 PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @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 archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ScriptArchDataUtils<GameObject, MapArchObject, Archetype> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptArchEditor<GameObject, MapArchObject, Archetype> scriptArchEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, null, "CrossfireEditor.jar", GuiFileFilters.mapFileFilter, GuiFileFilters.pythonFileFilter, validators, resources, gameObjectMatchers, errorView, 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, }, IGUIConstants.SCRIPTS_DIR, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); + return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, validators, resources, gameObjectMatchers, errorView, guiUtils, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); } /** @@ -506,4 +507,47 @@ return true; } + /** + * {@inheritDoc} + */ + @Override + public ImageIcon getCompassIcon(@NotNull final GUIUtils guiUtils) { + return null; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getGridartaJarFilename() { + return "CrossfireEditor.jar"; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public FileFilter getMapFileFilter() { + return GuiFileFilters.mapFileFilter; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public int[] getLockedItemsTypeNumbers() { + return 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, }; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAutoValidatorDefault() { + return PREFERENCES_VALIDATOR_AUTO_DEFAULT; + } + } Modified: trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-09 19:39:29 UTC (rev 9418) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-09 20:02:44 UTC (rev 9419) @@ -22,6 +22,7 @@ import java.awt.Component; import java.io.IOException; import java.net.URL; +import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.dialog.mapproperties.MapPropertiesDialogFactory; import net.sf.gridarta.gui.dialog.newmap.NewMapDialogFactory; @@ -479,7 +480,7 @@ @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 PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @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 archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ScriptArchDataUtils<GameObject, MapArchObject, Archetype> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptArchEditor<GameObject, MapArchObject, Archetype> scriptArchEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", GuiFileFilters.mapFileFilter, GuiFileFilters.luaFileFilter, validators, resources, gameObjectMatchers, errorView, 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, }, IGUIConstants.SCRIPTS_DIR, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); + return new GUIMainControl<GameObject, MapArchObject, Archetype>(mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, validators, resources, gameObjectMatchers, errorView, guiUtils, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, this, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, gameObjectSpells, numberSpells, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); } /** @@ -595,4 +596,47 @@ return false; } + /** + * {@inheritDoc} + */ + @Override + public ImageIcon getCompassIcon(@NotNull final GUIUtils guiUtils) { + return guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getGridartaJarFilename() { + return "DaimoninEditor.jar"; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public FileFilter getMapFileFilter() { + return GuiFileFilters.mapFileFilter; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public int[] getLockedItemsTypeNumbers() { + return 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, }; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isAutoValidatorDefault() { + return PREFERENCES_VALIDATOR_AUTO_DEFAULT; + } + } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-09 19:39:29 UTC (rev 9418) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-09 20:02:44 UTC (rev 9419) @@ -20,6 +20,7 @@ package net.sf.gridarta.maincontrol; import java.awt.Component; +import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.dialog.mapproperties.MapPropertiesDialogFactory; import net.sf.gridarta.gui.dialog.newmap.NewMapDialogFactory; @@ -474,4 +475,39 @@ */ boolean isAllowRandomMapParameters(); + /** + * Returns the icon to display in the selected square view. + * @param guiUtils the gui utils for creating icons + * @return the icon or {@code null} to display no icon + */ + @Nullable + ImageIcon getCompassIcon(@NotNull GUIUtils guiUtils); + + /** + * Returns the filename of the editor's .jar file. + * @return the filename + */ + @NotNull + String getGridartaJarFilename(); + + /** + * Returns the file filter for map files. + * @return the file filter for map files + */ + @NotNull + FileFilter getMapFileFilter(); + + /** + * Returns the type numbers of game objects being locked items. + * @return the type numbers + */ + @NotNull + int[] getLockedItemsTypeNumbers(); + + /** + * Returns whether the auto validator is enabled by default. + * @return whether the auto validator is enabled by default + */ + boolean isAutoValidatorDefault(); + } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-09 19:39:29 UTC (rev 9418) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-09 20:02:44 UTC (rev 9419) @@ -32,7 +32,6 @@ import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; -import javax.swing.filechooser.FileFilter; import net.sf.gridarta.MainControl; import net.sf.gridarta.action.AddBookmarkAction; import net.sf.gridarta.action.AddToSelectionAction; @@ -225,6 +224,7 @@ import net.sf.gridarta.utils.ActionUtils; import net.sf.gridarta.utils.EditorAction; import net.sf.gridarta.utils.Exiter; +import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.SystemIcons; import net.sf.japi.swing.action.ActionBuilder; @@ -329,17 +329,11 @@ * @param mapArchObjectFactory the map arch object factory instance * @param treasureTree the treasure tree instance * @param archetypeTypeSet the archetype type set instance - * @param compassIcon the icon to display in the selected square view; - * @param gridartaJarFilename the filename of the editor's .jar file - * @param mapFileFilter the file filter for map files - * @param scriptFileFilter the file filter for script files * @param validators the map validators * @param resources the resources to collect * @param gameObjectMatchers the game object matchers instance * @param errorView the error view for reporting errors - * @param lockedItemsTypeNumbers the type numbers of game objects being - * locked items - * @param scriptsDir the plugin scripts directory + * @param guiUtils the gui utils for creating icons * @param pluginModel the script model instance * @param archetypeChooserModel the archetype chooser model instance * @param animationObjects the animation objects instance @@ -347,8 +341,6 @@ * @param scriptedEventEditor the scripted event editor instance * @param scriptArchDataUtils the script arch data utils instance * @param scriptArchUtils the script arch utils instance - * @param autoValidatorDefault whether the auto validator is enabled by - * @param spellFile the spell file instance * @param editorFactory the editor factory instance * @param faceObjectProviders the face object providers for looking up * faces @@ -365,7 +357,7 @@ * @param pluginExecutor the script executor instance * @param pluginParameters the script parameters instance */ - public GUIMainControl(@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 ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapModelFactory<G, A, R> mapModelFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet archetypeTypeSet, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final int[] lockedItemsTypeNumbers, @NotNull final String scriptsDir, @NotNull final PluginModel<G, A, R> pluginModel, @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 ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final PathManager pathManager, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @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 PluginExecutor<G, A, R> pluginExecutor, @NotNull final PluginParameters pluginParameters) { + public GUIMainControl(@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 ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapModelFactory<G, A, R> mapModelFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final TreasureTree treasureTree, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final AbstractResources<G, A, R> resources, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final PluginModel<G, A, R> pluginModel, @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 ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final PathManager pathManager, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @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 PluginExecutor<G, A, R> pluginExecutor, @NotNull final PluginParameters pluginParameters) { this.archetypeSet = archetypeSet; final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory, mapManager, pickmapManager); @@ -378,6 +370,7 @@ final ImageCreator<G, A, R> imageCreator = new ImageCreator<G, A, R>(mapManager, rendererFactory); final VolatileSettings volatileSettings = new DefaultVolatileSettings(projectSettings.getMapsDirectory()); final ImageCreator2<G, A, R> imageCreator2 = new ImageCreator2<G, A, R>(volatileSettings, imageCreator); + final String spellFile = editorFactory.getSpellFile(); final SpellsUtils spellUtils = spellFile != null ? new SpellsUtils(spellFile) : null; final AppPreferencesModel appPreferencesModel = editorFactory.createAppPreferencesModel(); final MapViewManager<G, A, R> mapViewManager = new MapViewManager<G, A, R>(); @@ -396,7 +389,7 @@ final CFTreasureListTree treasureListTree = new CFTreasureListTree(treasureTree, parent, archetypeSet, faceObjectProviders, systemIcons); final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); final ImageIcon unknownSquareIcon = systemIcons.getUnknownSquareIcon(); - final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, parent, treasureListTree, faceObjectProviders, animationObjects, projectSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, editorFactory.getUndefinedSpellIndex(), treasureTree, noFaceSquareIcon, unknownSquareIcon, mapManager); + final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, parent, treasureListTree, faceObjectProviders, animationObjects, projectSettings, editorFactory.getMapFileFilter(), editorFactory.getScriptFileFilter(), faceObjects, gameObjectSpells, numberSpells, editorFactory.getUndefinedSpellIndex(), treasureTree, noFaceSquareIcon, unknownSquareIcon, mapManager); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("system_wall", "wall"); @@ -407,13 +400,13 @@ final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, gameObjectFactory, mapArchObjectFactory, mapModelFactory, insertionModeSet); final FindDialogManager<G, A, R> findDialogManager = new FindDialogManager<G, A, R>(parent, mapViewManager); final Exiter exiter = new DefaultExiter(parent); - scriptEditControl = new ScriptEditControl(scriptFileFilter, scriptExtension, parent, projectSettings.getMapsDirectory(), preferences, exiter); + scriptEditControl = new ScriptEditControl(editorFactory.getScriptFileFilter(), scriptExtension, parent, projectSettings.getMapsDirectory(), preferences, exiter); final TextAreaDefaults textAreaDefaults = new TextAreaDefaults(scriptEditControl); gameObjectAttributesDialogFactory.setTextAreaDefaults(textAreaDefaults); scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, mapManager, mapViewsManager, parent, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, mapManager, mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); final GameObjectMatcher monsterMatcherTmp = gameObjectMatchers.getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_monster", "monster"); @@ -424,12 +417,12 @@ final MapPathNormalizer mapPathNormalizer = new MapPathNormalizer(projectSettings); final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(projectSettings, mapManager, mapPathNormalizer); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); - final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); + final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, editorFactory.getLockedItemsTypeNumbers()); final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); final EditorAction mapActions = new MapActions<G, A, R>(parent, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); - final File scriptsFile = new File(projectSettings.getMapsDirectory(), scriptsDir); - updaterManager = new UpdaterManager(exiter, mapManager, parent, gridartaJarFilename); + final File scriptsFile = new File(projectSettings.getMapsDirectory(), editorFactory.getScriptsDir()); + updaterManager = new UpdaterManager(exiter, mapManager, parent, editorFactory.getGridartaJarFilename()); final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); final EditorAction undoControl = new UndoControl<G, A, R>(mapManager, gameObjectFactory, gameObjectMatchers); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); @@ -592,7 +585,7 @@ mainViewFrame.add(new MainToolbar(editorSettings).getComponent(), BorderLayout.NORTH); mainViewFrame.add(statusBar, BorderLayout.SOUTH); mainView.addTab(gameObjectTab); - mainView.addTab(new Tab("selectedSquare", new SelectedSquareView<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon, moveSquareUpAction, moveSquareDownAction, moveSquareTopAction, moveSquareBottomAction, moveSquareEnvAction, moveSquareInvAction), Location.RIGHT, false, 1, true)); + mainView.addTab(new Tab("selectedSquare", new SelectedSquareView<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, mapViewManager, mapViewSettings, editorFactory.getCompassIcon(guiUtils), faceObjectProviders, unknownSquareIcon, moveSquareUpAction, moveSquareDownAction, moveSquareTopAction, moveSquareBottomAction, moveSquareEnvAction, moveSquareInvAction), Location.RIGHT, false, 1, true)); mainView.addTab(new Tab("tools", toolPalette, Location.LEFT, false, 2, false)); mainView.addTab(new Tab("objects", objectChooser, Location.LEFT, false, 3, true)); final JMenu windowMenu = MenuUtils.getMenu(menuBar, "window"); @@ -677,7 +670,7 @@ new RecentManager<G, A, R>(mapManager, recentMapMenuPreferences); //noinspection ResultOfObjectAllocationIgnored - new AutoValidator<G, A, R>(validators, autoValidatorDefault, delayedMapModelListenerManager); + new AutoValidator<G, A, R>(validators, editorFactory.isAutoValidatorDefault(), delayedMapModelListenerManager); mapManager.setFileControl(fileControl); shortcutsManager.loadShortcuts(); delayedMapModelListenerManager.start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |