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-16 20:19:03
|
Revision: 9460 http://sourceforge.net/p/gridarta/code/9460 Author: akirschbaum Date: 2013-10-16 20:18:59 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused return value. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 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-16 20:07:10 UTC (rev 9459) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mapmenu/MapMenu.java 2013-10-16 20:18:59 UTC (rev 9460) @@ -195,12 +195,10 @@ * Adds a {@link MapMenuEntry} to this menu. * @param directory the directory to add to * @param mapMenuEntry the map menu entry - * @return the tree path for the inserted node * @noinspection TypeMayBeWeakened */ - @NotNull - public TreePath addMapMenuEntry(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { - return addMapMenuEntry(directory, new DefaultMutableTreeNode(mapMenuEntry, mapMenuEntry.allowsChildren())); + public void addMapMenuEntry(@NotNull final String directory, @NotNull final MapMenuEntry mapMenuEntry) { + addMapMenuEntry(directory, new DefaultMutableTreeNode(mapMenuEntry, mapMenuEntry.allowsChildren())); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 20:07:13
|
Revision: 9459 http://sourceforge.net/p/gridarta/code/9459 Author: akirschbaum Date: 2013-10-16 20:07:10 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2013-10-16 20:07:10 UTC (rev 9459) @@ -30,10 +30,6 @@ private int lastKeyword; - public HTMLTokenMarker() { - this(true); - } - public HTMLTokenMarker(final boolean js) { this.js = js; keywords = JavaScriptTokenMarker.getJavaScriptKeywords(); Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java 2013-10-16 20:07:10 UTC (rev 9459) @@ -180,13 +180,6 @@ } /** - * Returns the number of lines in this token marker. - */ - public int getLineCount() { - return length; - } - - /** * Returns true if the next line should be repainted. This will return true * after a line has been tokenized that starts a multi-line token that * continues onto the next line. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 20:04:59
|
Revision: 9458 http://sourceforge.net/p/gridarta/code/9458 Author: akirschbaum Date: 2013-10-16 20:04:57 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused parameters. Modified Paths: -------------- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CrossfireDialogTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/DaimoninAITokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/EmptyTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -60,7 +60,7 @@ * {@inheritDoc} */ @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { final char[] array = line.array; final int offset = line.offset; lastOffset = offset; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CrossfireDialogTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CrossfireDialogTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/CrossfireDialogTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -32,7 +32,7 @@ * {@inheritDoc} */ @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { final char[] array = line.array; final int offset = line.offset; final int length = line.count; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/DaimoninAITokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/DaimoninAITokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/DaimoninAITokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -78,7 +78,7 @@ * {@inheritDoc} */ @Override - public byte markTokensImpl(final byte token, @NotNull final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, @NotNull final Segment line) { final char[] array = line.array; int offset = line.offset; final int end = line.count + offset; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/EmptyTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/EmptyTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/EmptyTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -32,7 +32,7 @@ * {@inheritDoc} */ @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { addToken(line.count, Token.NULL); return token; } Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -40,7 +40,7 @@ } @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { final char[] array = line.array; final int offset = line.offset; lastOffset = offset; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -45,7 +45,7 @@ } @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { final char[] array = line.array; final int offset = line.offset; lastOffset = offset; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -38,7 +38,7 @@ } @Override - public byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + public byte markTokensImpl(final byte token, final Segment line) { final char[] array = line.array; final int offset = line.offset; lastOffset = offset; Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java 2013-10-16 20:00:49 UTC (rev 9457) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java 2013-10-16 20:04:57 UTC (rev 9458) @@ -80,7 +80,7 @@ } final byte oldToken = info.getToken(); - final byte token = markTokensImpl(prev == null ? Token.NULL : prev.getToken(), line, lineIndex); + final byte token = markTokensImpl(prev == null ? Token.NULL : prev.getToken(), line); info.setToken(token); @@ -140,10 +140,9 @@ * comment token type so that it continues on the next line. * @param token the initial token type for this line * @param line the line to be tokenized - * @param lineIndex the index of the line in the document, starting at 0 * @return the initial token type for the next line */ - protected abstract byte markTokensImpl(byte token, Segment line, int lineIndex); + protected abstract byte markTokensImpl(byte token, Segment line); /** * Informs the token marker that lines have been inserted into the document. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 20:00:54
|
Revision: 9457 http://sourceforge.net/p/gridarta/code/9457 Author: akirschbaum Date: 2013-10-16 20:00:49 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused parameters. 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/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.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-16 19:52:44 UTC (rev 9456) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-16 20:00:49 UTC (rev 9457) @@ -262,7 +262,7 @@ */ @NotNull @Override - 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) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final ErrorViewCollector errorViewCollector, @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) { 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-16 19:52:44 UTC (rev 9456) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-16 20:00:49 UTC (rev 9457) @@ -225,7 +225,7 @@ */ @NotNull @Override - 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) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final ErrorViewCollector errorViewCollector, @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) { 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-16 19:52:44 UTC (rev 9456) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-16 20:00:49 UTC (rev 9457) @@ -261,7 +261,7 @@ */ @NotNull @Override - 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) { + public AttributeRangeChecker<GameObject, MapArchObject, Archetype> loadAttributeRangeChecker(@NotNull final ErrorViewCollector errorViewCollector, @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) { Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java 2013-10-16 19:52:44 UTC (rev 9456) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java 2013-10-16 20:00:49 UTC (rev 9457) @@ -44,7 +44,6 @@ import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.gridarta.model.smoothface.SmoothFaces; -import net.sf.gridarta.model.validation.DelegatingMapValidator; import net.sf.gridarta.model.validation.ValidatorPreferences; import net.sf.gridarta.model.validation.checks.AttributeRangeChecker; import org.jetbrains.annotations.NotNull; @@ -155,15 +154,13 @@ /** * 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 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); + AttributeRangeChecker<G, A, R> loadAttributeRangeChecker(@NotNull ErrorViewCollector errorViewCollector, @NotNull GameObjectMatchers gameObjectMatchers, @NotNull final ValidatorPreferences validatorPreferences); /** * Creates a new {@link MapControlFactory} instance. Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-16 19:52:44 UTC (rev 9456) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-16 20:00:49 UTC (rev 9457) @@ -331,7 +331,7 @@ final EnvironmentChecker<G, A, R> environmentChecker = new EnvironmentChecker<G, A, R>(validatorPreferences); final ValidatorFactory<G, A, R> validatorFactory = new ValidatorFactory<G, A, R>(validatorPreferences, gameObjectMatchers, projectSettings, mapWriter); loadValidators(validators, validatorFactory, errorView); - final AttributeRangeChecker<G, A, R> attributeRangeChecker = projectFactory.loadAttributeRangeChecker(validators, new ErrorViewCollector(errorView, new File("GameObjectMatchers.xml")), projectSettings, gameObjectMatchers, validatorPreferences); + final AttributeRangeChecker<G, A, R> attributeRangeChecker = projectFactory.loadAttributeRangeChecker(new ErrorViewCollector(errorView, new File("GameObjectMatchers.xml")), gameObjectMatchers, validatorPreferences); validators.addValidator(attributeRangeChecker); validators.addValidator(environmentChecker); ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 19:52:50
|
Revision: 9456 http://sourceforge.net/p/gridarta/code/9456 Author: akirschbaum Date: 2013-10-16 19:52:44 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/InputHandler.java Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2013-10-16 19:41:42 UTC (rev 9455) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2013-10-16 19:52:44 UTC (rev 9456) @@ -116,24 +116,6 @@ } /** - * Removes a key binding from this input handler. This is not yet - * implemented. - * @param keyBinding the key binding - */ - @Override - public void removeKeyBinding(final String keyBinding) { - throw new InternalError("Not yet implemented"); - } - - /** - * Removes all key bindings from this input handler. - */ - @Override - public void removeAllKeyBindings() { - bindings.clear(); - } - - /** * Returns a copy of this input handler that shares the same key bindings. * Setting key bindings in the copy will also set them in the original. */ Modified: trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/InputHandler.java 2013-10-16 19:41:42 UTC (rev 9455) +++ trunk/src/textedit/src/main/java/net/sf/gridarta/textedit/textarea/InputHandler.java 2013-10-16 19:52:44 UTC (rev 9456) @@ -54,26 +54,6 @@ public abstract void addDefaultKeyBindings(); /** - * Removes a key binding from this input handler. - * @param keyBinding the key binding - */ - public abstract void removeKeyBinding(String keyBinding); - - /** - * Removes all key bindings from this input handler. - */ - public abstract void removeAllKeyBindings(); - - /** - * Grabs the next key typed event and invokes the specified action with the - * key as a the action command. - * @param listener the action - */ - public void grabNextKeyStroke(final ActionListener listener) { - grabAction = listener; - } - - /** * Returns if repetition is enabled. When repetition is enabled, actions * will be executed multiple times. This is usually invoked with a special * key stroke in the input handler. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 19:41:49
|
Revision: 9455 http://sourceforge.net/p/gridarta/code/9455 Author: akirschbaum Date: 2013-10-16 19:41:42 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unused parameters. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserControl.java 2013-10-16 19:38:28 UTC (rev 9454) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserControl.java 2013-10-16 19:41:42 UTC (rev 9455) @@ -31,7 +31,6 @@ import net.sf.gridarta.model.archetypechooser.ArchetypeChooserFolder; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserPanel; -import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.utils.ActionBuilderUtils; @@ -74,11 +73,8 @@ * @param archetypeChooserModel the archetype chooser model to use; no new * archetypes must be added afterwards * @param archetypeChooserView the archetype chooser view to use - * @param createDirectionPane whether to create a "direction" panel - * @param faceObjectProviders the face object providers for looking up - * faces */ - public ArchetypeChooserControl(@NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ArchetypeChooserView<G, A, R> archetypeChooserView, final boolean createDirectionPane, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeChooserControl(@NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ArchetypeChooserView<G, A, R> archetypeChooserView) { this.archetypeChooserModel = archetypeChooserModel; this.archetypeChooserView = archetypeChooserView; 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-16 19:38:28 UTC (rev 9454) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-16 19:41:42 UTC (rev 9455) @@ -377,7 +377,7 @@ final Action displayIconsOnlyAction = createAction("displayIconsOnly", "Archetype Chooser", new DisplayIconsOnlyAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeIconsOnly)); final Action displayArchetypeNamesAction = createAction("displayArchetypeNames", "Archetype Chooser", new DisplayArchetypeNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeGameObjectNames)); final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); - final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); + final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView); mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 19:38:32
|
Revision: 9454 http://sourceforge.net/p/gridarta/code/9454 Author: akirschbaum Date: 2013-10-16 19:38:28 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Remove unneeded code. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/DefaultMapViewSettings.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapviewsettings/TestMapViewSettings.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2013-10-16 01:17:07 UTC (rev 9453) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java 2013-10-16 19:38:28 UTC (rev 9454) @@ -241,7 +241,6 @@ } this.editType |= editType; - saveEditType(this.editType); fireEditTypeChanged(); } @@ -255,7 +254,6 @@ } this.editType &= ~editType; - saveEditType(this.editType); fireEditTypeChanged(); } @@ -449,12 +447,6 @@ protected abstract int loadEditType(); /** - * Saves the {@link #editType} value. - * @param editType the edit type value - */ - protected abstract void saveEditType(final int editType); - - /** * Loads the default value for {@link #autojoin}. * @return the default value */ Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/DefaultMapViewSettings.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/DefaultMapViewSettings.java 2013-10-16 01:17:07 UTC (rev 9453) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapviewsettings/DefaultMapViewSettings.java 2013-10-16 19:38:28 UTC (rev 9454) @@ -165,14 +165,6 @@ * {@inheritDoc} */ @Override - protected void saveEditType(final int editType) { - // ignore: retaining edit types would be confusing for the user - } - - /** - * {@inheritDoc} - */ - @Override protected boolean loadAutojoin() { return preferences.getBoolean(AUTOJOIN_KEY, false); } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/mapviewsettings/TestMapViewSettings.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/mapviewsettings/TestMapViewSettings.java 2013-10-16 01:17:07 UTC (rev 9453) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapviewsettings/TestMapViewSettings.java 2013-10-16 19:38:28 UTC (rev 9454) @@ -118,14 +118,6 @@ * {@inheritDoc} */ @Override - protected void saveEditType(final int editType) { - // ignore - } - - /** - * {@inheritDoc} - */ - @Override protected boolean loadAutojoin() { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 01:17:10
|
Revision: 9453 http://sourceforge.net/p/gridarta/code/9453 Author: akirschbaum Date: 2013-10-16 01:17:07 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Suppress warning. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-10-16 01:16:39 UTC (rev 9452) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-10-16 01:17:07 UTC (rev 9453) @@ -600,6 +600,7 @@ @SuppressWarnings("unchecked") protected Object clone() { try { + //noinspection OverriddenMethodCallDuringObjectConstruction final GameObjectContainer<G, A, R> clone = (GameObjectContainer<G, A, R>) super.clone(); clone.initData(); for (final BaseObject<G, A, R, G> gameObject : contents) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-16 01:16:51
|
Revision: 9452 http://sourceforge.net/p/gridarta/code/9452 Author: akirschbaum Date: 2013-10-16 01:16:39 +0000 (Wed, 16 Oct 2013) Log Message: ----------- Fix warnings about possible NullPointerExceptions. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-10-15 21:22:58 UTC (rev 9451) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-10-16 01:16:39 UTC (rev 9452) @@ -133,20 +133,26 @@ @Override public G next() { current = delegate.next(); + assert current != null; return current; } @Override public void remove() { + final G tmp = current; + if (tmp == null) { + throw new IllegalStateException(); + } // keep this in sync with GameObjectContainer#remove(G) // we can't simply invoke GameObjectContainer#remove(current) because that would result in a ConcurrentModificationException. notifyBeginChange(); try { - if (contents.size() >= 2 && contents.get(0) == current) { - contents.get(1).propagateElevation(current); + if (contents.size() >= 2 && contents.get(0) == tmp) { + contents.get(1).propagateElevation(tmp); } delegate.remove(); - current.setContainer(null, 0, 0); + tmp.setContainer(null, 0, 0); + current = null; } finally { notifyEndChange(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 21:23:04
|
Revision: 9451 http://sourceforge.net/p/gridarta/code/9451 Author: akirschbaum Date: 2013-10-15 21:22:58 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Move code from AutojoinLists to DefaultMapModel. Fixes cyclic dependency between these two classes. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinLists.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinLists.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinLists.java 2013-10-15 21:09:05 UTC (rev 9450) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinLists.java 2013-10-15 21:22:58 UTC (rev 9451) @@ -19,14 +19,12 @@ package net.sf.gridarta.model.autojoin; -import java.awt.Point; import java.io.Serializable; import java.util.IdentityHashMap; import java.util.Map; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapmodel.MapModel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -68,182 +66,14 @@ } /** - * Do autojoining on insertion of an game object on the map. All arches - * around the insert point get adjusted, and the archetype name of the - * correct archetype to be inserted is returned. This method must be called - * from the appropriate element of the AutojoinList, best use the link from - * the default archetype. - * @param point Location of the insert point on the map - * @param archetype the archetype to connect with - * @param mapModel Data model of the map - * @return the insertion result + * Returns an {@link AutojoinList} for a given archetype. + * @param archetype the archetype + * @return the autojoin list or {@code null} if none is defined for the + * archetype */ - @NotNull - public InsertionResult<G, A, R> joinInsert(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final R archetype) { - if (archetype.isMulti()) { - return new InsertionResult<G, A, R>(null, archetype); - } - - final AutojoinList<G, A, R> autojoinList = autojoinLists.get(archetype); - if (autojoinList == null) { - return new InsertionResult<G, A, R>(null, archetype); - } - - // if there already is an archetype of this list at point -> abort - final boolean isMainIndex = autojoinList.isMainIndex(archetype); - final G gameObject = findGameObjectOfAutojoinList(mapModel, point, autojoinList); - if (gameObject != null) { - final R gameObjectArchetype = gameObject.getArchetype(); - final boolean isExistingMainIndex = autojoinList.isMainIndex(gameObjectArchetype); - if (isMainIndex) { - // alt/main -> main - if (isExistingMainIndex) { - // ignore main -> main - return new InsertionResult<G, A, R>(null, null); // we don't want same archetypes over each other - } else { - // alt -> main -> update - } - } else { - // alt/main -> alt - if (isExistingMainIndex) { - // main -> alt -> update - } else { - // alt -> alt -> update if different archetype - if (gameObjectArchetype == archetype) { - return new InsertionResult<G, A, R>(null, null); // we don't want same archetypes over each other - } - } - } - } - - // now do the joining in all four directions: - final int altIndex = isMainIndex ? -1 : autojoinList.getAlternativeIndex(archetype); - int newIndex = 0; // return value, see above - newIndex |= joinInsert(mapModel, point, autojoinList, 0, -1, AutojoinList.NORTH, AutojoinList.SOUTH, altIndex); - newIndex |= joinInsert(mapModel, point, autojoinList, +1, 0, AutojoinList.EAST, AutojoinList.WEST, altIndex); - newIndex |= joinInsert(mapModel, point, autojoinList, 0, +1, AutojoinList.SOUTH, AutojoinList.NORTH, altIndex); - newIndex |= joinInsert(mapModel, point, autojoinList, -1, 0, AutojoinList.WEST, AutojoinList.EAST, altIndex); - final R newArchetype = isMainIndex ? autojoinList.getArchetype(newIndex) : archetype; - if (gameObject != null) { - gameObject.setArchetype(newArchetype); - return new InsertionResult<G, A, R>(gameObject, null); - } - return new InsertionResult<G, A, R>(null, newArchetype); - } - - private int joinInsert(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList, final int dx, final int dy, final int dir, final int reverseDir, final int altIndex) { - final Point tmp = new Point(point.x + dx, point.y + dy); - if (!mapModel.getMapArchObject().isPointValid(tmp)) { - return 0; - } - - final GameObject<G, A, R> gameObject = findGameObjectOfAutojoinList(mapModel, tmp, autojoinList); - if (gameObject == null) { - return 0; - } - - final R archetype = gameObject.getArchetype(); - final int index = autojoinList.getAlternativeIndex(archetype); - if (index != -1) { - return (index & reverseDir) == 0 ? 0 : dir; - } - - final int archetypeIndex = autojoinList.getIndex(archetype); - final int newIndex; - if ((altIndex & dir) == 0) { - newIndex = archetypeIndex & ~reverseDir; - } else { - newIndex = archetypeIndex | reverseDir; - } - gameObject.setArchetype(autojoinList.getArchetype(newIndex)); - return dir; - } - - /** - * Do autojoining on deletion of an GameObject on the map. All arches around - * the insert point get adjusted. This method must be called from the - * appropriate element of the AutojoinList, best use the link from the - * default archetype. - * @param point Location of the insert point on the map - * @param archetype the archetype to connect with - * @param mapModel Data model of the map - */ - public void joinDelete(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final R archetype) { - if (archetype.isMulti()) { - return; - } - - final AutojoinList<G, A, R> autojoinList = autojoinLists.get(archetype); - if (autojoinList == null) { - return; - } - - final boolean isMainIndex = autojoinList.isMainIndex(archetype); - final int altIndex = isMainIndex ? -1 : autojoinList.getAlternativeIndex(archetype); - - joinDelete(mapModel, point, autojoinList, 0, -1, AutojoinList.NORTH, AutojoinList.SOUTH, altIndex); - joinDelete(mapModel, point, autojoinList, +1, 0, AutojoinList.EAST, AutojoinList.WEST, altIndex); - joinDelete(mapModel, point, autojoinList, 0, +1, AutojoinList.SOUTH, AutojoinList.NORTH, altIndex); - joinDelete(mapModel, point, autojoinList, -1, 0, AutojoinList.WEST, AutojoinList.EAST, altIndex); - } - - private void joinDelete(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList, final int dx, final int dy, final int reverseDir, final int dir, final int altIndex) { - if ((altIndex & reverseDir) == 0) { - return; - } - - final Point tmp = new Point(point.x + dx, point.y + dy); - if (!mapModel.getMapArchObject().isPointValid(tmp)) { - return; - } - - final GameObject<G, A, R> gameObject = findMainGameObjectOfAutojoinList(mapModel, tmp, autojoinList); - if (gameObject == null) { - return; - } - - gameObject.setArchetype(autojoinList.getArchetype(autojoinList.getIndex(gameObject.getArchetype()) & ~dir)); - } - - /** - * Looks for an archetype at map-position point which is part of an autojoin - * list. - * @param mapModel the map model to search - * @param point location to search - * @param autojoinList the autojoin list - * @return the archetype which is part of this join-list or - * <code>null</code> if no such archetype exists - */ @Nullable - private G findGameObjectOfAutojoinList(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList) { - for (final G gameObject : mapModel.getMapSquare(point).reverse()) { - if (autojoinLists.get(gameObject.getArchetype()) == autojoinList) { - return gameObject; - } - } - - return null; + public AutojoinList<G, A, R> getAutojoinList(@NotNull final Archetype<G, A, R> archetype) { + return autojoinLists.get(archetype); } - /** - * Looks for an archetype at map-position point which is the main archetypes - * part of an autojoin list. - * @param mapModel the map model to search - * @param point location to search - * @param autojoinList the autojoin list - * @return the archetype which is part of this join-list or - * <code>null</code> if no such archetype exists - */ - @Nullable - private GameObject<G, A, R> findMainGameObjectOfAutojoinList(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList) { - for (final GameObject<G, A, R> gameObject : mapModel.getMapSquare(point).reverse()) { - final R archetype = gameObject.getArchetype(); - if (autojoinLists.get(archetype) == autojoinList && autojoinList.isMainIndex(archetype)) { - return gameObject; - } - } - - return null; - } - } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 21:09:05 UTC (rev 9450) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 21:22:58 UTC (rev 9451) @@ -30,6 +30,7 @@ import java.util.Set; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; +import net.sf.gridarta.model.autojoin.AutojoinList; import net.sf.gridarta.model.autojoin.AutojoinLists; import net.sf.gridarta.model.autojoin.InsertionResult; import net.sf.gridarta.model.baseobject.BaseObject; @@ -720,7 +721,7 @@ gameObject.remove(); if (join) { - autojoinLists.joinDelete(this, mapSquare.getMapLocation(), gameObject.getArchetype()); + joinDelete(mapSquare.getMapLocation(), gameObject.getArchetype()); } } } @@ -827,7 +828,7 @@ final R realArchetype = baseObject.getArchetype(); final R effectiveArchetype; if (join) { - final InsertionResult<G, A, R> insertionResult = autojoinLists.joinInsert(this, pos, realArchetype); + final InsertionResult<G, A, R> insertionResult = joinInsert(pos, realArchetype); final G gameObject = insertionResult.getGameObject(); if (gameObject != null) { return gameObject; @@ -1139,4 +1140,179 @@ return editType; } + /** + * Do autojoining on insertion of an game object on the map. All arches + * around the insert point get adjusted, and the archetype name of the + * correct archetype to be inserted is returned. This method must be called + * from the appropriate element of the AutojoinList, best use the link from + * the default archetype. + * @param point Location of the insert point on the map + * @param archetype the archetype to connect with + * @return the insertion result + */ + @NotNull + private InsertionResult<G, A, R> joinInsert(@NotNull final Point point, @NotNull final R archetype) { + if (archetype.isMulti()) { + return new InsertionResult<G, A, R>(null, archetype); + } + + final AutojoinList<G, A, R> autojoinList = autojoinLists.getAutojoinList(archetype); + if (autojoinList == null) { + return new InsertionResult<G, A, R>(null, archetype); + } + + // if there already is an archetype of this list at point -> abort + final boolean isMainIndex = autojoinList.isMainIndex(archetype); + final G gameObject = findGameObjectOfAutojoinList(point, autojoinList); + if (gameObject != null) { + final R gameObjectArchetype = gameObject.getArchetype(); + final boolean isExistingMainIndex = autojoinList.isMainIndex(gameObjectArchetype); + if (isMainIndex) { + // alt/main -> main + if (isExistingMainIndex) { + // ignore main -> main + return new InsertionResult<G, A, R>(null, null); // we don't want same archetypes over each other + } else { + // alt -> main -> update + } + } else { + // alt/main -> alt + if (isExistingMainIndex) { + // main -> alt -> update + } else { + // alt -> alt -> update if different archetype + if (gameObjectArchetype == archetype) { + return new InsertionResult<G, A, R>(null, null); // we don't want same archetypes over each other + } + } + } + } + + // now do the joining in all four directions: + final int altIndex = isMainIndex ? -1 : autojoinList.getAlternativeIndex(archetype); + int newIndex = 0; // return value, see above + newIndex |= joinInsert(point, autojoinList, 0, -1, AutojoinList.NORTH, AutojoinList.SOUTH, altIndex); + newIndex |= joinInsert(point, autojoinList, +1, 0, AutojoinList.EAST, AutojoinList.WEST, altIndex); + newIndex |= joinInsert(point, autojoinList, 0, +1, AutojoinList.SOUTH, AutojoinList.NORTH, altIndex); + newIndex |= joinInsert(point, autojoinList, -1, 0, AutojoinList.WEST, AutojoinList.EAST, altIndex); + final R newArchetype = isMainIndex ? autojoinList.getArchetype(newIndex) : archetype; + if (gameObject != null) { + gameObject.setArchetype(newArchetype); + return new InsertionResult<G, A, R>(gameObject, null); + } + return new InsertionResult<G, A, R>(null, newArchetype); + } + + private int joinInsert(@NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList, final int dx, final int dy, final int dir, final int reverseDir, final int altIndex) { + final Point tmp = new Point(point.x + dx, point.y + dy); + if (!mapArchObject.isPointValid(tmp)) { + return 0; + } + + final GameObject<G, A, R> gameObject = findGameObjectOfAutojoinList(tmp, autojoinList); + if (gameObject == null) { + return 0; + } + + final R archetype = gameObject.getArchetype(); + final int index = autojoinList.getAlternativeIndex(archetype); + if (index != -1) { + return (index & reverseDir) == 0 ? 0 : dir; + } + + final int archetypeIndex = autojoinList.getIndex(archetype); + final int newIndex; + if ((altIndex & dir) == 0) { + newIndex = archetypeIndex & ~reverseDir; + } else { + newIndex = archetypeIndex | reverseDir; + } + gameObject.setArchetype(autojoinList.getArchetype(newIndex)); + return dir; + } + + /** + * Do autojoining on deletion of an GameObject on the map. All arches around + * the insert point get adjusted. This method must be called from the + * appropriate element of the AutojoinList, best use the link from the + * default archetype. + * @param point Location of the insert point on the map + * @param archetype the archetype to connect with + */ + private void joinDelete(@NotNull final Point point, @NotNull final R archetype) { + if (archetype.isMulti()) { + return; + } + + final AutojoinList<G, A, R> autojoinList = autojoinLists.getAutojoinList(archetype); + if (autojoinList == null) { + return; + } + + final boolean isMainIndex = autojoinList.isMainIndex(archetype); + final int altIndex = isMainIndex ? -1 : autojoinList.getAlternativeIndex(archetype); + + joinDelete(point, autojoinList, 0, -1, AutojoinList.NORTH, AutojoinList.SOUTH, altIndex); + joinDelete(point, autojoinList, +1, 0, AutojoinList.EAST, AutojoinList.WEST, altIndex); + joinDelete(point, autojoinList, 0, +1, AutojoinList.SOUTH, AutojoinList.NORTH, altIndex); + joinDelete(point, autojoinList, -1, 0, AutojoinList.WEST, AutojoinList.EAST, altIndex); + } + + private void joinDelete(@NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList, final int dx, final int dy, final int reverseDir, final int dir, final int altIndex) { + if ((altIndex & reverseDir) == 0) { + return; + } + + final Point tmp = new Point(point.x + dx, point.y + dy); + if (!mapArchObject.isPointValid(tmp)) { + return; + } + + final GameObject<G, A, R> gameObject = findMainGameObjectOfAutojoinList(tmp, autojoinList); + if (gameObject == null) { + return; + } + + gameObject.setArchetype(autojoinList.getArchetype(autojoinList.getIndex(gameObject.getArchetype()) & ~dir)); + } + + /** + * Looks for an archetype at map-position point which is part of an autojoin + * list. + * @param point location to search + * @param autojoinList the autojoin list + * @return the archetype which is part of this join-list or + * <code>null</code> if no such archetype exists + */ + @Nullable + private G findGameObjectOfAutojoinList(@NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList) { + for (final G gameObject : getMapSquare(point).reverse()) { + if (autojoinLists.getAutojoinList(gameObject.getArchetype()) == autojoinList) { + return gameObject; + } + } + + return null; + } + + /** + * Looks for an archetype at map-position point which is the main archetypes + * part of an autojoin list. + * @param point location to search + * @param autojoinList the autojoin list + * @return the archetype which is part of this join-list or + * <code>null</code> if no such archetype exists + */ + @Nullable + private GameObject<G, A, R> findMainGameObjectOfAutojoinList(@NotNull final Point point, @NotNull final AutojoinList<G, A, R> autojoinList) { + for (final GameObject<G, A, R> gameObject : getMapSquare(point).reverse()) { + final R archetype = gameObject.getArchetype(); + if (autojoinLists.getAutojoinList(archetype) == autojoinList && autojoinList.isMainIndex(archetype)) { + return gameObject; + } + } + + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 21:09:11
|
Revision: 9450 http://sourceforge.net/p/gridarta/code/9450 Author: akirschbaum Date: 2013-10-15 21:09:05 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Move AttributeListUtils to different package. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractArchetypeParser.java Added Paths: ----------- trunk/src/model/src/main/java/net/sf/gridarta/model/io/AttributeListUtils.java trunk/src/model/src/test/java/net/sf/gridarta/model/io/AttributeListUtilsTest.java Removed Paths: ------------- trunk/src/model/src/main/java/net/sf/gridarta/model/archetype/AttributeListUtils.java trunk/src/model/src/test/java/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-10-15 21:01:00 UTC (rev 9449) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -36,11 +36,11 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.gui.utils.Severity; -import net.sf.gridarta.model.archetype.AttributeListUtils; 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.gameobject.GameObjectUtils; +import net.sf.gridarta.model.io.AttributeListUtils; import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Deleted: trunk/src/model/src/main/java/net/sf/gridarta/model/archetype/AttributeListUtils.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/archetype/AttributeListUtils.java 2013-10-15 21:01:00 UTC (rev 9449) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/archetype/AttributeListUtils.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -1,113 +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.model.archetype; - -import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.utils.StringUtils; -import org.jetbrains.annotations.NotNull; - -/** - * Utility class for archetype attribute related functions. - * @author Andreas Kirschbaum - */ -public class AttributeListUtils { - - /** - * Private constructor to prevent instantiation. - */ - private AttributeListUtils() { - } - - /** - * Removes an attribute from an attribute list. - * @param attributeList the attribute list to modify - * @param key the attribute key to remove - * @return the attribute list with the given key removed - */ - public static String removeAttribute(@NotNull final String attributeList, @NotNull final String key) { - if (attributeList.length() <= 0) { - return attributeList; - } - - final String prefix = key + " "; - - final String[] lines = StringUtils.PATTERN_END_OF_LINE.split(attributeList, -1); - - final StringBuilder sb = new StringBuilder(); - for (final String line : lines) { - if (!line.isEmpty() && !line.startsWith(prefix)) { - sb.append(line); - sb.append('\n'); - } - } - return sb.toString(); - } - - /** - * Returns all attributes from the given game object that don't exist in an - * archetype. Ignores the values; compares only keys. - * @param gameObject the game object - * @param archetype the archetype - * @return all attributes from the archetype that don't occur in the game - * object - */ - @NotNull - public static String diffArchTextKeys(@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final BaseObject<?, ?, ?, ?> archetype) { - final CharSequence oldObjectText = gameObject.getObjectText(); - final StringBuilder result = new StringBuilder(); - for (final String line : StringUtils.PATTERN_END_OF_LINE.split(archetype.getObjectText(), 0)) { - final int spaceIndex = line.indexOf(' '); - if (!line.isEmpty() && spaceIndex > 0 && StringUtils.diffTextString(oldObjectText, line.substring(0, spaceIndex + 1), true) == null) { - result.append(line).append('\n'); - } - } - return result.toString(); - } - - /** - * Returns all entries from the given attributes that don't exist in an - * archetype. - * @param attributes the attributes - * @param archetype the game object - * @return all lines from <code>attributes</code> that don't occur in this - * game object - */ - @NotNull - public static String diffArchTextValues(@NotNull final BaseObject<?, ?, ?, ?> archetype, @NotNull final CharSequence attributes) { - final CharSequence oldObjectText = archetype.getObjectText(); - final StringBuilder result = new StringBuilder(); - for (final String line : StringUtils.PATTERN_END_OF_LINE.split(attributes, 0)) { - try { - final CharSequence test = StringUtils.diffTextString(oldObjectText, line, false); - char c = '\n'; - if (test != null) { - c = test.charAt(0); - } - if (!line.isEmpty() && (test == null || c == '\n')) { - result.append(line).append('\n'); - } - } catch (final StringIndexOutOfBoundsException ignored) { - // ignore - } - } - return result.toString(); - } - -} Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractArchetypeParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractArchetypeParser.java 2013-10-15 21:01:00 UTC (rev 9449) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractArchetypeParser.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.anim.IllegalAnimationException; import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetype.AttributeListUtils; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; Copied: trunk/src/model/src/main/java/net/sf/gridarta/model/io/AttributeListUtils.java (from rev 9433, trunk/src/model/src/main/java/net/sf/gridarta/model/archetype/AttributeListUtils.java) =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/AttributeListUtils.java (rev 0) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/AttributeListUtils.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -0,0 +1,113 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.io; + +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.utils.StringUtils; +import org.jetbrains.annotations.NotNull; + +/** + * Utility class for archetype attribute related functions. + * @author Andreas Kirschbaum + */ +public class AttributeListUtils { + + /** + * Private constructor to prevent instantiation. + */ + private AttributeListUtils() { + } + + /** + * Removes an attribute from an attribute list. + * @param attributeList the attribute list to modify + * @param key the attribute key to remove + * @return the attribute list with the given key removed + */ + public static String removeAttribute(@NotNull final String attributeList, @NotNull final String key) { + if (attributeList.length() <= 0) { + return attributeList; + } + + final String prefix = key + " "; + + final String[] lines = StringUtils.PATTERN_END_OF_LINE.split(attributeList, -1); + + final StringBuilder sb = new StringBuilder(); + for (final String line : lines) { + if (!line.isEmpty() && !line.startsWith(prefix)) { + sb.append(line); + sb.append('\n'); + } + } + return sb.toString(); + } + + /** + * Returns all attributes from the given game object that don't exist in an + * archetype. Ignores the values; compares only keys. + * @param gameObject the game object + * @param archetype the archetype + * @return all attributes from the archetype that don't occur in the game + * object + */ + @NotNull + public static String diffArchTextKeys(@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final BaseObject<?, ?, ?, ?> archetype) { + final CharSequence oldObjectText = gameObject.getObjectText(); + final StringBuilder result = new StringBuilder(); + for (final String line : StringUtils.PATTERN_END_OF_LINE.split(archetype.getObjectText(), 0)) { + final int spaceIndex = line.indexOf(' '); + if (!line.isEmpty() && spaceIndex > 0 && StringUtils.diffTextString(oldObjectText, line.substring(0, spaceIndex + 1), true) == null) { + result.append(line).append('\n'); + } + } + return result.toString(); + } + + /** + * Returns all entries from the given attributes that don't exist in an + * archetype. + * @param attributes the attributes + * @param archetype the game object + * @return all lines from <code>attributes</code> that don't occur in this + * game object + */ + @NotNull + public static String diffArchTextValues(@NotNull final BaseObject<?, ?, ?, ?> archetype, @NotNull final CharSequence attributes) { + final CharSequence oldObjectText = archetype.getObjectText(); + final StringBuilder result = new StringBuilder(); + for (final String line : StringUtils.PATTERN_END_OF_LINE.split(attributes, 0)) { + try { + final CharSequence test = StringUtils.diffTextString(oldObjectText, line, false); + char c = '\n'; + if (test != null) { + c = test.charAt(0); + } + if (!line.isEmpty() && (test == null || c == '\n')) { + result.append(line).append('\n'); + } + } catch (final StringIndexOutOfBoundsException ignored) { + // ignore + } + } + return result.toString(); + } + +} Property changes on: trunk/src/model/src/main/java/net/sf/gridarta/model/io/AttributeListUtils.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 Deleted: trunk/src/model/src/test/java/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java 2013-10-15 21:01:00 UTC (rev 9449) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -1,108 +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.model.archetype; - -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.TestAnimationObjects; -import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.face.TestFaceObjects; -import net.sf.gridarta.model.gameobject.TestGameObjectFactory; -import net.sf.gridarta.utils.GUIUtils; -import net.sf.gridarta.utils.SystemIcons; -import org.jetbrains.annotations.NotNull; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test for {@link AttributeListUtils}. - * @author Andreas Kirschbaum - */ -public class AttributeListUtilsTest { - - /** - * Test case for {@link AttributeListUtils#removeAttribute(String, - * String)}. - */ - @Test - public void testRemoveAttribute() { - checkRemoveAttribute("", "abc", ""); - - checkRemoveAttribute("abc def\n", "abc", ""); - checkRemoveAttribute("abc def\n", "ab", "abc def\n"); - checkRemoveAttribute("abc def\n", "abcd", "abc def\n"); - - checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "abc", "ghi jkl\n" + "mno pqr\n"); - checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "def", "abc def\n" + "ghi jkl\n" + "mno pqr\n"); - checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "ghi", "abc def\n" + "mno pqr\n"); - checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "mno", "abc def\n" + "ghi jkl\n"); - - checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "Abc", "abc def\n" + "ghi jkl\n" + "mno pqr\n"); - - checkRemoveAttribute("abc def\n\n" + "ghi jkl\n\n", "xyz", "abc def\n" + "ghi jkl\n"); - checkRemoveAttribute("\n\n" + "abc def\n\n", "ghi", "abc def\n"); - checkRemoveAttribute("\n\n" + "abc def\n\n", "abc", ""); - } - - /** - * Calls {@link AttributeListUtils#removeAttribute(String, String)} and - * checks for expected results. - * @param attributeList the attribute list parameter to pass - * @param key the key parameter to pass - * @param expectedResult the expected result value - */ - private static void checkRemoveAttribute(@NotNull final String attributeList, @NotNull final String key, @NotNull final String expectedResult) { - Assert.assertEquals(expectedResult, AttributeListUtils.removeAttribute(attributeList, key)); - } - - /** - * Checks that {@link AttributeListUtils#diffArchTextValues(BaseObject, - * CharSequence)} returns correct values. - */ - @Test - public void checkDiffArchTextValues1() { - Assert.assertEquals("b 3\nd 4\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nb 2\nc 3\n"), "b 3\na 1\nd 4\n")); - Assert.assertEquals("d 4\nb 3\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nb 2\nc 3\n"), "d 4\nb 3\na 1\n")); - Assert.assertEquals("b 3\nd 4\n", AttributeListUtils.diffArchTextValues(newArchetype("c 3\nb 2\na 1\n"), "b 3\na 1\nd 4\n")); - Assert.assertEquals("d 4\nb 3\n", AttributeListUtils.diffArchTextValues(newArchetype("c 3\nb 2\na 1\n"), "d 4\nb 3\na 1\n")); - Assert.assertEquals("e 5\nb 2\nf 6\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nc 3\n"), "e 5\nb 2\nf 6\n")); - Assert.assertEquals("f 6\nb 2\ne 5\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nc 3\n"), "f 6\nb 2\ne 5\n")); - } - - /** - * Creates a new archetype. - * @param objectText the object text of the new archetype - * @return the new archetype - */ - @NotNull - private static BaseObject<?, ?, ?, ?> newArchetype(@NotNull final String objectText) { - final FaceObjects faceObjects = new TestFaceObjects(); - final GUIUtils guiUtils = new GUIUtils(); - final SystemIcons systemIcons = new SystemIcons(guiUtils); - final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects animationObjects = new TestAnimationObjects(); - final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); - final TestArchetype archetype = gameObjectFactory.newArchetype("arch"); - archetype.setObjectText(objectText); - return archetype; - } - -} Copied: trunk/src/model/src/test/java/net/sf/gridarta/model/io/AttributeListUtilsTest.java (from rev 9433, trunk/src/model/src/test/java/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java) =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/io/AttributeListUtilsTest.java (rev 0) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/io/AttributeListUtilsTest.java 2013-10-15 21:09:05 UTC (rev 9450) @@ -0,0 +1,109 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.io; + +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.TestAnimationObjects; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.face.TestFaceObjects; +import net.sf.gridarta.model.gameobject.TestGameObjectFactory; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import org.jetbrains.annotations.NotNull; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test for {@link AttributeListUtils}. + * @author Andreas Kirschbaum + */ +public class AttributeListUtilsTest { + + /** + * Test case for {@link AttributeListUtils#removeAttribute(String, + * String)}. + */ + @Test + public void testRemoveAttribute() { + checkRemoveAttribute("", "abc", ""); + + checkRemoveAttribute("abc def\n", "abc", ""); + checkRemoveAttribute("abc def\n", "ab", "abc def\n"); + checkRemoveAttribute("abc def\n", "abcd", "abc def\n"); + + checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "abc", "ghi jkl\n" + "mno pqr\n"); + checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "def", "abc def\n" + "ghi jkl\n" + "mno pqr\n"); + checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "ghi", "abc def\n" + "mno pqr\n"); + checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "mno", "abc def\n" + "ghi jkl\n"); + + checkRemoveAttribute("abc def\n" + "ghi jkl\n" + "mno pqr\n", "Abc", "abc def\n" + "ghi jkl\n" + "mno pqr\n"); + + checkRemoveAttribute("abc def\n\n" + "ghi jkl\n\n", "xyz", "abc def\n" + "ghi jkl\n"); + checkRemoveAttribute("\n\n" + "abc def\n\n", "ghi", "abc def\n"); + checkRemoveAttribute("\n\n" + "abc def\n\n", "abc", ""); + } + + /** + * Calls {@link AttributeListUtils#removeAttribute(String, String)} and + * checks for expected results. + * @param attributeList the attribute list parameter to pass + * @param key the key parameter to pass + * @param expectedResult the expected result value + */ + private static void checkRemoveAttribute(@NotNull final String attributeList, @NotNull final String key, @NotNull final String expectedResult) { + Assert.assertEquals(expectedResult, AttributeListUtils.removeAttribute(attributeList, key)); + } + + /** + * Checks that {@link AttributeListUtils#diffArchTextValues(BaseObject, + * CharSequence)} returns correct values. + */ + @Test + public void checkDiffArchTextValues1() { + Assert.assertEquals("b 3\nd 4\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nb 2\nc 3\n"), "b 3\na 1\nd 4\n")); + Assert.assertEquals("d 4\nb 3\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nb 2\nc 3\n"), "d 4\nb 3\na 1\n")); + Assert.assertEquals("b 3\nd 4\n", AttributeListUtils.diffArchTextValues(newArchetype("c 3\nb 2\na 1\n"), "b 3\na 1\nd 4\n")); + Assert.assertEquals("d 4\nb 3\n", AttributeListUtils.diffArchTextValues(newArchetype("c 3\nb 2\na 1\n"), "d 4\nb 3\na 1\n")); + Assert.assertEquals("e 5\nb 2\nf 6\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nc 3\n"), "e 5\nb 2\nf 6\n")); + Assert.assertEquals("f 6\nb 2\ne 5\n", AttributeListUtils.diffArchTextValues(newArchetype("a 1\nc 3\n"), "f 6\nb 2\ne 5\n")); + } + + /** + * Creates a new archetype. + * @param objectText the object text of the new archetype + * @return the new archetype + */ + @NotNull + private static BaseObject<?, ?, ?, ?> newArchetype(@NotNull final String objectText) { + final FaceObjects faceObjects = new TestFaceObjects(); + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects animationObjects = new TestAnimationObjects(); + final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); + final TestArchetype archetype = gameObjectFactory.newArchetype("arch"); + archetype.setObjectText(objectText); + return archetype; + } + +} Property changes on: trunk/src/model/src/test/java/net/sf/gridarta/model/io/AttributeListUtilsTest.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-10-15 21:01:06
|
Revision: 9449 http://sourceforge.net/p/gridarta/code/9449 Author: akirschbaum Date: 2013-10-15 21:01:00 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove redundant parameters from MapTransactionListener. Fixes cyclic dependency between MapModel and MapTransactionListener. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapTransactionListener.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java 2013-10-15 20:57:40 UTC (rev 9448) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java 2013-10-15 21:01:00 UTC (rev 9449) @@ -132,12 +132,12 @@ } @Override - public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { + public void beginTransaction(@NotNull final String name) { // ignore } @Override - public void endTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final SavedSquares<G, A, R> savedSquares) { + public void endTransaction(@NotNull final SavedSquares<G, A, R> savedSquares) { // ignore } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2013-10-15 20:57:40 UTC (rev 9448) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2013-10-15 21:01:00 UTC (rev 9449) @@ -301,12 +301,12 @@ } @Override - public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { + public void beginTransaction(@NotNull final String name) { // ignore } @Override - public void endTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final SavedSquares<G, A, R> savedSquares) { + public void endTransaction(@NotNull final SavedSquares<G, A, R> savedSquares) { // ignore } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java 2013-10-15 20:57:40 UTC (rev 9448) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java 2013-10-15 21:01:00 UTC (rev 9449) @@ -127,13 +127,13 @@ } @Override - public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { + public void beginTransaction(@NotNull final String name) { undoModel = undoModels.get(mapModel); undoState = new UndoState<G, A, R>(name, mapModel.getMapArchObject().createClone()); } @Override - public void endTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final SavedSquares<G, A, R> savedSquares) { + public void endTransaction(@NotNull final SavedSquares<G, A, R> savedSquares) { final UndoState<G, A, R> savedUndoState = undoState; assert savedUndoState != null; final UndoModel<G, A, R> savedUndoModel = undoModel; Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 20:57:40 UTC (rev 9448) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 21:01:00 UTC (rev 9449) @@ -665,7 +665,7 @@ private void fireBeginTransaction(@NotNull final String name) { savedSquares.clear(); for (final MapTransactionListener<G, A, R> listener : mapTransactionListeners.getListeners()) { - listener.beginTransaction(this, name); + listener.beginTransaction(name); } } @@ -674,7 +674,7 @@ */ private void fireEndTransaction() { for (final MapTransactionListener<G, A, R> listener : mapTransactionListeners.getListeners()) { - listener.endTransaction(this, savedSquares); + listener.endTransaction(savedSquares); } savedSquares.clear(); } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapTransactionListener.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapTransactionListener.java 2013-10-15 20:57:40 UTC (rev 9448) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapTransactionListener.java 2013-10-15 21:01:00 UTC (rev 9449) @@ -39,17 +39,15 @@ /** * A map transaction has started. - * @param mapModel the map model * @param name the transaction name */ - void beginTransaction(@NotNull MapModel<G, A, R> mapModel, @NotNull String name); + void beginTransaction(@NotNull String name); /** * A map transaction has ended. - * @param mapModel the map model * @param savedSquares the squares affected by the transaction */ - void endTransaction(@NotNull MapModel<G, A, R> mapModel, @NotNull SavedSquares<G, A, R> savedSquares); + void endTransaction(@NotNull SavedSquares<G, A, R> savedSquares); /** * A map transaction has been finished. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 20:57:47
|
Revision: 9448 http://sourceforge.net/p/gridarta/code/9448 Author: akirschbaum Date: 2013-10-15 20:57:40 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Support undo operations if different maps are modified concurrently. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/model/src/main/java/net/sf/gridarta/model/undo/UndoModel.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java 2013-10-15 20:28:10 UTC (rev 9447) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/undo/UndoControl.java 2013-10-15 20:57:40 UTC (rev 9448) @@ -76,69 +76,6 @@ private int maxUndoStates = 100; /** - * Listener to be notified for map transactions. The same listener is - * registered for all known maps. - */ - @NotNull - private final MapTransactionListener<G, A, R> mapTransactionListener = new MapTransactionListener<G, A, R>() { - - /** - * Records the map state at transaction begin time. It is used to - * detect (and drop) edit operations that do not change the map - * state. - * - * XXX: since only one listener instance is used for all maps, it - * will not work if concurrent transactions occur - */ - @Nullable - private UndoState<G, A, R> undoState; - - /** - * Records the undo model at transaction begin time. - */ - @Nullable - private UndoModel<G, A, R> undoModel; - - @Override - public void preBeginTransaction() { - // ignore - } - - @Override - public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { - undoModel = undoModels.get(mapModel); - undoState = new UndoState<G, A, R>(name, mapModel.getMapArchObject().createClone()); - } - - @Override - public void endTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final SavedSquares<G, A, R> savedSquares) { - final UndoState<G, A, R> savedUndoState = undoState; - assert savedUndoState != null; - final UndoModel<G, A, R> savedUndoModel = undoModel; - assert savedUndoModel != null; - if (savedSquares.isEmpty() && savedUndoState.getMapArchObject().equals(mapModel.getMapArchObject())) { - return; - } - - final SavedSquares<G, A, R> clonedSavedSquares = savedSquares.cloneAndClear(); - clonedSavedSquares.removeEmptySquares(savedUndoState.getMapArchObject().getMapSize()); - savedUndoState.setSavedSquares(clonedSavedSquares); - savedUndoModel.finish(savedUndoState); - if (maxUndoStates > 0) { - savedUndoModel.trimToSize(maxUndoStates); - } - - refreshMenus(); - } - - @Override - public void postEndTransaction() { - // ignore - } - - }; - - /** * Action for "undo" function. */ @Nullable @@ -167,8 +104,64 @@ @Override public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - undoModels.put(mapControl.getMapModel(), new UndoModel<G, A, R>(gameObjectFactory, gameObjectMatchers)); - mapControl.getMapModel().addMapTransactionListener(mapTransactionListener); + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final MapTransactionListener<G, A, R> mapTransactionListener = new MapTransactionListener<G, A, R>() { + + /** + * Records the map state at transaction begin time. It is + * used to detect (and drop) edit operations that do not + * change the map state. + */ + @Nullable + private UndoState<G, A, R> undoState; + + /** + * Records the undo model at transaction begin time. + */ + @Nullable + private UndoModel<G, A, R> undoModel; + + @Override + public void preBeginTransaction() { + // ignore + } + + @Override + public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { + undoModel = undoModels.get(mapModel); + undoState = new UndoState<G, A, R>(name, mapModel.getMapArchObject().createClone()); + } + + @Override + public void endTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final SavedSquares<G, A, R> savedSquares) { + final UndoState<G, A, R> savedUndoState = undoState; + assert savedUndoState != null; + final UndoModel<G, A, R> savedUndoModel = undoModel; + assert savedUndoModel != null; + if (savedSquares.isEmpty() && savedUndoState.getMapArchObject().equals(mapModel.getMapArchObject())) { + return; + } + + final SavedSquares<G, A, R> clonedSavedSquares = savedSquares.cloneAndClear(); + clonedSavedSquares.removeEmptySquares(savedUndoState.getMapArchObject().getMapSize()); + savedUndoState.setSavedSquares(clonedSavedSquares); + savedUndoModel.finish(savedUndoState); + if (maxUndoStates > 0) { + savedUndoModel.trimToSize(maxUndoStates); + } + + refreshMenus(); + } + + @Override + public void postEndTransaction() { + // ignore + } + + }; + + mapModel.addMapTransactionListener(mapTransactionListener); + undoModels.put(mapModel, new UndoModel<G, A, R>(gameObjectFactory, gameObjectMatchers, mapTransactionListener)); } @Override @@ -178,8 +171,9 @@ @Override public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { - undoModels.remove(mapControl.getMapModel()); - mapControl.getMapModel().removeMapTransactionListener(mapTransactionListener); + final UndoModel<G, A, R> undoModel = undoModels.remove(mapControl.getMapModel()); + assert undoModel != null; + mapControl.getMapModel().removeMapTransactionListener(undoModel.getMapTransactionListener()); } }; Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/undo/UndoModel.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/undo/UndoModel.java 2013-10-15 20:28:10 UTC (rev 9447) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/undo/UndoModel.java 2013-10-15 20:57:40 UTC (rev 9448) @@ -25,6 +25,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmodel.MapTransactionListener; import net.sf.gridarta.model.mapmodel.SavedSquares; import net.sf.gridarta.model.match.GameObjectMatchers; import org.jetbrains.annotations.NotNull; @@ -52,6 +53,12 @@ private final GameObjectMatchers gameObjectMatchers; /** + * The stored {@link MapTransactionListener}. + */ + @NotNull + private final MapTransactionListener<G, A, R> mapTransactionListener; + + /** * The undo stack. It consists of recorded {@link UndoState UndoStates} for * the associated {@link net.sf.gridarta.model.mapmodel.MapModel}. */ @@ -74,13 +81,25 @@ * Creates a new instance. * @param gameObjectFactory the game object factory to use * @param gameObjectMatchers the game object matchers to use + * @param mapTransactionListener the map transaction listener to store */ - public UndoModel(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { + public UndoModel(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final MapTransactionListener<G, A, R> mapTransactionListener) { this.gameObjectFactory = gameObjectFactory; this.gameObjectMatchers = gameObjectMatchers; + this.mapTransactionListener = mapTransactionListener; } /** + * Returns the {@link MapTransactionListener} that was passed to the + * constructor. + * @return the map transaction listener + */ + @NotNull + public MapTransactionListener<G, A, R> getMapTransactionListener() { + return mapTransactionListener; + } + + /** * Add a new undo state to the undo stack. This discards the existing "redo" * information (if present). * @param undoState the undo state to add This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 20:28:12
|
Revision: 9447 http://sourceforge.net/p/gridarta/code/9447 Author: akirschbaum Date: 2013-10-15 20:28:10 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Reorder initialization code. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 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-15 20:21:34 UTC (rev 9446) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 20:28:10 UTC (rev 9447) @@ -317,7 +317,6 @@ public GUIMainControl(@NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final EditorSettings editorSettings, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl) { this.projectModel = projectModel; final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); - mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); scriptExtension = editorFactory.getScriptExtension(); final DisplayMode<G, A, R> displayModeGameObjectNames = new DisplayNameCellRenderer<G, A, R>(projectModel.getFaceObjectProviders()); final DisplayMode<G, A, R> displayModeArchetypeNames = new ArchetypeNameCellRenderer<G, A, R>(projectModel.getFaceObjectProviders()); @@ -333,7 +332,6 @@ final MapViewManager<G, A, R> mapViewManager = new MapViewManager<G, A, R>(); final StatusBar<G, A, R> statusBar = new StatusBar<G, A, R>(projectModel.getMapManager(), mapViewManager, projectModel.getArchetypeSet(), projectModel.getFaceObjects()); final MapImageCache<G, A, R> mapImageCache = new MapImageCache<G, A, R>(projectModel.getMapManager(), systemIcons.getDefaultIcon(), systemIcons.getDefaultPreview(), rendererFactory, editorFactory.getCacheFiles()); - final MapDesktop<G, A, R> mapDesktop = new MapDesktop<G, A, R>(mapViewManager, projectModel.getMapManager(), mapImageCache, mapViewsManager); final MapFolderTree<G, A, R> mapFolderTree = new MapFolderTree<G, A, R>(projectSettings.getPickmapDir()); final ImageIcon icon = systemIcons.getAppIcon(); mainViewFrame = new JFrame(ACTION_BUILDER.format("mainWindow.title", getBuildNumberAsString())); @@ -380,12 +378,14 @@ final Action displayArchetypeNamesAction = createAction("displayArchetypeNames", "Archetype Chooser", new DisplayArchetypeNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeGameObjectNames)); final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); + mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); + mapViewsManager.setFileControl(fileControl); + final MapDesktop<G, A, R> mapDesktop = new MapDesktop<G, A, R>(mapViewManager, projectModel.getMapManager(), mapImageCache, mapViewsManager); final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, fileControl, pickmapChooserView); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); newMapDialogFactory.setObjectChooser(objectChooser); - mapViewsManager.setFileControl(fileControl); final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 20:21:42
|
Revision: 9446 http://sourceforge.net/p/gridarta/code/9446 Author: akirschbaum Date: 2013-10-15 20:21:34 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove PickmapChooserControl.setFileControl(). Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 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-10-15 20:18:47 UTC (rev 9445) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java 2013-10-15 20:21:34 UTC (rev 9446) @@ -125,7 +125,7 @@ * The {@link FileControl} to use. */ @NotNull - private FileControl<G, A, R> fileControl; + private final FileControl<G, A, R> fileControl; /** * Action called for "add new pickmap". @@ -332,15 +332,17 @@ * @param mapManager the map manager instance * @param parent the parent component * @param mapViewsManager the map views + * @param fileControl the file control instance * @param pickmapChooserView the view for this controller */ - public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { + public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final FileControl<G, A, R> fileControl, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { this.pickmapChooserModel = pickmapChooserModel; this.pickmapSettings = pickmapSettings; this.mapFolderTree = mapFolderTree; this.parent = parent; this.newMapDialogFactory = newMapDialogFactory; this.mapViewsManager = mapViewsManager; + this.fileControl = fileControl; ACTION_BUILDER.createToggles(true, this, "lockAllPickmaps"); pickmapChooserModel.addPickmapChooserListener(pickmapChooserModelListener); view = pickmapChooserView; @@ -358,11 +360,6 @@ view.setPopupMenu(popupMenu); } - @Deprecated - public void setFileControl(@NotNull final FileControl<G, A, R> fileControl) { - this.fileControl = fileControl; - } - /** * Reload a pickmap. Does nothing if the given file is unknown. * @param file the file of the pickmap 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-15 20:18:47 UTC (rev 9445) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 20:21:34 UTC (rev 9446) @@ -382,8 +382,7 @@ final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); - final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); - pickmapChooserControl.setFileControl(fileControl); + final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, fileControl, pickmapChooserView); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); newMapDialogFactory.setObjectChooser(objectChooser); mapViewsManager.setFileControl(fileControl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 20:18:52
|
Revision: 9445 http://sourceforge.net/p/gridarta/code/9445 Author: akirschbaum Date: 2013-10-15 20:18:47 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Properly run tests after changes. Modified Paths: -------------- trunk/test-mapvalidator/build.gradle Modified: trunk/test-mapvalidator/build.gradle =================================================================== --- trunk/test-mapvalidator/build.gradle 2013-10-15 19:51:08 UTC (rev 9444) +++ trunk/test-mapvalidator/build.gradle 2013-10-15 20:18:47 UTC (rev 9445) @@ -30,6 +30,7 @@ evaluationDependsOn typeProject.path task(taskName) { inputs.files inputDir + inputs.files typeProject.sourceSets.main.runtimeClasspath outputs.files outputFile dependsOn typeProject.tasks.getByName('classes') doLast { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:51:14
|
Revision: 9444 http://sourceforge.net/p/gridarta/code/9444 Author: akirschbaum Date: 2013-10-15 19:51:08 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Reorder initialization code. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 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-15 19:48:43 UTC (rev 9443) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:51:08 UTC (rev 9444) @@ -381,11 +381,11 @@ final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); + fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); + pickmapChooserControl.setFileControl(fileControl); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); newMapDialogFactory.setObjectChooser(objectChooser); - fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); - pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:48:48
|
Revision: 9443 http://sourceforge.net/p/gridarta/code/9443 Author: akirschbaum Date: 2013-10-15 19:48:43 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Reorder initialization code. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 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-15 19:37:13 UTC (rev 9442) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:48:43 UTC (rev 9443) @@ -340,9 +340,7 @@ final Frame parent = mainViewFrame; final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); final PickmapChooserView<G, A, R> pickmapChooserView = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree, projectModel.getMapArchObjectFactory(), projectModel.getMapReaderFactory(), projectModel.getPickmapManager()); - newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); final PickmapSettings pickmapSettings = new DefaultPickmapSettings(); - final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); final CFTreasureListTree treasureListTree = new CFTreasureListTree(projectModel.getTreasureTree(), parent, projectModel.getArchetypeSet(), projectModel.getFaceObjectProviders(), systemIcons); final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); final ImageIcon unknownSquareIcon = systemIcons.getUnknownSquareIcon(); @@ -363,9 +361,6 @@ scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); - pickmapChooserControl.setFileControl(fileControl); - mapViewsManager.setFileControl(fileControl); final GameObjectMatcher monsterMatcherTmp = projectModel.getGameObjectMatchers().getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_monster", "monster"); final GameObjectMatcher monsterMatcher = monsterMatcherTmp == null ? new TypeNrsGameObjectMatcher() : monsterMatcherTmp; final GameObjectMatcher exitGameObjectMatcherTmp = projectModel.getGameObjectMatchers().getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_exit", "exit"); @@ -375,13 +370,25 @@ final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(projectSettings, projectModel.getMapManager(), mapPathNormalizer); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(projectModel.getMapManager(), exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, editorFactory.getLockedItemsTypeNumbers()); - final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); - final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); final File scriptsFile = new File(projectSettings.getMapsDirectory(), editorFactory.getScriptsDir()); updaterManager = new UpdaterManager(exiter, projectModel.getMapManager(), parent, editorFactory.getGridartaJarFilename()); final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, projectModel.getArchetypeTypeSet()); final EditorAction undoControl = new UndoControl<G, A, R>(projectModel.getMapManager(), projectModel.getGameObjectFactory(), projectModel.getGameObjectMatchers()); + final Action displayGameObjectNamesAction = createAction("displayGameObjectNames", "Archetype Chooser", new DisplayGameObjectNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeArchetypeNames)); + final Action displayIconsOnlyAction = createAction("displayIconsOnly", "Archetype Chooser", new DisplayIconsOnlyAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeIconsOnly)); + final Action displayArchetypeNamesAction = createAction("displayArchetypeNames", "Archetype Chooser", new DisplayArchetypeNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeGameObjectNames)); + final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); + final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); + newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); + final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); + final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); + newMapDialogFactory.setObjectChooser(objectChooser); + fileControl = new DefaultFileControl<G, A, R>(projectSettings, volatileSettings, mapImageCache, projectModel.getMapManager(), mapViewsManager, parent, GuiFileFilters.mapFileFilter, editorFactory.getScriptFileFilter(), newMapDialogFactory, scriptExtension, scriptEditControl); + pickmapChooserControl.setFileControl(fileControl); + mapViewsManager.setFileControl(fileControl); + final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); + final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, projectModel.getMapManager()); final EditorAction mapFileActions = new MapFileActions<G, A, R>(imageCreator2, projectModel.getMapManager(), mapViewsManager, mapViewManager, fileControl, parent); @@ -390,16 +397,9 @@ @Nullable final MapMenuManager<G, A, R> bookmarksMapMenuManager = new MapMenuManager<G, A, R>(mapMenu, mapViewsManager, fileControl, mapImageCache); final ExitConnectorActions<G, A, R> exitConnectorActions = new ExitConnectorActions<G, A, R>(exitConnectorModel, exitMatcher, projectModel.getArchetypeSet(), projectModel.getMapManager(), fileControl, pathManager, insertionModeSet); // XXX: should be part of DefaultMainControl final EditorAction exitConnectorController = new ExitConnectorController<G, A, R>(exitConnectorActions, exitConnectorModel, mapViewManager); - final Action displayGameObjectNamesAction = createAction("displayGameObjectNames", "Archetype Chooser", new DisplayGameObjectNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeArchetypeNames)); - final Action displayArchetypeNamesAction = createAction("displayArchetypeNames", "Archetype Chooser", new DisplayArchetypeNamesAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeGameObjectNames)); - final Action displayIconsOnlyAction = createAction("displayIconsOnly", "Archetype Chooser", new DisplayIconsOnlyAction<G, A, R>(projectModel.getArchetypeChooserModel(), displayModeIconsOnly)); - final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); - final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); - final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareModel, objectChooser, pickmapSettings, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, projectModel.getMapManager(), selectedSquareModel, projectModel.getGameObjectFactory(), mapViewSettings); final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, false, 0, true); - newMapDialogFactory.setObjectChooser(objectChooser); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(parent, copyBuffer, objectChooser, mapViewManager, projectModel.getFaceObjectProviders(), insertionModeSet); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(projectModel.getArchetypeSet(), gameObjectAttributesModel, objectChooser, projectModel.getMapManager(), projectModel.getFaceObjectProviders()); final PluginController<G, A, R> pluginControl = new PluginController<G, A, R>(filterControl, pluginModel, parent, pluginParameterViewFactory, scriptsFile, systemIcons); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:37:21
|
Revision: 9442 http://sourceforge.net/p/gridarta/code/9442 Author: akirschbaum Date: 2013-10-15 19:37:13 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove NewMapDialogFactory.setPickmapChooserView(). 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/gui/dialog/newmap/NewMapDialogFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-15 19:31:13 UTC (rev 9441) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -42,6 +42,7 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.maincontrol.EditorFactory; @@ -432,8 +433,8 @@ */ @NotNull @Override - public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { - return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPDIFFICULTY, true, true, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, parent); + public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final PickmapChooserView<GameObject, MapArchObject, Archetype> pickmapChooserView, @NotNull final Component parent) { + return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPDIFFICULTY, true, true, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, pickmapChooserView, parent); } /** 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-15 19:31:13 UTC (rev 9441) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -40,6 +40,7 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.maincontrol.EditorFactory; @@ -323,8 +324,8 @@ */ @NotNull @Override - public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { - return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, 0, false, false, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, parent); + public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final PickmapChooserView<GameObject, MapArchObject, Archetype> pickmapChooserView, @NotNull final Component parent) { + return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, 0, false, false, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, pickmapChooserView, parent); } /** 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-15 19:31:13 UTC (rev 9441) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -42,6 +42,7 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.GridMapSquarePainter; import net.sf.gridarta.gui.map.renderer.RendererFactory; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.maincontrol.EditorFactory; @@ -431,8 +432,8 @@ */ @NotNull @Override - public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { - return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPDIFFICULTY, true, true, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, parent); + public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final PickmapChooserView<GameObject, MapArchObject, Archetype> pickmapChooserView, @NotNull final Component parent) { + return new NewMapDialogFactory<GameObject, MapArchObject, Archetype>(mapViewsManager, mapArchObjectFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPDIFFICULTY, true, true, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT, pickmapChooserView, parent); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java 2013-10-15 19:31:13 UTC (rev 9441) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -89,7 +89,7 @@ * The pickmap chooser control. */ @NotNull - private PickmapChooserView<G, A, R> pickmapChooserView; + private final PickmapChooserView<G, A, R> pickmapChooserView; /** * The object chooser instance. @@ -114,9 +114,11 @@ * @param showMapDifficulty whether to show the "mapDifficulty" field * @param defaultPickmapWidth the default width for new pickmaps * @param defaultPickmapHeight the default height for new pickmaps + * @param pickmapChooserView the pickmap chooser view for creating new + * pickmaps * @param parent the parent component */ - public NewMapDialogFactory(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, final int defaultMapWidth, final int defaultMapHeight, final int defaultMapDifficulty, final boolean showMapDifficulty, final boolean showMapSizeDefault, final int defaultPickmapWidth, final int defaultPickmapHeight, @NotNull final Component parent) { + public NewMapDialogFactory(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, final int defaultMapWidth, final int defaultMapHeight, final int defaultMapDifficulty, final boolean showMapDifficulty, final boolean showMapSizeDefault, final int defaultPickmapWidth, final int defaultPickmapHeight, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView, @NotNull final Component parent) { this.mapViewsManager = mapViewsManager; this.mapArchObjectFactory = mapArchObjectFactory; this.defaultMapWidth = defaultMapWidth; @@ -126,15 +128,11 @@ this.showMapDifficulty = showMapDifficulty; this.defaultPickmapWidth = defaultPickmapWidth; this.defaultPickmapHeight = defaultPickmapHeight; + this.pickmapChooserView = pickmapChooserView; this.parent = parent; } @Deprecated - public void setPickmapChooserView(@NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { - this.pickmapChooserView = pickmapChooserView; - } - - @Deprecated public void setObjectChooser(@NotNull final ObjectChooser<G, A, R> objectChooser) { this.objectChooser = objectChooser; } 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-15 19:31:13 UTC (rev 9441) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -30,6 +30,7 @@ import net.sf.gridarta.gui.map.mapview.MapViewManager; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.RendererFactory; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.model.archetype.Archetype; @@ -134,8 +135,8 @@ /** * Creates a new {@link MapViewFactory} instance. * @param rendererFactory the renderer factory to use - * @param pathManager the path manager for converting path names - * view factories + * @param pathManager the path manager for converting path names view + * factories * @return the new instance */ @NotNull @@ -163,11 +164,13 @@ * Creates a new {@link NewMapDialogFactory} instance. * @param mapViewsManager the map views * @param mapArchObjectFactory the map arch object factory instance + * @param pickmapChooserView the pickmap chooser view for creating new + * pickmaps * @param parent the parent component of the dialogs * @return the new new map dialog factory instance */ @NotNull - NewMapDialogFactory<G, A, R> newNewMapDialogFactory(@NotNull MapViewsManager<G, A, R> mapViewsManager, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull Component parent); + NewMapDialogFactory<G, A, R> newNewMapDialogFactory(@NotNull MapViewsManager<G, A, R> mapViewsManager, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull PickmapChooserView<G, A, R> pickmapChooserView, @NotNull Component parent); /** * Creates a new {@link PreferencesGroup} instance. 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-15 19:31:13 UTC (rev 9441) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:37:13 UTC (rev 9442) @@ -338,12 +338,11 @@ final ImageIcon icon = systemIcons.getAppIcon(); mainViewFrame = new JFrame(ACTION_BUILDER.format("mainWindow.title", getBuildNumberAsString())); final Frame parent = mainViewFrame; - newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), parent); final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); + final PickmapChooserView<G, A, R> pickmapChooserView = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree, projectModel.getMapArchObjectFactory(), projectModel.getMapReaderFactory(), projectModel.getPickmapManager()); + newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), pickmapChooserView, parent); final PickmapSettings pickmapSettings = new DefaultPickmapSettings(); - final PickmapChooserView<G, A, R> pickmapChooserView = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree, projectModel.getMapArchObjectFactory(), projectModel.getMapReaderFactory(), projectModel.getPickmapManager()); final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); - newMapDialogFactory.setPickmapChooserView(pickmapChooserView); final CFTreasureListTree treasureListTree = new CFTreasureListTree(projectModel.getTreasureTree(), parent, projectModel.getArchetypeSet(), projectModel.getFaceObjectProviders(), systemIcons); final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); final ImageIcon unknownSquareIcon = systemIcons.getUnknownSquareIcon(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:31:23
|
Revision: 9441 http://sourceforge.net/p/gridarta/code/9441 Author: akirschbaum Date: 2013-10-15 19:31:13 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Move code from PickmapChooserControl to PickmapChooserView. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.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/maincontrol/GUIMainControl.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java 2013-10-15 19:11:50 UTC (rev 9440) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java 2013-10-15 19:31:13 UTC (rev 9441) @@ -24,7 +24,7 @@ import net.sf.gridarta.gui.mapfiles.MapFolder; import net.sf.gridarta.gui.mapfiles.MapFolderTree; import net.sf.gridarta.gui.panel.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; @@ -89,7 +89,7 @@ * The pickmap chooser control. */ @NotNull - private PickmapChooserControl<G, A, R> pickmapChooserControl; + private PickmapChooserView<G, A, R> pickmapChooserView; /** * The object chooser instance. @@ -130,8 +130,8 @@ } @Deprecated - public void setPickmapChooserControl(@NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl) { - this.pickmapChooserControl = pickmapChooserControl; + public void setPickmapChooserView(@NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { + this.pickmapChooserView = pickmapChooserView; } @Deprecated @@ -150,7 +150,7 @@ * Shows a dialog for creating a new pickmap. */ public void showNewPickmapDialog() { - new NewPickmapDialog<G, A, R>(objectChooser, parent, defaultPickmapWidth, defaultPickmapHeight, pickmapChooserControl); + new NewPickmapDialog<G, A, R>(objectChooser, parent, defaultPickmapWidth, defaultPickmapHeight, pickmapChooserView); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.java 2013-10-15 19:11:50 UTC (rev 9440) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.java 2013-10-15 19:31:13 UTC (rev 9441) @@ -27,7 +27,7 @@ import javax.swing.text.JTextComponent; import net.sf.gridarta.gui.mapfiles.DuplicatePickmapException; import net.sf.gridarta.gui.panel.objectchooser.ObjectChooser; -import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; @@ -62,10 +62,10 @@ private final ObjectChooser<G, A, R> objectChooser; /** - * The pickmap chooser control. + * The pickmap chooser view. */ @NotNull - private final PickmapChooserControl<G, A, R> pickmapChooserControl; + private final PickmapChooserView<G, A, R> pickmapChooserView; /** * Textfield for the name of the map. The filename of the new map is unset @@ -80,12 +80,12 @@ * @param parentComponent the parent component of this dialog * @param defaultWidth the default width for new maps * @param defaultHeight the default height for new maps - * @param pickmapChooserControl the pickmap chooser control + * @param pickmapChooserView the pickmap chooser view */ - public NewPickmapDialog(@NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final Component parentComponent, final int defaultWidth, final int defaultHeight, @NotNull final PickmapChooserControl<G, A, R> pickmapChooserControl) { + public NewPickmapDialog(@NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final Component parentComponent, final int defaultWidth, final int defaultHeight, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { super(null, null, defaultWidth, defaultHeight); this.objectChooser = objectChooser; - this.pickmapChooserControl = pickmapChooserControl; + this.pickmapChooserView = pickmapChooserView; init1(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "newPickmap.title")); init2(); addDocumentListener(pickmapNameField); @@ -120,7 +120,7 @@ } try { - pickmapChooserControl.newPickmap(mapSize, pickmapName); + pickmapChooserView.newPickmap(mapSize, pickmapName); } catch (final DuplicatePickmapException ex) { ACTION_BUILDER.showMessageDialog(this, "pickmapExists", pickmapName); return false; 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-10-15 19:11:50 UTC (rev 9440) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java 2013-10-15 19:31:13 UTC (rev 9441) @@ -35,17 +35,12 @@ import net.sf.gridarta.gui.dialog.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.mapfiles.DuplicatePickmapException; -import net.sf.gridarta.gui.mapfiles.InvalidNameException; import net.sf.gridarta.gui.mapfiles.MapFile; -import net.sf.gridarta.gui.mapfiles.MapFolder; import net.sf.gridarta.gui.mapfiles.MapFolderTree; import net.sf.gridarta.gui.panel.objectchooser.ObjectChooserTab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcontrol.MapControlListener; @@ -103,18 +98,6 @@ private final PickmapSettings pickmapSettings; /** - * The {@link MapArchObjectFactory} instance. - */ - @NotNull - private final MapArchObjectFactory<A> mapArchObjectFactory; - - /** - * The map reader factory instance. - */ - @NotNull - private final MapReaderFactory<G, A> mapReaderFactory; - - /** * The view for this control. */ @NotNull @@ -133,12 +116,6 @@ private final NewMapDialogFactory<G, A, R> newMapDialogFactory; /** - * The {@link MapManager} instance for loading pickmaps. - */ - @NotNull - private final MapManager<G, A, R> pickmapManager; - - /** * The {@link MapViewsManager}. */ @NotNull @@ -351,27 +328,22 @@ * @param pickmapChooserModel the pickmap chooser model to control * @param pickmapSettings the pickmap settings to use * @param newMapDialogFactory the factory for creating new pickmaps - * @param mapArchObjectFactory the map arch object factory instance - * @param mapReaderFactory the map reader factory instance * @param mapFolderTree the map folder tree instance * @param mapManager the map manager instance * @param parent the parent component - * @param pickmapManager the pickmap manager for loading pickmaps * @param mapViewsManager the map views + * @param pickmapChooserView the view for this controller */ - public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView) { this.pickmapChooserModel = pickmapChooserModel; this.pickmapSettings = pickmapSettings; - this.mapArchObjectFactory = mapArchObjectFactory; - this.mapReaderFactory = mapReaderFactory; this.mapFolderTree = mapFolderTree; this.parent = parent; this.newMapDialogFactory = newMapDialogFactory; - this.pickmapManager = pickmapManager; this.mapViewsManager = mapViewsManager; ACTION_BUILDER.createToggles(true, this, "lockAllPickmaps"); pickmapChooserModel.addPickmapChooserListener(pickmapChooserModelListener); - view = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree); + view = pickmapChooserView; refresh(); view.addChangeListener(changeListener); mapManager.addMapManagerListener(mapManagerListener); @@ -392,63 +364,6 @@ } /** - * Add a new pickmap. - * @param mapSize the pickmap size in squares - * @param pickmapName the name of the pickmap - * @throws IOException if an I/O error occurs - * @throws DuplicatePickmapException if the pickmap name is not unique - */ - public void newPickmap(@NotNull final Size2D mapSize, @NotNull final String pickmapName) throws DuplicatePickmapException, IOException { - final MapFolder<G, A, R> activeMapFolder = view.getActiveFolder(); - if (activeMapFolder == null) { - return; - } - - if (!MapFile.isValidPickmapName(pickmapName)) { - throw new IOException("invalid pickmap name: " + pickmapName); - } - - for (final MapFile<G, A, R> mapFile : activeMapFolder) { - if (pickmapName.equals(mapFile.getFile().getName())) { - throw new DuplicatePickmapException(pickmapName); - } - } - final File file = new File(activeMapFolder.getDir(), pickmapName); - - if (file.isDirectory()) { - throw new IOException("pickmap file is a directory: " + file); - } - if (file.exists()) { - throw new IOException("pickmap file exists: " + file); - } - - final File dir = file.getParentFile(); - if (!dir.exists()) { - if (!dir.mkdirs()) { - throw new IOException("cannot create directory: " + dir); - } - } - - final A mapArchObject = mapArchObjectFactory.newMapArchObject(true); - mapArchObject.setMapSize(mapSize); - mapArchObject.setMapName(pickmapName); - final MapControl<G, A, R> mapControl = pickmapManager.newMap(null, mapArchObject, file, false); - try { - mapControl.save(); - } finally { - pickmapManager.release(mapControl); - } - - final MapFile<G, A, R> mapFile; - try { - mapFile = activeMapFolder.addPickmap(pickmapName, mapReaderFactory, pickmapManager); - } catch (final InvalidNameException ex) { - throw new AssertionError(ex); // the name has been checked before - } - view.setActivePickmap(mapFile); - } - - /** * Reload a pickmap. Does nothing if the given file is unknown. * @param file the file of the pickmap */ 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-10-15 19:11:50 UTC (rev 9440) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java 2013-10-15 19:31:13 UTC (rev 9441) @@ -20,6 +20,7 @@ package net.sf.gridarta.gui.panel.pickmapchooser; import java.awt.Component; +import java.io.File; import java.io.IOException; import javax.swing.BorderFactory; import javax.swing.JPopupMenu; @@ -27,6 +28,8 @@ import javax.swing.SwingConstants; import javax.swing.event.ChangeListener; import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.mapfiles.DuplicatePickmapException; +import net.sf.gridarta.gui.mapfiles.InvalidNameException; import net.sf.gridarta.gui.mapfiles.MapFile; import net.sf.gridarta.gui.mapfiles.MapFolder; import net.sf.gridarta.gui.mapfiles.MapFolderListener; @@ -34,9 +37,13 @@ import net.sf.gridarta.gui.mapfiles.MapFolderTreeListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.utils.CommonConstants; +import net.sf.gridarta.utils.Size2D; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -67,6 +74,24 @@ private final MapFolderTree<G, A, R> mapFolderTree; /** + * The {@link MapArchObjectFactory} instance. + */ + @NotNull + private final MapArchObjectFactory<A> mapArchObjectFactory; + + /** + * The map reader factory instance. + */ + @NotNull + private final MapReaderFactory<G, A> mapReaderFactory; + + /** + * The {@link MapManager} instance for loading pickmaps. + */ + @NotNull + private final MapManager<G, A, R> pickmapManager; + + /** * Panel with pickmaps. */ @NotNull @@ -166,10 +191,16 @@ * Creates a new instance. * @param pickmapChooserModel the attached pickmap chooser model * @param mapFolderTree the model to display + * @param mapArchObjectFactory the map arch object factory instance + * @param mapReaderFactory the map reader factory instance + * @param pickmapManager the pickmap manager for loading pickmaps */ - public PickmapChooserView(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final MapFolderTree<G, A, R> mapFolderTree) { + public PickmapChooserView(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapManager<G, A, R> pickmapManager) { this.pickmapChooserModel = pickmapChooserModel; this.mapFolderTree = mapFolderTree; + this.mapArchObjectFactory = mapArchObjectFactory; + this.mapReaderFactory = mapReaderFactory; + this.pickmapManager = pickmapManager; pickmapChooserModel.addPickmapChooserListener(pickmapChooserModelListener); pickmapPanel.setBorder(BorderFactory.createEmptyBorder(CommonConstants.SPACE_PICKMAP_ARCHETYPE_TOP, 0, 0, 0)); mapFolderTree.addModelListener(mapFolderTreeListener); @@ -252,15 +283,6 @@ } /** - * Returns the active folder. - * @return the active folder - */ - @Nullable - public MapFolder<G, A, R> getActiveFolder() { - return activeMapFolder; - } - - /** * Returns the title of a pickmap to use as the tab name. * @param mapFile the pickmap * @return the title @@ -290,4 +312,61 @@ return pickmapPanel.getSelectedIndex(); } + /** + * Add a new pickmap. + * @param mapSize the pickmap size in squares + * @param pickmapName the name of the pickmap + * @throws IOException if an I/O error occurs + * @throws DuplicatePickmapException if the pickmap name is not unique + */ + public void newPickmap(@NotNull final Size2D mapSize, @NotNull final String pickmapName) throws DuplicatePickmapException, IOException { + final MapFolder<G, A, R> activeMapFolder = this.activeMapFolder; + if (activeMapFolder == null) { + return; + } + + if (!MapFile.isValidPickmapName(pickmapName)) { + throw new IOException("invalid pickmap name: " + pickmapName); + } + + for (final MapFile<G, A, R> mapFile : activeMapFolder) { + if (pickmapName.equals(mapFile.getFile().getName())) { + throw new DuplicatePickmapException(pickmapName); + } + } + final File file = new File(activeMapFolder.getDir(), pickmapName); + + if (file.isDirectory()) { + throw new IOException("pickmap file is a directory: " + file); + } + if (file.exists()) { + throw new IOException("pickmap file exists: " + file); + } + + final File dir = file.getParentFile(); + if (!dir.exists()) { + if (!dir.mkdirs()) { + throw new IOException("cannot create directory: " + dir); + } + } + + final A mapArchObject = mapArchObjectFactory.newMapArchObject(true); + mapArchObject.setMapSize(mapSize); + mapArchObject.setMapName(pickmapName); + final MapControl<G, A, R> mapControl = pickmapManager.newMap(null, mapArchObject, file, false); + try { + mapControl.save(); + } finally { + pickmapManager.release(mapControl); + } + + final MapFile<G, A, R> mapFile; + try { + mapFile = activeMapFolder.addPickmap(pickmapName, mapReaderFactory, pickmapManager); + } catch (final InvalidNameException ex) { + throw new AssertionError(ex); // the name has been checked before + } + setActivePickmap(mapFile); + } + } 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-15 19:11:50 UTC (rev 9440) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:31:13 UTC (rev 9441) @@ -155,6 +155,7 @@ import net.sf.gridarta.gui.panel.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl; import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserModel; +import net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView; import net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.panel.tools.ToolPalette; @@ -340,8 +341,9 @@ newMapDialogFactory = editorFactory.newNewMapDialogFactory(mapViewsManager, projectModel.getMapArchObjectFactory(), parent); final PickmapChooserModel<G, A, R> pickmapChooserModel = new PickmapChooserModel<G, A, R>(); final PickmapSettings pickmapSettings = new DefaultPickmapSettings(); - final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, projectModel.getMapArchObjectFactory(), projectModel.getMapReaderFactory(), mapFolderTree, projectModel.getMapManager(), parent, projectModel.getPickmapManager(), mapViewsManager); - newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); + final PickmapChooserView<G, A, R> pickmapChooserView = new PickmapChooserView<G, A, R>(pickmapChooserModel, mapFolderTree, projectModel.getMapArchObjectFactory(), projectModel.getMapReaderFactory(), projectModel.getPickmapManager()); + final PickmapChooserControl<G, A, R> pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, pickmapSettings, newMapDialogFactory, mapFolderTree, projectModel.getMapManager(), parent, mapViewsManager, pickmapChooserView); + newMapDialogFactory.setPickmapChooserView(pickmapChooserView); final CFTreasureListTree treasureListTree = new CFTreasureListTree(projectModel.getTreasureTree(), parent, projectModel.getArchetypeSet(), projectModel.getFaceObjectProviders(), systemIcons); final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); final ImageIcon unknownSquareIcon = systemIcons.getUnknownSquareIcon(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:11:54
|
Revision: 9440 http://sourceforge.net/p/gridarta/code/9440 Author: akirschbaum Date: 2013-10-15 19:11:50 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove dependency ProjectModel -> MapViewSettings. Modified Paths: -------------- 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/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 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-15 19:06:21 UTC (rev 9439) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:11:50 UTC (rev 9440) @@ -184,6 +184,7 @@ import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; import net.sf.gridarta.model.pickmapsettings.DefaultPickmapSettings; @@ -296,6 +297,7 @@ * Creates a new instance. * @param projectModel the project model to edit * @param projectSettings the project settings instance + * @param mapViewSettings the map view settings * @param editorSettings the editor settings instance * @param errorView the error view for reporting errors * @param guiUtils the gui utils for creating icons @@ -311,10 +313,10 @@ * @param rendererFactory the renderer factory instance * @param filterControl the filter control instance */ - public GUIMainControl(@NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl) { + public GUIMainControl(@NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final EditorSettings editorSettings, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl) { this.projectModel = projectModel; final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); - mapViewsManager = new MapViewsManager<G, A, R>(projectModel.getMapViewSettings(), mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); + mapViewsManager = new MapViewsManager<G, A, R>(mapViewSettings, mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); scriptExtension = editorFactory.getScriptExtension(); final DisplayMode<G, A, R> displayModeGameObjectNames = new DisplayNameCellRenderer<G, A, R>(projectModel.getFaceObjectProviders()); final DisplayMode<G, A, R> displayModeArchetypeNames = new ArchetypeNameCellRenderer<G, A, R>(projectModel.getFaceObjectProviders()); @@ -351,7 +353,7 @@ final GameObjectMatcher belowFloorMatcher = projectModel.getGameObjectMatchers().getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_below_floor", "below_floor"); final GameObjectMatcher systemObjectMatcher = projectModel.getGameObjectMatchers().getMatcher("system_system_object"); final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(projectModel.getTopmostInsertionMode(), floorMatcher, wallMatcher, belowFloorMatcher, systemObjectMatcher); - final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(projectModel.getMapViewSettings(), projectModel.getGameObjectFactory(), projectModel.getMapArchObjectFactory(), projectModel.getMapModelFactory(), insertionModeSet); + final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, projectModel.getGameObjectFactory(), projectModel.getMapArchObjectFactory(), projectModel.getMapModelFactory(), insertionModeSet); final FindDialogManager<G, A, R> findDialogManager = new FindDialogManager<G, A, R>(parent, mapViewManager); final Exiter exiter = new DefaultExiter(parent); scriptEditControl = new ScriptEditControl(editorFactory.getScriptFileFilter(), scriptExtension, parent, projectSettings.getMapsDirectory(), preferences, exiter); @@ -373,14 +375,14 @@ final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(projectModel.getMapManager(), exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, editorFactory.getLockedItemsTypeNumbers()); final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(parent, editorFactory.getDirectionMap(), mapPathNormalizer, fileControl, mapViewsManager); - final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, projectModel.getMapViewSettings(), mapViewsManager, enterMap); + final EditorAction mapActions = new MapActions<G, A, R>(parent, projectModel.getMapManager(), mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, editorFactory.isAllowRandomMapParameters(), mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); final File scriptsFile = new File(projectSettings.getMapsDirectory(), editorFactory.getScriptsDir()); updaterManager = new UpdaterManager(exiter, projectModel.getMapManager(), parent, editorFactory.getGridartaJarFilename()); final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, projectModel.getArchetypeTypeSet()); final EditorAction undoControl = new UndoControl<G, A, R>(projectModel.getMapManager(), projectModel.getGameObjectFactory(), projectModel.getGameObjectMatchers()); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); - final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(projectModel.getMapViewSettings(), projectModel.getMapManager()); + final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, projectModel.getMapManager()); final EditorAction mapFileActions = new MapFileActions<G, A, R>(imageCreator2, projectModel.getMapManager(), mapViewsManager, mapViewManager, fileControl, parent); final BookmarksMapMenuPreferences bookmarksMapMenuPreferences = new BookmarksMapMenuPreferences(); final MapMenu mapMenu = bookmarksMapMenuPreferences.getMapMenu(); @@ -393,14 +395,14 @@ final ArchetypeChooserView<G, A, R> archetypeChooserView = new ArchetypeChooserView<G, A, R>(editorFactory.isCreateDirectionPane(), projectModel.getArchetypeChooserModel(), projectModel.getFaceObjectProviders(), displayGameObjectNamesAction, displayArchetypeNamesAction, displayIconsOnlyAction, displayModeGameObjectNames, displayModeArchetypeNames, displayModeIconsOnly); final ArchetypeChooserControl<G, A, R> archetypeChooserControl = new ArchetypeChooserControl<G, A, R>(projectModel.getArchetypeChooserModel(), archetypeChooserView, editorFactory.isCreateDirectionPane(), projectModel.getFaceObjectProviders()); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, projectModel.getArchetypeChooserModel(), pickmapChooserModel, projectModel.getArchetypeTypeSet()); - final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(projectModel.getMapViewSettings(), selectedSquareModel, objectChooser, pickmapSettings, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); - final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, projectModel.getMapManager(), selectedSquareModel, projectModel.getGameObjectFactory(), projectModel.getMapViewSettings()); + final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareModel, objectChooser, pickmapSettings, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); + final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, projectModel.getMapManager(), selectedSquareModel, projectModel.getGameObjectFactory(), mapViewSettings); final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, false, 0, true); newMapDialogFactory.setObjectChooser(objectChooser); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(parent, copyBuffer, objectChooser, mapViewManager, projectModel.getFaceObjectProviders(), insertionModeSet); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(projectModel.getArchetypeSet(), gameObjectAttributesModel, objectChooser, projectModel.getMapManager(), projectModel.getFaceObjectProviders()); final PluginController<G, A, R> pluginControl = new PluginController<G, A, R>(filterControl, pluginModel, parent, pluginParameterViewFactory, scriptsFile, systemIcons); - final EditorAction mainActions = new MainActions<G, A, R>(findDialogManager, replaceDialogManager, mainViewFrame, projectModel.getMapViewSettings(), projectModel.getArchetypeSet(), copyBuffer, objectChooser, projectModel.getMapManager(), mapViewManager, insertionModeSet); + final EditorAction mainActions = new MainActions<G, A, R>(findDialogManager, replaceDialogManager, mainViewFrame, mapViewSettings, projectModel.getArchetypeSet(), copyBuffer, objectChooser, projectModel.getMapManager(), mapViewManager, insertionModeSet); final EditorAction mapCursorActions = new MapCursorActions<G, A, R>(mapViewManager); final Action moveSquareDownAction = createAction("moveSquareDown", "Selected Square View", new MoveSquareDownAction<G, A, R>(selectedSquareModel, projectModel.getMapManager())); final Action moveSquareUpAction = createAction("moveSquareUp", "Selected Square View", new MoveSquareUpAction<G, A, R>(selectedSquareModel, projectModel.getMapManager())); @@ -436,7 +438,7 @@ createAction("enterSouthWestMap", "Map Navigation", mapActions); createAction("enterNorthWestMap", "Map Navigation", mapActions); createToggleAction("gridVisible", "Map Navigation", mapActions); - createToggleAction("lightVisible", "Map Navigation", new LightVisibleAction(projectModel.getMapViewSettings())); + createToggleAction("lightVisible", "Map Navigation", new LightVisibleAction(mapViewSettings)); createToggleAction("smoothing", "Map Navigation", mapActions); createToggleAction("doubleFaces", "Map Navigation", mapActions); createToggleAction("tileShow", "Map Navigation", mapActions); @@ -516,8 +518,8 @@ createAction("subFromSelection", "Map Cursor,Map/Selection", new SubFromSelectionAction<G, A, R>(mapViewManager)); createAction("startStopDrag", "Map Cursor,Map/Selection", new StartStopDragAction<G, A, R>(mapViewManager)); createAction("releaseDrag", "Map Cursor,Map/Selection", new ReleaseDragAction<G, A, R>(mapViewManager)); - createAction("insertArch", "Map Cursor,Map", new InsertArchAction<G, A, R>(mapViewManager, objectChooser, projectModel.getMapViewSettings())); - createAction("deleteArch", "Map Cursor,Map", new DeleteArchAction<G, A, R>(mapViewManager, projectModel.getMapViewSettings())); + createAction("insertArch", "Map Cursor,Map", new InsertArchAction<G, A, R>(mapViewManager, objectChooser, mapViewSettings)); + createAction("deleteArch", "Map Cursor,Map", new DeleteArchAction<G, A, R>(mapViewManager, mapViewSettings)); createAction("selectArchAbove", "Map Cursor,Selected Square View", new SelectArchBelowAction<G, A, R>(mapViewManager)); createAction("selectArchBelow", "Map Cursor,Selected Square View", new SelectArchAboveAction<G, A, R>(mapViewManager)); createAction("archAttributes", "Map", new ArchAttributesAction<G, A, R>(mapViewManager, gameObjectAttributesDialogFactory)); @@ -539,7 +541,7 @@ mainViewFrame.add(new MainToolbar(editorSettings).getComponent(), BorderLayout.NORTH); mainViewFrame.add(statusBar, BorderLayout.SOUTH); mainView.addTab(gameObjectTab); - mainView.addTab(new Tab("selectedSquare", new SelectedSquareView<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, mapViewManager, projectModel.getMapViewSettings(), editorFactory.getCompassIcon(guiUtils), projectModel.getFaceObjectProviders(), unknownSquareIcon, moveSquareUpAction, moveSquareDownAction, moveSquareTopAction, moveSquareBottomAction, moveSquareEnvAction, moveSquareInvAction), Location.RIGHT, false, 1, true)); + mainView.addTab(new Tab("selectedSquare", new SelectedSquareView<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, mapViewManager, mapViewSettings, editorFactory.getCompassIcon(guiUtils), projectModel.getFaceObjectProviders(), unknownSquareIcon, moveSquareUpAction, moveSquareDownAction, moveSquareTopAction, moveSquareBottomAction, moveSquareEnvAction, moveSquareInvAction), Location.RIGHT, false, 1, true)); mainView.addTab(new Tab("tools", toolPalette, Location.LEFT, false, 2, false)); mainView.addTab(new Tab("objects", objectChooser, Location.LEFT, false, 3, true)); final JMenu windowMenu = MenuUtils.getMenu(menuBar, "window"); 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-15 19:06:21 UTC (rev 9439) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GridartaEditor.java 2013-10-15 19:11:50 UTC (rev 9440) @@ -55,6 +55,8 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapviewsettings.DefaultMapViewSettings; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.NamedGameObjectMatcher; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; @@ -219,7 +221,8 @@ final NamedFilter defaultNamedFilterList = new NamedFilter(projectModel.getGameObjectMatchers().getFilters()); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); - final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(projectModel.getMapViewSettings(), filterControl, projectModel.getGameObjectParser(), projectModel.getFaceObjectProviders(), systemIcons, projectModel.getSmoothFaces()); + final MapViewSettings mapViewSettings = new DefaultMapViewSettings(); + final RendererFactory<G, A, R> rendererFactory = editorFactory.newRendererFactory(mapViewSettings, filterControl, projectModel.getGameObjectParser(), projectModel.getFaceObjectProviders(), systemIcons, projectModel.getSmoothFaces()); final NamedFilter defaultFilterList = new NamedFilter(Collections.<NamedGameObjectMatcher>emptyList()); final PluginParameterFactory<G, A, R> pluginParameterFactory = new PluginParameterFactory<G, A, R>(projectModel.getArchetypeSet(), projectModel.getMapManager(), defaultFilterList, projectSettings); @@ -239,7 +242,7 @@ try { switch (mode) { case NORMAL: - returnCode = runNormal(args2, editorFactory, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, pluginModel, projectModel, projectSettings, editorSettings, pathManager, systemIcons, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, scriptArchEditor); + returnCode = runNormal(args2, editorFactory, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, pluginModel, projectModel, projectSettings, mapViewSettings, editorSettings, pathManager, systemIcons, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, scriptArchEditor); break; case BATCH_PNG: @@ -327,6 +330,7 @@ * @param pluginModel the plugin model to use * @param projectModel the project model to use * @param projectSettings the project settings + * @param mapViewSettings the map view settings * @param editorSettings the editor settings * @param pathManager the path manager * @param systemIcons the system icons for creating icons @@ -336,13 +340,13 @@ * @param scriptArchEditor the script arch editor * @return return code suitable for passing to {@link System#exit(int)} */ - private int runNormal(@NotNull final Iterable<String> args, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor) { + private int runNormal(@NotNull final Iterable<String> args, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final EditorSettings editorSettings, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor) { final GUIMainControl<?, ?, ?>[] guiMainControl = new GUIMainControl<?, ?, ?>[1]; final Runnable runnable = new Runnable() { @Override public void run() { - guiMainControl[0] = new GUIMainControl<G, A, R>(projectModel, projectSettings, editorSettings, errorView, guiUtils, pluginModel, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, editorFactory, pathManager, systemIcons, configSourceFactory, rendererFactory, filterControl); + guiMainControl[0] = new GUIMainControl<G, A, R>(projectModel, projectSettings, mapViewSettings, editorSettings, errorView, guiUtils, pluginModel, scriptArchEditor, scriptedEventEditor, scriptArchDataUtils, scriptArchUtils, editorFactory, pathManager, systemIcons, configSourceFactory, rendererFactory, filterControl); } }; Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 19:06:21 UTC (rev 9439) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 19:11:50 UTC (rev 9440) @@ -73,8 +73,6 @@ import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mapmodel.TopmostInsertionMode; -import net.sf.gridarta.model.mapviewsettings.DefaultMapViewSettings; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.GameObjectMatchersParser; @@ -142,9 +140,6 @@ private final GameObjectMatchers gameObjectMatchers; @NotNull - private final MapViewSettings mapViewSettings = new DefaultMapViewSettings(); - - @NotNull private final GameObjectParser<G, A, R> gameObjectParser; @NotNull @@ -476,11 +471,6 @@ } @NotNull - public MapViewSettings getMapViewSettings() { - return mapViewSettings; - } - - @NotNull public GameObjectParser<G, A, R> getGameObjectParser() { return gameObjectParser; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 19:06:35
|
Revision: 9439 http://sourceforge.net/p/gridarta/code/9439 Author: akirschbaum Date: 2013-10-15 19:06:21 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove dependency MapCursor -> MapViewSettings. 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/action/DeleteArchAction.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.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/test/java/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapcursor/MapCursor.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.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-15 18:57:22 UTC (rev 9438) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -405,8 +405,8 @@ */ @NotNull @Override - public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager, @NotNull final MapViewSettings mapViewSettings) { - return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXLen(), isoMapSquareInfo.getYLen(), pathManager, mapViewSettings); + public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager) { + return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXLen(), isoMapSquareInfo.getYLen(), pathManager); } /** 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-15 18:57:22 UTC (rev 9438) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -296,8 +296,8 @@ */ @NotNull @Override - public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager, @NotNull final MapViewSettings mapViewSettings) { - return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT, pathManager, mapViewSettings); + public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager) { + return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT, pathManager); } /** 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-15 18:57:22 UTC (rev 9438) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -404,8 +404,8 @@ */ @NotNull @Override - public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager, @NotNull final MapViewSettings mapViewSettings) { - return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXLen(), isoMapSquareInfo.getYLen(), pathManager, mapViewSettings); + public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager) { + return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXLen(), isoMapSquareInfo.getYLen(), pathManager); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/action/DeleteArchAction.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/action/DeleteArchAction.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/action/DeleteArchAction.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -25,6 +25,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcursor.MapCursor; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.utils.EditorAction; import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; @@ -37,6 +38,12 @@ public class DeleteArchAction<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractMapCursorAction<G, A, R> implements EditorAction { /** + * The {@link MapViewSettings} for querying options. + */ + @NotNull + private final MapViewSettings mapViewSettings; + + /** * The {@link Action} associated with this editor action. Set to {@code * null} if no action is associated. */ @@ -46,9 +53,11 @@ /** * Creates a new instance. * @param mapViewManager the map view manager + * @param mapViewSettings the map view settings for querying options */ - public DeleteArchAction(@NotNull final MapViewManager<G, A, R> mapViewManager) { + public DeleteArchAction(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final MapViewSettings mapViewSettings) { super(mapViewManager); + this.mapViewSettings = mapViewSettings; } /** @@ -74,7 +83,7 @@ */ private boolean doDeleteArch(final boolean performAction) { final MapCursor<G, A, R> mapCursor = getActiveMapCursor(); - return mapCursor != null && mapCursor.deleteSelectedGameObject(performAction); + return mapCursor != null && mapCursor.deleteSelectedGameObject(performAction, mapViewSettings.isAutojoin()); } /** Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -30,7 +30,6 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapgrid.MapGrid; import net.sf.gridarta.model.mapmodel.MapModel; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -70,25 +69,17 @@ private final PathManager pathManager; /** - * The {@link MapViewSettings} instance. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * Creates a new instance. * @param rendererFactory the renderer factory to use * @param xScrollDistance the x distance when scrolling * @param yScrollDistance the y distance when scrolling * @param pathManager the path manager for converting path names - * @param mapViewSettings the map view settings instance */ - public DefaultMapViewFactory(@NotNull final RendererFactory<G, A, R> rendererFactory, final int xScrollDistance, final int yScrollDistance, @NotNull final PathManager pathManager, @NotNull final MapViewSettings mapViewSettings) { + public DefaultMapViewFactory(@NotNull final RendererFactory<G, A, R> rendererFactory, final int xScrollDistance, final int yScrollDistance, @NotNull final PathManager pathManager) { this.rendererFactory = rendererFactory; this.xScrollDistance = xScrollDistance; this.yScrollDistance = yScrollDistance; this.pathManager = pathManager; - this.mapViewSettings = mapViewSettings; } /** @@ -101,7 +92,7 @@ final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); final AbstractMapRenderer<G, A, R> renderer = mapControl.isPickmap() ? rendererFactory.newPickmapRenderer(mapModel, mapGrid) : rendererFactory.newMapRenderer(mapModel, mapGrid); renderer.setFocusable(true); - final MapView<G, A, R> mapView = new DefaultMapView<G, A, R>(mapControl, viewCounter, pathManager, mapGrid, new MapCursor<G, A, R>(mapGrid, mapModel, mapViewSettings), renderer, viewPosition, xScrollDistance, yScrollDistance); + final MapView<G, A, R> mapView = new DefaultMapView<G, A, R>(mapControl, viewCounter, pathManager, mapGrid, new MapCursor<G, A, R>(mapGrid, mapModel), renderer, viewPosition, xScrollDistance, yScrollDistance); mapView.getInternalFrame().setJMenuBar(ACTION_BUILDER.createMenuBar(false, "mapwindow")); return mapView; } Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -466,7 +466,7 @@ final MapCursor<G, A, R> mapCursor = this.mapCursor; if (mapCursor != null && index < model.getSize()) { setSelectedIndex(index); - mapCursor.deleteSelectedGameObject(true); + mapCursor.deleteSelectedGameObject(true, mapViewSettings.isAutojoin()); } } 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-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/EditorFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -135,12 +135,11 @@ * Creates a new {@link MapViewFactory} instance. * @param rendererFactory the renderer factory to use * @param pathManager the path manager for converting path names - * @param mapViewSettings the map view settings to pass to the created map * view factories * @return the new instance */ @NotNull - MapViewFactory<G, A, R> newMapViewFactory(@NotNull RendererFactory<G, A, R> rendererFactory, @NotNull PathManager pathManager, @NotNull MapViewSettings mapViewSettings); + MapViewFactory<G, A, R> newMapViewFactory(@NotNull RendererFactory<G, A, R> rendererFactory, @NotNull PathManager pathManager); /** * Creates a new {@link AppPreferencesModel} instance. 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-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/GUIMainControl.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -313,7 +313,7 @@ */ public GUIMainControl(@NotNull final ProjectModel<G, A, R> projectModel, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final PluginModel<G, A, R> pluginModel, @NotNull final ScriptArchEditor<G, A, R> scriptArchEditor, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final ScriptArchDataUtils<G, A, R> scriptArchDataUtils, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final PathManager pathManager, @NotNull final SystemIcons systemIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl) { this.projectModel = projectModel; - final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager, projectModel.getMapViewSettings()); + final MapViewFactory<G, A, R> mapViewFactory = editorFactory.newMapViewFactory(rendererFactory, pathManager); mapViewsManager = new MapViewsManager<G, A, R>(projectModel.getMapViewSettings(), mapViewFactory, projectModel.getMapManager(), projectModel.getPickmapManager()); scriptExtension = editorFactory.getScriptExtension(); final DisplayMode<G, A, R> displayModeGameObjectNames = new DisplayNameCellRenderer<G, A, R>(projectModel.getFaceObjectProviders()); @@ -517,7 +517,7 @@ createAction("startStopDrag", "Map Cursor,Map/Selection", new StartStopDragAction<G, A, R>(mapViewManager)); createAction("releaseDrag", "Map Cursor,Map/Selection", new ReleaseDragAction<G, A, R>(mapViewManager)); createAction("insertArch", "Map Cursor,Map", new InsertArchAction<G, A, R>(mapViewManager, objectChooser, projectModel.getMapViewSettings())); - createAction("deleteArch", "Map Cursor,Map", new DeleteArchAction<G, A, R>(mapViewManager)); + createAction("deleteArch", "Map Cursor,Map", new DeleteArchAction<G, A, R>(mapViewManager, projectModel.getMapViewSettings())); createAction("selectArchAbove", "Map Cursor,Selected Square View", new SelectArchBelowAction<G, A, R>(mapViewManager)); createAction("selectArchBelow", "Map Cursor,Selected Square View", new SelectArchAboveAction<G, A, R>(mapViewManager)); createAction("archAttributes", "Map", new ArchAttributesAction<G, A, R>(mapViewManager, gameObjectAttributesDialogFactory)); Modified: trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java =================================================================== --- trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -76,7 +76,7 @@ // select + cut final CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> copyBuffer = TestMapControlCreatorUtils.newCopyBuffer(testMapControlCreator); - final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreatorUtils.newMapView(mapControl, testMapControlCreator.getMapModelCreator().getMapViewSettings()); + final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreatorUtils.newMapView(mapControl); mapView.getMapGrid().select(new Point(1, 1), SelectionMode.ADD); copyBuffer.cut(mapView, new Rectangle(1, 1, 1, 1)); Modified: trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java =================================================================== --- trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapgrid.MapGrid; import net.sf.gridarta.model.mapmodel.MapModel; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,21 +37,6 @@ public class TestMapViewFactory implements MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> { /** - * The {@link MapViewSettings} to pass to the created map view factories. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** - * Creates a new instance. - * @param mapViewSettings the map view settings instance to pass to the - * created map view factories - */ - public TestMapViewFactory(@NotNull final MapViewSettings mapViewSettings) { - this.mapViewSettings = mapViewSettings; - } - - /** * {@inheritDoc} */ @NotNull @@ -60,7 +44,7 @@ public MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @Nullable final Point viewPosition, final int viewCounter) { final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); - return new TestMapView(mapControl, mapGrid, new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(mapGrid, mapModel, mapViewSettings)); + return new TestMapView(mapControl, mapGrid, new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(mapGrid, mapModel)); } } Modified: trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java =================================================================== --- trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/gridarta/src/test/java/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -41,7 +41,6 @@ import net.sf.gridarta.model.mapgrid.MapGrid; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; /** @@ -59,14 +58,13 @@ /** * Creates a new {@link MapView} instance. * @param mapControl the associated map control - * @param mapViewSettings the map view settings instance to use * @return the map view instance */ @NotNull - public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @NotNull final MapViewSettings mapViewSettings) { + public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); - return new TestMapView(mapControl, mapGrid, new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(mapGrid, mapModel, mapViewSettings)); + return new TestMapView(mapControl, mapGrid, new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(mapGrid, mapModel)); } /** @@ -87,7 +85,7 @@ */ @NotNull public static MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> newMapViewsManager(@NotNull final TestMapControlCreator mapControlCreator) { - final MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> mapViewFactory = new TestMapViewFactory(mapControlCreator.getMapModelCreator().getMapViewSettings()); + final MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> mapViewFactory = new TestMapViewFactory(); return new MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype>(mapControlCreator.getMapModelCreator().getMapViewSettings(), mapViewFactory, mapControlCreator.getMapManager(), mapControlCreator.getPickmapManager()); } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapcursor/MapCursor.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapcursor/MapCursor.java 2013-10-15 18:57:22 UTC (rev 9438) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapcursor/MapCursor.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -33,7 +33,6 @@ import net.sf.gridarta.model.mapgrid.SelectionMode; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapSquare; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -91,12 +90,6 @@ private final MapModel<G, A, R> mapModel; /** - * The {@link MapViewSettings} for querying options. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * Used to test if coordinates are on the map. Created by MapGrid. */ @NotNull @@ -171,12 +164,10 @@ * construction. * @param mapGrid Cursor is bound to this grid * @param mapModel the map model of this cursor - * @param mapViewSettings the map view settings for querying options */ - public MapCursor(@NotNull final MapGrid mapGrid, @NotNull final MapModel<G, A, R> mapModel, @NotNull final MapViewSettings mapViewSettings) { + public MapCursor(@NotNull final MapGrid mapGrid, @NotNull final MapModel<G, A, R> mapModel) { this.mapGrid = mapGrid; this.mapModel = mapModel; - this.mapViewSettings = mapViewSettings; mapRec = mapGrid.getMapRec(); final MapGridListener mapGridListener = new MapGridListener() { @@ -680,9 +671,10 @@ * Deletes the selected game object. Does nothing if no game object is * selected. * @param performAction whether the action should be performed + * @param autoJoin whether to preform auto-joining * @return whether the action was or can be performed */ - public boolean deleteSelectedGameObject(final boolean performAction) { + public boolean deleteSelectedGameObject(final boolean performAction, final boolean autoJoin) { if (!onMap) { return false; } @@ -701,7 +693,7 @@ mapModel.beginTransaction("Delete"); // TODO; I18N/L10N try { G nextGameObject = mapSquare.getNext(gameObject); - mapModel.removeGameObject(gameObject, mapViewSettings.isAutojoin()); + mapModel.removeGameObject(gameObject, autoJoin); if (nextGameObject == null) { nextGameObject = mapSquare.getFirst(); } 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-15 18:57:22 UTC (rev 9438) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2013-10-15 19:06:21 UTC (rev 9439) @@ -30,7 +30,6 @@ import net.sf.gridarta.model.mapgrid.SelectionMode; import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; -import net.sf.gridarta.model.mapviewsettings.TestMapViewSettings; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -67,7 +66,7 @@ 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()), new TestMapViewSettings()); + final MapCursor<TestGameObject, TestMapArchObject, TestArchetype> cursor = new MapCursor<TestGameObject, TestMapArchObject, TestArchetype>(grid, mapModelCreator.newMapModel(gridSize.getWidth(), gridSize.getHeight())); cursor.addMapCursorListener(listener); Assert.assertFalse("MapCursor has to be disabled when created.", cursor.isActive()); listener.changedPosCounter = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 18:57:29
|
Revision: 9438 http://sourceforge.net/p/gridarta/code/9438 Author: akirschbaum Date: 2013-10-15 18:57:22 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove unused parameters. Modified Paths: -------------- 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/resource/DefaultResources.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/resource/DefaultResources.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/resource/DefaultResources.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReader.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReaderFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/io/GameObjectParser.java trunk/src/model/src/main/java/net/sf/gridarta/model/resource/AbstractResources.java trunk/src/model/src/test/java/net/sf/gridarta/model/io/DefaultMapReaderTest.java trunk/src/model/src/test/java/net/sf/gridarta/model/io/TestMapReaderFactory.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.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-15 18:48:53 UTC (rev 9437) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -450,8 +450,8 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { - return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { + return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } /** 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-15 18:48:53 UTC (rev 9437) +++ trunk/src/atrinik/src/main/java/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -34,7 +34,6 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.GameObjectParser; -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.ProjectSettings; @@ -99,15 +98,14 @@ * @param gameObjectParser the game object parser to use * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use - * @param mapViewSettings the map view settings instance * @param faceObjects the face objects instance * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { - super(gameObjectParser, archetypeSet, mapViewSettings); + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + super(gameObjectParser, archetypeSet); this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; 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-15 18:48:53 UTC (rev 9437) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -341,8 +341,8 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { - return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, smoothFaces, archFaceProvider, faceObjectProviders); + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { + return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, faceObjects, animationObjects, smoothFaces, archFaceProvider, faceObjectProviders); } /** Modified: trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/crossfire/src/main/java/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -34,7 +34,6 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.GameObjectParser; -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.ProjectSettings; @@ -106,7 +105,6 @@ * @param gameObjectParser the game object parser instance * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use - * @param mapViewSettings the map view settings instance * @param faceObjects the face objects instance * @param animationObjects the animation objects instance * @param smoothFaces the smooth faces instance @@ -114,8 +112,8 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final SmoothFaces smoothFaces, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { - super(gameObjectParser, archetypeSet, mapViewSettings); + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final SmoothFaces smoothFaces, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + super(gameObjectParser, archetypeSet); this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; 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-15 18:48:53 UTC (rev 9437) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -449,8 +449,8 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { - return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SmoothFaces smoothFaces) { + return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } /** Modified: trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/daimonin/src/main/java/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -34,7 +34,6 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.GameObjectParser; -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.ProjectSettings; @@ -93,15 +92,14 @@ * @param gameObjectParser the game object parser to use * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use - * @param mapViewSettings the map view settings instance * @param faceObjects the face objects instance * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { - super(gameObjectParser, archetypeSet, mapViewSettings); + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + super(gameObjectParser, archetypeSet); this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.faceObjects = faceObjects; 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-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -97,7 +97,7 @@ final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, projectModel.getArchetypeSet(), projectModel.getArchetypeTypeSet()); 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); + final MapReaderFactory<G, A> mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory); final MapWriter<G, A, R> mapWriter = new DefaultMapWriter<G, A, R>(mapArchObjectParserFactory, gameObjectParser); final AutojoinLists<G, A, R> autojoinLists = new AutojoinLists<G, A, R>(); final ArchetypeChooserModel<G, A, R> archetypeChooserModel = new ArchetypeChooserModel<G, A, R>(); Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -33,7 +33,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.utils.StringUtils; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -187,7 +186,7 @@ * {@inheritDoc} */ @Override - public void collectTempList(@NotNull final MapViewSettings mapViewSettings, final List<G> objects) { + public void collectTempList(@NotNull final List<G> objects) { final Collection<G> tailList = new ArrayList<G>(); for (final G gameObject : objects) { Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReader.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReader.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReader.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -30,7 +30,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.utils.IOUtils; import org.jetbrains.annotations.NotNull; @@ -59,12 +58,11 @@ * instance * @param mapArchObjectFactory the map arch object factory instance * @param gameObjectParser the game object parser instance - * @param mapViewSettings the map view settings instance * @param file the file to open * @throws IOException in case the file couldn't be read * @throws InvalidMapFormatException in case the file is in wrong format */ - public DefaultMapReader(@NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final File file) throws IOException { + public DefaultMapReader(@NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final File file) throws IOException { final FileInputStream fis = new FileInputStream(file); try { final InputStreamReader isr = new InputStreamReader(fis, IOUtils.MAP_ENCODING); @@ -85,7 +83,7 @@ fis.close(); } - gameObjectParser.collectTempList(mapViewSettings, objects); + gameObjectParser.collectTempList(objects); } /** Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReaderFactory.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReaderFactory.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/DefaultMapReaderFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -25,7 +25,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; /** @@ -53,24 +52,16 @@ private final GameObjectParserFactory<G, A, R> gameObjectParserFactory; /** - * The {@link MapViewSettings} instance to use. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * Creates a new instance. * @param mapArchObjectFactory the map arch object factory instance * @param mapArchObjectParserFactory the map arch object parser factory * instance * @param gameObjectParserFactory the game object parser factory instance - * @param mapViewSettings the map view settings instance */ - public DefaultMapReaderFactory(@NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final GameObjectParserFactory<G, A, R> gameObjectParserFactory, @NotNull final MapViewSettings mapViewSettings) { + public DefaultMapReaderFactory(@NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final GameObjectParserFactory<G, A, R> gameObjectParserFactory) { this.mapArchObjectFactory = mapArchObjectFactory; this.mapArchObjectParserFactory = mapArchObjectParserFactory; this.gameObjectParserFactory = gameObjectParserFactory; - this.mapViewSettings = mapViewSettings; } /** @@ -80,7 +71,7 @@ @Override public MapReader<G, A> newMapReader(@NotNull final File file) throws IOException { final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); - return new DefaultMapReader<G, A, R>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapViewSettings, file); + return new DefaultMapReader<G, A, R>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, file); } } Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/GameObjectParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/GameObjectParser.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/GameObjectParser.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -76,10 +75,9 @@ /** * Browse first through the archetype list and attach map arches to it then * browse through the face list and try to find the pictures. - * @param mapViewSettings the map view settings instance * @param objects the list of game objects to collect */ - void collectTempList(@NotNull MapViewSettings mapViewSettings, List<G> objects); + void collectTempList(@NotNull List<G> objects); /** * Returns the modified fields of a {@link GameObject}. These fields are Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/resource/AbstractResources.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/resource/AbstractResources.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/resource/AbstractResources.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -29,7 +29,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.settings.ProjectSettings; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; @@ -53,12 +52,6 @@ private final ArchetypeSet<G, A, R> archetypeSet; /** - * The {@link MapViewSettings} instance. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * Whether the resources have been loaded. */ private boolean loaded; @@ -72,12 +65,10 @@ * Creates a new instance. * @param gameObjectParser the game object parser to use * @param archetypeSet the archetype set to update - * @param mapViewSettings the map view settings instance */ - protected AbstractResources(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapViewSettings mapViewSettings) { + protected AbstractResources(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; - this.mapViewSettings = mapViewSettings; } /** @@ -85,7 +76,7 @@ * @param invObjects all archetypes */ private void finishRead(@NotNull final List<G> invObjects) { - gameObjectParser.collectTempList(mapViewSettings, invObjects); + gameObjectParser.collectTempList(invObjects); archetypeSet.connectFaces(); // attach faces to arches } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/io/DefaultMapReaderTest.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/io/DefaultMapReaderTest.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/io/DefaultMapReaderTest.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -32,8 +32,6 @@ import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; -import net.sf.gridarta.model.mapviewsettings.TestMapViewSettings; import net.sf.gridarta.utils.Size2D; import org.junit.Assert; import org.junit.Test; @@ -69,8 +67,7 @@ mapModel.insertArchToMap(arch1x1, null, new Point(0, 0), false); mapModel.insertArchToMap(arch1x1, null, new Point(1, 0), false); mapControl.save(); - final MapViewSettings mapViewSettings = new TestMapViewSettings(); - final DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> reader = mapControlCreator.newMapReader(mapViewSettings, mapFile); + final DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> reader = mapControlCreator.newMapReader(mapFile); final List<TestGameObject> objects = reader.getGameObjects(); Assert.assertEquals(6, objects.size()); Assert.assertEquals("arch1x1", objects.get(0).getArchetype().getArchetypeName()); Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/io/TestMapReaderFactory.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/io/TestMapReaderFactory.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/io/TestMapReaderFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -25,7 +25,6 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; /** @@ -53,24 +52,16 @@ private final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser; /** - * The {@link MapViewSettings} instance. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * Creates a new instance. * @param mapArchObjectParserFactory the map arch object parser factory * instance * @param mapArchObjectFactory the map arch object factory instance * @param gameObjectParser the game object parser instance - * @param mapViewSettings the map view settings instance */ - public TestMapReaderFactory(@NotNull final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<TestMapArchObject> mapArchObjectFactory, @NotNull final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser, @NotNull final MapViewSettings mapViewSettings) { + public TestMapReaderFactory(@NotNull final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<TestMapArchObject> mapArchObjectFactory, @NotNull final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser) { this.mapArchObjectParserFactory = mapArchObjectParserFactory; this.mapArchObjectFactory = mapArchObjectFactory; this.gameObjectParser = gameObjectParser; - this.mapViewSettings = mapViewSettings; } /** @@ -79,7 +70,7 @@ @NotNull @Override public MapReader<TestGameObject, TestMapArchObject> newMapReader(@NotNull final File file) throws IOException { - return new DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapViewSettings, file); + return new DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, file); } } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -49,8 +49,6 @@ import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; import net.sf.gridarta.model.mapmodel.TestMapModelHelper; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; -import net.sf.gridarta.model.mapviewsettings.TestMapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; import net.sf.gridarta.model.settings.ProjectSettings; @@ -157,8 +155,7 @@ exitMatcher = new ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype>(exitGameObjectMatcher); mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); gameObjectParser = mapModelCreator.newGameObjectParser(); - final TestMapViewSettings mapViewSettings = new TestMapViewSettings(); - mapReaderFactory = new TestMapReaderFactory(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapViewSettings); + mapReaderFactory = new TestMapReaderFactory(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser); projectSettings = new TestProjectSettings(); mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); @@ -324,15 +321,13 @@ /** * Creates a new instance. - * @param mapViewSettings the map view settings to pass to the map reader - * constructor * @param mapFile the file to pass to the map reader constructor * @return the map reader instance * @throws IOException if the map reader cannot be created */ @NotNull - public DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> newMapReader(@NotNull final MapViewSettings mapViewSettings, @NotNull final File mapFile) throws IOException { - return new DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapViewSettings, mapFile); + public DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> newMapReader(@NotNull final File mapFile) throws IOException { + return new DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapFile); } } Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectFactory.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -40,7 +40,6 @@ import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.MapControlFactory; import net.sf.gridarta.model.mapmodel.MapModelFactory; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.settings.ProjectSettings; @@ -128,7 +127,6 @@ * @param gameObjectParser the game object parser to use * @param archetypeSet the archetype set to use * @param archetypeParser the archetype parser to use - * @param mapViewSettings the map view settings to use * @param faceObjects the face objects to use * @param animationObjects the animation objects to use * @param archFaceProvider the arch face provider to use @@ -138,7 +136,7 @@ * @return the new instance */ @NotNull - AbstractResources<G, A, R> newResources(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull SmoothFaces smoothFaces); + AbstractResources<G, A, R> newResources(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull SmoothFaces smoothFaces); /** * Creates a new {@link MapArchObjectParserFactory} instance. Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:48:53 UTC (rev 9437) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:57:22 UTC (rev 9438) @@ -218,7 +218,7 @@ gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final AbstractArchetypeParser<G, A, R, ?> archetypeParser = projectFactory.newArchetypeParser(errorView, gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, projectSettings, smoothFaces); final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - resources = projectFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders, smoothFaces); + resources = projectFactory.newResources(gameObjectParser, archetypeSet, archetypeParser, faceObjects, animationObjects, archFaceProvider, faceObjectProviders, smoothFaces); loadArchetypes(errorView, projectSettings, archetypeSet, archetypeChooserModel, resources, configSource); faceObjectProviders.addFaceObjectProvidersListener(new FaceObjectProvidersListener() { @@ -230,7 +230,7 @@ }); final MapArchObjectParserFactory<A> mapArchObjectParserFactory = projectFactory.newMapArchObjectParserFactory(); mapArchObjectFactory = projectFactory.newMapArchObjectFactory(projectSettings); - mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, mapViewSettings); + mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory); final MapWriter<G, A, R> mapWriter = new DefaultMapWriter<G, A, R>(mapArchObjectParserFactory, gameObjectParser); final ValidatorPreferences validatorPreferences = new DefaultValidatorPreferences(); gameObjectMatchers = loadGameObjectMatchers(xmlHelper, errorView, projectSettings); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 18:48:56
|
Revision: 9437 http://sourceforge.net/p/gridarta/code/9437 Author: akirschbaum Date: 2013-10-15 18:48:53 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Remove unused parameter. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinListsParser.java trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinListsParser.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2013-10-15 18:47:19 UTC (rev 9436) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2013-10-15 18:48:53 UTC (rev 9437) @@ -35,7 +35,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; @@ -61,12 +60,11 @@ * Loads all the autojoin lists from the data file. * @param errorView the error view for reporting errors * @param archetypeSet the archetype set for looking up archetypes - * @param mapViewSettings the map view settings instance * @param baseDir the base directory to load autojoin info from * @return the loaded autojoin lists */ @NotNull - public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> AutojoinLists<G, A, R> loadList(@NotNull final ErrorView errorView, final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapViewSettings mapViewSettings, @NotNull final File baseDir) { + public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> AutojoinLists<G, A, R> loadList(@NotNull final ErrorView errorView, final ArchetypeSet<G, A, R> archetypeSet, @NotNull final File baseDir) { try { final URL url = IOUtils.getResource(baseDir, FILENAME); try { Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:47:19 UTC (rev 9436) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:48:53 UTC (rev 9437) @@ -235,7 +235,7 @@ final ValidatorPreferences validatorPreferences = new DefaultValidatorPreferences(); gameObjectMatchers = loadGameObjectMatchers(xmlHelper, errorView, projectSettings); validators = loadValidators(errorView, projectFactory, projectSettings, gameObjectMatchers, archetypeTypeSet, validatorPreferences, mapWriter); - final AutojoinLists<G, A, R> autojoinLists = AutojoinListsParser.loadList(errorView, archetypeSet, mapViewSettings, projectSettings.getConfigurationDirectory()); + final AutojoinLists<G, A, R> autojoinLists = AutojoinListsParser.loadList(errorView, archetypeSet, projectSettings.getConfigurationDirectory()); mapModelFactory = new MapModelFactory<G, A, R>(archetypeChooserModel, autojoinLists, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); final MapControlFactory<G, A, R> mapControlFactory = projectFactory.newMapControlFactory(mapWriter, projectSettings, mapModelFactory); mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, projectSettings, faceObjectProviders); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-10-15 18:47:25
|
Revision: 9436 http://sourceforge.net/p/gridarta/code/9436 Author: akirschbaum Date: 2013-10-15 18:47:19 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Do not calculate edit types unless the map has a map view. Removes dependency MapModelFactory -> MapViewSettings. Modified Paths: -------------- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapModelFactory.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/src/model/src/test/java/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java Modified: trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -57,6 +57,12 @@ private FileControl<G, A, R> fileControl; /** + * The {@link MapViewSettings} instance. + */ + @NotNull + private final MapViewSettings mapViewSettings; + + /** * The {@link MapViewFactory} to use. */ @NotNull @@ -148,6 +154,7 @@ * @param pickmapManager the pickmap manager to use */ public MapViewsManager(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapViewFactory<G, A, R> mapViewFactory, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager) { + this.mapViewSettings = mapViewSettings; this.mapViewFactory = mapViewFactory; this.mapManager = mapManager; mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); @@ -208,6 +215,7 @@ */ @NotNull public MapView<G, A, R> newMapView(@NotNull final MapControl<G, A, R> mapControl, @Nullable final Point viewPosition, @Nullable final Point centerSquare) { + mapControl.getMapModel().addActiveEditType(mapViewSettings.getEditType()); return getMapViewsInt(mapControl).newMapView(mapControl, viewPosition, centerSquare, mapViewFactory); } 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-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/gridarta/src/main/java/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -102,7 +102,7 @@ final AutojoinLists<G, A, R> autojoinLists = new AutojoinLists<G, A, R>(); final ArchetypeChooserModel<G, A, R> archetypeChooserModel = new ArchetypeChooserModel<G, A, R>(); final InsertionMode<G, A, R> topmostInsertionMode = new TopmostInsertionMode<G, A, R>(); - final MapModelFactory<G, A, R> mapModelFactory = new MapModelFactory<G, A, R>(archetypeChooserModel, autojoinLists, mapViewSettings, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + final MapModelFactory<G, A, R> mapModelFactory = new MapModelFactory<G, A, R>(archetypeChooserModel, autojoinLists, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); final MapControlFactory<G, A, R> mapControlFactory = editorFactory.newMapControlFactory(mapWriter, projectSettings, mapModelFactory); final MapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, projectSettings, projectModel.getFaceObjectProviders()); final Set<NamedGameObjectMatcher> matchers = new HashSet<NamedGameObjectMatcher>(); Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -223,17 +223,15 @@ * @param autojoinLists the autojoin lists instance to use * @param mapArchObject the map arch object to associate with this model * @param archetypeChooserModel the archetype chooser control - * @param activeEditType the active edit types * @param gameObjectFactory the game object factory for creating game * objects * @param gameObjectMatchers the game object matchers to use * @param topmostInsertionMode the "topmost" insertion mode */ - public DefaultMapModel(@NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final A mapArchObject, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final int activeEditType, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { + public DefaultMapModel(@NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final A mapArchObject, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { this.mapArchObject = mapArchObject; this.autojoinLists = autojoinLists; this.archetypeChooserModel = archetypeChooserModel; - this.activeEditType = activeEditType; this.gameObjectFactory = gameObjectFactory; this.gameObjectMatchers = gameObjectMatchers; this.topmostInsertionMode = topmostInsertionMode; Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapModelFactory.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapModelFactory.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/mapmodel/MapModelFactory.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -25,7 +25,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatchers; import org.jetbrains.annotations.NotNull; @@ -48,12 +47,6 @@ private final AutojoinLists<G, A, R> autojoinLists; /** - * The map view settings instance. - */ - @NotNull - private final MapViewSettings mapViewSettings; - - /** * The {@link GameObjectFactory} for creating {@link GameObject * GameObjects}. */ @@ -76,16 +69,14 @@ * Creates a new instance. * @param archetypeChooserModel the archetype chooser model to use * @param autojoinLists the autojoin lists to use - * @param mapViewSettings the map view settings instance * @param gameObjectFactory the game object factory for creating game * objects * @param gameObjectMatchers the game object matchers to use * @param topmostInsertionMode the "topmost" insertion mode */ - public MapModelFactory(@NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final MapViewSettings mapViewSettings, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { + public MapModelFactory(@NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final InsertionMode<G, A, R> topmostInsertionMode) { this.archetypeChooserModel = archetypeChooserModel; this.autojoinLists = autojoinLists; - this.mapViewSettings = mapViewSettings; this.gameObjectFactory = gameObjectFactory; this.gameObjectMatchers = gameObjectMatchers; this.topmostInsertionMode = topmostInsertionMode; @@ -98,7 +89,7 @@ */ @NotNull public MapModel<G, A, R> newMapModel(@NotNull final A mapArchObject) { - return new DefaultMapModel<G, A, R>(autojoinLists, mapArchObject, archetypeChooserModel, mapViewSettings.getEditType(), gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + return new DefaultMapModel<G, A, R>(autojoinLists, mapArchObject, archetypeChooserModel, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } } Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -163,7 +163,7 @@ mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); pathManager = new PathManager(projectSettings); - mapModelFactory = new MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype>(archetypeChooserModel, mapModelCreator.getAutojoinLists(), mapViewSettings, mapModelCreator.getGameObjectFactory(), mapModelCreator.getGameObjectMatchers(), mapModelCreator.getTopmostInsertionMode()); + mapModelFactory = new MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype>(archetypeChooserModel, mapModelCreator.getAutojoinLists(), mapModelCreator.getGameObjectFactory(), mapModelCreator.getGameObjectMatchers(), mapModelCreator.getTopmostInsertionMode()); mapControlFactory = new TestMapControlFactory(mapWriter, projectSettings, mapModelFactory); final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, projectSettings, mapModelCreator.getFaceObjectProviders()); tmpMapManager.setFileControl(fileControl); Modified: trunk/src/model/src/test/java/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/src/model/src/test/java/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/model/src/test/java/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -170,7 +170,7 @@ public MapModel<TestGameObject, TestMapArchObject, TestArchetype> newMapModel(final int w, final int h) { final TestMapArchObject mapArchObject = new TestMapArchObject(); mapArchObject.setMapSize(new Size2D(w, h)); - return new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + return new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, mapArchObject, archetypeChooserModel, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); } /** Modified: trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java =================================================================== --- trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:31:19 UTC (rev 9435) +++ trunk/src/project/src/main/java/net/sf/gridarta/project/ProjectModel.java 2013-10-15 18:47:19 UTC (rev 9436) @@ -236,7 +236,7 @@ gameObjectMatchers = loadGameObjectMatchers(xmlHelper, errorView, projectSettings); validators = loadValidators(errorView, projectFactory, projectSettings, gameObjectMatchers, archetypeTypeSet, validatorPreferences, mapWriter); final AutojoinLists<G, A, R> autojoinLists = AutojoinListsParser.loadList(errorView, archetypeSet, mapViewSettings, projectSettings.getConfigurationDirectory()); - mapModelFactory = new MapModelFactory<G, A, R>(archetypeChooserModel, autojoinLists, mapViewSettings, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); + mapModelFactory = new MapModelFactory<G, A, R>(archetypeChooserModel, autojoinLists, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); final MapControlFactory<G, A, R> mapControlFactory = projectFactory.newMapControlFactory(mapWriter, projectSettings, mapModelFactory); mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, projectSettings, faceObjectProviders); pickmapManager = new DefaultPickmapManager<G, A, R>(mapReaderFactory, mapControlFactory, projectSettings, faceObjectProviders); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |