From: <aki...@us...> - 2008-08-28 18:20:00
|
Revision: 5010 http://gridarta.svn.sourceforge.net/gridarta/?rev=5010&view=rev Author: akirschbaum Date: 2008-08-28 18:20:08 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Make import spells work again. Modified Paths: -------------- trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/daimonin/src/daieditor/messages.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -50,10 +50,6 @@ enterTileIOException.title=Invalid path enterTileIOException.message=Failed to load file for tiled map.\n{0} -importSpellsSuccess.title=Collect spells -importSpellsSuccess.message=Successfully collected {0} spells. -importSpellsFailed.title=Collect spells -importSpellsFailed.message=Collecting spells failed!\nMaybe the specified file is of wrong format. loadArchesNoArchfiles.title=No archfiles loadArchesNoArchfiles.message=No archfiles could be found. If you have no archfiles\nyet, you need to download them. If you do, make sure\nthe path is correct under menu ''File->Options''. Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -50,10 +50,6 @@ enterTileIOException.title=Ung\xFCltiger Pfad enterTileIOException.message=Kann verbundene Karte nicht laden.\n{0} -importSpellsSuccess.title=Zauberspr\xFCche sammeln -importSpellsSuccess.message={0} Zauberspr\xFCche geladen. -importSpellsFailed.title=Zauberspr\xFCche sammeln -importSpellsFailed.message=Das Sammeln der Zauberspr\xFCche ist fehlgeschlagen.\nEvtl. ist das Dateiformat falsch? loadArchesNoArchfiles.title=Keine Archetypen gefunden loadArchesNoArchfiles.message=Es konnten keine Archetypen gefunden werden.\nBitte stellen Sie sicher, dass der Pfad\nunter ''Datei->Optionen...'' korrekt ist. Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -50,10 +50,6 @@ #enterTileIOException.title= #enterTileIOException.message= -#importSpellsSuccess.title= -#importSpellsSuccess.message= -#importSpellsFailed.title= -#importSpellsFailed.message= #loadArchesNoArchfiles.title= #loadArchesNoArchfiles.message= Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -50,10 +50,6 @@ enterTileIOException.title=Ogiltig s\xF6kv\xE4g enterTileIOException.message=Misslyckades \xF6ppna filen f\xF6r s\xF6kv\xE4gen.\n{0} -importSpellsSuccess.title=Sammanst\xE4ll trollformler -importSpellsSuccess.message=Lyckades sammanst\xE4lla {0} trollformler. -importSpellsFailed.title=Sammanst\xE4ll trollformler -importSpellsFailed.message=Sammanst\xE4llning av trollformler misslyckades.\nVar den angivna filen inte av r\xE4tt format? loadArchesNoArchfiles.title=Inga arketypfiler loadArchesNoArchfiles.message=Inga arketypfiler kunde hittas. Om du saknar arketypfiler\n m\xE5ste du ladda hem dom. Om du g\xF6r detta, se till\natt s\xF6kv\xE4gen under ''Arkiv->Inst\xE4llningar'' \xE4r korrekt. Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -1102,3 +1102,11 @@ moveTileUp.shortdescription=Move Object up in Square moveTileDown.shortdescription=Move Object down in Square moveTileBottom.shortdescription=Move Object to bottom of Square + + +############### +# SpellsUtils +importSpellsSuccess.title=Collect spells +importSpellsSuccess.message=Successfully collected {0} spells. +importSpellsFailed.title=Collect spells +importSpellsFailed.message=Collecting spells failed!\nMaybe the specified file is of wrong format. Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -959,3 +959,11 @@ moveTileUp.shortdescription=Objekt nach oben verschieben moveTileDown.shortdescription=Objekt nach unten verschieben moveTileBottom.shortdescription=Object ans Ende verschieben + + +############### +# SpellsUtils +importSpellsSuccess.title=Zauberspr\xFCche sammeln +importSpellsSuccess.message={0} Zauberspr\xFCche geladen. +importSpellsFailed.title=Zauberspr\xFCche sammeln +importSpellsFailed.message=Das Sammeln der Zauberspr\xFCche ist fehlgeschlagen.\nEvtl. ist das Dateiformat falsch? Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -955,3 +955,11 @@ #moveTileUp.shortdescription= #moveTileDown.shortdescription= #moveTileBottom.shortdescription= + + +############### +# SpellsUtils +#importSpellsSuccess.title= +#importSpellsSuccess.message= +#importSpellsFailed.title= +#importSpellsFailed.message= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-08-26 19:01:00 UTC (rev 5009) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-08-28 18:20:08 UTC (rev 5010) @@ -958,3 +958,11 @@ moveTileUp.shortdescription=Flytta upp objekt moveTileDown.shortdescription=Flytta ner objekt #moveTileBottom.shortdescription= + + +############### +# SpellsUtils +importSpellsSuccess.title=Sammanst\xE4ll trollformler +importSpellsSuccess.message=Lyckades sammanst\xE4lla {0} trollformler. +importSpellsFailed.title=Sammanst\xE4ll trollformler +importSpellsFailed.message=Sammanst\xE4llning av trollformler misslyckades.\nVar den angivna filen inte av r\xE4tt format? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-29 20:02:50
|
Revision: 5013 http://gridarta.svn.sourceforge.net/gridarta/?rev=5013&view=rev Author: akirschbaum Date: 2008-08-29 20:02:59 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Ignore empty lines in .anim files. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-08-28 19:27:29 UTC (rev 5012) +++ trunk/crossfire/ChangeLog 2008-08-29 20:02:59 UTC (rev 5013) @@ -1,3 +1,7 @@ +2008-08-29 Andreas Kirschbaum + + * Ignore empty lines in .anim files. + 2008-08-18 Andreas Kirschbaum * Add option for running plugin scripts from the command line. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-08-28 19:27:29 UTC (rev 5012) +++ trunk/daimonin/ChangeLog 2008-08-29 20:02:59 UTC (rev 5013) @@ -1,5 +1,9 @@ -2008-08-16 Andreas Kirschbaum <xxx> +2008-08-29 Andreas Kirschbaum + * Ignore empty lines in .anim files. + +2008-08-16 Andreas Kirschbaum + * Add "fill" and "fill random". These new fill modes use the "auto" fill mode. Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-08-28 19:27:29 UTC (rev 5012) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-08-29 20:02:59 UTC (rev 5013) @@ -126,7 +126,7 @@ int lineNumber; for (lineNumber = 1; (line2 = in.readLine()) != null; lineNumber++) { final String line = line2.trim(); - if (line.startsWith("#")) { + if (line.startsWith("#") || line.length() == 0) { /* ignore comment lines. */ } else if (line.startsWith(startKey)) { if (inAnim) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-05 22:32:41
|
Revision: 5023 http://gridarta.svn.sourceforge.net/gridarta/?rev=5023&view=rev Author: akirschbaum Date: 2008-09-05 22:32:49 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Hide system game object matchers from the GUI. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/conf/GameObjectMatchers.xml trunk/resource/system/dtd/GameObjectMatchers.dtd trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatcherParser.java trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchers.java trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchersParser.java trunk/src/app/net/sf/gridarta/gameobject/match/NamedGameObjectMatcher.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/crossfire/ChangeLog 2008-09-05 22:32:49 UTC (rev 5023) @@ -1,3 +1,7 @@ +2008-09-06 Andreas Kirschbaum + + * Hide system game object matchers from the GUI. + 2008-08-29 Andreas Kirschbaum * Ignore empty lines in .anim files. Modified: trunk/crossfire/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/conf/GameObjectMatchers.xml 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/crossfire/resource/conf/GameObjectMatchers.xml 2008-09-05 22:32:49 UTC (rev 5023) @@ -129,4 +129,56 @@ <title xml:lang="de">Lebewesen</title> <Attrib name="alive" /> </GameObjectMatcher> + + <!-- Objects to be treated as floors in insertion tool --> + <GameObjectMatcher id="system_floor" system="true"> + <title xml:lang="en">Floor</title> + <title xml:lang="de">Boden</title> + <Attrib name="is_floor" /> + </GameObjectMatcher> + + <!-- Objects to be put below the floor in insertion tool --> + <GameObjectMatcher id="system_below_floor" system="true"> + <title xml:lang="en">Below Floor</title> + <title xml:lang="de">Unter Boden</title> + <TypeNrs numbers="-666" /> <!-- do not match anything for now --> + </GameObjectMatcher> + + <!-- Objects to be put below the floor in insertion tool --> + <GameObjectMatcher id="system_wall" system="true"> + <title xml:lang="en">Wall</title> + <title xml:lang="de">Wand</title> + <title xml:lang="fr">Murs</title> + <title xml:lang="sv">Väggar</title> + <And> + <TypeNrs numbers="0" /> + <Attrib name="move_block" op="ne" value="" /> + <Attrib name="is_floor" value="" /> + </And> + </GameObjectMatcher> + + <!-- Objects to be treated as monsters in insertion tool --> + <GameObjectMatcher id="system_monster" system="true"> + <title xml:lang="en">Monster</title> + <title xml:lang="de">Monster</title> + <title xml:lang="fr">Monstres</title> + <title xml:lang="sv">Monster</title> + <And> + <Attrib name="alive" /> + <Or> + <Attrib name="monster" /> + <Attrib name="generator" /> + </Or> + </And> + </GameObjectMatcher> + + <!-- Objects to be treated as exits by the GUI --> + <GameObjectMatcher id="system_exit" system="true"> + <title xml:lang="en">Exit</title> + <title xml:lang="de">Ausgang</title> + <title xml:lang="fr">Sorties</title> + <title xml:lang="sv">Utgångar</title> + <TypeNrs numbers="41 57 58 66 94 95" /> + </GameObjectMatcher> + </GameObjectMatchers> Modified: trunk/resource/system/dtd/GameObjectMatchers.dtd =================================================================== --- trunk/resource/system/dtd/GameObjectMatchers.dtd 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/resource/system/dtd/GameObjectMatchers.dtd 2008-09-05 22:32:49 UTC (rev 5023) @@ -7,6 +7,7 @@ <!ELEMENT GameObjectMatcher (title+,%Match;)> <!ATTLIST GameObjectMatcher id CDATA #IMPLIED + system (true|false) 'false' > <!ELEMENT title (#PCDATA)> Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-05 22:32:49 UTC (rev 5023) @@ -391,20 +391,20 @@ log.error("Cannot read GameObjectMatchers.xml: " + ex.getMessage()); } GameObjectMatchersInstance.setInstance(gameObjectMatchers); - final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("floor"); - final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("wall"); - final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcher("monster"); + final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); + final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("system_wall", "wall"); + final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcher("system_monster", "monster"); if (monsterMatcher == null) { log.fatal("GameObjectMatcher 'monster' does not exist"); throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); } - final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcher("below_floor"); + final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcher("system_below_floor", "below_floor"); if (belowFloorMatcher == null) { log.warn("GameObjectMatcher 'below_floor' does not exist"); } DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); - exitMatcher = gameObjectMatchers.getMatcher("exit"); + exitMatcher = gameObjectMatchers.getMatcher("system_exit", "exit"); if (exitMatcher == null) { log.fatal("GameObjectMatcher 'exit' does not exist"); throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); Modified: trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatcherParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatcherParser.java 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatcherParser.java 2008-09-05 22:32:49 UTC (rev 5023) @@ -73,6 +73,7 @@ if (title == null || title.length() == 0) { title = id; } + final boolean systemMatcher = el.getAttribute("system").equals("true"); final Node content; try { content = (Node) xpath.evaluate("*[last()]", el, XPathConstants.NODE); @@ -81,7 +82,7 @@ } assert content.getNodeType() == Node.ELEMENT_NODE; final GameObjectMatcher matcher = createMatcher((Element) content); - return new NamedGameObjectMatcher(editType, id, title, matcher); + return new NamedGameObjectMatcher(systemMatcher ? 0 : editType, id, title, systemMatcher, matcher); } /** Modified: trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchers.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchers.java 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchers.java 2008-09-05 22:32:49 UTC (rev 5023) @@ -22,10 +22,11 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import javax.xml.parsers.DocumentBuilder; import javax.xml.xpath.XPath; import net.sf.gridarta.gameobject.GameObject; @@ -75,12 +76,18 @@ /** * Returns a matcher by id. - * @param id the id + * @param ids the ids to find * @return the matcher, or <code>null</code> if no such matcher exists */ @Nullable - public NamedGameObjectMatcher getMatcher(@NotNull final String id) { - return gameObjectMatchersByIds.get(id); + public NamedGameObjectMatcher getMatcher(@NotNull final String... ids) { + for (final String id : ids) { + final NamedGameObjectMatcher matcher = gameObjectMatchersByIds.get(id); + if (matcher != null) { + return matcher; + } + } + return null; } /** @@ -88,7 +95,13 @@ * @return the filter game object matches */ public Collection<NamedGameObjectMatcher> getFilters() { - return Collections.unmodifiableCollection(gameObjectMatchersByIds.values()); + final Set<NamedGameObjectMatcher> result = new HashSet<NamedGameObjectMatcher>(gameObjectMatchersByIds.size()); + for (final NamedGameObjectMatcher matcher : gameObjectMatchersByIds.values()) { + if (!matcher.isSystemMatcher()) { + result.add(matcher); + } + } + return result; } /** Modified: trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchersParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchersParser.java 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/src/app/net/sf/gridarta/gameobject/match/GameObjectMatchersParser.java 2008-09-05 22:32:49 UTC (rev 5023) @@ -75,16 +75,17 @@ } int editType = 1; for (final Element node : new NodeListIterator<Element>(doc.getElementsByTagName("GameObjectMatcher"))) { - if (editType == 0) { - log.warn("Too many GameObjectMatchers, ignoring rest"); - break; - } final NamedGameObjectMatcher archObjectMatcher = aom.parseMatcher(node, editType); gameObjectMatchers.add(archObjectMatcher); if (archObjectMatcher.getID() != null) { gameObjectMatchersByIds.put(archObjectMatcher.getID(), archObjectMatcher); } - editType <<= 1; + if (editType != 0 && !archObjectMatcher.isSystemMatcher()) { + editType <<= 1; + if (editType == 0) { + log.warn("Too many GameObjectMatchers, ignoring rest"); + } + } } if (log.isInfoEnabled()) { log.info("Loaded " + gameObjectMatchers.size() + " GameObjectMatchers from '" + filename + "'."); Modified: trunk/src/app/net/sf/gridarta/gameobject/match/NamedGameObjectMatcher.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/match/NamedGameObjectMatcher.java 2008-08-29 21:08:16 UTC (rev 5022) +++ trunk/src/app/net/sf/gridarta/gameobject/match/NamedGameObjectMatcher.java 2008-09-05 22:32:49 UTC (rev 5023) @@ -40,6 +40,12 @@ /** The localized name. */ private final String name; + /** + * Whether this matcher is a system matcher. System matchers are not shown + * in the GUI. + */ + private final boolean systemMatcher; + /** The {@link GameObjectMatcher} to wrap. */ private final GameObjectMatcher gameObjectMatcher; @@ -52,12 +58,14 @@ * @param editType the edit type * @param id the ID for this <code>GameObjectMachter</code> * @param name the localized name + * @param systemMatcher whether this matcher is a system matcher * @param gameObjectMatcher the matcher to delegate to */ - public NamedGameObjectMatcher(final int editType, final String id, final String name, final GameObjectMatcher gameObjectMatcher) { + public NamedGameObjectMatcher(final int editType, final String id, final String name, final boolean systemMatcher, final GameObjectMatcher gameObjectMatcher) { this.editType = editType; this.id = id; this.name = name; + this.systemMatcher = systemMatcher; this.gameObjectMatcher = gameObjectMatcher; } @@ -92,4 +100,12 @@ return editType; } + /** + * Returns whether this matcher is a system matcher. + * @return whether this matcher is a system matcher + */ + public boolean isSystemMatcher() { + return systemMatcher; + } + } // class NamedGameObjectMatcher This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-06 00:03:31
|
Revision: 5024 http://gridarta.svn.sourceforge.net/gridarta/?rev=5024&view=rev Author: akirschbaum Date: 2008-09-06 00:03:42 +0000 (Sat, 06 Sep 2008) Log Message: ----------- Fix 'no face' issue for animated archetypes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-05 22:32:49 UTC (rev 5023) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-06 00:03:42 UTC (rev 5024) @@ -139,6 +139,8 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, mainView, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, toolPalette, autojoinLists, exitMatcher); ((DefaultMapControlFactory) mapControlFactory).init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); + archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { @@ -148,8 +150,6 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); - copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-05 22:32:49 UTC (rev 5023) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-06 00:03:42 UTC (rev 5024) @@ -198,6 +198,8 @@ // initialize & load MultiPositionData.init(getConfigurationDirectory()); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); + archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { @@ -207,8 +209,6 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); - copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:27:10
|
Revision: 5032 http://gridarta.svn.sourceforge.net/gridarta/?rev=5032&view=rev Author: akirschbaum Date: 2008-09-07 09:27:17 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Add MapControlFactory.init(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java trunk/src/app/net/sf/gridarta/map/MapControlFactory.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java 2008-09-07 09:16:49 UTC (rev 5031) +++ trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java 2008-09-07 09:27:17 UTC (rev 5032) @@ -96,16 +96,7 @@ super(gridartaObjectsFactory); } - /** - * Initializes the instance. - * @param gridartaObjectsFactory the gridarta objects factory to use - * @param rendererFactory the renderer factory to use - * @param mapActions the map actions to use - * @param archetypeChooserModel the archetype chooser model to use - * @param mapImageCache the map image cache to use - * @param autojoinLists the autojoin lists to use - * @param exitTypeGameObjectMatcher the matcher for exit objects - */ + /** {@inheritDoc} */ public void init(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final MapActions mapActions, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final GameObjectMatcher exitTypeGameObjectMatcher) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.rendererFactory = rendererFactory; Modified: trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java 2008-09-07 09:16:49 UTC (rev 5031) +++ trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java 2008-09-07 09:27:17 UTC (rev 5032) @@ -96,16 +96,7 @@ super(gridartaObjectsFactory); } - /** - * Creates a new instance. - * @param gridartaObjectsFactory the gridarta objects factory to use - * @param rendererFactory the renderer factory to use - * @param mapActions the map actions to use - * @param archetypeChooserModel the archetype chooser model to use - * @param mapImageCache the map image cache to use - * @param autojoinLists the autojoin lists to use - * @param exitTypeGameObjectMatcher the matcher for exit objects - */ + /** {@inheritDoc} */ public void init(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final MapActions mapActions, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final GameObjectMatcher exitTypeGameObjectMatcher) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.rendererFactory = rendererFactory; Modified: trunk/src/app/net/sf/gridarta/map/MapControlFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControlFactory.java 2008-09-07 09:16:49 UTC (rev 5031) +++ trunk/src/app/net/sf/gridarta/map/MapControlFactory.java 2008-09-07 09:27:17 UTC (rev 5032) @@ -23,10 +23,17 @@ import java.io.File; import java.io.IOException; import java.util.List; +import net.sf.gridarta.AutojoinLists; +import net.sf.gridarta.GridartaObjectsFactory; +import net.sf.gridarta.MapActions; +import net.sf.gridarta.MapImageCache; import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.gameobject.match.GameObjectMatcher; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.MapViewBasic; +import net.sf.gridarta.gui.map.RendererFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -37,6 +44,18 @@ public interface MapControlFactory<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, V extends MapViewBasic<G, A, R, V>> { /** + * Initializes the instance. + * @param gridartaObjectsFactory the gridarta objects factory to use + * @param rendererFactory the renderer factory to use + * @param mapActions the map actions to use + * @param archetypeChooserModel the archetype chooser model to use + * @param mapImageCache the map image cache to use + * @param autojoinLists the autojoin lists to use + * @param exitTypeGameObjectMatcher the matcher for exit objects + */ + void init(@NotNull GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull RendererFactory<G, A, R> rendererFactory, @NotNull MapActions mapActions, @NotNull ArchetypeChooserModel<G, A, R, V> archetypeChooserModel, @NotNull MapImageCache<G, A, R, V> mapImageCache, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull GameObjectMatcher exitTypeGameObjectMatcher); + + /** * Create a new map control instance. * @param parent the parent component for error messages * @param objects the objects to insert into the new map This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:29:46
|
Revision: 5034 http://gridarta.svn.sourceforge.net/gridarta/?rev=5034&view=rev Author: akirschbaum Date: 2008-09-07 09:29:56 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:27:57 UTC (rev 5033) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) @@ -60,7 +60,6 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapViewManager; import net.sf.gridarta.gui.RecentManager; -import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; @@ -137,10 +136,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, mainView, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, toolPalette, autojoinLists, exitMatcher); - ((DefaultMapControlFactory) mapControlFactory).init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); - archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:27:57 UTC (rev 5033) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) @@ -67,7 +67,6 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapViewManager; import net.sf.gridarta.gui.RecentManager; -import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; @@ -192,10 +191,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, mainView, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, toolPalette, autojoinLists, exitMatcher); - ((DefaultMapControlFactory) mapControlFactory).init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); - // initialize & load MultiPositionData.init(getConfigurationDirectory()); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:27:57 UTC (rev 5033) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) @@ -446,6 +446,9 @@ mapActions.updateMenuState(); init3(); archetypeParser = newArchetypeParser(gridartaObjectsFactory, archetypeChooserControl, animationObjects, archetypeSet); + gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, mainView, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, toolPalette, autojoinLists, exitMatcher); + mapControlFactory.init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); + GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:32:28
|
Revision: 5035 http://gridarta.svn.sourceforge.net/gridarta/?rev=5035&view=rev Author: akirschbaum Date: 2008-09-07 09:32:38 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:32:38 UTC (rev 5035) @@ -244,6 +244,11 @@ } /** {@inheritDoc} */ + @Override + protected void init4() { + } + + /** {@inheritDoc} */ @NotNull @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:32:38 UTC (rev 5035) @@ -191,9 +191,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - // initialize & load - MultiPositionData.init(getConfigurationDirectory()); - archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { @@ -315,6 +312,12 @@ } /** {@inheritDoc} */ + @Override + protected void init4() { + MultiPositionData.init(getConfigurationDirectory()); + } + + /** {@inheritDoc} */ @NotNull @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:29:56 UTC (rev 5034) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:32:38 UTC (rev 5035) @@ -449,6 +449,7 @@ gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, mainView, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, toolPalette, autojoinLists, exitMatcher); mapControlFactory.init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); + init4(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); @@ -471,6 +472,8 @@ protected abstract void init3(); + protected abstract void init4(); + /** * The file control instance. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:37:37
|
Revision: 5037 http://gridarta.svn.sourceforge.net/gridarta/?rev=5037&view=rev Author: akirschbaum Date: 2008-09-07 09:37:42 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:36:37 UTC (rev 5036) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) @@ -136,18 +136,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - archetypeSet.loadArchetypes(archetypeParser); - - if (globalSettings.isAutoPopupDocu()) { - // do an automated help popup because the docu version has increased - // (people won't notice the docu otherwise - nobody expects a docu in opensource) - onlineHelp(); - globalSettings.setAutoPopupDocu(false); - } - - copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); - mainActions.init(); - final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:36:37 UTC (rev 5036) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) @@ -191,18 +191,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - archetypeSet.loadArchetypes(archetypeParser); - - if (globalSettings.isAutoPopupDocu()) { - // do an automated help popup because the docu version has increased - // (people won't notice the docu otherwise - nobody expects a docu in opensource) - onlineHelp(); - globalSettings.setAutoPopupDocu(false); - } - - copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); - mainActions.init(); - // Delete libraries. final File libs = new File(System.getProperty("user.dir"), "lib"); final String libsString = ACTION_FACTORY.getString("oldLibs.okayLibs"); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:36:37 UTC (rev 5036) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) @@ -450,6 +450,17 @@ mapControlFactory.init(gridartaObjectsFactory, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); init4(); + archetypeSet.loadArchetypes(archetypeParser); + + if (globalSettings.isAutoPopupDocu()) { + // do an automated help popup because the docu version has increased + // (people won't notice the docu otherwise - nobody expects a docu in opensource) + onlineHelp(); + globalSettings.setAutoPopupDocu(false); + } + + copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); + mainActions.init(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:41:32
|
Revision: 5038 http://gridarta.svn.sourceforge.net/gridarta/?rev=5038&view=rev Author: akirschbaum Date: 2008-09-07 09:41:26 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:41:26 UTC (rev 5038) @@ -237,6 +237,11 @@ } /** {@inheritDoc} */ + @Override + protected void deleteLibraries() { + } + + /** {@inheritDoc} */ @NotNull @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:41:26 UTC (rev 5038) @@ -191,30 +191,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - // Delete libraries. - final File libs = new File(System.getProperty("user.dir"), "lib"); - final String libsString = ACTION_FACTORY.getString("oldLibs.okayLibs"); - assert libsString != null; - final String[] patterns = libsString.split("\\s+"); - final File[] libFiles = libs.listFiles(Factory.not(new GlobFileFilter(patterns))); - if (libFiles != null) { - Arrays.sort(libFiles); - if (log.isInfoEnabled()) { - for (final File libFile : libFiles) { - log.info(libFile); - } - } - } - if (libFiles != null && libFiles.length > 0 && ACTION_FACTORY.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { - Arrays.sort(libFiles); - for (final File libFile : libFiles) { - libFile.delete(); - } - if (libs.listFiles().length == 0) { - libs.delete(); - } - } - final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); @@ -306,6 +282,34 @@ } /** {@inheritDoc} */ + @Override + protected void deleteLibraries() { + // Delete libraries. + final File libs = new File(System.getProperty("user.dir"), "lib"); + final String libsString = ACTION_FACTORY.getString("oldLibs.okayLibs"); + assert libsString != null; + final String[] patterns = libsString.split("\\s+"); + final File[] libFiles = libs.listFiles(Factory.not(new GlobFileFilter(patterns))); + if (libFiles != null) { + Arrays.sort(libFiles); + if (log.isInfoEnabled()) { + for (final File libFile : libFiles) { + log.info(libFile); + } + } + } + if (libFiles != null && libFiles.length > 0 && ACTION_FACTORY.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { + Arrays.sort(libFiles); + for (final File libFile : libFiles) { + libFile.delete(); + } + if (libs.listFiles().length == 0) { + libs.delete(); + } + } + } + + /** {@inheritDoc} */ @NotNull @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:37:42 UTC (rev 5037) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:41:26 UTC (rev 5038) @@ -461,6 +461,7 @@ copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); + deleteLibraries(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); @@ -485,6 +486,8 @@ protected abstract void init4(); + protected abstract void deleteLibraries(); + /** * The file control instance. */ Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:37:42 UTC (rev 5037) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:41:26 UTC (rev 5038) @@ -563,6 +563,12 @@ } /** {@inheritDoc} */ + @Override + protected void deleteLibraries() { + throw new AssertionError(); + } + + /** {@inheritDoc} */ @NotNull @Override protected MapActions init1() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:42:40
|
Revision: 5039 http://gridarta.svn.sourceforge.net/gridarta/?rev=5039&view=rev Author: akirschbaum Date: 2008-09-07 09:42:47 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Remove outdated comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:41:26 UTC (rev 5038) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:42:47 UTC (rev 5039) @@ -139,9 +139,6 @@ final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); - // browse arch archive - // load object from a arch file you found - final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "analyze"); if (menuAnalyze != null) { filterControl.createMenuEntries(menuAnalyze); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:41:26 UTC (rev 5038) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:42:47 UTC (rev 5039) @@ -194,9 +194,6 @@ final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); - // browse arch archive - // load object from a arch file you found - archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); // load the autojoin lists This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:44:37
|
Revision: 5040 http://gridarta.svn.sourceforge.net/gridarta/?rev=5040&view=rev Author: akirschbaum Date: 2008-09-07 09:44:41 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:42:47 UTC (rev 5039) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) @@ -136,9 +136,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); - mapManager.setRecentManager(recentManager); - final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "analyze"); if (menuAnalyze != null) { filterControl.createMenuEntries(menuAnalyze); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:42:47 UTC (rev 5039) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) @@ -191,9 +191,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - final RecentManager recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); - mapManager.setRecentManager(recentManager); - archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); // load the autojoin lists Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:42:47 UTC (rev 5039) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) @@ -30,6 +30,7 @@ import javax.swing.ImageIcon; import javax.swing.JComboBox; import javax.swing.JFileChooser; +import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; @@ -59,6 +60,7 @@ import net.sf.gridarta.gui.MapManagerActions; import net.sf.gridarta.gui.MapPreview; import net.sf.gridarta.gui.MapViewManager; +import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.ReplaceDialogManager; import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.gui.SystemIcons; @@ -294,6 +296,9 @@ @NotNull protected final AbstractArchetypeParser<G, A, R> archetypeParser; + @NotNull + protected final RecentManager recentManager; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -462,6 +467,8 @@ copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); deleteLibraries(); + recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); + mapManager.setRecentManager(recentManager); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:47:12
|
Revision: 5041 http://gridarta.svn.sourceforge.net/gridarta/?rev=5041&view=rev Author: akirschbaum Date: 2008-09-07 09:47:21 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) @@ -59,7 +59,6 @@ import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapViewManager; -import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; @@ -136,12 +135,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "analyze"); - if (menuAnalyze != null) { - filterControl.createMenuEntries(menuAnalyze); - } - scriptControl.loadScripts(new File(globalSettings.getMapDir(), IGUIConstants.SCRIPTS_DIR)); - archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); // load the autojoin lists @@ -232,6 +225,16 @@ /** {@inheritDoc} */ @Override + protected void init5() { + final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "analyze"); + if (menuAnalyze != null) { + filterControl.createMenuEntries(menuAnalyze); + } + scriptControl.loadScripts(new File(globalSettings.getMapDir(), IGUIConstants.SCRIPTS_DIR)); + } + + /** {@inheritDoc} */ + @Override protected void deleteLibraries() { } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) @@ -48,7 +48,6 @@ import java.util.Arrays; import java.util.List; import javax.swing.JComboBox; -import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; @@ -66,7 +65,6 @@ import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapViewManager; -import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; @@ -277,6 +275,11 @@ /** {@inheritDoc} */ @Override + protected void init5() { + } + + /** {@inheritDoc} */ + @Override protected void deleteLibraries() { // Delete libraries. final File libs = new File(System.getProperty("user.dir"), "lib"); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:44:41 UTC (rev 5040) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) @@ -469,6 +469,7 @@ deleteLibraries(); recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); + init5(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); @@ -495,6 +496,8 @@ protected abstract void deleteLibraries(); + protected abstract void init5(); + /** * The file control instance. */ Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:44:41 UTC (rev 5040) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:47:21 UTC (rev 5041) @@ -564,6 +564,11 @@ /** {@inheritDoc} */ @Override + protected void init5() { + } + + /** {@inheritDoc} */ + @Override protected void deleteLibraries() { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:49:08
|
Revision: 5042 http://gridarta.svn.sourceforge.net/gridarta/?rev=5042&view=rev Author: akirschbaum Date: 2008-09-07 09:49:17 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) @@ -135,8 +135,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); - // load the autojoin lists autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) @@ -189,8 +189,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); - // load the autojoin lists autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:47:21 UTC (rev 5041) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) @@ -470,6 +470,7 @@ recentManager = new RecentManager(mapManager, (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "recent"), globalSettings, mapPreviewAccessory); mapManager.setRecentManager(recentManager); init5(); + archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:50:19
|
Revision: 5043 http://gridarta.svn.sourceforge.net/gridarta/?rev=5043&view=rev Author: akirschbaum Date: 2008-09-07 09:50:22 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) @@ -135,9 +135,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - // load the autojoin lists - autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); - if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); } else { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) @@ -189,9 +189,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - // load the autojoin lists - autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); - if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); } else { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:49:17 UTC (rev 5042) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) @@ -471,6 +471,7 @@ mapManager.setRecentManager(recentManager); init5(); archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); + autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:51:58
|
Revision: 5044 http://gridarta.svn.sourceforge.net/gridarta/?rev=5044&view=rev Author: akirschbaum Date: 2008-09-07 09:52:05 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) @@ -135,14 +135,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { - ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); - } else { - pickmapChooserControl.loadPickmaps(); - if (!pickmapChooserControl.isEmpty()) { - objectChooser.movePickmapChooserToFront(); - } - } recentManager.initRecent(); new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, pythonFileFilter, newMapDialogFactory, ".py"); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) @@ -189,14 +189,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { - ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); - } else { - pickmapChooserControl.loadPickmaps(); - if (!pickmapChooserControl.isEmpty()) { - objectChooser.movePickmapChooserToFront(); - } - } recentManager.initRecent(); new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, luaFileFilter, newMapDialogFactory, ".lua"); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:50:22 UTC (rev 5043) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) @@ -472,6 +472,14 @@ init5(); archetypeChooserControl.getArchetypeChooserView().finishBuildProcess(); autojoinLists.loadList(archetypeSet, getConfigurationDirectory()); + if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { + ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); + } else { + pickmapChooserControl.loadPickmaps(); + if (!pickmapChooserControl.isEmpty()) { + objectChooser.movePickmapChooserToFront(); + } + } } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:52:54
|
Revision: 5045 http://gridarta.svn.sourceforge.net/gridarta/?rev=5045&view=rev Author: akirschbaum Date: 2008-09-07 09:53:04 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) @@ -135,7 +135,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - recentManager.initRecent(); new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, pythonFileFilter, newMapDialogFactory, ".py"); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) @@ -189,7 +189,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - recentManager.initRecent(); new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, luaFileFilter, newMapDialogFactory, ".lua"); } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:52:05 UTC (rev 5044) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) @@ -480,6 +480,7 @@ objectChooser.movePickmapChooserToFront(); } } + recentManager.initRecent(); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 09:58:45
|
Revision: 5046 http://gridarta.svn.sourceforge.net/gridarta/?rev=5046&view=rev Author: akirschbaum Date: 2008-09-07 09:58:53 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 09:58:53 UTC (rev 5046) @@ -72,7 +72,6 @@ import net.sf.gridarta.gui.prefs.UpdatePrefs; import net.sf.gridarta.gui.selectedsquare.SelectedSquareControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; -import net.sf.gridarta.map.AutoValidator; import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.validation.DelegatingMapValidator; import net.sf.gridarta.map.validation.checks.AttributeRangeChecker; @@ -134,8 +133,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }); - new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, pythonFileFilter, newMapDialogFactory, ".py"); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 09:58:53 UTC (rev 5046) @@ -79,7 +79,6 @@ import net.sf.gridarta.gui.selectedsquare.SelectedSquareControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.utils.GUIUtils; -import net.sf.gridarta.map.AutoValidator; import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; @@ -188,8 +187,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }); - new AutoValidator<GameObject, MapArchObject, Archetype, CMapViewBasic>(validators, mapManager, PREFS_VALIDATOR_AUTO_DEFAULT); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT); fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, luaFileFilter, newMapDialogFactory, ".lua"); } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:53:04 UTC (rev 5045) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 09:58:53 UTC (rev 5046) @@ -88,6 +88,7 @@ import net.sf.gridarta.help.Help; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.io.PathManager; +import net.sf.gridarta.map.AutoValidator; import net.sf.gridarta.map.InsertionMode; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; @@ -326,8 +327,10 @@ * @param undefinedSpellIndex the index for no spell * @param lockedItemsTypeNumbers the type numbers of game objects being * locked items + * @param autoValidatorDefault whether the auto validator is enabled by + * default */ - protected AbstractMainControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<G, A, R, V> mapControlFactory, final boolean createDirectionPane, @Nullable final File mapImageCacheDir, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, final int typeNoEventConnector, final boolean includeFaceText, final int undefinedSpellIndex, @NotNull final int[] lockedItemsTypeNumbers) { + protected AbstractMainControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<G, A, R, V> mapControlFactory, final boolean createDirectionPane, @Nullable final File mapImageCacheDir, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, final int typeNoEventConnector, final boolean includeFaceText, final int undefinedSpellIndex, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; @@ -481,6 +484,7 @@ } } recentManager.initRecent(); + new AutoValidator<G, A, R, V>(validators, mapManager, autoValidatorDefault); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:53:04 UTC (rev 5045) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 09:58:53 UTC (rev 5046) @@ -446,7 +446,7 @@ * @param mapControlFactory the map control factory instance to use */ protected TestMainControl(@NotNull final GridartaObjectsFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> gridartaObjectsFactory, @NotNull final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<TestAnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapControlFactory) { - super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script", "Script", 0, null, -1, false, 0, new int[] { 13, }); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script", "Script", 0, null, -1, false, 0, new int[] { 13, }, false); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 10:05:41
|
Revision: 5048 http://gridarta.svn.sourceforge.net/gridarta/?rev=5048&view=rev Author: akirschbaum Date: 2008-09-07 10:05:51 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:03:37 UTC (rev 5047) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:05:51 UTC (rev 5048) @@ -128,7 +128,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT); - fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, pythonFileFilter, newMapDialogFactory, ".py"); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:03:37 UTC (rev 5047) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:05:51 UTC (rev 5048) @@ -188,7 +188,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT); - fileControl = new FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, luaFileFilter, newMapDialogFactory, ".lua"); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:03:37 UTC (rev 5047) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:05:51 UTC (rev 5048) @@ -485,6 +485,7 @@ } recentManager.initRecent(); new AutoValidator<G, A, R, V>(validators, mapManager, autoValidatorDefault); + fileControl = new FileControl<G, A, R, V>(globalSettings, archetypeSet, mapPreviewAccessory, mapManager, mainView, mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension); } protected abstract AbstractArchetypeParser<G, A, R> newArchetypeParser(final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, final net.sf.gridarta.gameobject.ArchetypeSet<G, A, R> archetypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 10:16:56
|
Revision: 5052 http://gridarta.svn.sourceforge.net/gridarta/?rev=5052&view=rev Author: akirschbaum Date: 2008-09-07 10:16:56 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Order import statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:15:02 UTC (rev 5051) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:16:56 UTC (rev 5052) @@ -49,7 +49,6 @@ import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.EditTypes; -import net.sf.gridarta.FileControl; import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:15:02 UTC (rev 5051) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:16:56 UTC (rev 5052) @@ -52,7 +52,6 @@ import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.EditTypes; -import net.sf.gridarta.FileControl; import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 10:15:02 UTC (rev 5051) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-09-07 10:16:56 UTC (rev 5052) @@ -66,8 +66,8 @@ import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapViewManager; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 10:20:44
|
Revision: 5053 http://gridarta.svn.sourceforge.net/gridarta/?rev=5053&view=rev Author: akirschbaum Date: 2008-09-07 10:20:53 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:16:56 UTC (rev 5052) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:20:53 UTC (rev 5053) @@ -106,12 +106,6 @@ /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainControl.class); - /** Preferences key for using System.exit(). */ - public static final String PREFS_SYSTEM_EXIT = "systemExit"; - - /** Preferences default value for using System.exit(). */ - public static final boolean PREFS_SYSTEM_EXIT_DEFAULT = true; - /** The current script controller. */ private ScriptController scriptControl; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:16:56 UTC (rev 5052) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:20:53 UTC (rev 5053) @@ -129,12 +129,6 @@ /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(CMainControl.class); - /** Preferences key for using System.exit(). */ - public static final String PREFS_SYSTEM_EXIT = "systemExit"; - - /** Preferences default value for using System.exit(). */ - public static final boolean PREFS_SYSTEM_EXIT_DEFAULT = true; - /** Preferences key for server application. */ public static final String PREFS_APP_SERVER = "appServer"; Modified: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 10:16:56 UTC (rev 5052) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 10:20:53 UTC (rev 5053) @@ -19,7 +19,6 @@ package daieditor.gui.prefs; -import daieditor.CMainControl; import java.awt.Component; import java.util.prefs.Preferences; import javax.swing.Box; @@ -27,6 +26,7 @@ import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.GUIConstants; import net.sf.japi.swing.ActionFactory; @@ -71,12 +71,12 @@ /** {@inheritDoc} */ public void apply() { - PREFS.putBoolean(CMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); + PREFS.putBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); } /** {@inheritDoc} */ public void revert() { - systemExit.setSelected(PREFS.getBoolean(CMainControl.PREFS_SYSTEM_EXIT, CMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); } /** {@inheritDoc} */ @@ -87,7 +87,7 @@ /** {@inheritDoc} */ public boolean isChanged() { return !( - systemExit.isSelected() == PREFS.getBoolean(CMainControl.PREFS_SYSTEM_EXIT, CMainControl.PREFS_SYSTEM_EXIT_DEFAULT) + systemExit.isSelected() == PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT) ); } @@ -100,7 +100,7 @@ miscPanel.setBorder(createTitledBorder("optionsMisc")); systemExit = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSystemExit")); - systemExit.setSelected(PREFS.getBoolean(CMainControl.PREFS_SYSTEM_EXIT, CMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); miscPanel.add(systemExit); return miscPanel; } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:16:56 UTC (rev 5052) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:20:53 UTC (rev 5053) @@ -130,6 +130,12 @@ /** Preferences default value for username. */ public static final String PREFS_USERNAME_DEFAULT = System.getProperty("user.name"); + /** Preferences key for using System.exit(). */ + public static final String PREFS_SYSTEM_EXIT = "systemExit"; + + /** Preferences default value for using System.exit(). */ + public static final boolean PREFS_SYSTEM_EXIT_DEFAULT = true; + /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(AbstractMainControl.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 10:45:48
|
Revision: 5055 http://gridarta.svn.sourceforge.net/gridarta/?rev=5055&view=rev Author: akirschbaum Date: 2008-09-07 10:45:57 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:41:26 UTC (rev 5054) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) @@ -42,11 +42,9 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.util.List; import javax.swing.JComboBox; import javax.swing.JMenu; -import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.EditTypes; import net.sf.gridarta.GlobalSettings; @@ -342,50 +340,6 @@ } /** {@inheritDoc} */ - public void doExit() { - mainView.setEnabled(false); - appExitNotify(); - ScriptEditControlInstance.getInstance().appExitNotify(); - final Thread thread = new Thread() { - /** {@inheritDoc} */ - public void run() { - try { - mainActions.waitUntilArchCollectionFinished(); - } catch (final InterruptedException ex) { - log.warn("Archetype collection was interrupted"); - } - try { - SwingUtilities.invokeAndWait(new Runnable() { - /** {@inheritDoc} */ - public void run() { - mainView.dispose(); - } - }); - } catch (final InterruptedException ex) { - log.warn("Cannot destroy main view: " + ex.getMessage()); - } catch (final InvocationTargetException ex) { - log.warn("Cannot destroy main view: " + ex.getMessage()); - } - if (prefs.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)) { - if (log.isDebugEnabled()) { - log.debug(ACTION_FACTORY.getString("logExitWithExit")); - } - System.exit(0); - } else { - log.debug(ACTION_FACTORY.getString("logExitWithoutExit")); - } - } - }; - thread.start(); - } - - /** Notifies that the application is about to exit. */ - void appExitNotify() { - mainView.appExitNotify(); // notify main view - gameObjectAttributesControl.appExitNotify(); - } - - /** {@inheritDoc} */ public void handleThrowable(final Throwable t) { mainView.handleThrowable(t); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:41:26 UTC (rev 5054) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) @@ -44,12 +44,10 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.List; import javax.swing.JComboBox; import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.EditTypes; import net.sf.gridarta.GlobalSettings; @@ -507,44 +505,6 @@ } /** {@inheritDoc} */ - public void doExit() { - mainView.setEnabled(false); - appExitNotify(); - ScriptEditControlInstance.getInstance().appExitNotify(); - final Thread thread = new Thread() { - /** {@inheritDoc} */ - public void run() { - try { - mainActions.waitUntilArchCollectionFinished(); - } catch (final InterruptedException ex) { - log.warn("Archetype collection was interrupted"); - } - try { - SwingUtilities.invokeAndWait(new Runnable() { - /** {@inheritDoc} */ - public void run() { - mainView.dispose(); - } - }); - } catch (final InterruptedException ex) { - log.warn("Cannot destroy main view: " + ex.getMessage()); - } catch (final InvocationTargetException ex) { - log.warn("Cannot destroy main view: " + ex.getMessage()); - } - if (prefs.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)) { - if (log.isDebugEnabled()) { - log.debug(ACTION_FACTORY.getString("logExitWithExit")); - } - System.exit(0); - } else { - log.debug(ACTION_FACTORY.getString("logExitWithoutExit")); - } - } - }; - thread.start(); - } - - /** {@inheritDoc} */ public void revert(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", mapControl.getMapFileName())) { final File mfile = mapControl.getMapFile(); @@ -561,12 +521,6 @@ } } - /** Notifies that the application is about to exit. */ - void appExitNotify() { - mainView.appExitNotify(); // notify main view - gameObjectAttributesControl.appExitNotify(); - } - /** {@inheritDoc} */ public void handleThrowable(final Throwable t) { mainView.handleThrowable(t); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:41:26 UTC (rev 5054) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) @@ -22,6 +22,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.util.Collections; import java.util.Map; import java.util.MissingResourceException; @@ -32,6 +33,7 @@ import javax.swing.JFileChooser; import javax.swing.JMenu; import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.archtype.ArchetypeAttributeParser; @@ -688,4 +690,43 @@ return ScriptEditControlInstance.getInstance().closeAllTabs() && mapManager.closeAll() && pickmapChooserControl.canExit(); } + /** {@inheritDoc} */ + public void doExit() { + mainView.setEnabled(false); + mainView.appExitNotify(); + gameObjectAttributesControl.appExitNotify(); + ScriptEditControlInstance.getInstance().appExitNotify(); + final Thread thread = new Thread() { + /** {@inheritDoc} */ + public void run() { + try { + mainActions.waitUntilArchCollectionFinished(); + } catch (final InterruptedException ex) { + log.warn("Archetype collection was interrupted"); + } + try { + SwingUtilities.invokeAndWait(new Runnable() { + /** {@inheritDoc} */ + public void run() { + mainView.dispose(); + } + }); + } catch (final InterruptedException ex) { + log.warn("Cannot destroy main view: " + ex.getMessage()); + } catch (final InvocationTargetException ex) { + log.warn("Cannot destroy main view: " + ex.getMessage()); + } + if (prefs.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)) { + if (log.isDebugEnabled()) { + log.debug(ACTION_FACTORY.getString("logExitWithExit")); + } + System.exit(0); + } else { + log.debug(ACTION_FACTORY.getString("logExitWithoutExit")); + } + } + }; + thread.start(); + } + } // class AbstractMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 11:04:34
|
Revision: 5056 http://gridarta.svn.sourceforge.net/gridarta/?rev=5056&view=rev Author: akirschbaum Date: 2008-09-07 11:04:42 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move DevPrefs to common code base; add 'Developers' pane to Crossfire's options dialog. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/crossfire/resource/icons/development/Server24.gif trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/crossfire/ChangeLog 2008-09-07 11:04:42 UTC (rev 5056) @@ -1,3 +1,7 @@ +2008-09-07 Andreas Kirschbaum + + * Add options pane "Developers". + 2008-09-06 Andreas Kirschbaum * Hide system game object matchers from the GUI. Property changes on: trunk/crossfire/resource/icons/development/Server24.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:mergeinfo + Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -64,6 +64,7 @@ import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.objectchooser.ObjectChooser; +import net.sf.gridarta.gui.prefs.DevPrefs; import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; @@ -324,6 +325,7 @@ new ResPrefs((GlobalSettingsImpl) globalSettings), new GUIPrefs(), new MiscPrefs(), + new DevPrefs(), new UpdatePrefs(), new MapValidatorPrefs<GameObject, MapArchObject, Archetype>("cfeditor", validators, PREFS_VALIDATOR_AUTO_DEFAULT) ); // prefsGroup Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -30,7 +30,6 @@ import daieditor.gui.map.CMapViewBasic; import daieditor.gui.map.DefaultRendererFactory; import daieditor.gui.prefs.AppPrefs; -import daieditor.gui.prefs.DevPrefs; import daieditor.gui.prefs.GUIPrefs; import daieditor.gui.prefs.NetPrefs; import daieditor.gui.prefs.ResPrefs; @@ -70,6 +69,7 @@ import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.objectchooser.ObjectChooser; +import net.sf.gridarta.gui.prefs.DevPrefs; import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/action.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -139,7 +139,6 @@ prefsApp.icon=development/Application24 -prefsDev.icon=development/Server24 prefsRes.icon=general/Save24 prefsGUI.icon=development/Host24 Deleted: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -1,108 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 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 daieditor.gui.prefs; - -import java.awt.Component; -import java.util.prefs.Preferences; -import javax.swing.Box; -import javax.swing.JCheckBox; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; -import javax.swing.border.TitledBorder; -import net.sf.gridarta.AbstractMainControl; -import net.sf.gridarta.MainControl; -import net.sf.gridarta.gui.GUIConstants; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.prefs.AbstractPrefs; - -/** - * Preferences Module for developer preferences. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @serial exclude - */ -public final class DevPrefs extends AbstractPrefs { - - /** The serial version UID. */ - private static final long serialVersionUID = 1; - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** Preferences. */ - private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); - - /** Use Systme.exit() for exiting the program. */ - private JCheckBox systemExit; - - /** Create a DevPrefs pane. */ - public DevPrefs() { - setListLabelText(ACTION_FACTORY.getString("prefsDev.title")); - setListLabelIcon(ACTION_FACTORY.getIcon("prefsDev.icon")); - - add(createMiscPanel()); - add(Box.createVerticalGlue()); - } - - /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border - */ - private static Border createTitledBorder(final String titleKey) { - return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), GUIConstants.DIALOG_BORDER); - } - - /** {@inheritDoc} */ - public void apply() { - PREFS.putBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); - } - - /** {@inheritDoc} */ - public void revert() { - systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); - } - - /** {@inheritDoc} */ - public void defaults() { - systemExit.setSelected(true); - } - - /** {@inheritDoc} */ - public boolean isChanged() { - return !( - systemExit.isSelected() == PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT) - ); - } - - /** - * Creates the subpanel with the misc settings. - * @return subpanel - */ - private Component createMiscPanel() { - final Box miscPanel = Box.createVerticalBox(); - miscPanel.setBorder(createTitledBorder("optionsMisc")); - - systemExit = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSystemExit")); - systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); - miscPanel.add(systemExit); - return miscPanel; - } - -} // class DevPrefs Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=Load Arches from Collection optionsResMedia=Media optionsResMedia.shortdescription=<html>The media directory is for choosing background sounds for maps.<br>Please know that you cannot simply choose any media directory you want.<br>The background sound will only work if the files exist on the client as well.<br>Therefore, choosing a standard daimonin media directory is crucial.</html> -optionsSystemExit.text=Use System.exit() for exiting -optionsSystemExit.shortdescription=<html><strong>Developers</strong> should uncheck this and report when the application does not exit gracefully without using System.exit().</html> optionsApps=External Applications optionsAppServer=Server optionsAppClient=Client @@ -326,7 +324,6 @@ # Preference Modules prefsApp.title=External applications -prefsDev.title=Developers ################# Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=Vorbereitete Archetypen laden #optionsResMedia= #optionsResMedia.shortdescription= -#optionsSystemExit.text= -#optionsSystemExit.shortdescription= #optionsApps= #optionsAppServer= #optionsAppClient= @@ -294,7 +292,6 @@ # Preference Modules #prefsApp.title= -#prefsDev.title= ################# Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -85,8 +85,6 @@ #optionsLoadArchColl.text= #optionsResMedia= #optionsResMedia.shortdescription= -#optionsSystemExit.text= -#optionsSystemExit.shortdescription= #optionsApps= #optionsAppServer= #optionsAppClient= @@ -291,7 +289,6 @@ # Preference Modules #prefsApp.title= -#prefsDev.title= ################# Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=L\xE4s arketyper fr\xE5n samling optionsResMedia=Media optionsResMedia.shortdescription=<html>Mediakatalogen anv\xE4nds f\xF6r att v\xE4lja bakgrundsljud till kartor.<br>Observera att det inte g\xE5r att v\xE4lja vilka filer som helst.<br>Bakgrundsljud fungerar enbart om filen finns i klienten ocks\xE5.<br>D\xE4rf\xF6r \xE4r det viktigt att v\xE4lja en Daimonin standardkatalog f\xF6r media.</html> -optionsSystemExit.text=Anv\xE4nd System.exit() f\xF6r avslutning -optionsSystemExit.shortdescription=<html><strong>Utvecklare</strong> b\xF6r avmarkera detta och rapportera n\xE4r applikationen inte avslutar korrekt utan att anv\xE4nda System.exit().</html> optionsApps=Externa applikationer optionsAppServer=Server optionsAppClient=Klient @@ -292,7 +290,6 @@ # Preference Modules prefsApp.title=Externa applikationer -prefsDev.title=Utvecklare ################# Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/action.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -77,6 +77,7 @@ prefsMisc.icon=general/Preferences24 prefsMapValidator.icon=general/Search24 +prefsDev.icon=development/Server24 prefsUpdate.icon=general/Search24 mapTileRevert.icon=general/Undo16 Copied: trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java (from rev 5053, trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -0,0 +1,108 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.prefs; + +import java.awt.Component; +import java.util.prefs.Preferences; +import javax.swing.Box; +import javax.swing.JCheckBox; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.border.TitledBorder; +import net.sf.gridarta.AbstractMainControl; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.gui.GUIConstants; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.prefs.AbstractPrefs; + +/** + * Preferences Module for developer preferences. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @serial exclude + */ +public final class DevPrefs extends AbstractPrefs { + + /** The serial version UID. */ + private static final long serialVersionUID = 1; + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** Preferences. */ + private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); + + /** Use Systme.exit() for exiting the program. */ + private JCheckBox systemExit; + + /** Create a DevPrefs pane. */ + public DevPrefs() { + setListLabelText(ACTION_FACTORY.getString("prefsDev.title")); + setListLabelIcon(ACTION_FACTORY.getIcon("prefsDev.icon")); + + add(createMiscPanel()); + add(Box.createVerticalGlue()); + } + + /** + * Create a titled border. + * @param titleKey Action Key for border title + * @return titled border + */ + private static Border createTitledBorder(final String titleKey) { + return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), GUIConstants.DIALOG_BORDER); + } + + /** {@inheritDoc} */ + public void apply() { + PREFS.putBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); + } + + /** {@inheritDoc} */ + public void revert() { + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + } + + /** {@inheritDoc} */ + public void defaults() { + systemExit.setSelected(true); + } + + /** {@inheritDoc} */ + public boolean isChanged() { + return !( + systemExit.isSelected() == PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT) + ); + } + + /** + * Creates the subpanel with the misc settings. + * @return subpanel + */ + private Component createMiscPanel() { + final Box miscPanel = Box.createVerticalBox(); + miscPanel.setBorder(createTitledBorder("optionsMisc")); + + systemExit = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSystemExit")); + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + miscPanel.add(systemExit); + return miscPanel; + } + +} // class DevPrefs Property changes on: trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -732,6 +732,7 @@ prefsRes.title=Paths & resources prefsGUI.title=Appearance +prefsDev.title=Developers prefsUpdate.title=Update autoUpdate.text=Automatically check for updates on startup? @@ -759,6 +760,8 @@ optionsRestart.title=Warning optionsRestart.message=Most options require restarting the editor to take effect. optionsLoadArchColl.text=Load Arches from Collection +optionsSystemExit.text=Use System.exit() for exiting +optionsSystemExit.shortdescription=<html><strong>Developers</strong> should uncheck this and report when the application does not exit gracefully without using System.exit().</html> arcDoc.htmlText=<html><head><meta name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -687,6 +687,7 @@ prefsRes.title=Pfade & Ressourcen prefsGUI.title=Aussehen +prefsDev.title=Entwickler prefsUpdate.title=Update autoUpdate.text=Beim Programmstart automatisch auf Updates pr\xFCfen? @@ -714,6 +715,8 @@ optionsRestart.title=Warnung optionsRestart.message=Viele Optionen erfordern einen Programmneustart, um effektiv zu werden. optionsLoadArchColl.text=Vorbereitete Archetypen laden +#optionsSystemExit.text= +#optionsSystemExit.shortdescription= arcDoc.htmlText=<html><head meta name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -686,6 +686,7 @@ #prefsRes.title= #prefsGUI.title= +#prefsDev.title= #prefsUpdate.title= #autoUpdate.text= @@ -713,6 +714,8 @@ #optionsRestart.title= #optionsRestart.message= #optionsLoadArchColl.text= +#optionsSystemExit.text= +#optionsSystemExit.shortdescription= arcDoc.htmlText=<html><head><meta name="Gridarta" contents="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -690,6 +690,7 @@ prefsRes.title=S\xF6kv\xE4gar och resurser prefsGUI.title=Utseende +prefsDev.title=Utvecklare prefsUpdate.title=Uppdatering autoUpdate.text=Automatiskt leta efter uppdateringar vid uppstart? @@ -717,6 +718,8 @@ optionsRestart.title=Varning optionsRestart.message=De flesta inst\xE4llningarna kr\xE4ver att editor startas om f\xF6r att g\xE4lla. optionsLoadArchColl.text=L\xE4s arketyper fr\xE5n samling +optionsSystemExit.text=Anv\xE4nd System.exit() f\xF6r avslutning +optionsSystemExit.shortdescription=<html><strong>Utvecklare</strong> b\xF6r avmarkera detta och rapportera n\xE4r applikationen inte avslutar korrekt utan att anv\xE4nda System.exit().</html> arcDoc.htmlText=<html><head name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 11:11:08
|
Revision: 5057 http://gridarta.svn.sourceforge.net/gridarta/?rev=5057&view=rev Author: akirschbaum Date: 2008-09-07 11:11:14 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move CMainControl.openFiles() to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) @@ -80,7 +80,6 @@ import net.sf.gridarta.map.validation.checks.MapDifficultyChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.treasurelist.TreasureLocation; import net.sf.japi.swing.ActionFactory; @@ -286,31 +285,6 @@ fileControl.openFileWanted(true); } - /** - * Load a list of map files. - * @param filenames collection of filenames to load - */ - public void openFiles(final Iterable<String> filenames) { - for (final String filename : filenames) { - final File file = new File(filename); - final boolean isScriptFile = filename.toLowerCase().endsWith(".py"); - if (file.isFile()) { - if (isScriptFile) { - ScriptEditControlInstance.getInstance().openScriptFile(file.getAbsolutePath()); - } else { - mapManager.openMapFileWithView(file, null); - } - } else if (!file.exists()) { - if (isScriptFile) { - // TODO: pass filename - ScriptEditControlInstance.getInstance().openScriptNew(); - } else { - newLevelWanted(file.getName()); - } - } // If neither branch matches, it's a directory - what to do with directories? - } - } - /** {@inheritDoc} */ public boolean saveLevelAsWanted(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { return fileControl.saveLevelAsWanted(mapControl); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) @@ -97,7 +97,6 @@ import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; import net.sf.gridarta.spells.SpellsUtils; -import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.treasurelist.TreasureLocation; import net.sf.japi.io.args.ArgParser; @@ -452,31 +451,6 @@ return mainView; } - /** - * Load a list of map files. - * @param filenames collection of filenames to load - */ - public void openFiles(final Iterable<String> filenames) { - for (final String filename : filenames) { - final File file = new File(filename); - final boolean isScriptFile = filename.toLowerCase().endsWith(".lua"); - if (file.isFile()) { - if (isScriptFile) { - ScriptEditControlInstance.getInstance().openScriptFile(file.getAbsolutePath()); - } else { - mapManager.openMapFileWithView(file, null); - } - } else if (!file.exists()) { - if (isScriptFile) { - // TODO: pass filename - ScriptEditControlInstance.getInstance().openScriptNew(); - } else { - newLevelWanted(file.getName()); - } - } // If neither branch matches, it's a directory - what to do with directories? - } - } - /** {@inheritDoc} */ public boolean saveLevelAsWanted(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { return fileControl.saveLevelAsWanted(mapControl); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) @@ -174,6 +174,12 @@ @NotNull protected final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory; + /** + * The file extension for script files. + */ + @NotNull + private final String scriptExtension; + /** The renderer factory. */ private final RendererFactory<G, A, R> rendererFactory; @@ -303,6 +309,7 @@ */ protected AbstractMainControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<G, A, R, V> mapControlFactory, final boolean createDirectionPane, @Nullable final File mapImageCacheDir, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, final int typeNoEventConnector, final boolean includeFaceText, final int undefinedSpellIndex, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault) { this.gridartaObjectsFactory = gridartaObjectsFactory; + this.scriptExtension = scriptExtension; this.globalSettings = globalSettings; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); final EditTypes<G, A, R, V> editTypes = new EditTypes<G, A, R, V>(tmpMapManager); @@ -729,4 +736,29 @@ thread.start(); } + /** + * Load a list of map files. + * @param filenames collection of filenames to load + */ + public void openFiles(final Iterable<String> filenames) { + for (final String filename : filenames) { + final File file = new File(filename); + final boolean isScriptFile = filename.toLowerCase().endsWith(scriptExtension); + if (file.isFile()) { + if (isScriptFile) { + ScriptEditControlInstance.getInstance().openScriptFile(file.getAbsolutePath()); + } else { + mapManager.openMapFileWithView(file, null); + } + } else if (!file.exists()) { + if (isScriptFile) { + // TODO: pass filename + ScriptEditControlInstance.getInstance().openScriptNew(); + } else { + newLevelWanted(file.getName()); + } + } // If neither branch matches, it's a directory - what to do with directories? + } + } + } // class AbstractMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 11:14:41
|
Revision: 5058 http://gridarta.svn.sourceforge.net/gridarta/?rev=5058&view=rev Author: akirschbaum Date: 2008-09-07 11:14:50 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move MainControl.getMainView() to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) @@ -156,7 +156,7 @@ @NotNull @Override protected CFTreasureListTree<GameObject, MapArchObject, Archetype> createTreasureListTree() { - return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, + return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(getMainView(), archetypeSet, specialTreasureLists, new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE) ); } @@ -166,7 +166,7 @@ @Override protected MapActions init1() { archetypeTypeSet.getListTable().put("event", ScriptArchUtils.getEventTypes()); - return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); + return new MapActions(getMainView(), getMainView(), gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); } /** {@inheritDoc} */ @@ -177,13 +177,13 @@ filterControl = new CFilterControl(null, mapManager, defaultNamedFilterList); ((CrossfireObjectsFactory) gridartaObjectsFactory).setFilterControl(filterControl); final ScriptParameters scriptParameters = new ScriptParameters(archetypeSet, globalSettings, mapManager, validators); - scriptControl = new ScriptController(filterControl, scriptParameters, mainView); + scriptControl = new ScriptController(filterControl, scriptParameters, getMainView()); } /** {@inheritDoc} */ @Override protected void init3() { - scriptControl.getView().setMenu((JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "plugins")); + scriptControl.getView().setMenu((JMenu) ACTION_FACTORY.find(getMainView().getJMenuBar(), "plugins")); } /** {@inheritDoc} */ @@ -194,7 +194,7 @@ /** {@inheritDoc} */ @Override protected void init5() { - final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "analyze"); + final JMenu menuAnalyze = (JMenu) ACTION_FACTORY.find(getMainView().getJMenuBar(), "analyze"); if (menuAnalyze != null) { filterControl.createMenuEntries(menuAnalyze); } @@ -272,14 +272,6 @@ return mapValidators; } - /** - * Returns the main view. - * @return the main view - */ - public MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> getMainView() { - return mainView; - } - /** Invoked when user wants to open a file. */ public void open() { fileControl.openFileWanted(true); @@ -317,7 +309,7 @@ /** {@inheritDoc} */ public void handleThrowable(final Throwable t) { - mainView.handleThrowable(t); + getMainView().handleThrowable(t); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) @@ -217,7 +217,7 @@ @NotNull @Override protected CFTreasureListTree<GameObject, MapArchObject, Archetype> createTreasureListTree() { - return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, + return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(getMainView(), archetypeSet, specialTreasureLists, new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE), new TreasureLocation(globalSettings.getMapDefaultFolder(), null) ); @@ -227,7 +227,7 @@ @NotNull @Override protected MapActions init1() { - return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); + return new MapActions(getMainView(), getMainView(), gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); } /** {@inheritDoc} */ @@ -268,7 +268,7 @@ } } } - if (libFiles != null && libFiles.length > 0 && ACTION_FACTORY.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { + if (libFiles != null && libFiles.length > 0 && ACTION_FACTORY.showOnetimeConfirmDialog(getMainView(), JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { Arrays.sort(libFiles); for (final File libFile : libFiles) { libFile.delete(); @@ -386,11 +386,11 @@ public void controlServer() { if (controlServer == null) { controlServer = new ProcessRunner("controlServer", prefs.get(PREFS_APP_SERVER, PREFS_APP_SERVER_DEFAULT)); - ACTION_FACTORY.showOnetimeMessageDialog(mainView, JOptionPane.WARNING_MESSAGE, "controlServerWarning"); + ACTION_FACTORY.showOnetimeMessageDialog(getMainView(), JOptionPane.WARNING_MESSAGE, "controlServerWarning"); } else { controlServer.setCommand(prefs.get(PREFS_APP_SERVER, PREFS_APP_SERVER_DEFAULT)); } - controlServer.showDialog(mainView); + controlServer.showDialog(getMainView()); } /** Control the client. */ @@ -401,13 +401,13 @@ } else { controlClient.setCommand(prefs.get(PREFS_APP_CLIENT, PREFS_APP_CLIENT_DEFAULT)); } - controlClient.showDialog(mainView); + controlClient.showDialog(getMainView()); } /** Collect Spells. */ @ActionMethod public void collectSpells() { - new SpellsUtils(IGUIConstants.SPELL_FILE).importSpellsWanted(getConfigurationDirectory(), mainView); + new SpellsUtils(IGUIConstants.SPELL_FILE).importSpellsWanted(getConfigurationDirectory(), getMainView()); } /** @@ -443,14 +443,6 @@ mapManager.refreshCurrentMap(); } - /** - * Returns the main view. - * @return the main view - */ - public MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> getMainView() { - return mainView; - } - /** {@inheritDoc} */ public boolean saveLevelAsWanted(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { return fileControl.saveLevelAsWanted(mapControl); @@ -480,7 +472,7 @@ /** {@inheritDoc} */ public void revert(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { - if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", mapControl.getMapFileName())) { + if (ACTION_FACTORY.showQuestionDialog(getMainView(), "confirmRevertMap", mapControl.getMapFileName())) { final File mfile = mapControl.getMapFile(); final Point[] viewPositions = mapControl.getViewPositions(); mapManager.closeLevel(mapControl, true); @@ -497,7 +489,7 @@ /** {@inheritDoc} */ public void handleThrowable(final Throwable t) { - mainView.handleThrowable(t); + getMainView().handleThrowable(t); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:11:14 UTC (rev 5057) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) @@ -229,7 +229,7 @@ /** The main view. */ @NotNull - protected final MainView<G, A, R, V> mainView; + private final MainView<G, A, R, V> mainView; /** * The object chooser. @@ -761,4 +761,9 @@ } } + /** {@inheritDoc} */ + public MainView<G, A, R, V> getMainView() { + return mainView; + } + } // class AbstractMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-09-07 11:18:18
|
Revision: 5059 http://gridarta.svn.sourceforge.net/gridarta/?rev=5059&view=rev Author: akirschbaum Date: 2008-09-07 11:18:27 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move MainControl.saveLevelAsWanted() to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:18:27 UTC (rev 5059) @@ -278,11 +278,6 @@ } /** {@inheritDoc} */ - public boolean saveLevelAsWanted(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { - return fileControl.saveLevelAsWanted(mapControl); - } - - /** {@inheritDoc} */ @NotNull @Override public PreferencesGroup createPreferencesGroup() { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:18:27 UTC (rev 5059) @@ -444,11 +444,6 @@ } /** {@inheritDoc} */ - public boolean saveLevelAsWanted(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl) { - return fileControl.saveLevelAsWanted(mapControl); - } - - /** {@inheritDoc} */ @NotNull @Override public PreferencesGroup createPreferencesGroup() { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:14:50 UTC (rev 5058) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-09-07 11:18:27 UTC (rev 5059) @@ -766,4 +766,9 @@ return mainView; } + /** {@inheritDoc} */ + public boolean saveLevelAsWanted(@NotNull final MapControl<G, A, R, V> mapControl) { + return fileControl.saveLevelAsWanted(mapControl); + } + } // class AbstractMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |