You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2013-10-08 17:43:18
|
Revision: 9385 http://sourceforge.net/p/gridarta/code/9385 Author: akirschbaum Date: 2013-10-08 17:43:13 +0000 (Tue, 08 Oct 2013) Log Message: ----------- Inline variable. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 16:13:39 UTC (rev 9384) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-08 17:43:13 UTC (rev 9385) @@ -179,7 +179,6 @@ //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } - final DocumentBuilder documentBuilder = xmlHelper.getDocumentBuilder(); AttributeRangeChecker<G, A, R> attributeRangeChecker = null; final EnvironmentChecker<G, A, R> environmentChecker = new EnvironmentChecker<G, A, R>(validatorPreferences); @@ -187,12 +186,12 @@ final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), "GameObjectMatchers.xml"); final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, url); try { - documentBuilder.setErrorHandler(new ErrorViewCollectorErrorHandler(gameObjectMatchersErrorViewCollector, ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID)); + xmlHelper.getDocumentBuilder().setErrorHandler(new ErrorViewCollectorErrorHandler(gameObjectMatchersErrorViewCollector, ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID)); try { - final GameObjectMatchersParser gameObjectMatchersParser = new GameObjectMatchersParser(documentBuilder, xmlHelper.getXPath()); + final GameObjectMatchersParser gameObjectMatchersParser = new GameObjectMatchersParser(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); gameObjectMatchersParser.readGameObjectMatchers(url, gameObjectMatchers, gameObjectMatchersErrorViewCollector); } finally { - documentBuilder.setErrorHandler(null); + xmlHelper.getDocumentBuilder().setErrorHandler(null); } } catch (final IOException ex) { gameObjectMatchersErrorViewCollector.addWarning(ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID, ex.getMessage()); @@ -221,7 +220,7 @@ validators.addValidator(new PaidItemShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, paidItemMatcher)); } } - final Map<String, TreasureTreeNode> specialTreasureLists = loadSpecialTreasureLists(errorView, documentBuilder, projectSettings); + final Map<String, TreasureTreeNode> specialTreasureLists = loadSpecialTreasureLists(errorView, xmlHelper.getDocumentBuilder(), projectSettings); final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : configSourceFactory.getConfigSource(projectSettings.getConfigSourceName()); treasureTree = TreasureLoader.parseTreasures(errorView, specialTreasureLists, configSource, projectSettings); final ArchetypeAttributeFactory archetypeAttributeFactory = new DefaultArchetypeAttributeFactory(); @@ -231,12 +230,12 @@ try { final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); final ErrorViewCollector typesErrorViewCollector = new ErrorViewCollector(errorView, url); - documentBuilder.setErrorHandler(new ErrorViewCollectorErrorHandler(typesErrorViewCollector, ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID)); + xmlHelper.getDocumentBuilder().setErrorHandler(new ErrorViewCollectorErrorHandler(typesErrorViewCollector, ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID)); try { - final ArchetypeTypeSetParser archetypeTypeSetParser = new ArchetypeTypeSetParser(documentBuilder, archetypeTypeSet, archetypeTypeParser); + final ArchetypeTypeSetParser archetypeTypeSetParser = new ArchetypeTypeSetParser(xmlHelper.getDocumentBuilder(), archetypeTypeSet, archetypeTypeParser); archetypeTypeSetParser.loadTypesFromXML(typesErrorViewCollector, new InputSource(url.toString())); } finally { - documentBuilder.setErrorHandler(null); + xmlHelper.getDocumentBuilder().setErrorHandler(null); } final ArchetypeTypeList eventTypeSetTmp = archetypeTypeSet.getList("event"); if (eventTypeSetTmp == null) { @@ -272,11 +271,11 @@ try { final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), spellFile); final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, url); - documentBuilder.setErrorHandler(new ErrorViewCollectorErrorHandler(errorViewCollector, ErrorViewCategory.SPELLS_FILE_INVALID)); + xmlHelper.getDocumentBuilder().setErrorHandler(new ErrorViewCollectorErrorHandler(errorViewCollector, ErrorViewCategory.SPELLS_FILE_INVALID)); try { XMLSpellLoader.load(errorViewCollector, url, xmlHelper.getDocumentBuilder(), numberSpells); } finally { - documentBuilder.setErrorHandler(null); + xmlHelper.getDocumentBuilder().setErrorHandler(null); } } catch (final FileNotFoundException ex) { errorView.addWarning(ErrorViewCategory.SPELLS_FILE_INVALID, spellFile + ": " + ex.getMessage()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 16:13:44
|
Revision: 9384 http://sourceforge.net/p/gridarta/code/9384 Author: akirschbaum Date: 2013-10-05 16:13:39 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Add comment. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 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-05 16:12:08 UTC (rev 9383) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-05 16:13:39 UTC (rev 9384) @@ -218,6 +218,7 @@ * @param projectSettings the project settings instance * @param gameObjectMatchers the defined game object matchers * @param validatorPreferences the validator preferences to use + * @return the loaded attribute range checker */ @NotNull AttributeRangeChecker<G, A, R> loadAttributeRangeChecker(@NotNull DelegatingMapValidator<G, A, R> mapValidators, @NotNull ErrorViewCollector errorViewCollector, @NotNull ProjectSettings projectSettings, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 16:12:10
|
Revision: 9383 http://sourceforge.net/p/gridarta/code/9383 Author: akirschbaum Date: 2013-10-05 16:12:08 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Extract code into functions. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:39:52 UTC (rev 9382) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 16:12:08 UTC (rev 9383) @@ -201,11 +201,13 @@ final ValidatorFactory<G, A, R> validatorFactory = new ValidatorFactory<G, A, R>(validatorPreferences, gameObjectMatchers, projectSettings, mapWriter); loadValidators(validators, validatorFactory, errorView); attributeRangeChecker = editorFactory.loadAttributeRangeChecker(validators, gameObjectMatchersErrorViewCollector, projectSettings, gameObjectMatchers, validatorPreferences); - validators.addValidator(attributeRangeChecker); - validators.addValidator(environmentChecker); } catch (final FileNotFoundException ex) { errorView.addWarning(ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID, "GameObjectMatchers.xml: " + ex.getMessage()); } + if (attributeRangeChecker != null) { + validators.addValidator(attributeRangeChecker); + } + validators.addValidator(environmentChecker); final GameObjectMatcher shopSquareMatcher = gameObjectMatchers.getMatcher("system_shop_square", "shop_square"); if (shopSquareMatcher != null) { final GameObjectMatcher noSpellsMatcher = gameObjectMatchers.getMatcher("system_no_spells", "no_spells"); @@ -219,34 +221,7 @@ validators.addValidator(new PaidItemShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, paidItemMatcher)); } } - Map<String, TreasureTreeNode> specialTreasureLists; - try { - final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), "TreasureLists.xml"); - final ErrorViewCollector treasureListsErrorViewCollector = new ErrorViewCollector(errorView, url); - try { - final InputStream inputStream = url.openStream(); - try { - documentBuilder.setErrorHandler(new ErrorViewCollectorErrorHandler(treasureListsErrorViewCollector, ErrorViewCategory.TREASURES_FILE_INVALID)); - try { - final Document specialTreasureListsDocument = documentBuilder.parse(new InputSource(inputStream)); - specialTreasureLists = TreasureListsParser.parseTreasureLists(specialTreasureListsDocument); - } finally { - documentBuilder.setErrorHandler(null); - } - } finally { - inputStream.close(); - } - } catch (final IOException ex) { - treasureListsErrorViewCollector.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } catch (final SAXException ex) { - treasureListsErrorViewCollector.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } - } catch (final FileNotFoundException ex) { - errorView.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, "TreasureLists.xml: " + ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } + final Map<String, TreasureTreeNode> specialTreasureLists = loadSpecialTreasureLists(errorView, documentBuilder, projectSettings); final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : configSourceFactory.getConfigSource(projectSettings.getConfigSourceName()); treasureTree = TreasureLoader.parseTreasures(errorView, specialTreasureLists, configSource, projectSettings); final ArchetypeAttributeFactory archetypeAttributeFactory = new DefaultArchetypeAttributeFactory(); @@ -285,17 +260,7 @@ log.info("Start to load archetypes..."); } configSource.read(projectSettings, resources, errorView); - for (final R archetype : archetypeSet.getArchetypes()) { - final CharSequence editorFolder = archetype.getEditorFolder(); - if (editorFolder != null && !editorFolder.equals(GameObject.EDITOR_FOLDER_INTERN)) { - final String[] tmp = StringUtils.PATTERN_SLASH.split(editorFolder, 2); - if (tmp.length == 2) { - final String panelName = tmp[0]; - final String folderName = tmp[1]; - archetypeChooserModel.addArchetype(panelName, folderName, archetype); - } - } - } + addArchetypes(archetypeChooserModel, archetypeSet); if (log.isInfoEnabled()) { log.info("Archetype loading took " + (double) (System.currentTimeMillis() - timeStart) / 1000.0 + " seconds."); } @@ -323,6 +288,53 @@ } } + private void addArchetypes(@NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { + for (final R archetype : archetypeSet.getArchetypes()) { + final CharSequence editorFolder = archetype.getEditorFolder(); + if (editorFolder != null && !editorFolder.equals(GameObject.EDITOR_FOLDER_INTERN)) { + final String[] tmp = StringUtils.PATTERN_SLASH.split(editorFolder, 2); + if (tmp.length == 2) { + final String panelName = tmp[0]; + final String folderName = tmp[1]; + archetypeChooserModel.addArchetype(panelName, folderName, archetype); + } + } + } + } + + @NotNull + private Map<String, TreasureTreeNode> loadSpecialTreasureLists(@NotNull final ErrorView errorView, @NotNull final DocumentBuilder documentBuilder, @NotNull final ProjectSettings projectSettings) { + Map<String, TreasureTreeNode> specialTreasureLists; + try { + final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), "TreasureLists.xml"); + final ErrorViewCollector treasureListsErrorViewCollector = new ErrorViewCollector(errorView, url); + try { + final InputStream inputStream = url.openStream(); + try { + documentBuilder.setErrorHandler(new ErrorViewCollectorErrorHandler(treasureListsErrorViewCollector, ErrorViewCategory.TREASURES_FILE_INVALID)); + try { + final Document specialTreasureListsDocument = documentBuilder.parse(new InputSource(inputStream)); + specialTreasureLists = TreasureListsParser.parseTreasureLists(specialTreasureListsDocument); + } finally { + documentBuilder.setErrorHandler(null); + } + } finally { + inputStream.close(); + } + } catch (final IOException ex) { + treasureListsErrorViewCollector.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, ex.getMessage()); + specialTreasureLists = Collections.emptyMap(); + } catch (final SAXException ex) { + treasureListsErrorViewCollector.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, ex.getMessage()); + specialTreasureLists = Collections.emptyMap(); + } + } catch (final FileNotFoundException ex) { + errorView.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, "TreasureLists.xml: " + ex.getMessage()); + specialTreasureLists = Collections.emptyMap(); + } + return specialTreasureLists; + } + /** * Creates map validators from preferences. * @param validators the validators to add the newly created validators to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 15:39:56
|
Revision: 9382 http://sourceforge.net/p/gridarta/code/9382 Author: akirschbaum Date: 2013-10-05 15:39:52 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Remove DefaultMainControl.scriptArchData. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:34:06 UTC (rev 9381) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:39:52 UTC (rev 9382) @@ -73,7 +73,6 @@ import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.GameObjectMatchersParser; import net.sf.gridarta.model.resource.AbstractResources; -import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.EditorSettings; @@ -136,9 +135,6 @@ private final ScriptArchEditor<G, A, R> scriptArchEditor; @NotNull - private final ScriptArchData<G, A, R> scriptArchData; - - @NotNull private final ScriptArchDataUtils<G, A, R> scriptArchDataUtils; @NotNull @@ -283,7 +279,6 @@ final ScriptedEventFactory<G, A, R> scriptedEventFactory = editorFactory.newScriptedEventFactory(scriptArchUtils, gameObjectFactory, scriptedEventEditor, archetypeSet); scriptArchEditor = new DefaultScriptArchEditor<G, A, R>(scriptedEventFactory, scriptExtension, scriptName, scriptArchUtils, scriptFileFilter, projectSettings, mapManager, pathManager); scriptedEventEditor.setScriptArchEditor(scriptArchEditor); - scriptArchData = editorFactory.newScriptArchData(); scriptArchDataUtils = editorFactory.newScriptArchDataUtils(scriptArchUtils, scriptedEventFactory, scriptedEventEditor); final long timeStart = System.currentTimeMillis(); if (log.isInfoEnabled()) { @@ -411,7 +406,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 MapModelFactory<G, A, R> mapModelFactory, @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 PluginExecutor<G, A, R> pluginExecutor, @NotNull final PluginParameters pluginParameters, @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<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet 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 PluginModel<G, A, R> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final Direction[] directionMap, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { - return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, GuiFileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, lockedItemsTypeNumbers, scriptsDir, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); + return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, projectSettings, editorSettings, mapViewSettings, mapModelFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, GuiFileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, lockedItemsTypeNumbers, scriptsDir, pluginModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, pluginExecutor, pluginParameters); } } 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-05 15:34:06 UTC (rev 9381) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-05 15:39:52 UTC (rev 9382) @@ -207,7 +207,6 @@ import net.sf.gridarta.model.pickmapsettings.DefaultPickmapSettings; import net.sf.gridarta.model.pickmapsettings.PickmapSettings; import net.sf.gridarta.model.resource.AbstractResources; -import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.settings.DefaultVolatileSettings; import net.sf.gridarta.model.settings.EditorSettings; @@ -350,7 +349,6 @@ * @param animationObjects the animation objects instance * @param scriptArchEditor the script arch editor instance * @param scriptedEventEditor the scripted event editor instance - * @param scriptArchData the script arch data 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 @@ -376,7 +374,7 @@ * @param pluginExecutor the script executor instance * @param pluginParameters the script parameters instance */ - 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 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 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 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 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 Direction[] directionMap, @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 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 PluginExecutor<G, A, R> pluginExecutor, @NotNull final PluginParameters pluginParameters) { + 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 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 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 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, final boolean allowRandomMapParameters, @NotNull final Direction[] directionMap, @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 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 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); @@ -635,7 +633,7 @@ final ErrorListView<G, A, R> errorListView = new ErrorListView<G, A, R>(mapViewManager); gameObjectAttributesControl.addTab(new ArchTab<G, A, R>(archetypeTypeSet, gameObjectAttributesModel)); gameObjectAttributesControl.addTab(new MsgTextTab<G, A, R>(gameObjectAttributesModel)); - gameObjectAttributesControl.addTab(new EventsTab<G, A, R>(parent, mapManager, gameObjectAttributesModel, scriptArchEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils)); + gameObjectAttributesControl.addTab(new EventsTab<G, A, R>(parent, mapManager, gameObjectAttributesModel, scriptArchEditor, editorFactory.newScriptArchData(), scriptArchDataUtils, scriptArchUtils)); gameObjectAttributesControl.addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, noFaceSquareIcon, unknownSquareIcon)); gameObjectAttributesControl.addTab(textEditorTab); mainView.addTab(new Tab("monsters", new MonsterControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher).getView(), Location.BOTTOM, false, 4, false)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 15:34:10
|
Revision: 9381 http://sourceforge.net/p/gridarta/code/9381 Author: akirschbaum Date: 2013-10-05 15:34:06 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Replace parameter with return value. 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/DefaultMainControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.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-05 15:22:47 UTC (rev 9380) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-05 15:34:06 UTC (rev 9381) @@ -283,8 +283,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void initMapValidators(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences) { + final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker = new AttributeRangeChecker<GameObject, MapArchObject, Archetype>(validatorPreferences); final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcherWarn(errorViewCollector, "system_monster_only", "system_monster", "monster"); if (monsterMatcher != null) { addAttributeRangeChecker(attributeRangeChecker, monsterMatcher, "level", "level", 0, 125); @@ -352,6 +354,7 @@ addAttributeRangeChecker(attributeRangeChecker, combatValuesObjectsMatcher, "resist_paralyze", "paralyze (effect)", Integer.MIN_VALUE, 100); addAttributeRangeChecker(attributeRangeChecker, combatValuesObjectsMatcher, "resist_snare", "snare (effect)", Integer.MIN_VALUE, 100); } + return attributeRangeChecker; } private static void addAttributeRangeChecker(@NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final GameObjectMatcher matcher, @NotNull final String name, @NotNull final String displayName, final int minValue, final int maxValue) { 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-05 15:22:47 UTC (rev 9380) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-05 15:34:06 UTC (rev 9381) @@ -258,8 +258,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void initMapValidators(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences) { + final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker = new AttributeRangeChecker<GameObject, MapArchObject, Archetype>(validatorPreferences); final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcherWarn(errorViewCollector, "system_monster"); if (monsterMatcher != null) { try { @@ -268,6 +270,7 @@ log.warn(ex.getMessage() + " for monster checker"); } } + return attributeRangeChecker; } /** 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-05 15:22:47 UTC (rev 9380) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-05 15:34:06 UTC (rev 9381) @@ -283,8 +283,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void initMapValidators(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences) { + final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker = new AttributeRangeChecker<GameObject, MapArchObject, Archetype>(validatorPreferences); final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcherWarn(errorViewCollector, "system_monster_only", "system_monster", "monster"); if (monsterMatcher != null) { addAttributeRangeChecker(attributeRangeChecker, monsterMatcher, "level", "level", 0, 125); @@ -352,6 +354,7 @@ addAttributeRangeChecker(attributeRangeChecker, combatValuesObjectsMatcher, "resist_paralyze", "paralyze (effect)", Integer.MIN_VALUE, 100); addAttributeRangeChecker(attributeRangeChecker, combatValuesObjectsMatcher, "resist_snare", "snare (effect)", Integer.MIN_VALUE, 100); } + return attributeRangeChecker; } private static void addAttributeRangeChecker(@NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final GameObjectMatcher matcher, @NotNull final String name, @NotNull final String displayName, final int minValue, final int maxValue) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:22:47 UTC (rev 9380) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:34:06 UTC (rev 9381) @@ -183,9 +183,10 @@ //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } - final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(validatorPreferences); + final DocumentBuilder documentBuilder = xmlHelper.getDocumentBuilder(); + + AttributeRangeChecker<G, A, R> attributeRangeChecker = null; final EnvironmentChecker<G, A, R> environmentChecker = new EnvironmentChecker<G, A, R>(validatorPreferences); - final DocumentBuilder documentBuilder = xmlHelper.getDocumentBuilder(); try { final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), "GameObjectMatchers.xml"); final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, url); @@ -203,7 +204,7 @@ final ValidatorFactory<G, A, R> validatorFactory = new ValidatorFactory<G, A, R>(validatorPreferences, gameObjectMatchers, projectSettings, mapWriter); loadValidators(validators, validatorFactory, errorView); - editorFactory.initMapValidators(validators, gameObjectMatchersErrorViewCollector, projectSettings, gameObjectMatchers, attributeRangeChecker, validatorPreferences); + attributeRangeChecker = editorFactory.loadAttributeRangeChecker(validators, gameObjectMatchersErrorViewCollector, projectSettings, gameObjectMatchers, validatorPreferences); validators.addValidator(attributeRangeChecker); validators.addValidator(environmentChecker); } catch (final FileNotFoundException ex) { @@ -322,7 +323,9 @@ } numberSpells.sort(); } - ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); + if (attributeRangeChecker != null) { + ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); + } } /** 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-05 15:22:47 UTC (rev 9380) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-05 15:34:06 UTC (rev 9381) @@ -212,15 +212,15 @@ void initSmoothFaces(@NotNull FaceObjects faceObjects); /** - * Initializes the map validators. + * Loads the attribute range checker for map validation. * @param mapValidators the map validators that delegates to add to * @param errorViewCollector the error view collector to use * @param projectSettings the project settings instance * @param gameObjectMatchers the defined game object matchers - * @param attributeRangeChecker the attribute range checker to use * @param validatorPreferences the validator preferences to use */ - void initMapValidators(@NotNull DelegatingMapValidator<G, A, R> mapValidators, @NotNull ErrorViewCollector errorViewCollector, @NotNull ProjectSettings projectSettings, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences); + @NotNull + AttributeRangeChecker<G, A, R> loadAttributeRangeChecker(@NotNull DelegatingMapValidator<G, A, R> mapValidators, @NotNull ErrorViewCollector errorViewCollector, @NotNull ProjectSettings projectSettings, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences); /** * Creates a new {@link AbstractArchetypeParser} instance. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 15:22:53
|
Revision: 9380 http://sourceforge.net/p/gridarta/code/9380 Author: akirschbaum Date: 2013-10-05 15:22:47 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Move loading of editor scripts lists from DefaultMainControl to GridartaEditor. 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/DefaultMainControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.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-05 15:14:01 UTC (rev 9379) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -181,8 +181,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @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 ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, validatorPreferences, mapWriter); } /** @@ -493,4 +493,13 @@ return new AtrinikServerActions(mapViewManager, fileControl, pathManager); } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getScriptsDir() { + return IGUIConstants.SCRIPTS_DIR; + } + } 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-05 15:14:01 UTC (rev 9379) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -151,8 +151,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @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 ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, errorView, this, false, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, validatorPreferences, mapWriter); } /** @@ -405,4 +405,13 @@ return null; // action not supported } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getScriptsDir() { + return IGUIConstants.SCRIPTS_DIR; + } + } 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-05 15:14:01 UTC (rev 9379) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -181,8 +181,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @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 ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, validatorPreferences, mapWriter); } /** @@ -493,4 +493,13 @@ return null; // action not supported } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getScriptsDir() { + return IGUIConstants.SCRIPTS_DIR; + } + } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:14:01 UTC (rev 9379) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -19,7 +19,6 @@ package net.sf.gridarta.maincontrol; -import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -99,8 +98,6 @@ import net.sf.gridarta.model.validation.checks.ValidatorFactory; import net.sf.gridarta.plugin.PluginExecutor; import net.sf.gridarta.plugin.PluginModel; -import net.sf.gridarta.plugin.PluginModelLoader; -import net.sf.gridarta.plugin.PluginModelParser; import net.sf.gridarta.plugin.PluginParameters; import net.sf.gridarta.plugin.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; @@ -156,7 +153,6 @@ * collect game objects spells * @param spellFile the spell file name to load or <code>null</code> to not * load numbered spells - * @param scriptsDir the plugin scripts directory * @param errorView the error view to add errors to * @param editorFactory the editor factory to use * @param forceReadFromFiles if set, read resources from individual files @@ -170,17 +166,15 @@ * @param archetypeSet the archetype set to use * @param archetypeChooserModel the archetype chooser model to use * @param mapManager the map manager - * @param pluginModel the script model * @param validators the map validators * @param scriptedEventEditor the scripted event editor * @param resources the resources * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use - * @param pluginParameterFactory the plugin parameter factory to use * @param validatorPreferences the validator preferences to use * @param mapWriter the map writer for writing temporary map files */ - 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 ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<G, A, R> mapWriter) { + public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, final boolean forceReadFromFiles, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AbstractMapManager<G, A, R> mapManager, @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 ValidatorPreferences validatorPreferences, @NotNull final MapWriter<G, A, R> mapWriter) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -328,9 +322,6 @@ } numberSpells.sort(); } - final File scriptsFile = new File(projectSettings.getMapsDirectory(), scriptsDir); - final PluginModelParser<G, A, R> pluginModelParser = new PluginModelParser<G, A, R>(pluginParameterFactory); - new PluginModelLoader<G, A, R>(pluginModelParser).loadPlugins(errorView, scriptsFile, pluginModel); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); } 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-05 15:14:01 UTC (rev 9379) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -107,19 +107,17 @@ * @param archetypeSet the archetype set to use * @param archetypeChooserModel the archetype chooser model to use * @param mapManager the map manager - * @param pluginModel the script model * @param validators the map validators * @param scriptedEventEditor the scripted event editor * @param resources the resources * @param numberSpells the number spells to use * @param gameObjectSpells the game object spells to use - * @param pluginParameterFactory the plugin parameter factory to use * @param validatorPreferences the validator preferences to use * @param mapWriter the map writer for saving temporary maps * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull ProjectSettings projectSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull ArchetypeTypeSet archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull ValidatorPreferences validatorPreferences, @NotNull MapWriter<G, A, R> mapWriter); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull ProjectSettings projectSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull ArchetypeTypeSet archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AbstractMapManager<G, A, R> mapManager, @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 ValidatorPreferences validatorPreferences, @NotNull MapWriter<G, A, R> mapWriter); /** * Returns the offset for drawing double faces. @@ -406,4 +404,10 @@ @Nullable EditorAction newServerActions(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final FileControl<G, A, R> fileControl, @NotNull final PathManager pathManager); + /** + * Returns the default directory for editor scripts. + * @return the directory + */ + String getScriptsDir(); + } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-10-05 15:14:01 UTC (rev 9379) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-10-05 15:22:47 UTC (rev 9380) @@ -99,6 +99,8 @@ import net.sf.gridarta.plugin.PluginExecException; import net.sf.gridarta.plugin.PluginExecutor; import net.sf.gridarta.plugin.PluginModel; +import net.sf.gridarta.plugin.PluginModelLoader; +import net.sf.gridarta.plugin.PluginModelParser; import net.sf.gridarta.plugin.PluginParameters; import net.sf.gridarta.plugin.parameter.PluginParameterFactory; import net.sf.gridarta.preferences.FilePreferencesFactory; @@ -286,7 +288,12 @@ final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList, projectSettings); - final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == GridartaRunMode.COLLECT_ARCHES, errorView, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == GridartaRunMode.COLLECT_ARCHES, errorView, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, validatorPreferences, mapWriter); + + final PluginModelParser<G, A, R> pluginModelParser = new PluginModelParser<G, A, R>(pluginParameterFactory); + final File scriptsFile = new File(projectSettings.getMapsDirectory(), editorFactory.getScriptsDir()); + new PluginModelLoader<G, A, R>(pluginModelParser).loadPlugins(errorView, scriptsFile, pluginModel); + new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(projectSettings.getConfigurationDirectory()); final NamedFilter defaultNamedFilterList = new NamedFilter(gameObjectMatchers.getFilters()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 15:14:08
|
Revision: 9379 http://sourceforge.net/p/gridarta/code/9379 Author: akirschbaum Date: 2013-10-05 15:14:01 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Move loading of autojoin lists from DefaultMainControl to GridartaEditor. 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/DefaultMainControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.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-05 13:34:55 UTC (rev 9378) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -52,7 +52,6 @@ import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.autojoin.AutojoinLists; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.errorview.ErrorView; @@ -182,8 +181,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final 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 PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } /** 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-05 13:34:55 UTC (rev 9378) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -50,7 +50,6 @@ import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.autojoin.AutojoinLists; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.errorview.ErrorView; @@ -152,8 +151,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final 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 PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } /** 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-05 13:34:55 UTC (rev 9378) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -52,7 +52,6 @@ import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.autojoin.AutojoinLists; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.errorview.ErrorView; @@ -182,8 +181,8 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final 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 PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 13:34:55 UTC (rev 9378) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -48,8 +48,6 @@ import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSetParser; import net.sf.gridarta.model.archetypetype.DefaultArchetypeAttributeFactory; -import net.sf.gridarta.model.autojoin.AutojoinLists; -import net.sf.gridarta.model.autojoin.AutojoinListsParser; import net.sf.gridarta.model.configsource.ConfigSource; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.direction.Direction; @@ -171,7 +169,6 @@ * @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 pluginModel the script model * @param validators the map validators @@ -183,7 +180,7 @@ * @param validatorPreferences the validator preferences to use * @param mapWriter the map writer for writing temporary map files */ - 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 ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeTypeSet 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 PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<G, A, R> mapWriter) { + 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 ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<G, A, R> mapWriter) { final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(); @@ -334,7 +331,6 @@ final File scriptsFile = new File(projectSettings.getMapsDirectory(), scriptsDir); final PluginModelParser<G, A, R> pluginModelParser = new PluginModelParser<G, A, R>(pluginParameterFactory); new PluginModelLoader<G, A, R>(pluginModelParser).loadPlugins(errorView, scriptsFile, pluginModel); - new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(projectSettings.getConfigurationDirectory()); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); } 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-05 13:34:55 UTC (rev 9378) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -37,7 +37,6 @@ import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.autojoin.AutojoinLists; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCollector; @@ -107,7 +106,6 @@ * @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 pluginModel the script model * @param validators the map validators @@ -121,7 +119,7 @@ * @return the new instance */ @NotNull - DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull ProjectSettings projectSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull ArchetypeTypeSet 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 PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull ValidatorPreferences validatorPreferences, @NotNull MapWriter<G, A, R> mapWriter); + DefaultMainControl<G, A, R> newMainControl(boolean forceReadFromFiles, @NotNull ErrorView errorView, @NotNull ProjectSettings projectSettings, @NotNull ConfigSourceFactory configSourceFactory, @NotNull PathManager pathManager, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull ArchetypeTypeSet archetypeTypeSet, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull AbstractMapManager<G, A, R> mapManager, @NotNull PluginModel<G, A, R> pluginModel, @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 PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull ValidatorPreferences validatorPreferences, @NotNull MapWriter<G, A, R> mapWriter); /** * Returns the offset for drawing double faces. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-10-05 13:34:55 UTC (rev 9378) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-10-05 15:14:01 UTC (rev 9379) @@ -52,6 +52,7 @@ import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.autojoin.AutojoinLists; +import net.sf.gridarta.model.autojoin.AutojoinListsParser; import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.model.configsource.DefaultConfigSourceFactory; import net.sf.gridarta.model.errorview.ErrorView; @@ -285,7 +286,8 @@ final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(archetypeSet, mapManager, defaultFilterList, projectSettings); - final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == GridartaRunMode.COLLECT_ARCHES, errorView, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + final DefaultMainControl<G, A, R> mainControl = editorFactory.newMainControl(mode == GridartaRunMode.COLLECT_ARCHES, errorView, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(projectSettings.getConfigurationDirectory()); final NamedFilter defaultNamedFilterList = new NamedFilter(gameObjectMatchers.getFilters()); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 13:35:04
|
Revision: 9378 http://sourceforge.net/p/gridarta/code/9378 Author: akirschbaum Date: 2013-10-05 13:34:55 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Split GlobalSettings into {Editor,Project,Volatile}Settings. Modified Paths: -------------- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 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/model/maparchobject/DefaultMapArchObjectFactory.java trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/CollectedConfigSource.java trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/FilesConfigSource.java trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 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/model/maparchobject/DefaultMapArchObjectFactory.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/settings/CollectedConfigSource.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/settings/FilesConfigSource.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 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/model/maparchobject/DefaultMapArchObjectFactory.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/model/settings/CollectedConfigSource.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/model/settings/FilesConfigSource.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/src/gridarta/src/main/java/net/sf/gridarta/action/CollectArchesAction.java trunk/src/gridarta/src/main/java/net/sf/gridarta/action/CollectSpellsAction.java trunk/src/gridarta/src/main/java/net/sf/gridarta/action/OptionsAction.java trunk/src/gridarta/src/main/java/net/sf/gridarta/commands/CollectArchesCommand.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialogFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gomap/GoMapDialogManager.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/prefs/GUIPreferences.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/prefs/MiscPreferences.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/misc/DefaultFileControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/misc/MainToolbar.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.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 trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/gridarta/src/test/java/net/sf/gridarta/actions/ExitConnectorActionsTest.java trunk/src/model/src/main/java/net/sf/gridarta/model/configsource/AbstractConfigSource.java trunk/src/model/src/main/java/net/sf/gridarta/model/configsource/ConfigSource.java trunk/src/model/src/main/java/net/sf/gridarta/model/index/MapsIndexer.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/PathManager.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapcontrol/DefaultMapControl.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmanager/AbstractMapManager.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmanager/DefaultMapManager.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmanager/DefaultPickmapManager.java trunk/src/model/src/main/java/net/sf/gridarta/model/mappathnormalizer/MapPathNormalizer.java trunk/src/model/src/main/java/net/sf/gridarta/model/resource/AbstractResources.java trunk/src/model/src/main/java/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ExitChecker.java trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/TilePathsChecker.java trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ValidatorFactory.java trunk/src/model/src/test/java/net/sf/gridarta/model/index/MapsIndexerTest.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlFactory.java trunk/src/model/src/test/java/net/sf/gridarta/model/validation/ValidationUtils.java trunk/src/plugin/src/main/java/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java trunk/test-mapvalidator/atrinik/maps/dev/editor/scripts/MapValidator trunk/test-mapvalidator/crossfire/maps/editor/scripts/MapValidator trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator Added Paths: ----------- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/AtrinikDefaultProjectSettings.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/settings/CrossfireDefaultProjectSettings.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/model/settings/DaimoninDefaultProjectSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/AbstractDefaultProjectSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/AbstractEditorSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/AbstractProjectSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultEditorSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultVolatileSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/EditorSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/EditorSettingsListener.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/ProjectSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/ProjectSettingsListener.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/VolatileSettings.java trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestProjectSettings.java Removed Paths: ------------- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/AbstractGlobalSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettingsListener.java trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestGlobalSettings.java Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -26,7 +26,7 @@ import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; @@ -46,10 +46,10 @@ private final MapManager<GameObject, MapArchObject, Archetype> mapManager; /** - * The {@link GlobalSettings} to use. + * The {@link ProjectSettings} to use. */ @NotNull - private final GlobalSettings globalSettings; + private final ProjectSettings projectSettings; /** * The {@link MapPathNormalizer} for converting map paths to {@link @@ -61,13 +61,13 @@ /** * Creates a new instance. * @param mapManager the map manager to use - * @param globalSettings the global settings instance + * @param projectSettings the project settings instance * @param mapPathNormalizer the map path normalize for converting map paths * to files */ - public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { + public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ProjectSettings projectSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { this.mapManager = mapManager; - this.globalSettings = globalSettings; + this.projectSettings = projectSettings; this.mapPathNormalizer = mapPathNormalizer; } @@ -76,7 +76,7 @@ */ @Override public void showDialog(@NotNull final Component parent, @NotNull final Frame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { - final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); + final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, projectSettings, mapModel, mapFileFilter, mapPathNormalizer); pane.showDialog(parent); } Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -54,7 +54,7 @@ import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; @@ -314,13 +314,13 @@ * Creates a new instance. * @param helpParent the parent frame for help windows * @param mapManager the map manager to use - * @param globalSettings the global settings instance + * @param projectSettings the project settings instance * @param mapModel the map model whose properties are shown/edited. * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public MapPropertiesDialog(@NotNull final Frame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + public MapPropertiesDialog(@NotNull final Frame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ProjectSettings projectSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -336,7 +336,7 @@ final Component mainPanel = createMainPanel(map); tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapMapTabTitle"), mainPanel); - mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); + mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, projectSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilesTabTitle"), tilePanel); 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-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -88,7 +88,8 @@ import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.EditorSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; @@ -121,7 +122,7 @@ import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import net.sf.gridarta.var.atrinik.model.mapcontrol.DefaultMapControlFactory; import net.sf.gridarta.var.atrinik.model.scripts.DefaultScriptedEventFactory; -import net.sf.gridarta.var.atrinik.model.settings.DefaultGlobalSettings; +import net.sf.gridarta.var.atrinik.model.settings.AtrinikDefaultProjectSettings; import net.sf.gridarta.var.atrinik.resource.DefaultResources; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; @@ -181,8 +182,8 @@ */ @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 PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final 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 PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final ProjectSettings projectSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final 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 PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @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 PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, projectSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } /** @@ -198,8 +199,8 @@ */ @NotNull @Override - public MapArchObjectFactory<MapArchObject> newMapArchObjectFactory(@NotNull final GlobalSettings globalSettings) { - return new DefaultMapArchObjectFactory(globalSettings); + public MapArchObjectFactory<MapArchObject> newMapArchObjectFactory(@NotNull final ProjectSettings projectSettings) { + return new DefaultMapArchObjectFactory(projectSettings); } /** @@ -234,8 +235,8 @@ */ @NotNull @Override - public GlobalSettings newGlobalSettings() { - return new DefaultGlobalSettings(); + public ProjectSettings newProjectSettings(@NotNull final EditorSettings editorSettings) { + return new AtrinikDefaultProjectSettings(editorSettings); } /** @@ -252,7 +253,7 @@ */ @NotNull @Override - public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final ProjectSettings projectSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); } @@ -261,8 +262,8 @@ */ @NotNull @Override - public MapControlFactory<GameObject, MapArchObject, Archetype> newMapControlFactory(@NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter, @NotNull final GlobalSettings globalSettings, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory) { - return new DefaultMapControlFactory(mapWriter, globalSettings, mapModelFactory); + public MapControlFactory<GameObject, MapArchObject, Archetype> newMapControlFactory(@NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter, @NotNull final ProjectSettings projectSettings, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory) { + return new DefaultMapControlFactory(mapWriter, projectSettings, mapModelFactory); } /** @@ -284,7 +285,7 @@ * {@inheritDoc} */ @Override - public void initMapValidators(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final GlobalSettings globalSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences) { + public void initMapValidators(@NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ProjectSettings projectSettings, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final ValidatorPreferences validatorPreferences) { final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcherWarn(errorViewCollector, "system_monster_only", "system_monster", "monster"); if (monsterMatcher != null) { addAttributeRangeChecker(attributeRangeChecker, monsterMatcher, "level", "level", 0, 125); @@ -366,9 +367,9 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ProjectSettings projectSettings) { try { - final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); + final URL url = IOUtils.getResource(projectSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); } catch (final IOException ex) { errorView.addWarning(ErrorViewCategory.ARCHDEF_FILE_INVALID, IGUIConstants.ARCHDEF_FILE + ": " + ex.getMessage()); @@ -444,8 +445,8 @@ */ @NotNull @Override - public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer) { - return new DefaultMapPropertiesDialogFactory(mapManager, globalSettings, mapPathNormalizer); + public MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype> newMapPropertiesDialogFactory(@NotNull final ProjectSettings projectSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapPathNormalizer mapPathNormalizer) { + return new DefaultMapPropertiesDialogFactory(mapManager, projectSettings, mapPathNormalizer); } /** @@ -462,8 +463,8 @@ */ @NotNull @Override - public PreferencesGroup createPreferencesGroup(@NotNull final GlobalSettings globalSettings, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final AppPreferencesModel appPreferencesModel, @NotNull final ExitConnectorModel exitConnectorModel, @NotNull final ConfigSourceFactory configSourceFactory) { - return new PreferencesGroup("Gridarta for Atrinik", new ResPreferences(globalSettings, configSourceFactory), new AppPreferences(appPreferencesModel), new NetPreferences(), new GUIPreferences(globalSettings), new MiscPreferences(exitConnectorModel, globalSettings), new DevPreferences(), new UpdatePreferences(), new MapValidatorPreferences(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); + public PreferencesGroup createPreferencesGroup(@NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final AppPreferencesModel appPreferencesModel, @NotNull final ExitConnectorModel exitConnectorModel, @NotNull final ConfigSourceFactory configSourceFactory) { + return new PreferencesGroup("Gridarta for Atrinik", new ResPreferences(projectSettings, editorSettings, configSourceFactory), new AppPreferences(appPreferencesModel), new NetPreferences(), new GUIPreferences(editorSettings), new MiscPreferences(exitConnectorModel, projectSettings, editorSettings), new DevPreferences(), new UpdatePreferences(), new MapValidatorPreferences(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); } /** @@ -471,8 +472,8 @@ */ @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 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 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 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 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 mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(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, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); + 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 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 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 mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(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, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, projectSettings, editorSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } /** Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/DefaultMapArchObjectFactory.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/DefaultMapArchObjectFactory.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/DefaultMapArchObjectFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -20,7 +20,7 @@ package net.sf.gridarta.var.atrinik.model.maparchobject; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import org.jetbrains.annotations.NotNull; /** @@ -30,17 +30,17 @@ public class DefaultMapArchObjectFactory implements MapArchObjectFactory<MapArchObject> { /** - * The {@link GlobalSettings} to use. + * The {@link ProjectSettings} to use. */ @NotNull - private final GlobalSettings globalSettings; + private final ProjectSettings projectSettings; /** * Creates a new instance. - * @param globalSettings the global settings to use + * @param projectSettings the project settings to use */ - public DefaultMapArchObjectFactory(@NotNull final GlobalSettings globalSettings) { - this.globalSettings = globalSettings; + public DefaultMapArchObjectFactory(@NotNull final ProjectSettings projectSettings) { + this.projectSettings = projectSettings; } /** @@ -51,7 +51,7 @@ public MapArchObject newMapArchObject(final boolean addDefaultAttributes) { final MapArchObject mapArchObject = new MapArchObject(); if (addDefaultAttributes) { - mapArchObject.addText("Created: " + String.format("%tF", System.currentTimeMillis()) + " " + globalSettings.getUserName()); + mapArchObject.addText("Created: " + String.format("%tF", System.currentTimeMillis()) + " " + projectSettings.getUserName()); mapArchObject.setDarkness(-1); } return mapArchObject; Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -27,7 +27,7 @@ import net.sf.gridarta.model.mapcontrol.MapControlFactory; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelFactory; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; @@ -47,10 +47,10 @@ private final MapWriter<GameObject, MapArchObject, Archetype> mapWriter; /** - * The {@link GlobalSettings} to use. + * The {@link ProjectSettings} to use. */ @NotNull - private final GlobalSettings globalSettings; + private final ProjectSettings projectSettings; /** * The {@link MapModelFactory} for creating {@link MapModel} instances. @@ -61,13 +61,13 @@ /** * Creates a new instance. * @param mapWriter the map writer for saving map control instances - * @param globalSettings the global settings to use + * @param projectSettings the project settings to use * @param mapModelFactory the map model factory for creating map model * instances */ - public DefaultMapControlFactory(@NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter, @NotNull final GlobalSettings globalSettings, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory) { + public DefaultMapControlFactory(@NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter, @NotNull final ProjectSettings projectSettings, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory) { this.mapWriter = mapWriter; - this.globalSettings = globalSettings; + this.projectSettings = projectSettings; this.mapModelFactory = mapModelFactory; } @@ -87,7 +87,7 @@ } mapModel.resetModified(); } - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, globalSettings); + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, false, mapWriter, projectSettings); mapControl.getMapModel().setMapFile(file); return mapControl; } @@ -109,7 +109,7 @@ } mapModel.resetModified(); } - final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, globalSettings); + final MapControl<GameObject, MapArchObject, Archetype> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype>(mapModel, true, mapWriter, projectSettings); mapControl.getMapModel().setMapFile(file); mapControl.getMapModel().resetModified(); return mapControl; Copied: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/AtrinikDefaultProjectSettings.java (from rev 9370, trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java) =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/AtrinikDefaultProjectSettings.java (rev 0) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/AtrinikDefaultProjectSettings.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -0,0 +1,69 @@ +/* + * 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.atrinik.model.settings; + +import java.io.File; +import net.sf.gridarta.model.settings.AbstractDefaultProjectSettings; +import net.sf.gridarta.model.settings.EditorSettings; +import net.sf.gridarta.var.atrinik.IGUIConstants; +import org.jetbrains.annotations.NotNull; + +/** + * Maintains path names to resources. + * @author Andreas Kirschbaum + */ +public class AtrinikDefaultProjectSettings extends AbstractDefaultProjectSettings { + + /** + * Creates a new instance. + * @param editorSettings the editor settings for retrieving default values + */ + public AtrinikDefaultProjectSettings(@NotNull final EditorSettings editorSettings) { + super(editorSettings); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getPickmapDir() { + return new File(getArchDirectory(), IGUIConstants.PICKMAP_DIR); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getConfigurationDirectory() { + return new File(getArchDirectory(), "dev/editor/conf"); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getCollectedDirectory() { + return getArchDirectory(); + } + +} Property changes on: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/AtrinikDefaultProjectSettings.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/CollectedConfigSource.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/CollectedConfigSource.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/CollectedConfigSource.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -25,7 +25,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.resource.AbstractResources; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import org.jetbrains.annotations.NotNull; /** @@ -47,8 +47,8 @@ * {@inheritDoc} */ @Override - public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void read(@NotNull final GlobalSettings globalSettings, @NotNull final AbstractResources<G, A, R> resources, @NotNull final ErrorView errorView) { - resources.readCollected(globalSettings, errorView); + public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void read(@NotNull final ProjectSettings projectSettings, @NotNull final AbstractResources<G, A, R> resources, @NotNull final ErrorView errorView) { + resources.readCollected(projectSettings, errorView); } /** Deleted: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -1,59 +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.atrinik.model.settings; - -import java.io.File; -import net.sf.gridarta.var.atrinik.IGUIConstants; -import org.jetbrains.annotations.NotNull; - -/** - * Maintains path names to resources. - * @author Andreas Kirschbaum - */ -public class DefaultGlobalSettings extends net.sf.gridarta.model.settings.DefaultGlobalSettings { - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public File getPickmapDir() { - return new File(getArchDirectory(), IGUIConstants.PICKMAP_DIR); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public File getConfigurationDirectory() { - return new File(getArchDirectory(), "dev/editor/conf"); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public File getCollectedDirectory() { - return getArchDirectory(); - } - -} Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/FilesConfigSource.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/FilesConfigSource.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/settings/FilesConfigSource.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -25,7 +25,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.resource.AbstractResources; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import org.jetbrains.annotations.NotNull; /** @@ -48,8 +48,8 @@ * {@inheritDoc} */ @Override - public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void read(@NotNull final GlobalSettings globalSettings, @NotNull final AbstractResources<G, A, R> resources, @NotNull final ErrorView errorView) { - resources.readFiles(globalSettings, errorView); + public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void read(@NotNull final ProjectSettings projectSettings, @NotNull final AbstractResources<G, A, R> resources, @NotNull final ErrorView errorView) { + resources.readFiles(projectSettings, errorView); } /** Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -37,7 +37,7 @@ import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.resource.CollectedResourcesWriter; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.collectable.AtrinikArchetypeSetCollectable; @@ -121,9 +121,9 @@ * {@inheritDoc} */ @Override - protected void readFilesInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { - faceObjectProviders.setNormal(new FilesResourcesReader(globalSettings.getArchDirectory(), globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects, archFaceProvider).read(errorView, invObjects)); - loadArtifacts(errorView, invObjects, globalSettings.getCollectedDirectory()); + protected void readFilesInt(@NotNull final ProjectSettings projectSettings, @NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + faceObjectProviders.setNormal(new FilesResourcesReader(projectSettings.getArchDirectory(), projectSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects, archFaceProvider).read(errorView, invObjects)); + loadArtifacts(errorView, invObjects, projectSettings.getCollectedDirectory()); } /** @@ -131,10 +131,10 @@ */ @NotNull @Override - protected List<GameObject> readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView) { + protected List<GameObject> readCollectedInt(@NotNull final ProjectSettings projectSettings, @NotNull final ErrorView errorView) { final List<GameObject> invObjects = new ArrayList<GameObject>(); - faceObjectProviders.setNormal(new CollectedResourcesReader(globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects).read(errorView, invObjects)); - loadArtifacts(errorView, invObjects, globalSettings.getCollectedDirectory()); + faceObjectProviders.setNormal(new CollectedResourcesReader(projectSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects).read(errorView, invObjects)); + loadArtifacts(errorView, invObjects, projectSettings.getCollectedDirectory()); return invObjects; } Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -26,7 +26,7 @@ import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; 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; @@ -46,10 +46,10 @@ private final MapManager<GameObject, MapArchObject, Archetype> mapManager; /** - * The {@link GlobalSettings} to use. + * The {@link ProjectSettings} to use. */ @NotNull - private final GlobalSettings globalSettings; + private final ProjectSettings projectSettings; /** * The {@link MapPathNormalizer} for converting map paths to {@link @@ -61,13 +61,13 @@ /** * Creates a new instance. * @param mapManager the map manager to use - * @param globalSettings the global settings instance + * @param projectSettings the project settings instance * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { + public DefaultMapPropertiesDialogFactory(@NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ProjectSettings projectSettings, @NotNull final MapPathNormalizer mapPathNormalizer) { this.mapManager = mapManager; - this.globalSettings = globalSettings; + this.projectSettings = projectSettings; this.mapPathNormalizer = mapPathNormalizer; } @@ -76,7 +76,7 @@ */ @Override public void showDialog(@NotNull final Component parent, @NotNull final Frame helpParent, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter) { - final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); + final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, projectSettings, mapModel, mapFileFilter, mapPathNormalizer); pane.showDialog(parent); } Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-10-05 07:38:31 UTC (rev 9377) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -46,7 +46,7 @@ import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; @@ -357,13 +357,13 @@ * Creates a map-options dialog. * @param helpParent the parent frame for help windows * @param mapManager the map manager to use - * @param globalSettings the global settings instance + * @param projectSettings the project settings instance * @param mapModel the map model whose properties are shown/edited * @param mapFileFilter the Swing file filter to use * @param mapPathNormalizer the map path normalizer for converting map paths * to files */ - public MapPropertiesDialog(@NotNull final Frame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { + public MapPropertiesDialog(@NotNull final Frame helpParent, @NotNull final MapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ProjectSettings projectSettings, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final FileFilter mapFileFilter, @NotNull final MapPathNormalizer mapPathNormalizer) { okButton.setDefaultCapable(true); final JButton helpButton = new JButton(ACTION_BUILDER.createAction(false, "mapHelp", this)); final JButton restoreButton = new JButton(ACTION_BUILDER.createAction(false, "mapRestore", this)); @@ -409,7 +409,7 @@ final Component weatherPanel = createWeatherPanel(map); tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWeatherTabTitle"), weatherPanel); - mapTilePane = new FlatMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); + mapTilePane = new FlatMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, projectSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilesTabTitle"), tilePanel); 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-05 07:38:31 UTC (rev 9377) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-05 13:34:55 UTC (rev 9378) @@ -83,7 +83,8 @@ import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; -import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.EditorSettings; +import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; @@ -116,7 +117,7 @@ import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; import net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory; import net.sf.gridarta.var.crossfire.model.scripts.DefaultScriptedEventFactory; -import net.sf.gridarta.var.crossfire.model.settings.DefaultGlobalSettings; +import net.sf.gridarta.var.crossfire.model.settings.CrossfireDefaultProjectSettings; import net.sf.gridarta.var.crossfire.resource.DefaultResources; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; @@ -151,8 +152,8 @@ */ ... [truncated message content] |
From: <aki...@us...> - 2013-10-05 07:38:36
|
Revision: 9377 http://sourceforge.net/p/gridarta/code/9377 Author: akirschbaum Date: 2013-10-05 07:38:31 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Do not automatically open the help dialog when the editor is started for the first time. Modified Paths: -------------- trunk/src/atrinik/ChangeLog trunk/src/crossfire/ChangeLog trunk/src/daimonin/ChangeLog trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettings.java trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestGlobalSettings.java Modified: trunk/src/atrinik/ChangeLog =================================================================== --- trunk/src/atrinik/ChangeLog 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/atrinik/ChangeLog 2013-10-05 07:38:31 UTC (rev 9377) @@ -1,3 +1,8 @@ +2013-10-05 Andreas Kirschbaum + + * Do not automatically open the help dialog when the editor is + started for the first time. + 2013-07-19 Andreas Kirschbaum * Add attribute_ordering section to types.xml. It specifies the Modified: trunk/src/crossfire/ChangeLog =================================================================== --- trunk/src/crossfire/ChangeLog 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/crossfire/ChangeLog 2013-10-05 07:38:31 UTC (rev 9377) @@ -1,3 +1,8 @@ +2013-10-05 Andreas Kirschbaum + + * Do not automatically open the help dialog when the editor is + started for the first time. + 2013-07-19 Andreas Kirschbaum * Add attribute_ordering section to types.xml. It specifies the Modified: trunk/src/daimonin/ChangeLog =================================================================== --- trunk/src/daimonin/ChangeLog 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/daimonin/ChangeLog 2013-10-05 07:38:31 UTC (rev 9377) @@ -1,3 +1,8 @@ +2013-10-05 Andreas Kirschbaum + + * Do not automatically open the help dialog when the editor is + started for the first time. + 2013-07-19 Andreas Kirschbaum * Add attribute_ordering section to types.xml. It specifies the 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-05 07:07:52 UTC (rev 9376) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-05 07:38:31 UTC (rev 9377) @@ -548,7 +548,7 @@ createAction("collectArches", "Tool", new CollectArchesAction<G, A, R>(globalSettings, resources, exiter, mainViewFrame)); createAction("reloadFaces", "Image,Tool", new ReloadFacesAction<G, A, R>(archetypeSet, faceObjectProviders)); createAction("validateMap", "Map,Tool", new ValidateMapAction<G, A, R>(validators, mapManager)); - final Action helpAction = createAction("showHelp", "Help", new ShowHelpAction(parent)); + createAction("showHelp", "Help", new ShowHelpAction(parent)); createAction("tipOfTheDay", "Help", new TipOfTheDayAction(parent)); createAction("newMap", "Map", new NewMapAction<G, A, R>(newMapDialogFactory)); createAction("goMap", "Map", new GoMapDialogManager<G, A, R>(parent, mapManager, mapViewsManager, globalSettings, exiter)); @@ -642,13 +642,6 @@ new ArchetypeValidator(animationObjects, faceObjects, errorView).validate(archetypeSet); new AnimationValidator(faceObjects, errorView).validate(animationObjects); - if (globalSettings.isAutoPopupDocumentation()) { - // do an automated help popup because the documentation version has increased - // (people won't notice the documentation otherwise - nobody expects a documentation in open source) - helpAction.actionPerformed(null); - globalSettings.setAutoPopupDocumentation(false); - } - final MapMenuPreferences recentMapMenuPreferences = new RecentMapMenuPreferences(); final MapMenuManager<G, A, R> recentMapMenuManager = new MapMenuManager<G, A, R>(recentMapMenuPreferences.getMapMenu(), mapViewsManager, fileControl, mapImageCache); final JMenu recentMenu = MenuUtils.getMenu(menuBar, "recent"); Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2013-10-05 07:38:31 UTC (rev 9377) @@ -66,12 +66,6 @@ private static final String IMAGE_SET_KEY = "useImageSet"; /** - * The preferences key for storing the last known documentation version. - */ - @NotNull - private static final String DOCUMENTATION_VERSION_KEY = "docuVersion"; - - /** * Key for info whether the main window's toolbar is shown. */ @NotNull @@ -173,11 +167,6 @@ private String configSourceName; /** - * Time for an automated documentation popup. - */ - private boolean autoPopupDocumentation; - - /** * The the default directory for saving maps. */ @NotNull @@ -222,14 +211,6 @@ imageSet = preferences.get(IMAGE_SET_KEY, imageSetDefault); imageDirectory = mapsDirectory; configSourceName = preferences.get(CONFIG_SOURCE_KEY, ""); - final int documentationVersion = ActionBuilderUtils.getInt(ACTION_BUILDER, "docuVersion", 0); - if (documentationVersion > 0 && preferences.getInt(DOCUMENTATION_VERSION_KEY, 0) < documentationVersion) { - // remember to open documentation - autoPopupDocumentation = true; - // update documentation version right now, because we want the help popup only one time - preferences.putInt(DOCUMENTATION_VERSION_KEY, documentationVersion); - } - currentSaveMapDirectory = mapsDirectory.exists() ? mapsDirectory : new File(System.getProperty("user.dir")); } @@ -448,22 +429,6 @@ } /** - * {@inheritDoc} - */ - @Override - public boolean isAutoPopupDocumentation() { - return autoPopupDocumentation; - } - - /** - * {@inheritDoc} - */ - @Override - public void setAutoPopupDocumentation(final boolean autoPopupDocumentation) { - this.autoPopupDocumentation = autoPopupDocumentation; - } - - /** * Returns whether the main toolbar should be shown. * @return whether the main toolbar should be shown */ Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettings.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettings.java 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/settings/GlobalSettings.java 2013-10-05 07:38:31 UTC (rev 9377) @@ -112,10 +112,6 @@ */ void setCurrentSaveMapDirectory(@NotNull File currentSaveMapDirectory); - boolean isAutoPopupDocumentation(); - - void setAutoPopupDocumentation(boolean autoPopupDocumentation); - /** * Returns the pickmap directory. * @return the pickmap directory Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestGlobalSettings.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestGlobalSettings.java 2013-10-05 07:07:52 UTC (rev 9376) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/settings/TestGlobalSettings.java 2013-10-05 07:38:31 UTC (rev 9377) @@ -146,22 +146,6 @@ * {@inheritDoc} */ @Override - public boolean isAutoPopupDocumentation() { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setAutoPopupDocumentation(final boolean autoPopupDocumentation) { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ - @Override @NotNull public File getPickmapDir() { throw new AssertionError(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 07:07:55
|
Revision: 9376 http://sourceforge.net/p/gridarta/code/9376 Author: akirschbaum Date: 2013-10-05 07:07:52 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Fix error message when running the editor from within the IDE. Modified Paths: -------------- trunk/gridarta.ipr trunk/src/atrinik/atrinik.iml trunk/src/crossfire/crossfire.iml trunk/src/daimonin/daimonin.iml Added Paths: ----------- trunk/src/resources/resources.iml Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2013-10-05 06:53:04 UTC (rev 9375) +++ trunk/gridarta.ipr 2013-10-05 07:07:52 UTC (rev 9376) @@ -2175,6 +2175,7 @@ <module fileurl="file://$PROJECT_DIR$/src/model/model.iml" filepath="$PROJECT_DIR$/src/model/model.iml" /> <module fileurl="file://$PROJECT_DIR$/src/plugin/plugin.iml" filepath="$PROJECT_DIR$/src/plugin/plugin.iml" /> <module fileurl="file://$PROJECT_DIR$/src/preferences/preferences.iml" filepath="$PROJECT_DIR$/src/preferences/preferences.iml" /> + <module fileurl="file://$PROJECT_DIR$/src/resources/resources.iml" filepath="$PROJECT_DIR$/src/resources/resources.iml" /> <module fileurl="file://$PROJECT_DIR$/src/textedit/textedit.iml" filepath="$PROJECT_DIR$/src/textedit/textedit.iml" /> <module fileurl="file://$PROJECT_DIR$/src/utils/utils.iml" filepath="$PROJECT_DIR$/src/utils/utils.iml" /> </modules> Modified: trunk/src/atrinik/atrinik.iml =================================================================== --- trunk/src/atrinik/atrinik.iml 2013-10-05 06:53:04 UTC (rev 9375) +++ trunk/src/atrinik/atrinik.iml 2013-10-05 07:07:52 UTC (rev 9376) @@ -14,6 +14,7 @@ <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="plugin" /> + <orderEntry type="module" module-name="resources" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="bsh-commands" level="project" /> Modified: trunk/src/crossfire/crossfire.iml =================================================================== --- trunk/src/crossfire/crossfire.iml 2013-10-05 06:53:04 UTC (rev 9375) +++ trunk/src/crossfire/crossfire.iml 2013-10-05 07:07:52 UTC (rev 9376) @@ -14,6 +14,7 @@ <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="plugin" /> + <orderEntry type="module" module-name="resources" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="bsh-commands" level="project" /> Modified: trunk/src/daimonin/daimonin.iml =================================================================== --- trunk/src/daimonin/daimonin.iml 2013-10-05 06:53:04 UTC (rev 9375) +++ trunk/src/daimonin/daimonin.iml 2013-10-05 07:07:52 UTC (rev 9376) @@ -14,6 +14,7 @@ <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="plugin" /> + <orderEntry type="module" module-name="resources" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="bsh-commands" level="project" /> Added: trunk/src/resources/resources.iml =================================================================== --- trunk/src/resources/resources.iml (rev 0) +++ trunk/src/resources/resources.iml 2013-10-05 07:07:52 UTC (rev 9376) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/build" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> + Property changes on: trunk/src/resources/resources.iml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 06:53:10
|
Revision: 9375 http://sourceforge.net/p/gridarta/code/9375 Author: akirschbaum Date: 2013-10-05 06:53:04 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Add private modifiers. Modified Paths: -------------- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/tools/ToolSelector.java trunk/src/gridarta/src/main/java/net/sf/gridarta/updater/Updater.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/model/src/test/java/net/sf/gridarta/model/maparchobject/TestMapArchObject.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.java trunk/src/preferences/src/main/java/net/sf/gridarta/preferences/Storage.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/src/utils/src/main/java/net/sf/gridarta/utils/ProcessRunner.java trunk/src/utils/src/main/java/net/sf/gridarta/utils/SystemIcons.java Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -155,7 +155,7 @@ * Creates a new instance as a copy of another map arch object. * @param mapArchObject the other map arch object */ - public MapArchObject(@NotNull final MapArchObject mapArchObject) { + private MapArchObject(@NotNull final MapArchObject mapArchObject) { super(mapArchObject); noSave = mapArchObject.noSave; noMagic = mapArchObject.noMagic; Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -57,7 +57,7 @@ * The name of the "glow_radius" attribute. */ @NotNull - public static final String GLOW_RADIUS = "glow_radius"; + private static final String GLOW_RADIUS = "glow_radius"; /** * The name of the "invisible" attribute. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -114,13 +114,13 @@ * Color for float values. */ @NotNull - public static final Color FLOAT_COLOR = new Color(19, 134, 0); + private static final Color FLOAT_COLOR = new Color(19, 134, 0); /** * Color for int values. */ @NotNull - public static final Color INT_COLOR = new Color(74, 70, 156); + private static final Color INT_COLOR = new Color(74, 70, 156); /** * The game object being modified. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -384,7 +384,7 @@ * @param directory the entry's directory * @param treeNode the tree node */ - public DeletedNode(@NotNull final String directory, @NotNull final DefaultMutableTreeNode treeNode) { + private DeletedNode(@NotNull final String directory, @NotNull final DefaultMutableTreeNode treeNode) { this.directory = directory; this.treeNode = treeNode; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -184,7 +184,7 @@ * @param directory the entry's directory * @param mapMenuEntry the entry */ - public Result(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { + private Result(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { this.directory = directory; this.mapMenuEntry = mapMenuEntry; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/tools/ToolSelector.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/tools/ToolSelector.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/tools/ToolSelector.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -245,7 +245,7 @@ * Creates a SelectionAction. * @param tool the tool to select with this action */ - SelectionAction(@NotNull final Tool<G, A, R> tool) { + private SelectionAction(@NotNull final Tool<G, A, R> tool) { this.tool = tool; ACTION_BUILDER.initAction(false, this, tool.getId()); } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/updater/Updater.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/updater/Updater.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/updater/Updater.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -313,7 +313,7 @@ * @param prefix Prefix for update information within the resource * bundle */ - VersionInfo(@NotNull final ResourceBundle bundle, @NotNull final String prefix) { + private VersionInfo(@NotNull final ResourceBundle bundle, @NotNull final String prefix) { this(bundle.getString(prefix + ".number"), bundle.getString(prefix + ".tstamp"), bundle.getString(prefix + ".developer")); } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -47,7 +47,7 @@ * An empty array of <code>int</code>s. */ @NotNull - public static final int[] EMPTY_INT_ARRAY = new int[0]; + private static final int[] EMPTY_INT_ARRAY = new int[0]; /** * The logger for printing log messages. Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/maparchobject/TestMapArchObject.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/maparchobject/TestMapArchObject.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/maparchobject/TestMapArchObject.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -43,7 +43,7 @@ * @param mapArchObject the other map arch object * @noinspection TypeMayBeWeakened */ - public TestMapArchObject(@NotNull final TestMapArchObject mapArchObject) { + private TestMapArchObject(@NotNull final TestMapArchObject mapArchObject) { super(mapArchObject); } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -63,7 +63,7 @@ * @return the new map cursor instance */ @NotNull - public static MapCursor<TestGameObject, TestMapArchObject, TestArchetype> createCursor(@NotNull final MapGrid grid) { + private static MapCursor<TestGameObject, TestMapArchObject, TestArchetype> createCursor(@NotNull final MapGrid grid) { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final Size2D gridSize = grid.getSize(); final MapCursor<TestGameObject, TestMapArchObject, TestArchetype> cursor = new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(grid, mapModelCreator.newMapModel(gridSize.getWidth(), gridSize.getHeight())); Modified: trunk/src/preferences/src/main/java/net/sf/gridarta/preferences/Storage.java =================================================================== --- trunk/src/preferences/src/main/java/net/sf/gridarta/preferences/Storage.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/preferences/src/main/java/net/sf/gridarta/preferences/Storage.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -51,7 +51,7 @@ * The pattern that matches a single equal sign ("="). */ @NotNull - public static final Pattern PATTERN_EQUAL = Pattern.compile("="); + private static final Pattern PATTERN_EQUAL = Pattern.compile("="); /** * The Logger for printing log messages. Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -231,7 +231,7 @@ private boolean ignore; // while true, all ActionEvents get ignored - MenuActionListener(@NotNull final CFPythonPopup popup, @NotNull final ScriptEditControl control) { + private MenuActionListener(@NotNull final CFPythonPopup popup, @NotNull final ScriptEditControl control) { this.popup = popup; this.control = control; } Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -1753,7 +1753,7 @@ private int end; - CaretUndo(final int start, final int end) { + private CaretUndo(final int start, final int end) { this.start = start; this.end = end; } Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/actions/Replace.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/actions/Replace.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/actions/Replace.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -160,7 +160,7 @@ * Create a new instance. * @param textArea The text area to replace in. */ - public ReplaceDialog(final JEditTextArea textArea) { + private ReplaceDialog(final JEditTextArea textArea) { this.textArea = textArea; replaceButton.setDefaultCapable(true); setOptions(new Object[] { replaceButton, cancelButton, }); Modified: trunk/src/utils/src/main/java/net/sf/gridarta/utils/ProcessRunner.java =================================================================== --- trunk/src/utils/src/main/java/net/sf/gridarta/utils/ProcessRunner.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/utils/src/main/java/net/sf/gridarta/utils/ProcessRunner.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -312,7 +312,7 @@ * @param title Title for this CopyOutput * @param textArea JTextArea to append output to */ - CopyOutput(@NotNull final String title, @NotNull final JTextArea textArea) { + private CopyOutput(@NotNull final String title, @NotNull final JTextArea textArea) { this.title = title; appender = new Appender(textArea); } Modified: trunk/src/utils/src/main/java/net/sf/gridarta/utils/SystemIcons.java =================================================================== --- trunk/src/utils/src/main/java/net/sf/gridarta/utils/SystemIcons.java 2013-10-05 06:46:26 UTC (rev 9374) +++ trunk/src/utils/src/main/java/net/sf/gridarta/utils/SystemIcons.java 2013-10-05 06:53:04 UTC (rev 9375) @@ -69,7 +69,7 @@ * The name of the image for highlighting map squares that are affected by * nearby light emitting game objects. */ - public static final String SQUARE_LIGHT = SYSTEM_DIR + "light.png"; + private static final String SQUARE_LIGHT = SYSTEM_DIR + "light.png"; public static final String SQUARE_NO_FACE = SYSTEM_DIR + "no_face.png"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 06:46:29
|
Revision: 9374 http://sourceforge.net/p/gridarta/code/9374 Author: akirschbaum Date: 2013-10-05 06:46:26 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Remove unused parameter. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java 2013-10-05 06:43:31 UTC (rev 9373) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java 2013-10-05 06:46:26 UTC (rev 9374) @@ -29,7 +29,6 @@ import net.sf.gridarta.model.baseobject.GameObjectContainer; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.utils.Size2D; @@ -69,12 +68,10 @@ /** * Creates a new instance. * @param mapModel the rendered map model - * @param gameObjectParser the game object parser for generating tooltip - * information or <code>null</code> * @param isoMapSquareInfo the iso map square info to use */ - protected AbstractSimpleIsoMapRenderer(@NotNull final MapModel<G, A, R> mapModel, @Nullable final GameObjectParser<G, A, R> gameObjectParser, @NotNull final IsoMapSquareInfo isoMapSquareInfo) { - super(mapModel, gameObjectParser); + protected AbstractSimpleIsoMapRenderer(@NotNull final MapModel<G, A, R> mapModel, @NotNull final IsoMapSquareInfo isoMapSquareInfo) { + super(mapModel, null); this.mapModel = mapModel; this.isoMapSquareInfo = isoMapSquareInfo; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2013-10-05 06:43:31 UTC (rev 9373) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2013-10-05 06:46:26 UTC (rev 9374) @@ -74,7 +74,7 @@ * @param unknownSquareIcon the icon for unknown squares */ public SimpleIsoMapRenderer(final int spawnPointTypeNo, @NotNull final MapModel<G, A, R> mapModel, @NotNull final MultiPositionData multiPositionData, @NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final ImageIcon unknownSquareIcon) { - super(mapModel, null, isoMapSquareInfo); + super(mapModel, isoMapSquareInfo); this.spawnPointTypeNo = spawnPointTypeNo; this.multiPositionData = multiPositionData; this.isoMapSquareInfo = isoMapSquareInfo; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 06:43:36
|
Revision: 9373 http://sourceforge.net/p/gridarta/code/9373 Author: akirschbaum Date: 2013-10-05 06:43:31 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Add final modifier. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java 2013-10-05 06:38:19 UTC (rev 9372) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java 2013-10-05 06:43:31 UTC (rev 9373) @@ -108,7 +108,7 @@ * The associated {@link JDialog} instance. */ @Nullable - private JDialog dialog; + private final JDialog dialog; /** * Creates a new instance. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 06:38:22
|
Revision: 9372 http://sourceforge.net/p/gridarta/code/9372 Author: akirschbaum Date: 2013-10-05 06:38:19 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Weaken types. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributesDefinition.java trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributesDefinition.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributesDefinition.java 2013-10-05 06:30:08 UTC (rev 9371) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributesDefinition.java 2013-10-05 06:38:19 UTC (rev 9372) @@ -23,7 +23,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.baseobject.Attributes; import org.jetbrains.annotations.NotNull; /** @@ -48,11 +48,12 @@ } /** - * Checks whether a {@link BaseObject} matches all type attributes. + * Checks whether an {@link Attributes} instance matches all type + * attributes. * @param baseObject the base object to check * @return whether the base object matches */ - public boolean matches(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + public boolean matches(@NotNull final Attributes baseObject) { for (final ArchetypeAttributeDefinition typeAttribute : archetypeAttributes) { if (!typeAttribute.matches(baseObject)) { return false; Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2013-10-05 06:30:08 UTC (rev 9371) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2013-10-05 06:38:19 UTC (rev 9372) @@ -23,6 +23,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.TestAnimationObjects; import net.sf.gridarta.model.archetype.TestDefaultArchetype; +import net.sf.gridarta.model.baseobject.Attributes; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; @@ -49,7 +50,7 @@ final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final AnimationObjects animationObjects = new TestAnimationObjects(); final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); - final BaseObject<?, ?, ?, ?> archetype = new TestDefaultArchetype("base", faceObjectProviders, animationObjects); + final Attributes archetype = new TestDefaultArchetype("base", faceObjectProviders, animationObjects); final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", true, null, false, "description", "use", typeAttributes); Assert.assertEquals("name1 (1)", archetypeType1.getDisplayName(archetype)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-05 06:30:15
|
Revision: 9371 http://sourceforge.net/p/gridarta/code/9371 Author: akirschbaum Date: 2013-10-05 06:30:08 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Weaken types. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/src/model/src/main/java/net/sf/gridarta/model/maplocation/MapLocation.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-07-19 13:27:24 UTC (rev 9370) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-10-05 06:30:08 UTC (rev 9371) @@ -564,7 +564,7 @@ * @return the pane */ @NotNull - public JTabbedPane getTabbedPane() { + public Component getTabbedPane() { return tabbedPane; } @@ -573,7 +573,7 @@ * @return the dialog attributes */ @NotNull - public Collection<DialogAttribute<G, A, R, ?>> getDialogAttributes() { + public Iterable<DialogAttribute<G, A, R, ?>> getDialogAttributes() { return Collections.unmodifiableCollection(dialogAttributes); } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2013-07-19 13:27:24 UTC (rev 9370) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2013-10-05 06:30:08 UTC (rev 9371) @@ -33,6 +33,7 @@ import java.util.Set; import javax.swing.Icon; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.baseobject.Attributes; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.DefaultIsoGameObject; import net.sf.gridarta.model.gameobject.GameObject; @@ -556,7 +557,7 @@ * @param head the head of the game object * @return the rotation angle in radians */ - private static double getRotate(@NotNull final BaseObject<?, ?, ?, ?> head) { + private static double getRotate(@NotNull final Attributes head) { final int rotate = -head.getAttributeInt(DefaultIsoGameObject.ROTATE) % 360; return (rotate < 0 ? rotate + 360 : rotate) * 2 * Math.PI / 360; } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java 2013-07-19 13:27:24 UTC (rev 9370) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java 2013-10-05 06:30:08 UTC (rev 9371) @@ -19,7 +19,7 @@ package net.sf.gridarta.model.archetypetype; -import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.baseobject.Attributes; import org.jetbrains.annotations.NotNull; /** @@ -56,7 +56,7 @@ * @param baseObject the base object * @return whether the base object matches */ - public boolean matches(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + public boolean matches(@NotNull final Attributes baseObject) { return matches(baseObject.getAttributeString(key)); } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-07-19 13:27:24 UTC (rev 9370) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-10-05 06:30:08 UTC (rev 9371) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.archetypetype; import java.util.Iterator; +import net.sf.gridarta.model.baseobject.Attributes; import net.sf.gridarta.model.baseobject.BaseObject; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -285,7 +286,7 @@ * @return the description */ @NotNull - public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + public String getDisplayName(@NotNull final Attributes baseObject) { final StringBuilder sb = new StringBuilder(); sb.append(typeName); sb.append(" ("); Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/maplocation/MapLocation.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/maplocation/MapLocation.java 2013-07-19 13:27:24 UTC (rev 9370) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/maplocation/MapLocation.java 2013-10-05 06:30:08 UTC (rev 9371) @@ -22,6 +22,7 @@ import java.awt.Point; import java.io.File; import java.util.regex.Pattern; +import net.sf.gridarta.model.baseobject.Attributes; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.PathManager; @@ -159,7 +160,7 @@ * @param gameObject the game object * @return the exit x coordinate */ - private static int getMapY(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + private static int getMapY(@NotNull final Attributes gameObject) { return gameObject.getAttributeInt(BaseObject.SP); } @@ -168,7 +169,7 @@ * @param gameObject the game object * @return the exit y coordinate */ - private static int getMapX(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + private static int getMapX(@NotNull final Attributes gameObject) { return gameObject.getAttributeInt(BaseObject.HP); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 13:27:29
|
Revision: 9370 http://sourceforge.net/p/gridarta/code/9370 Author: akirschbaum Date: 2013-07-19 13:27:24 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Add attribute_ordering section to types.xml. It specifies the ordering of attributes when writing map files. Modified Paths: -------------- trunk/src/atrinik/ChangeLog trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/src/crossfire/ChangeLog 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/model/io/DefaultGameObjectParser.java trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/src/crossfire/src/main/resources/resource/conf/types.xml trunk/src/crossfire/src/test/java/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java trunk/src/daimonin/ChangeLog 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/GridartaEditor.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/Constants.java trunk/src/model/src/main/resources/system/dtd/types.dtd trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java trunk/src/utils/src/main/java/net/sf/gridarta/utils/StringUtils.java Added Paths: ----------- trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder1-types.xml trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder2-types.xml trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder3-types.xml trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder4-types.xml Modified: trunk/src/atrinik/ChangeLog =================================================================== --- trunk/src/atrinik/ChangeLog 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/atrinik/ChangeLog 2013-07-19 13:27:24 UTC (rev 9370) @@ -1,3 +1,8 @@ +2013-07-19 Andreas Kirschbaum + + * Add attribute_ordering section to types.xml. It specifies the + ordering of attributes when writing map files. + 2013-07-12 Andreas Kirschbaum * Release 0.10. 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-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -225,7 +225,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } Modified: trunk/src/crossfire/ChangeLog =================================================================== --- trunk/src/crossfire/ChangeLog 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/ChangeLog 2013-07-19 13:27:24 UTC (rev 9370) @@ -1,5 +1,8 @@ 2013-07-19 Andreas Kirschbaum + * Add attribute_ordering section to types.xml. It specifies the + ordering of attributes when writing map files. + * Properly support attack_movement attribute in game object attributes dialog. 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-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -195,8 +195,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet, archetypeTypeSet); } /** Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -19,11 +19,10 @@ package net.sf.gridarta.var.crossfire.model.io; -import java.util.Comparator; -import java.util.HashMap; import java.util.Map; import java.util.TreeMap; import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; @@ -39,298 +38,22 @@ public class DefaultGameObjectParser extends AbstractGameObjectParser<GameObject, MapArchObject, Archetype> { /** - * Determines the field order when writing objects to a file. The key is the - * field name, the value is an Integer that describes the order. Lower - * values are written first. + * The {@link ArchetypeTypeSet} for sorting attributes on save. */ - private static final Map<String, Integer> keys = new HashMap<String, Integer>(); + @NotNull + private final ArchetypeTypeSet archetypeTypeSet; - /* - * Initialize {@link keys} array. - * @todo this information should be read from a file. - */ - - static { - addKey("name"); - addKey("name_pl"); - addKey("custom_name"); - addKey("title"); - addKey("race"); - addKey("slaying"); - addKey("skill"); - addKey("msg"); - addKey("lore"); - addKey("other_arch"); - addKey("face"); - addKey("animation"); - addKey("is_animated"); - addKey("Str"); - addKey("Dex"); - addKey("Con"); - addKey("Wis"); - addKey("Pow"); - addKey("Cha"); - addKey("Int"); - addKey("hp"); - addKey("maxhp"); - addKey("sp"); - addKey("maxsp"); - addKey("grace"); - addKey("maxgrace"); - addKey("exp"); - addKey("perm_exp"); - addKey("expmul"); - addKey("food"); - addKey("dam"); - addKey("luck"); - addKey("wc"); - addKey("ac"); - addKey("x"); - addKey("y"); - addKey("speed"); - addKey("speed_left"); - addKey("move_state"); - addKey("attack_movement"); - addKey("nrof"); - addKey("level"); - addKey("direction"); - addKey("type"); - addKey("subtype"); - addKey("attacktype"); - addKey("resist_physical"); - addKey("resist_magic"); - addKey("resist_fire"); - addKey("resist_electricity"); - addKey("resist_cold"); - addKey("resist_confusion"); - addKey("resist_acid"); - addKey("resist_drain"); - addKey("resist_weaponmagic"); - addKey("resist_ghosthit"); - addKey("resist_poison"); - addKey("resist_slow"); - addKey("resist_paralyze"); - addKey("resist_turn_undead"); - addKey("resist_fear"); - addKey("resist_cancellation"); - addKey("resist_deplete"); - addKey("resist_death"); - addKey("resist_chaos"); - addKey("resist_counterspell"); - addKey("resist_godpower"); - addKey("resist_holyword"); - addKey("resist_blind"); - addKey("resist_internal"); - addKey("resist_life_stealing"); - addKey("resist_disease"); - addKey("path_attuned"); - addKey("path_repelled"); - addKey("path_denied"); - addKey("material"); - addKey("materialname"); - addKey("value"); - addKey("carrying"); - addKey("weight"); - addKey("invisible"); - addKey("state"); - addKey("magic"); - addKey("last_heal"); - addKey("last_sp"); - addKey("last_grace"); - addKey("last_eat"); - addKey("connected"); - addKey("glow_radius"); - addKey("randomitems"); - addKey("npc_status"); - addKey("npc_program"); - addKey("run_away"); - addKey("pick_up"); - addKey("container"); - addKey("will_apply"); - addKey("smoothlevel"); - addKey("map_layer"); - addKey("current_weapon_script"); - addKey("weapontype"); - addKey("tooltype"); - addKey("elevation"); - addKey("client_type"); - addKey("item_power"); - addKey("duration"); - addKey("range"); - addKey("range_modifier"); - addKey("duration_modifier"); - addKey("dam_modifier"); - addKey("gen_sp_armour"); - addKey("move_type"); - addKey("move_block"); - addKey("move_allow"); - addKey("move_on"); - addKey("move_off"); - addKey("move_slow"); - addKey("move_slow_penalty"); - addKey("alive"); - addKey("wiz"); - addKey("was_wiz"); - addKey("applied"); - addKey("unpaid"); - addKey("can_use_shield"); - addKey("no_pick"); - addKey("walk_on"); - addKey("no_pass"); - addKey("is_animated"); - addKey("slow_move"); - addKey("flying"); - addKey("monster"); - addKey("friendly"); - addKey("generator"); - addKey("is_thrown"); - addKey("auto_apply"); - addKey("treasure"); - addKey("player sold"); - addKey("see_invisible"); - addKey("can_roll"); - addKey("overlay_floor"); - addKey("is_turnable"); - addKey("walk_off"); - addKey("fly_on"); - addKey("fly_off"); - addKey("is_used_up"); - addKey("identified"); - addKey("reflecting"); - addKey("changing"); - addKey("splitting"); - addKey("hitback"); - addKey("startequip"); - addKey("blocksview"); - addKey("undead"); - addKey("scared"); - addKey("unaggressive"); - addKey("reflect_missile"); - addKey("reflect_spell"); - addKey("no_magic"); - addKey("no_fix_player"); - addKey("is_lightable"); - addKey("tear_down"); - addKey("run_away"); - addKey("pass_thru"); - addKey("can_pass_thru"); - addKey("unique"); - addKey("no_drop"); - addKey("wizcast"); - addKey("can_cast_spell"); - addKey("can_use_scroll"); - addKey("can_use_range"); - addKey("can_use_bow"); - addKey("can_use_armour"); - addKey("can_use_weapon"); - addKey("can_use_ring"); - addKey("has_ready_range"); - addKey("has_ready_bow"); - addKey("xrays"); - addKey("is_floor"); - addKey("lifesave"); - addKey("no_strength"); - addKey("sleep"); - addKey("stand_still"); - addKey("random_move"); - addKey("only_attack"); - addKey("confused"); - addKey("stealth"); - addKey("cursed"); - addKey("damned"); - addKey("see_anywhere"); - addKey("known_magical"); - addKey("known_cursed"); - addKey("can_use_skill"); - addKey("been_applied"); - addKey("has_ready_scroll"); - addKey("can_use_rod"); - addKey("can_use_horn"); - addKey("make_invisible"); - addKey("inv_locked"); - addKey("is_wooded"); - addKey("is_hilly"); - addKey("has_ready_skill"); - addKey("has_ready_weapon"); - addKey("no_skill_ident"); - addKey("is_blind"); - addKey("can_see_in_dark"); - addKey("is_cauldron"); - addKey("is_dust"); - addKey("no_steal"); - addKey("one_hit"); - addKey("berserk"); - addKey("neutral"); - addKey("no_attack"); - addKey("no_damage"); - addKey("activate_on_push"); - addKey("activate_on_release"); - addKey("is_water"); - addKey("use_content_on_gen"); - addKey("is_buildable"); - addKey("body_range"); - addKey("body_arm"); - addKey("body_torso"); - addKey("body_head"); - addKey("body_neck"); - addKey("body_skill"); - addKey("body_finger"); - addKey("body_shoulder"); - addKey("body_foot"); - addKey("body_hand"); - addKey("body_wrist"); - addKey("body_waist"); - } - /** - * The next key added via {@link #addKey(String)} is assigned this id. - */ - private static int idKey = 1; - - /** - * Adds a new key to {@link #keys}. The order in which the keys are added is - * the order in which the objects fields are written out. - * @param key the key to add - */ - private static void addKey(final String key) { - keys.put(key, idKey++); - } - - /** - * Comparator to compare two object fields. The comparator sorts the fields - * in the order in which they should be written to disk. - */ - private static final Comparator<String> keyOrderComparator = new Comparator<String>() { - - @Override - public int compare(final String o1, final String o2) { - final Integer i1 = keys.get(o1); - final Integer i2 = keys.get(o2); - final int v1 = i1 == null ? Integer.MAX_VALUE : i1; - final int v2 = i2 == null ? Integer.MAX_VALUE : i2; - if (v1 < v2) { - return -1; - } - if (v1 > v2) { - return +1; - } - assert v1 == v2; - if (v1 == Integer.MAX_VALUE) { - return o1.compareTo(o2); - } - return 0; - } - - }; - - /** * Create a new instance. * @param gameObjectFactory the game object factory for creating new game * object instances * @param archetypeSet the archetype set for looking up archetypes + * @param archetypeTypeSet the archetype type set for sorting attributes on + * save */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet) { super(gameObjectFactory, archetypeSet); + this.archetypeTypeSet = archetypeTypeSet; } /** @@ -339,7 +62,7 @@ @NotNull @Override public Map<String, String> getModifiedFields(@NotNull final GameObject gameObject) { - final Map<String, String> fields = new TreeMap<String, String>(keyOrderComparator); + final Map<String, String> fields = new TreeMap<String, String>(archetypeTypeSet.getAttributeOrderComparator()); addModifiedFields(gameObject, fields); return fields; } Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -20,6 +20,7 @@ package net.sf.gridarta.var.crossfire.model.io; import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; @@ -47,13 +48,22 @@ private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; /** + * The {@link ArchetypeTypeSet} for sorting attributes on save. + */ + @NotNull + private final ArchetypeTypeSet archetypeTypeSet; + + /** * Creates a new instance. * @param gameObjectFactory the game object factory to use * @param archetypeSet the archetype set for looking up archetypes + * @param archetypeTypeSet the archetype type set for sorting attributes on + * save */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet) { this.gameObjectFactory = gameObjectFactory; this.archetypeSet = archetypeSet; + this.archetypeTypeSet = archetypeTypeSet; } /** @@ -61,7 +71,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, archetypeSet); + return new DefaultGameObjectParser(gameObjectFactory, archetypeSet, archetypeTypeSet); } } Modified: trunk/src/crossfire/src/main/resources/resource/conf/types.xml =================================================================== --- trunk/src/crossfire/src/main/resources/resource/conf/types.xml 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/src/main/resources/resource/conf/types.xml 2013-07-19 13:27:24 UTC (rev 9370) @@ -448,6 +448,239 @@ </ignorelists> + <!-- This is the order in which attributes are written to map files. + Attributes not included here are placed at the end and sorted + alphabetically. --> + <attribute_order> + name + name_pl + custom_name + title + race + slaying + skill + msg + lore + other_arch + face + animation + Str + Dex + Con + Wis + Pow + Cha + Int + hp + maxhp + sp + maxsp + grace + maxgrace + exp + perm_exp + expmul + food + dam + luck + wc + ac + x + y + speed + speed_left + move_state + attack_movement + nrof + level + direction + type + subtype + attacktype + resist_physical + resist_magic + resist_fire + resist_electricity + resist_cold + resist_confusion + resist_acid + resist_drain + resist_weaponmagic + resist_ghosthit + resist_poison + resist_slow + resist_paralyze + resist_turn_undead + resist_fear + resist_cancellation + resist_deplete + resist_death + resist_chaos + resist_counterspell + resist_godpower + resist_holyword + resist_blind + resist_internal + resist_life_stealing + resist_disease + path_attuned + path_repelled + path_denied + material + materialname + value + carrying + weight + invisible + state + magic + last_heal + last_sp + last_grace + last_eat + connected + glow_radius + randomitems + npc_status + npc_program + pick_up + container + will_apply + smoothlevel + map_layer + current_weapon_script + weapontype + tooltype + elevation + client_type + item_power + duration + range + range_modifier + duration_modifier + dam_modifier + gen_sp_armour + move_type + move_block + move_allow + move_on + move_off + move_slow + move_slow_penalty + alive + wiz + was_wiz + applied + unpaid + can_use_shield + no_pick + walk_on + no_pass + is_animated + slow_move + flying + monster + friendly + generator + is_thrown + auto_apply + treasure + player sold + see_invisible + can_roll + overlay_floor + is_turnable + walk_off + fly_on + fly_off + is_used_up + identified + reflecting + changing + splitting + hitback + startequip + blocksview + undead + scared + unaggressive + reflect_missile + reflect_spell + no_magic + no_fix_player + is_lightable + tear_down + run_away + pass_thru + can_pass_thru + unique + no_drop + wizcast + can_cast_spell + can_use_scroll + can_use_range + can_use_bow + can_use_armour + can_use_weapon + can_use_ring + has_ready_range + has_ready_bow + xrays + is_floor + lifesave + no_strength + sleep + stand_still + random_move + only_attack + confused + stealth + cursed + damned + see_anywhere + known_magical + known_cursed + can_use_skill + been_applied + has_ready_scroll + can_use_rod + can_use_horn + make_invisible + inv_locked + is_wooded + is_hilly + has_ready_skill + has_ready_weapon + no_skill_ident + is_blind + can_see_in_dark + is_cauldron + is_dust + no_steal + one_hit + berserk + neutral + no_attack + no_damage + activate_on_push + activate_on_release + is_water + use_content_on_gen + is_buildable + body_range + body_arm + body_torso + body_head + body_neck + body_skill + body_finger + body_shoulder + body_foot + body_hand + body_wrist + body_waist + </attribute_order> + <!--###################### default attributes ######################--> <!-- Modified: trunk/src/crossfire/src/test/java/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java =================================================================== --- trunk/src/crossfire/src/test/java/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/crossfire/src/test/java/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -23,15 +23,16 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; -import net.sf.gridarta.model.io.AbstractArchetypeParserTest; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; 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.io.AbstractArchetypeParser; +import net.sf.gridarta.model.io.AbstractArchetypeParserTest; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.utils.GUIUtils; @@ -108,8 +109,9 @@ final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, "images"); archetypeSet.setLoadedFromArchive(true); + final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); assert archetypeSet != null; - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet, archetypeTypeSet); assert archetypeSet != null; final SmoothFaces smoothFaces = new SmoothFaces(faceObjects); assert archetypeSet != null; Modified: trunk/src/daimonin/ChangeLog =================================================================== --- trunk/src/daimonin/ChangeLog 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/daimonin/ChangeLog 2013-07-19 13:27:24 UTC (rev 9370) @@ -1,3 +1,8 @@ +2013-07-19 Andreas Kirschbaum + + * Add attribute_ordering section to types.xml. It specifies the + ordering of attributes when writing map files. + 2013-07-12 Andreas Kirschbaum * Release 0.10. 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-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -225,7 +225,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } 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-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -158,10 +158,12 @@ * Creates a new {@link GameObjectParserFactory} instance. * @param gameObjectFactory the game object parser factory to use * @param archetypeSet the archetype set for looking up archetypes + * @param archetypeTypeSet the archetype type set for sorting attributes on + * save * @return the new instance */ @NotNull - GameObjectParserFactory<G, A, R> newGameObjectParserFactory(@NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet); + GameObjectParserFactory<G, A, R> newGameObjectParserFactory(@NotNull GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final ArchetypeTypeSet archetypeTypeSet); /** * Creates a new {@link GlobalSettings} instance. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -258,7 +258,7 @@ } }); - final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet); + final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet, archetypeTypeSet); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); final MapArchObjectParserFactory<A> mapArchObjectParserFactory = editorFactory.newMapArchObjectParserFactory(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -94,7 +94,7 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); - final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet); + final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet, archetypeTypeSet); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final MapViewSettings mapViewSettings = new DefaultMapViewSettings(); final MapReaderFactory<G, A> mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, mapViewSettings); Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -21,8 +21,10 @@ import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -73,6 +75,42 @@ private final Map<String, AttributeBitmask> bitmaskTable = new HashMap<String, AttributeBitmask>(); /** + * Attribute names in save order. + */ + @NotNull + private final Map<String, Integer> attributeOrder = new LinkedHashMap<String, Integer>(); + + /** + * A {@link Comparator} that compares strings by {@link #attributeOrder}. + */ + @NotNull + private final Comparator<String> attributeOrderComparator = new Comparator<String>() { + + @Override + public int compare(@NotNull final String o1, @NotNull final String o2) { + final Integer index1 = attributeOrder.get(o1); + final Integer index2 = attributeOrder.get(o2); + if (index1 == null) { + if (index2 == null) { + return o1.compareTo(o2); + } + return +1; + } + if (index2 == null) { + return -1; + } + if (index1 < index2) { + return -1; + } + if (index1 > index2) { + return +1; + } + return 0; + } + + }; + + /** * Adds an {@link ArchetypeType} instance. * @param archetypeType the archetype type instance */ @@ -209,6 +247,33 @@ } /** + * Adds an attribute name for attribute ordering when saving. The new + * attribute name is placed after all previously added attribute names and + * before all other attribute names. + * @param attributeName the attribute name + * @return whether insertion failed because the attribute name was already + * known + */ + public boolean addAttributeOrder(@NotNull final String attributeName) { + if (attributeOrder.containsKey(attributeName)) { + return true; + } + + attributeOrder.put(attributeName, attributeOrder.size()); + return false; + } + + /** + * Returns a {@link Comparator} that sorts attributes keys by the order + * defined by {@link #addAttributeOrder(String)}. + * @return the comparator + */ + @NotNull + public Comparator<String> getAttributeOrderComparator() { + return attributeOrderComparator; + } + + /** * Returns a description of this type. * @param baseObject the base object to describe * @return the description Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -24,6 +24,7 @@ import javax.xml.parsers.DocumentBuilder; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.utils.SyntaxErrorException; import net.sf.gridarta.utils.XmlUtils; import net.sf.japi.xml.NodeListIterator; @@ -34,6 +35,7 @@ import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Node; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -112,6 +114,7 @@ parseBitmasks(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_BITMASKS), errorViewCollector); parseLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_LISTS), errorViewCollector); final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_IGNORELISTS), errorViewCollector); + parseAttributeOrder(NodeListIterator.getFirstChild(rootElement, Constants.XML_ELEMENT_ATTRIBUTE_ORDER), errorViewCollector); final ArchetypeType defaultArchetypeType = parseDefaultType(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); final Iterator<Element> typeElements = new NodeListIterator<Element>(rootElement, Constants.XML_ELEMENT_TYPE); @@ -319,6 +322,24 @@ } /** + * Parses the {@link Constants#XML_ELEMENT_ATTRIBUTE_ORDER} section of a + * types.xml file. + * @param attributeOrderElement the element to parse or {@code null} + * @param errorViewCollector the error view collector for reporting errors + */ + private void parseAttributeOrder(@Nullable final Node attributeOrderElement, @NotNull final ErrorViewCollector errorViewCollector) { + if (attributeOrderElement != null) { + for (final String value : StringUtils.PATTERN_WHITESPACE_NEWLINE.split(attributeOrderElement.getTextContent())) { + if (!value.isEmpty()) { + if (archetypeTypeSet.addAttributeOrder(value)) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, value + ": duplicate attribute name"); + } + } + } + } + } + + /** * Parses the {@link Constants#XML_ELEMENT_IGNORE_LIST} section of a * types.xml file. * @param ignoreListElement the element to parse Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/Constants.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/Constants.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/Constants.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -194,6 +194,12 @@ public static final String XML_ELEMENT_IGNORELISTS = "ignorelists"; /** + * The name of the "attribute_order" element. + */ + @NotNull + public static final String XML_ELEMENT_ATTRIBUTE_ORDER = "attribute_order"; + + /** * The name of the "ignore_list" element. */ @NotNull Modified: trunk/src/model/src/main/resources/system/dtd/types.dtd =================================================================== --- trunk/src/model/src/main/resources/system/dtd/types.dtd 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/model/src/main/resources/system/dtd/types.dtd 2013-07-19 13:27:24 UTC (rev 9370) @@ -19,7 +19,7 @@ --> <!-- The types document root element. --> -<!ELEMENT types ((bitmasks|xi:include), (lists|xi:include), (ignorelists|xi:include), (default_type|xi:include), (type|xi:include)+)> +<!ELEMENT types ((bitmasks|xi:include), (lists|xi:include), (ignorelists|xi:include), attribute_order?, (default_type|xi:include), (type|xi:include)+)> <!ATTLIST types> <!ELEMENT bitmasks (bitmask*)> @@ -37,6 +37,11 @@ xml:base CDATA #IMPLIED > +<!-- When writing a game object, the attributes are sorted in this order. + Attributes not specified here are placed at the end and ordered + alphabetically. Attributes are delimited with whitespace. --> +<!ELEMENT attribute_order (#PCDATA)> + <!-- name: the name of the bitmask; must be unique --> <!-- is_named: whether values are to be encoded as strings in external representation --> Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -23,6 +23,10 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCollector; @@ -142,22 +146,68 @@ } /** + * Checks that a "archetype_order" is parsed correctly: missing + * attribute_order element. + * @throws ParserConfigurationException if the test fails + */ + @Test + public void testArchetypeOrder1() throws ParserConfigurationException { + final ArchetypeTypeSet typeSet = loadArchetypeTypeSet("attributeOrder1"); + Assert.assertFalse(errorView.hasErrors()); + final List<String> keys = new ArrayList<String>(Arrays.asList("a", "b", "c", "d")); + Collections.sort(keys, typeSet.getAttributeOrderComparator()); + Assert.assertEquals("[a, b, c, d]", keys.toString()); + } + + /** + * Checks that a "archetype_order" is parsed correctly: empty element. + * @throws ParserConfigurationException if the test fails + */ + @Test + public void testArchetypeOrder2() throws ParserConfigurationException { + final ArchetypeTypeSet typeSet = loadArchetypeTypeSet("attributeOrder2"); + Assert.assertFalse(errorView.hasErrors()); + final List<String> keys = new ArrayList<String>(Arrays.asList("a", "b", "c", "d")); + Collections.sort(keys, typeSet.getAttributeOrderComparator()); + Assert.assertEquals("[a, b, c, d]", keys.toString()); + } + + /** + * Checks that a "archetype_order" is parsed correctly: all attributes + * specified. + * @throws ParserConfigurationException if the test fails + */ + @Test + public void testArchetypeOrder3() throws ParserConfigurationException { + final ArchetypeTypeSet typeSet = loadArchetypeTypeSet("attributeOrder3"); + Assert.assertFalse(errorView.hasErrors()); + final List<String> keys = new ArrayList<String>(Arrays.asList("a", "b", "c", "d")); + Collections.sort(keys, typeSet.getAttributeOrderComparator()); + Assert.assertEquals("[c, d, a, b]", keys.toString()); + } + + /** + * Checks that a "archetype_order" is parsed correctly: some attributes + * missing. + * @throws ParserConfigurationException if the test fails + */ + @Test + public void testArchetypeOrder4() throws ParserConfigurationException { + final ArchetypeTypeSet typeSet = loadArchetypeTypeSet("attributeOrder4"); + Assert.assertFalse(errorView.hasErrors()); + final List<String> keys = new ArrayList<String>(Arrays.asList("a", "b", "c", "d")); + Collections.sort(keys, typeSet.getAttributeOrderComparator()); + Assert.assertEquals("[c, a, b, d]", keys.toString()); + } + + /** * Checks that a types.xml file can be read. * @param name the base name of the resources to load * @throws ParserConfigurationException if the test fails * @throws IOException if the test fails */ private void check(@NotNull final String name) throws ParserConfigurationException, IOException { - final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); - final ArchetypeTypeSetParser parser = createArchetypeTypeSetParser(archetypeTypeSet); - - final InputStream typesXml = getClass().getResourceAsStream("ArchetypeTypeSetParserTest-" + name + "-types.xml"); - Assert.assertNotNull(typesXml); - final InputSource inputSource = new InputSource(typesXml); - inputSource.setSystemId("types.dtd"); - - parser.loadTypesFromXML(errorViewCollector, inputSource); - + final ArchetypeTypeSet archetypeTypeSet = loadArchetypeTypeSet(name); final InputStream is = getClass().getResourceAsStream("ArchetypeTypeSetParserTest-" + name + "-result.txt"); Assert.assertNotNull(is); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -174,6 +224,27 @@ } /** + * Loads a types.xml file from resources. + * @param name the base name of the resources to load + * @return the archetype type set + * @throws ParserConfigurationException if the file cannot be read + */ + @NotNull + private ArchetypeTypeSet loadArchetypeTypeSet(@NotNull final String name) throws ParserConfigurationException { + final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); + final ArchetypeTypeSetParser parser = createArchetypeTypeSetParser(archetypeTypeSet); + + final InputStream typesXml = getClass().getResourceAsStream("ArchetypeTypeSetParserTest-" + name + "-types.xml"); + System.out.println("ArchetypeTypeSetParserTest-" + name + "-types.xml"); + Assert.assertNotNull(typesXml); + final InputSource inputSource = new InputSource(typesXml); + inputSource.setSystemId("types.dtd"); + + parser.loadTypesFromXML(errorViewCollector, inputSource); + return archetypeTypeSet; + } + + /** * Creates a new {@link ArchetypeTypeSetParser} instance. * @param archetypeTypeSet the archetype type set to modify * @return the archetype type set parser instance Added: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder1-types.xml =================================================================== --- trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder1-types.xml (rev 0) +++ trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder1-types.xml 2013-07-19 13:27:24 UTC (rev 9370) @@ -0,0 +1,10 @@ +<?xml version="1.0" standalone="no" ?> + +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists/> + <ignorelists/> + <default_type/> + <type number="1" name="name1"/> +</types> Property changes on: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder1-types.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Added: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder2-types.xml =================================================================== --- trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder2-types.xml (rev 0) +++ trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder2-types.xml 2013-07-19 13:27:24 UTC (rev 9370) @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="no" ?> + +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists/> + <ignorelists/> + <attribute_order/> + <default_type/> + <type number="1" name="name1"/> +</types> Property changes on: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder2-types.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Added: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder3-types.xml =================================================================== --- trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder3-types.xml (rev 0) +++ trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder3-types.xml 2013-07-19 13:27:24 UTC (rev 9370) @@ -0,0 +1,14 @@ +<?xml version="1.0" standalone="no" ?> + +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists/> + <ignorelists/> + <attribute_order> + c d + a b + </attribute_order> + <default_type/> + <type number="1" name="name1"/> +</types> Property changes on: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder3-types.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Added: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder4-types.xml =================================================================== --- trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder4-types.xml (rev 0) +++ trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder4-types.xml 2013-07-19 13:27:24 UTC (rev 9370) @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="no" ?> + +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists/> + <ignorelists/> + <attribute_order>c a</attribute_order> + <default_type/> + <type number="1" name="name1"/> +</types> Property changes on: trunk/src/model/src/test/resources/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest-attributeOrder4-types.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Modified: trunk/src/utils/src/main/java/net/sf/gridarta/utils/StringUtils.java =================================================================== --- trunk/src/utils/src/main/java/net/sf/gridarta/utils/StringUtils.java 2013-07-19 08:58:58 UTC (rev 9369) +++ trunk/src/utils/src/main/java/net/sf/gridarta/utils/StringUtils.java 2013-07-19 13:27:24 UTC (rev 9370) @@ -31,12 +31,18 @@ public class StringUtils { /** - * Pattern to match whitespace. + * Pattern to match whitespace excluding NL and CR. */ @NotNull public static final Pattern PATTERN_WHITESPACE = Pattern.compile("[\\x00-\\x09\\x0b\\x20]+"); /** + * Pattern to match whitespace including NL and CR. + */ + @NotNull + public static final Pattern PATTERN_WHITESPACE_NEWLINE = Pattern.compile("[\\x00-\\x0b\\x0d\\x20]+"); + + /** * Pattern to match trailing whitespace. */ @NotNull This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 08:59:02
|
Revision: 9369 http://sourceforge.net/p/gridarta/code/9369 Author: akirschbaum Date: 2013-07-19 08:58:58 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Properly support attack_movement attribute in game object attributes dialog. [Crossfire] Modified Paths: -------------- trunk/src/crossfire/ChangeLog trunk/src/crossfire/src/main/resources/resource/conf/types.xml trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/TestArchetypeAttributeFactory.java Added Paths: ----------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList2.java trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList2.java Modified: trunk/src/crossfire/ChangeLog =================================================================== --- trunk/src/crossfire/ChangeLog 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/crossfire/ChangeLog 2013-07-19 08:58:58 UTC (rev 9369) @@ -1,3 +1,8 @@ +2013-07-19 Andreas Kirschbaum + + * Properly support attack_movement attribute in game object + attributes dialog. + 2013-07-12 Andreas Kirschbaum * Release 0.10. Modified: trunk/src/crossfire/src/main/resources/resource/conf/types.xml =================================================================== --- trunk/src/crossfire/src/main/resources/resource/conf/types.xml 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/crossfire/src/main/resources/resource/conf/types.xml 2013-07-19 08:58:58 UTC (rev 9369) @@ -103,6 +103,10 @@ # bool_special - Like bool, but with customized true/false values # # treasurelist - CF treasure list (see "treasures" file) # # list_LISTNAME - list, must be defined as a <list> element; # +# list2_LISTNAME1_LISTNAME2 # +# - double list, must be defined as a <list> elements; # +# LISTNAME1 selects bits 0-3, LISTNAME2 selects bits # +# 4+ # # bitmask_BITMASKNAME - bitmask, must be defined as a <bitmask> # # element # # # @@ -376,6 +380,31 @@ <listentry value="3" name="general"/> <listentry value="4" name="window"/> </list> + + <list name="attackmovementlow"> + <listentry value="0" name="default"/> + <listentry value="1" name="DISTATT"/> + <listentry value="2" name="RUNATT"/> + <listentry value="3" name="HITRUN"/> + <listentry value="4" name="WAITATT"/> + <listentry value="5" name="RUSH"/> + <listentry value="6" name="ALLRUN"/> + <listentry value="7" name="DISTHIT"/> + <listentry value="8" name="WAIT2"/> + </list> + + <list name="attackmovementhigh"> + <listentry value="0" name="default"/> + <listentry value="1" name="PETMOVE"/> + <listentry value="2" name="CIRCLE1"/> + <listentry value="3" name="CIRCLE2"/> + <listentry value="4" name="PACEH"/> + <listentry value="5" name="PACEH2"/> + <listentry value="6" name="RANDO"/> + <listentry value="7" name="RANDO2"/> + <listentry value="8" name="PACEV"/> + <listentry value="9" name="PACEV2"/> + </list> </lists> <ignorelists> @@ -3563,7 +3592,42 @@ wake the monster up. If the player has stealth, the size of this square is reduced in half plus 1. </attribute> - <attribute arch="attack_movement" editor="attack movement" type="int"/> + <attribute arch="attack_movement" editor="attack movement" type="list2_attackmovementlow_attackmovementhigh"><![CDATA[ + Specifies how the NPC or Monster moves: + default - Move toward a player. + DISTATT - Move toward a player if far, but maintain some space, + attack from a distance - good for missile users only. + RUNATT - Run but attack if player catches up to object. + HITRUN - Run to then hit player then run away cyclicly. + WAITATT - Wait for player to approach then hit, move if hit. + RUSH - Rush toward player blindly, similiar to dumb monster. + ALLRUN - Always run, never attack good for sim. of weak player. + DISTHIT - Attack from a distance if hit as recommended by Frank. + WAIT2 - Monster does not try to move towards player if far. + Maintains comfortable distance. + + The second setting specifies the behavior when there is no enemy: + default - Stand still. + PETMOVE - The monster follows the player until it is called off + and will try to attack whatever the player is attacking. + CIRCLE1 - The monster will move in a circle until it is attacked, + or until it finds an enemy. This is good for + non-aggressive monsters and NPC. + CIRCLE2 - Same as CIRCLE1 but a larger circle is used. + PACEH - The monster will pace back and forth until attacked. + This is HORIZONTAL movement. + PACEH2 - The monster will pace as above but the length of the + pace area is longer and the monster stops before + changing directions. This is HORIZONTAL movement. + RANDO - The monster will go in a random direction until it is + stopped by an obstacle, then it chooses another direction. + RANDO2 - Constantly move in a different random direction. + PACEV - The monster will pace back and forth until attacked. + This is VERTICAL movement. + PACEV2 - The monster will pace as above but the length of the + pace area is longer and the monster stops before + changing directions. This is VERTICAL movement.]]> + </attribute> <attribute arch="run_away" editor="run at % health" type="int"> This is a percentage value in the range 0-100. When the monster's health points drop below this percentage (relative to Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -69,6 +69,7 @@ import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInt; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInvSpell; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList; +import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList2; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeLong; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeMapPath; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeScriptFile; @@ -379,6 +380,45 @@ } @Override + public void visit(@NotNull final ArchetypeAttributeList2 archetypeAttribute) { + final JLabel label = new JLabel(archetypeAttribute.getAttributeName() + ": "); + label.setForeground(INT_COLOR); + final int value = attributes.getAttributeInt(archetypeAttribute.getArchetypeAttributeName()); + + final JComponent component1; + @Nullable final JComboBox input1; + final ArchetypeTypeList list1 = archetypeTypeSet.getList(archetypeAttribute.getListName1()); + if (list1 != null) { + input1 = buildArrayBox(list1, value & 0x0F, archetypeAttribute.getAttributeName()); + component1 = input1; + } else { + // error: list data is missing or corrupt + input1 = new JComboBox(); + component1 = new JLabel("Error: Undefined List"); + } + + final JComponent component2; + @Nullable final JComboBox input2; + final ArchetypeTypeList list2 = archetypeTypeSet.getList(archetypeAttribute.getListName2()); + if (list2 != null) { + input2 = buildArrayBox(list2, value >> 4, archetypeAttribute.getAttributeName()); + component2 = input2; + } else { + // error: list data is missing or corrupt + input2 = new JComboBox(); + component2 = new JLabel("Error: Undefined List"); + } + + final JComponent component = new JPanel(new GridBagLayout()); + final GridBagConstraints gbc = new GridBagConstraints(); + gbc.weightx = 1.0; + gbc.fill = GridBagConstraints.HORIZONTAL; + component.add(component1, gbc); + component.add(component2, gbc); + guiInfo = new GuiInfoTwoColumn<G, A, R, ArchetypeAttributeList2>(new DialogAttributeList2<G, A, R>(archetypeAttribute, input1, input2, archetypeTypeSet), label, component); + } + + @Override public void visit(@NotNull final ArchetypeAttributeLong archetypeAttribute) { final JLabel label = new JLabel(archetypeAttribute.getAttributeName() + ": "); label.setForeground(INT_COLOR); Added: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList2.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList2.java (rev 0) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList2.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -0,0 +1,120 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.dialog.gameobjectattributes; + +import javax.swing.JComboBox; +import javax.swing.text.Document; +import javax.swing.text.Style; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList2; +import net.sf.gridarta.model.archetypetype.ArchetypeType; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link DialogAttribute} for {@link ArchetypeAttributeList2}. + * @author Andreas Kirschbaum + */ +public class DialogAttributeList2<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeList2> { + + /** + * The input ui component for editing bits 0-3 of the value. + */ + @NotNull + private final JComboBox input1; + + /** + * The input ui component for editing bits 4+ of the value. + */ + @NotNull + private final JComboBox input2; + + /** + * The archetype type set. + */ + @NotNull + private final ArchetypeTypeSet archetypeTypeSet; + + /** + * Creates a new instance. + * @param ref reference to the attribute data + * @param input1 the input ui component for editing bits 0-3 of the value + * @param input2 the input ui component for editing bits 4+ of the value + * @param archetypeTypeSet the archetype type set + */ + public DialogAttributeList2(@NotNull final ArchetypeAttributeList2 ref, @NotNull final JComboBox input1, @NotNull final JComboBox input2, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + super(ref); + this.input1 = input1; + this.input2 = input2; + this.archetypeTypeSet = archetypeTypeSet; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { + final int attributeValueTmp1 = input1.getSelectedIndex(); + final int attributeValue1 = archetypeTypeSet.getList(getRef().getListName1()).get(attributeValueTmp1).getFirst(); + + final int attributeValueTmp2 = input2.getSelectedIndex(); + final int attributeValue2 = archetypeTypeSet.getList(getRef().getListName2()).get(attributeValueTmp2).getFirst(); + + final int attributeValue = (attributeValue1 & 0x0F) | (attributeValue2 << 4); + final String archetypeAttributeName = getRef().getArchetypeAttributeName(); + if (archetype.getAttributeInt(archetypeAttributeName) != attributeValue) { + return archetypeAttributeName + " " + attributeValue; + } + + return ""; + } + + /** + * {@inheritDoc} + */ + @Override + public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { + final Object selectedItem1 = input1.getSelectedItem(); + if (selectedItem1 == null) { + return; + } + + final Object selectedItem2 = input2.getSelectedItem(); + if (selectedItem2 == null) { + return; + } + + final String value1 = selectedItem1.toString().trim(); + if (value1.isEmpty() || value1.startsWith("<")) { + return; + } + + final String value2 = selectedItem2.toString().trim(); + if (value2.isEmpty() || value2.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + value1 + " / " + value2); + } + +} Property changes on: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList2.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -158,6 +158,19 @@ ArchetypeAttribute newArchetypeAttributeList(@NotNull String archetypeAttributeName, @NotNull String attributeName, @NotNull String description, int inputLength, @NotNull String listName); /** + * Creates a new "list2" archetype attribute. + * @param archetypeAttributeName the archetype attribute name + * @param attributeName the user interface attribute name + * @param description the attribute's description + * @param inputLength the input length in characters for text input fields + * @param listName1 the list name for bits 0-3 + * @param listName2 the list name for bits 4+ + * @return the bitmask attribute + */ + @NotNull + ArchetypeAttribute newArchetypeAttributeList2(@NotNull String archetypeAttributeName, @NotNull String attributeName, @NotNull String description, int inputLength, @NotNull String listName1, @NotNull String listName2); + + /** * Creates a new "long" archetype attribute. * @param archetypeAttributeName the archetype attribute name * @param attributeName the user interface attribute name Added: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList2.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList2.java (rev 0) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList2.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -0,0 +1,83 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.archetypetype; + +import org.jetbrains.annotations.NotNull; + +/** + * An {@link ArchetypeAttribute} for selecting a value from two lists. + * @author Andreas Kirschbaum + */ +public class ArchetypeAttributeList2 extends AbstractArchetypeAttributeList { + + /** + * The list name for bits 0-3. + */ + @NotNull + private final String listName1; + + /** + * The list name for bits 4+. + */ + @NotNull + private final String listName2; + + /** + * Creates a new instance. + * @param archetypeAttributeName the archetype attribute name + * @param attributeName the user interface attribute name + * @param description the attribute's description + * @param inputLength the input length in characters for text input fields + * @param listName1 the list name for bits 0-3 + * @param listName2 the list name for bits 4+ + */ + public ArchetypeAttributeList2(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String listName1, @NotNull final String listName2) { + super(archetypeAttributeName, attributeName, description, inputLength); + this.listName1 = listName1; + this.listName2 = listName2; + } + + /** + * Returns the list name for bits 0-3. + * @return the list name + */ + @NotNull + public String getListName1() { + return listName1; + } + + /** + * Returns the list name for bits 4+. + * @return the list name + */ + @NotNull + public String getListName2() { + return listName2; + } + + /** + * {@inheritDoc} + */ + @Override + public void visit(@NotNull final ArchetypeAttributeVisitor visitor) { + visitor.visit(this); + } + +} Property changes on: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList2.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -41,6 +41,12 @@ private static final Pattern LINE_BREAK = Pattern.compile("\\s*\n\\s*"); /** + * Pattern to match the list name separator in "list2_xxx_yyy" types. + */ + @NotNull + private static final Pattern UNDERSCORE = Pattern.compile("_"); + + /** * The {@link ArchetypeAttributeFactory} for creating {@link * ArchetypeAttribute ArchetypeAttributes}. */ @@ -144,6 +150,25 @@ return null; } return archetypeAttributeFactory.newArchetypeAttributeList(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, listName); + } else if (attributeType.startsWith("list2_")) { + // got a bitmask attribute + final String listNames = attributeType.substring(6).trim(); + final String[] tmp = UNDERSCORE.split(listNames, 2); + if (tmp.length != 2) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": Lists \"" + listNames + "\" are undefined."); + return null; + } + final String listName1 = tmp[0]; + final String listName2 = tmp[1]; + if (archetypeTypeSet.getList(listName1) == null) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": List \"" + listName1 + "\" is undefined."); + return null; + } + if (archetypeTypeSet.getList(listName2) == null) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": List \"" + listName2 + "\" is undefined."); + return null; + } + return archetypeAttributeFactory.newArchetypeAttributeList2(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, listName1, listName2); } else if (attributeType.equals("treasurelist")) { return archetypeAttributeFactory.newArchetypeAttributeTreasure(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength); } else { Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -91,6 +91,12 @@ * Visitor callback function. * @param archetypeAttribute the visited node */ + void visit(@NotNull ArchetypeAttributeList2 archetypeAttribute); + + /** + * Visitor callback function. + * @param archetypeAttribute the visited node + */ void visit(@NotNull ArchetypeAttributeLong archetypeAttribute); /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -133,6 +133,15 @@ */ @NotNull @Override + public ArchetypeAttribute newArchetypeAttributeList2(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String listName1, @NotNull final String listName2) { + return new ArchetypeAttributeList2(archetypeAttributeName, attributeName, description, inputLength, listName1, listName2); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override public ArchetypeAttribute newArchetypeAttributeLong(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) { return new ArchetypeAttributeLong(archetypeAttributeName, attributeName, description, inputLength); } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -34,6 +34,7 @@ import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInt; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInvSpell; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList; +import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList2; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeLong; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeMapPath; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeScriptFile; @@ -185,6 +186,11 @@ } @Override + public void visit(@NotNull final ArchetypeAttributeList2 archetypeAttribute) { + // XXX: missing + } + + @Override public void visit(@NotNull final ArchetypeAttributeLong archetypeAttribute) { // XXX: missing } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/TestArchetypeAttributeFactory.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/TestArchetypeAttributeFactory.java 2013-07-19 08:24:28 UTC (rev 9368) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/archetypetype/TestArchetypeAttributeFactory.java 2013-07-19 08:58:58 UTC (rev 9369) @@ -132,6 +132,15 @@ */ @NotNull @Override + public ArchetypeAttribute newArchetypeAttributeList2(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String listName1, @NotNull final String listName2) { + return new TestArchetypeAttribute("list2", archetypeAttributeName, attributeName, description, inputLength); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override public ArchetypeAttribute newArchetypeAttributeLong(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) { return new TestArchetypeAttribute("long", archetypeAttributeName, attributeName, description, inputLength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 08:24:34
|
Revision: 9368 http://sourceforge.net/p/gridarta/code/9368 Author: akirschbaum Date: 2013-07-19 08:24:28 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-07-19 07:52:58 UTC (rev 9367) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/AttributesPaneBuilder.java 2013-07-19 08:24:28 UTC (rev 9368) @@ -368,7 +368,7 @@ final JComboBox input; final ArchetypeTypeList list = archetypeTypeSet.getList(archetypeAttribute.getListName()); if (list != null) { - input = buildArrayBox(list, attributes, archetypeAttribute.getArchetypeAttributeName(), archetypeAttribute.getAttributeName()); + input = buildArrayBox(list, attributes.getAttributeInt(archetypeAttribute.getArchetypeAttributeName()), archetypeAttribute.getAttributeName()); component = input; } else { // error: list data is missing or corrupt @@ -723,16 +723,14 @@ /** * Constructs the combo box for arrays of "list data". * @param listData list with list items and corresponding values - * @param attributes the associated game object - * @param archetypeAttributeName the name of the shown attribute + * @param value the current value of the attribute * @param attributeName the label to show on the combo box * @return the completed <code>JComboBox</code> */ @NotNull - private static JComboBox buildArrayBox(@NotNull final ArchetypeTypeList listData, @NotNull final Attributes attributes, @NotNull final String archetypeAttributeName, @NotNull final String attributeName) { + private static JComboBox buildArrayBox(@NotNull final ArchetypeTypeList listData, final int value, @NotNull final String attributeName) { final String[] array = new String[listData.size()]; boolean hasSelection = false; - final int value = attributes.getAttributeInt(archetypeAttributeName); int selectedIndex = 0; for (int i = 0; i < array.length; i++) { array[i] = listData.get(i).getSecond(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 07:53:04
|
Revision: 9367 http://sourceforge.net/p/gridarta/code/9367 Author: akirschbaum Date: 2013-07-19 07:52:58 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Remove redundant field. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:50:29 UTC (rev 9366) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:52:58 UTC (rev 9367) @@ -32,12 +32,6 @@ public class DialogAttributeInt<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeInt> { /** - * Reference to the attribute data. - */ - @NotNull - private final ArchetypeAttributeInt ref; - - /** * The input ui component for editing the value. */ @NotNull @@ -50,7 +44,6 @@ */ public DialogAttributeInt(@NotNull final ArchetypeAttributeInt ref, @NotNull final JFormattedTextField input) { super(ref); - this.ref = ref; this.input = input; } @@ -60,6 +53,7 @@ @NotNull @Override public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException { + final ArchetypeAttributeInt ref = getRef(); final String archetypeAttributeName = ref.getArchetypeAttributeName(); final int value; if (input.getText().trim().isEmpty()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 07:50:38
|
Revision: 9366 http://sourceforge.net/p/gridarta/code/9366 Author: akirschbaum Date: 2013-07-19 07:50:29 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Move error dialogs out of DialogAttribute implementations. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java Added Paths: ----------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/InvalidAttributeException.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -32,7 +31,6 @@ import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A single Attribute, combining an {@link ArchetypeAttribute} with its input @@ -79,13 +77,11 @@ * gameObject}'s current archetype * @param newMsg the new "msg" value for the owner * @param archetypeType the owner's archetype type - * @param parent the parent component of the dialog this attribute is part - * of - * @return the game object text or {@code null} if the attribute cannot be - * encoded + * @return the game object text or an empty string + * @throws InvalidAttributeException if the attribute cannot be encoded */ - @Nullable - public abstract String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent); + @NotNull + public abstract String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException; /** * Appends a summary line for this attribute to a {@link Document}. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.gui.utils.AnimationComponent; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeAnimationName<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeAnimationName> { @@ -52,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String inline = input.getAnimName(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -76,9 +76,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String encodedValue = getEncodedValue(); // get bitmask value final String archetypeAttributeName = getRef().getArchetypeAttributeName(); String oldValue = archetype.getAttributeString(archetypeAttributeName); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.AbstractButton; import javax.swing.text.Document; import javax.swing.text.Style; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; // a boolean attribute (flag) @@ -54,9 +52,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.isSelected() != (archetype.getAttributeInt(archetypeAttributeName) == 1)) { return archetypeAttributeName + " " + (input.isSelected() ? 1 : 0); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.AbstractButton; import javax.swing.text.Document; import javax.swing.text.Style; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; // a boolean attribute with customized true/false values @@ -54,9 +52,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String valString; if (input.isSelected()) { valString = getRef().getTrueValue(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.gui.utils.FaceComponent; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeFaceName<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeFaceName> { @@ -52,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String inline = input.getFaceName(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,9 +19,7 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.model.archetype.Archetype; @@ -30,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeFloat<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeFloat> { @@ -53,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.getText().trim().isEmpty()) { if (archetype.hasAttribute(archetypeAttributeName)) { @@ -70,9 +67,7 @@ return archetypeAttributeName + " " + value; } } catch (final NumberFormatException ignored) { - // parsing failed: wrong entry!! - JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; + throw new InvalidAttributeException("must be a number"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,9 +19,7 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.model.archetype.Archetype; @@ -30,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeInt<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeInt> { @@ -60,9 +57,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException { final String archetypeAttributeName = ref.getArchetypeAttributeName(); final int value; if (input.getText().trim().isEmpty()) { @@ -71,14 +68,12 @@ try { value = ((Number) input.getValue()).intValue(); } catch (final NumberFormatException ignored) { - JOptionPane.showMessageDialog(parent, "Attribute '" + ref.getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; + throw new InvalidAttributeException(getRef(), "must be a number"); } } if (value < ref.getMinValue() || value > ref.getMaxValue()) { - JOptionPane.showMessageDialog(parent, "Attribute '" + ref.getAttributeName() + "' must be " + ref.getMinValue() + ".." + ref.getMaxValue() + "!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; + throw new InvalidAttributeException(getRef(), "must be " + ref.getMinValue() + ".." + ref.getMaxValue()); } if (archetype.getAttributeInt(archetypeAttributeName) != value) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JComboBox; import javax.swing.text.Document; import javax.swing.text.Style; @@ -31,7 +30,6 @@ import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.Spells; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeInvSpell<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeInvSpell> { @@ -69,9 +67,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final int index = input.getSelectedIndex(); if (index < gameObjectSpells.size() + (isOptionalSpell ? 1 : 0)) { final boolean isModified; Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JComboBox; import javax.swing.text.Document; import javax.swing.text.Style; @@ -30,7 +29,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeList<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeList> { @@ -61,9 +59,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final int attributeValueTmp = input.getSelectedIndex(); final int attributeValue = archetypeTypeSet.getList(getRef().getListName()).get(attributeValueTmp).getFirst(); // attribute value Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,9 +19,7 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.model.archetype.Archetype; @@ -30,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeLong<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeLong> { @@ -53,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.getText().trim().isEmpty()) { if (archetype.getAttributeLong(archetypeAttributeName) != 0L) { @@ -68,8 +65,7 @@ return archetypeAttributeName + " " + value; } } catch (final NumberFormatException ignored) { - JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; + throw new InvalidAttributeException(getRef(), "must be a number"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.gui.map.maptilepane.TilePanel; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeMapPath<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeMapPath> { @@ -52,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String newString = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!archetype.getAttributeString(archetypeAttributeName).equals(newString)) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.gui.map.maptilepane.TilePanel; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeScriptFile<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeScriptFile> { @@ -52,9 +50,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String newString = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!archetype.getAttributeString(archetypeAttributeName).equals(newString)) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JComboBox; import javax.swing.text.Document; import javax.swing.text.Style; @@ -31,7 +30,6 @@ import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeSpell<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeSpell> { @@ -62,9 +60,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final int index = input.getSelectedIndex(); final int attributeValue = index == 0 ? 0 : numberSpells.getSpell(index - 1).getNumber(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.JTextComponent; import javax.swing.text.Style; @@ -29,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; // a String attribute @@ -54,9 +52,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final String inline = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.text.Document; import javax.swing.text.Style; import net.sf.gridarta.model.archetype.Archetype; @@ -30,7 +29,6 @@ import net.sf.gridarta.textedit.textarea.JEditTextArea; import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeText<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeText> { @@ -53,9 +51,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { if (getRef().getArchetypeAttributeName().equalsIgnoreCase("msg")) { final String msgText = StringUtils.removeTrailingWhitespaceFromLines(input.getText()); if (!msgText.isEmpty()) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,8 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; -import javax.swing.JOptionPane; import javax.swing.text.Document; import javax.swing.text.JTextComponent; import javax.swing.text.Style; @@ -32,7 +30,6 @@ import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.treasurelist.TreasureTree; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; // a treasurelist attribute @@ -65,17 +62,16 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) throws InvalidAttributeException { final String inline = input.getText().trim(); // input string final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.isEmpty(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!isNone && treasureTree.get(inline) == null && !inline.equalsIgnoreCase(archetype.getAttributeString(archetypeAttributeName))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. - JOptionPane.showMessageDialog(parent, "In attribute '" + getRef().getAttributeName() + "':\n" + "'" + inline + "' is not a known treasurelist name!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; + throw new InvalidAttributeException("In attribute '" + getRef().getAttributeName() + "':\n" + "'" + inline + "' is not a known treasurelist name!"); } if (!inline.equalsIgnoreCase(archetype.getAttributeString(archetypeAttributeName)) && !(isNone && !archetype.hasAttribute(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.dialog.gameobjectattributes; -import java.awt.Component; import javax.swing.JComboBox; import javax.swing.text.Document; import javax.swing.text.Style; @@ -31,7 +30,6 @@ import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DialogAttributeZSpell<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttribute<G, A, R, ArchetypeAttributeZSpell> { @@ -68,9 +66,9 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType) { final int index = input.getSelectedIndex(); final int attributeValue = index == 0 ? undefinedSpellIndex : numberSpells.getSpell(index - 1).getNumber(); // attribute value final String archetypeAttributeName = getRef().getArchetypeAttributeName(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-07-19 07:19:52 UTC (rev 9365) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -715,8 +715,11 @@ final StringBuilder newArchText = new StringBuilder(); final String[] newMsg = new String[1]; for (final DialogAttribute<G, A, R, ?> dialogAttribute : attributesPaneBuilder.getDialogAttributes()) { - final String text = dialogAttribute.getObjectText(gameObject, archetype, newMsg, tmpArchetypeType, optionPane); - if (text == null) { + final String text; + try { + text = dialogAttribute.getObjectText(gameObject, archetype, newMsg, tmpArchetypeType); + } catch (final InvalidAttributeException ex) { + JOptionPane.showMessageDialog(optionPane, ex.getMessage(), "Input Error", JOptionPane.ERROR_MESSAGE); return false; } if (!text.isEmpty()) { Added: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/InvalidAttributeException.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/InvalidAttributeException.java (rev 0) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/InvalidAttributeException.java 2013-07-19 07:50:29 UTC (rev 9366) @@ -0,0 +1,53 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.dialog.gameobjectattributes; + +import net.sf.gridarta.model.archetypetype.ArchetypeAttribute; +import org.jetbrains.annotations.NotNull; + +/** + * Indicates that an attribute cannot be encoded. + * @author Andreas Kirschbaum + */ +public class InvalidAttributeException extends Exception { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance. + * @param message the reason why the attribute cannot be encoded + */ + public InvalidAttributeException(@NotNull final String message) { + super(message); + } + + /** + * Creates a new instance. + * @param attribute the attribute + * @param message the reason why the attribute cannot be encoded + */ + public InvalidAttributeException(@NotNull final ArchetypeAttribute attribute, @NotNull final String message) { + super("Attribute '" + attribute.getAttributeName() + "' " + message + "!"); + } + +} Property changes on: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/InvalidAttributeException.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 07:20:00
|
Revision: 9365 http://sourceforge.net/p/gridarta/code/9365 Author: akirschbaum Date: 2013-07-19 07:19:52 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Rename function name. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -85,7 +85,7 @@ * encoded */ @Nullable - public abstract String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent); + public abstract String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent); /** * Appends a summary line for this attribute to a {@link Document}. Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -54,7 +54,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String inline = input.getAnimName(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -78,7 +78,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String encodedValue = getEncodedValue(); // get bitmask value final String archetypeAttributeName = getRef().getArchetypeAttributeName(); String oldValue = archetype.getAttributeString(archetypeAttributeName); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -56,7 +56,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.isSelected() != (archetype.getAttributeInt(archetypeAttributeName) == 1)) { return archetypeAttributeName + " " + (input.isSelected() ? 1 : 0); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -56,7 +56,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String valString; if (input.isSelected()) { valString = getRef().getTrueValue(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -54,7 +54,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String inline = input.getFaceName(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -55,7 +55,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.getText().trim().isEmpty()) { if (archetype.hasAttribute(archetypeAttributeName)) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -62,7 +62,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String archetypeAttributeName = ref.getArchetypeAttributeName(); final int value; if (input.getText().trim().isEmpty()) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -71,7 +71,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final int index = input.getSelectedIndex(); if (index < gameObjectSpells.size() + (isOptionalSpell ? 1 : 0)) { final boolean isModified; Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -63,7 +63,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final int attributeValueTmp = input.getSelectedIndex(); final int attributeValue = archetypeTypeSet.getList(getRef().getListName()).get(attributeValueTmp).getFirst(); // attribute value Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -55,7 +55,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (input.getText().trim().isEmpty()) { if (archetype.getAttributeLong(archetypeAttributeName) != 0L) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -54,7 +54,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String newString = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!archetype.getAttributeString(archetypeAttributeName).equals(newString)) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -54,7 +54,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String newString = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!archetype.getAttributeString(archetypeAttributeName).equals(newString)) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -64,7 +64,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final int index = input.getSelectedIndex(); final int attributeValue = index == 0 ? 0 : numberSpells.getSpell(index - 1).getNumber(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -56,7 +56,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String inline = input.getText().trim(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -55,7 +55,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { if (getRef().getArchetypeAttributeName().equalsIgnoreCase("msg")) { final String msgText = StringUtils.removeTrailingWhitespaceFromLines(input.getText()); if (!msgText.isEmpty()) { Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -67,7 +67,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final String inline = input.getText().trim(); // input string final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.isEmpty(); final String archetypeAttributeName = getRef().getArchetypeAttributeName(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -70,7 +70,7 @@ */ @Nullable @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { + public String getObjectText(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent) { final int index = input.getSelectedIndex(); final int attributeValue = index == 0 ? undefinedSpellIndex : numberSpells.getSpell(index - 1).getNumber(); // attribute value final String archetypeAttributeName = getRef().getArchetypeAttributeName(); Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-07-19 07:19:06 UTC (rev 9364) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-07-19 07:19:52 UTC (rev 9365) @@ -715,7 +715,7 @@ final StringBuilder newArchText = new StringBuilder(); final String[] newMsg = new String[1]; for (final DialogAttribute<G, A, R, ?> dialogAttribute : attributesPaneBuilder.getDialogAttributes()) { - final String text = dialogAttribute.getText2(gameObject, archetype, newMsg, tmpArchetypeType, optionPane); + final String text = dialogAttribute.getObjectText(gameObject, archetype, newMsg, tmpArchetypeType, optionPane); if (text == null) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 07:19:09
|
Revision: 9364 http://sourceforge.net/p/gridarta/code/9364 Author: akirschbaum Date: 2013-07-19 07:19:06 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:12:07 UTC (rev 9363) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:19:06 UTC (rev 9364) @@ -38,6 +38,7 @@ * A single Attribute, combining an {@link ArchetypeAttribute} with its input * component(s). * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum */ public abstract class DialogAttribute<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, T extends ArchetypeAttribute> { @@ -54,7 +55,7 @@ private final T ref; /** - * Create a DialogAttribute. + * Creates a new instance. * @param ref reference to the attribute data */ protected DialogAttribute(@NotNull final T ref) { @@ -70,6 +71,19 @@ return ref; } + /** + * Returns the attribute text for this attribute. The returned string is + * inserted into the owner's game object text. + * @param gameObject the owner + * @param archetype the owner's new archetype; it might differ from {@code + * gameObject}'s current archetype + * @param newMsg the new "msg" value for the owner + * @param archetypeType the owner's archetype type + * @param parent the parent component of the dialog this attribute is part + * of + * @return the game object text or {@code null} if the attribute cannot be + * encoded + */ @Nullable public abstract String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 07:12:17
|
Revision: 9363 http://sourceforge.net/p/gridarta/code/9363 Author: akirschbaum Date: 2013-07-19 07:12:07 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Add nullable annotations. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/commands/CollectArchesCommand.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/help/HtmlPane.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/model/src/main/java/net/sf/gridarta/model/anim/DefaultAnimationObject.java trunk/src/model/src/main/java/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/src/model/src/main/java/net/sf/gridarta/model/face/AbstractFaceProvider.java trunk/src/model/src/main/java/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/model/src/test/java/net/sf/gridarta/model/errorview/TestErrorView.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/commands/CollectArchesCommand.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/commands/CollectArchesCommand.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/commands/CollectArchesCommand.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -38,6 +38,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(CollectArchesCommand.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -54,6 +54,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DelayedMapModelListenerManager.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -44,6 +44,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DialogAttribute.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -43,6 +43,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DialogAttributeBitmask.class); /** @@ -59,6 +60,7 @@ /** * Reference to the bitmask data. */ + @Nullable private AttributeBitmask bitmask; /** @@ -121,6 +123,7 @@ * Get the active bitmask value in external file representation. * @return active bitmask value in external file representation */ + @NotNull private String getEncodedValue() { return bitmask.encodeValue(value); } @@ -143,16 +146,17 @@ * @param encodedValue new active bitmask value in external file * representation */ - public void setEncodedValue(final String encodedValue) { + public void setEncodedValue(@NotNull final String encodedValue) { assert bitmask != null; setValue(bitmask.decodeValue(encodedValue)); } + @Nullable public AttributeBitmask getBitmask() { return bitmask; } - public void setBitmask(final AttributeBitmask bitmask) { + public void setBitmask(@Nullable final AttributeBitmask bitmask) { this.bitmask = bitmask; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/help/HtmlPane.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/help/HtmlPane.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/help/HtmlPane.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -35,6 +35,7 @@ import javax.swing.event.HyperlinkListener; import javax.swing.text.Document; import net.sf.gridarta.utils.CommonConstants; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -46,6 +47,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Logger log = Logger.getLogger("HtmlPane.class"); /** @@ -56,6 +58,7 @@ /** * The JEditorPane that displays the html page. */ + @NotNull private final JEditorPane html; /** @@ -63,7 +66,7 @@ * contents in this HtmlPane. * @param fileName the name of the HTML-file */ - HtmlPane(final String fileName) { + HtmlPane(@NotNull final String fileName) { try { // first looking for the html file in extracted form final File file = new File(CommonConstants.HELP_DIR, fileName); @@ -124,7 +127,7 @@ * @param type mime-type of the given text (e.g. "text/html") * @param text text to display (can be html-text for example) */ - HtmlPane(final String type, final String text) { + HtmlPane(@NotNull final String type, @NotNull final String text) { // open new JEditorPane html = new JEditorPane(type, text); html.setEditable(false); @@ -151,7 +154,7 @@ * @param e occurred <code>HyperlinkEvent</code> */ @Override - public void hyperlinkUpdate(final HyperlinkEvent e) { + public void hyperlinkUpdate(@NotNull final HyperlinkEvent e) { if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { linkActivated(e.getURL()); } @@ -166,7 +169,7 @@ * argument. * @param u the URL to follow */ - private void linkActivated(final URL u) { + private void linkActivated(@NotNull final URL u) { final Cursor cursor = html.getCursor(); final Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); html.setCursor(waitCursor); @@ -187,6 +190,7 @@ /** * Original cursor that should be restored once the document is loaded. */ + @NotNull private final Cursor cursor; /** @@ -194,7 +198,7 @@ * @param url the URL to load * @param cursor the cursor to restore once the document is loaded */ - private PageLoader(final URL url, final Cursor cursor) { + private PageLoader(@NotNull final URL url, @NotNull final Cursor cursor) { this.url = url; this.cursor = cursor; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -40,16 +40,20 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ParameterTypeEditor.class); + @NotNull private final PluginParameter<G, A, R> parameter; + @NotNull private final Plugin<G, A, R> plugin; + @NotNull private final ItemListener itemListener = new ItemListener() { @Override - public void itemStateChanged(final ItemEvent e) { + public void itemStateChanged(@NotNull final ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if (!parameter.getParameterType().equals(e.getItem())) { try { @@ -63,7 +67,7 @@ }; - public ParameterTypeEditor(@NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, final Plugin<G, A, R> plugin, final PluginParameter<G, A, R> parameter) { + public ParameterTypeEditor(@NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory, @NotNull final Plugin<G, A, R> plugin, @NotNull final PluginParameter<G, A, R> parameter) { super(pluginParameterFactory.getTypes()); this.parameter = parameter; this.plugin = plugin; Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapView.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -67,6 +67,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DefaultMapView.class); /** @@ -120,6 +121,7 @@ * The {@link MapModelListener} used to detect changes in the map model that * should be reflected in the window title. */ + @NotNull private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { @Override @@ -158,6 +160,7 @@ * The {@link MapArchObjectListener} used to detect changes in the map model * that should be reflected in the window title. */ + @NotNull private final MapArchObjectListener mapArchObjectListener = new MapArchObjectListener() { @Override @@ -176,6 +179,7 @@ * The {@link MapControlListener} used to detect changes in the map control * that should be reflected in the window title. */ + @NotNull private final MapControlListener<G, A, R> mapControlListener = new MapControlListener<G, A, R>() { @Override Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/ImageCreator.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/ImageCreator.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/renderer/ImageCreator.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -48,6 +48,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ImageCreator.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -44,6 +44,7 @@ /** * The logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(MapImageCache.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -45,6 +45,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(MapMenu.class); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -81,11 +81,13 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(PickmapChooserControl.class); /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -204,6 +206,7 @@ /** * The map control listener which is registered to the selected pickmap. */ + @NotNull private final MapControlListener<G, A, R> mapControlListener = new MapControlListener<G, A, R>() { @Override @@ -221,6 +224,7 @@ * The {@link MapModelListener} which is registered to the selected * pickmap. */ + @NotNull private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { @Override @@ -258,6 +262,7 @@ /** * The pickmap chooser listener used to track the currently active pickmap. */ + @NotNull private final PickmapChooserModelListener<G, A, R> pickmapChooserModelListener = new PickmapChooserModelListener<G, A, R>() { @Override @@ -298,6 +303,7 @@ /** * The {@link MapManagerListener} to track existing pickmaps. */ + @NotNull private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { @Override Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -51,11 +51,13 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(PickmapChooserView.class); /** * The attached {@link PickmapChooserModel}. */ + @NotNull private final PickmapChooserModel<G, A, R> pickmapChooserModel; /** @@ -67,16 +69,19 @@ /** * Panel with pickmaps. */ + @NotNull private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); /** * The last known active folder. */ + @Nullable private MapFolder<G, A, R> activeMapFolder; /** * The listener attached to {@link #mapFolderTree}. */ + @NotNull private final MapFolderTreeListener<G, A, R> mapFolderTreeListener = new MapFolderTreeListener<G, A, R>() { @Override @@ -115,6 +120,7 @@ /** * The listener attached to {@link #activeMapFolder}. */ + @NotNull private final MapFolderListener<G, A, R> mapFolderListener = new MapFolderListener<G, A, R>() { @Override @@ -138,6 +144,7 @@ * The {@link PickmapChooserModelListener} attached to {@link * #pickmapChooserModel} to detect modified pickmaps. */ + @NotNull private final PickmapChooserModelListener<G, A, R> pickmapChooserModelListener = new PickmapChooserModelListener<G, A, R>() { @Override @@ -258,6 +265,7 @@ * @param mapFile the pickmap * @return the title */ + @NotNull public String getTitle(@NotNull final MapFile<G, A, R> mapFile) { final String name = mapFile.getFile().getName(); final MapControl<G, A, R> mapControl = mapFile.getPickmap(); @@ -269,6 +277,7 @@ * Returns the {@link JTabbedPane} with all pickmaps. * @return the <code>JTabbedPane</code> with all pickmaps */ + @NotNull public Component getPickmapPanel() { return pickmapPanel; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/spells/SpellsUtils.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/spells/SpellsUtils.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/spells/SpellsUtils.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -57,16 +57,19 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(SpellsUtils.class); /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * File filter for filtering spellist.h files. */ + @NotNull private static final FileFilter SPELL_LIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", "spellist.h"); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/DefaultMainControl.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -130,6 +130,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DefaultMainControl.class); @NotNull 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-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -251,11 +251,13 @@ /** * The logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(GUIMainControl.class); /** * The {@link Preferences}. */ + @NotNull private static final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/anim/DefaultAnimationObject.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/anim/DefaultAnimationObject.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/anim/DefaultAnimationObject.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -41,6 +41,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DefaultAnimationObject.class); /** @@ -81,6 +82,7 @@ /** * A {@link Pattern} that matches the end of lines. */ + @NotNull private static final Pattern PATTERN_END_OF_LINE = Pattern.compile("\n"); /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/artifact/ArtifactParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/artifact/ArtifactParser.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/artifact/ArtifactParser.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -50,6 +50,7 @@ /** * The logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ArtifactParser.class); /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/face/AbstractFaceProvider.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/face/AbstractFaceProvider.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/face/AbstractFaceProvider.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -38,12 +38,14 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(AbstractFaceProvider.class); /** * The HashMap to provide the icons from. Note: Weak hashing does not differ * because the keys are definitely referenced elsewhere. */ + @NotNull private final Map<String, SoftReference<ImageIcon>> cache = new HashMap<String, SoftReference<ImageIcon>>(); /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/face/DefaultFaceObjects.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/face/DefaultFaceObjects.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/face/DefaultFaceObjects.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -62,11 +62,13 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(DefaultFaceObjects.class); /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/errorview/TestErrorView.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/errorview/TestErrorView.java 2013-07-19 06:58:07 UTC (rev 9362) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/errorview/TestErrorView.java 2013-07-19 07:12:07 UTC (rev 9363) @@ -32,6 +32,7 @@ /** * The {@link Logger} for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(TestErrorView.class); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 06:58:14
|
Revision: 9362 http://sourceforge.net/p/gridarta/code/9362 Author: akirschbaum Date: 2013-07-19 06:58:07 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Fix possible NullPointerExceptions in game object attributes dialog. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -72,6 +72,11 @@ @Nullable public abstract String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType archetypeType, final Component parent); + /** + * Appends a summary line for this attribute to a {@link Document}. + * @param doc the document to append to + * @param style the style for the new text + */ public abstract void appendSummary(@NotNull final Document doc, @NotNull final Style style); /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -70,9 +70,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getAnimName(); - if (!value.isEmpty()) { - addLine(doc, style, "", " = " + value); + if (value.isEmpty()) { + return; } + + addLine(doc, style, "", " = " + value); } } // DialogAttributeAnimationName Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -96,10 +96,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String tmp = input.getText().trim(); - if (!tmp.isEmpty() && !tmp.startsWith("<")) { - addLine(doc, style, "", " = " + tmp); + final String text = input.getText(); + if (text == null) { + return; } + + final String tmp = text.trim(); + if (tmp.isEmpty() || tmp.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + tmp); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -70,10 +70,11 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final boolean value = input.isSelected(); - if (value) { - addLine(doc, style, "<" , ">"); + if (!input.isSelected()) { + return; } + + addLine(doc, style, "<" , ">"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -76,10 +76,11 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final boolean value = input.isSelected(); - if (value) { - addLine(doc, style, "<", ">"); + if (!input.isSelected()) { + return; } + + addLine(doc, style, "<", ">"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -70,9 +70,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getFaceName(); - if (!value.isEmpty()) { - addLine(doc, style, "", " = " + value); + if (value.isEmpty()) { + return; } + + addLine(doc, style, "", " = " + value); } } // DialogAttributeFaceName Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -85,9 +85,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, "", " = " + value); + if (value == null || value.isEmpty() || value.equals("0")) { + return; } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -94,9 +94,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, "", " = " + value); + if (value == null || value.isEmpty() || value.equals("0")) { + return; } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -130,10 +130,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); - if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, "", " = " + value); + final Object selectedItem = input.getSelectedItem(); + if (selectedItem == null) { + return; } + + final String value = selectedItem.toString().trim(); + if (value.isEmpty() || value.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -80,10 +80,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); - if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, "", " = " + value); + final Object selectedItem = input.getSelectedItem(); + if (selectedItem == null) { + return; } + + final String value = selectedItem.toString().trim(); + if (value.isEmpty() || value.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -82,9 +82,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, "", " = " + value); + if (value == null || value.isEmpty() || value.equals("0")) { + return; } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -70,9 +70,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty()) { - addLine(doc, style, "", " = " + value); + if (value.isEmpty()) { + return; } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -70,9 +70,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty()) { - addLine(doc, style, "", " = " + value); + if (value.isEmpty()) { + return; } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -80,10 +80,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); - if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, "", " = " + value); + final Object selectedItem = input.getSelectedItem(); + if (selectedItem == null) { + return; } + + final String value = selectedItem.toString().trim(); + if (value.isEmpty() || value.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -72,9 +72,11 @@ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); - if (value != null && !value.isEmpty()) { - addLine(doc, style, "", " = " + value); + if (value == null || value.isEmpty()) { + return; } + + addLine(doc, style, "", " = " + value); } } // DialogAttributeString Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -71,7 +71,7 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - /* Nothing to do. */ + // Nothing to do. } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -94,10 +94,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getText().trim(); - if (!value.isEmpty() && !value.equals(CFTreasureListTree.NONE_SYM)) { - addLine(doc, style, "", " = " + value); + final String text = input.getText(); + if (text == null) { + return; } + + final String value = text.trim(); + if (value.isEmpty() || value.equals(CFTreasureListTree.NONE_SYM)) { + return; + } + + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 06:48:57 UTC (rev 9361) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 06:58:07 UTC (rev 9362) @@ -86,10 +86,17 @@ */ @Override public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); - if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, "", " = " + value); + final Object selectedItem = input.getSelectedItem(); + if (selectedItem == null) { + return; } + + final String value = selectedItem.toString().trim(); + if (value.isEmpty() || value.startsWith("<")) { + return; + } + + addLine(doc, style, "", " = " + value); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-07-19 06:49:00
|
Revision: 9361 http://sourceforge.net/p/gridarta/code/9361 Author: akirschbaum Date: 2013-07-19 06:48:57 +0000 (Fri, 19 Jul 2013) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -74,9 +74,17 @@ public abstract void appendSummary(@NotNull final Document doc, @NotNull final Style style); - protected static void addLine(@NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String line) { + /** + * Appends a line to a {@link Document}. The line consists of the name of + * this attribute, possibly with some text prepended and/or appended. + * @param doc the document to add to + * @param style the style for the new text + * @param prefix the text to prepend; may be empty + * @param postfix the text to append; may be empty + */ + protected void addLine(@NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String prefix, @NotNull final String postfix) { try { - doc.insertString(doc.getLength(), line + "\n", style); + doc.insertString(doc.getLength(), prefix + ref.getAttributeName() + postfix + "\n", style); } catch (final BadLocationException e) { log.error("toggleSummary: Bad Location in Document!", e); } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -71,7 +71,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getAnimName(); if (!value.isEmpty()) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -98,7 +98,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String tmp = input.getText().trim(); if (!tmp.isEmpty() && !tmp.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + tmp); + addLine(doc, style, "", " = " + tmp); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -72,7 +72,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final boolean value = input.isSelected(); if (value) { - addLine(doc, style, "<" + getRef().getAttributeName() + ">"); + addLine(doc, style, "<" , ">"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -78,7 +78,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final boolean value = input.isSelected(); if (value) { - addLine(doc, style, "<" + getRef().getAttributeName() + ">"); + addLine(doc, style, "<", ">"); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -71,7 +71,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getFaceName(); if (!value.isEmpty()) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -86,7 +86,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -95,7 +95,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, ref.getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -132,7 +132,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getSelectedItem().toString().trim(); if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -82,7 +82,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getSelectedItem().toString().trim(); if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -83,7 +83,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty() && !value.equals("0")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -71,7 +71,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty()) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -71,7 +71,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty()) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -82,7 +82,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getSelectedItem().toString().trim(); if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -73,7 +73,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText(); if (value != null && !value.isEmpty()) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -96,7 +96,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getText().trim(); if (!value.isEmpty() && !value.equals(CFTreasureListTree.NONE_SYM)) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 06:37:44 UTC (rev 9360) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java 2013-07-19 06:48:57 UTC (rev 9361) @@ -88,7 +88,7 @@ public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { final String value = input.getSelectedItem().toString().trim(); if (!value.isEmpty() && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); + addLine(doc, style, "", " = " + value); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |