From: <aki...@us...> - 2008-08-15 22:43:58
|
Revision: 4871 http://gridarta.svn.sourceforge.net/gridarta/?rev=4871&view=rev Author: akirschbaum Date: 2008-08-15 22:44:04 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/FileControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxEditor.java trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxModel.java trunk/crossfire/src/cfeditor/gui/script/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/gui/script/parameter/MyCellRenderer.java trunk/crossfire/src/cfeditor/script/ScriptController.java trunk/crossfire/src/cfeditor/script/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/script/parameter/PluginParameterFactory.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/FileControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -214,7 +214,7 @@ */ public CMainControl() { super(new CrossfireObjectsFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects()); - final ArchetypeSet archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, ((GlobalSettingsImpl) globalSettings).getImageSet(), gridartaObjectsFactory); + archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, ((GlobalSettingsImpl) globalSettings).getImageSet(), gridartaObjectsFactory); ScriptedEvent.setArchetypeSet(archetypeSet); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "zoom", "gc", "onlineHelp", "tod", "about"); @@ -341,7 +341,7 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeTypeSet, gameObjectMatchers); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers); copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); Modified: trunk/crossfire/src/cfeditor/FileControl.java =================================================================== --- trunk/crossfire/src/cfeditor/FileControl.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/FileControl.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,7 +20,6 @@ package cfeditor; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.gui.map.CMapViewBasic; import cfeditor.map.MapArchObject; @@ -31,6 +30,7 @@ import javax.swing.filechooser.FileFilter; import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.MapManager; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.map.MapPreviewAccessory; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.map.MapControl; @@ -53,7 +53,7 @@ * The archetype set. */ @NotNull - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<?, ?, ?> archetypeSet; /** * The map preview accessory. @@ -105,7 +105,7 @@ * @param scriptFileFilter the script file filter * @param newMapDialogFactory the new map dialog factory */ - public FileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet archetypeSet, @NotNull final MapPreviewAccessory mapPreviewAccessory, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapDialogFactory) { + public FileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<?, ?, ?> archetypeSet, @NotNull final MapPreviewAccessory mapPreviewAccessory, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapDialogFactory) { this.globalSettings = globalSettings; this.archetypeSet = archetypeSet; this.mapPreviewAccessory = mapPreviewAccessory; Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -27,6 +27,7 @@ import java.util.List; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.gameobject.AbstractArchetypeParser; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; @@ -59,7 +60,7 @@ /** The archetype set. */ @NotNull - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<?, ?, Archetype> archetypeSet; /** The archetype chooser to add parsed archetypes to. */ private final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl; @@ -73,7 +74,7 @@ * @param animationObjects the animation objects instance to use * @param archetypeSet the archetype set */ - public ArchetypeParser(final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet archetypeSet) { + public ArchetypeParser(final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.archetypeChooserControl = archetypeChooserControl; this.animationObjects = animationObjects; Modified: trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBox.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBox.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,11 +20,11 @@ package cfeditor.gui.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Dimension; import javax.swing.JComboBox; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; import org.apache.log4j.Logger; @@ -41,7 +41,7 @@ private final ArchComboBoxModel archComboBoxModel; - public ArchComboBox(@NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ArchetypeSet archetypeSet, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { + public ArchComboBox(@NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { setMaximumRowCount(4); archComboBoxModel = new ArchComboBoxModel(archetypeSet); archComboBoxEditor = new ArchComboBoxEditor(this, archComboBoxModel, objectChooser, gameObjectAttributesModel, archetypeSet); Modified: trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxEditor.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxEditor.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,7 +20,6 @@ package cfeditor.gui.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Color; @@ -43,6 +42,7 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import net.sf.gridarta.CommonConstants; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; import org.jetbrains.annotations.Nullable; @@ -57,7 +57,7 @@ private final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel; - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<?, ?, Archetype> archetypeSet; private JPanel editorPanel = null; @@ -69,7 +69,7 @@ private boolean locked = false; - public ArchComboBoxEditor(final ArchComboBox archComboBox, final ArchComboBoxModel archComboBoxModel, final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser, final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, final ArchetypeSet archetypeSet) { + public ArchComboBoxEditor(final ArchComboBox archComboBox, final ArchComboBoxModel archComboBoxModel, final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser, final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, final ArchetypeSet<?, ?, Archetype> archetypeSet) { this.archComboBox = archComboBox; this.archComboBoxModel = archComboBoxModel; this.objectChooser = objectChooser; Modified: trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxModel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxModel.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gui/script/parameter/ArchComboBoxModel.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,12 +20,12 @@ package cfeditor.gui.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import javax.swing.AbstractListModel; import javax.swing.ComboBoxModel; +import net.sf.gridarta.gameobject.ArchetypeSet; public class ArchComboBoxModel extends AbstractListModel implements ComboBoxModel { @@ -38,7 +38,7 @@ private static final long serialVersionUID = 1L; - public ArchComboBoxModel(final ArchetypeSet archetypeSet) { + public ArchComboBoxModel(final ArchetypeSet<?, ?, Archetype> archetypeSet) { final Collection<Archetype> archetypes = archetypeSet.getArchetypes(); archList = archetypes.toArray(new Archetype[archetypes.size()]); Arrays.sort(archList, new Comparator<Archetype>() { Modified: trunk/crossfire/src/cfeditor/gui/script/parameter/ArchParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/script/parameter/ArchParameterView.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gui/script/parameter/ArchParameterView.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,7 +20,6 @@ package cfeditor.gui.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.script.parameter.ArchParameter; @@ -29,6 +28,7 @@ import java.awt.event.ItemListener; import javax.swing.JComponent; import javax.swing.JPanel; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; import org.jetbrains.annotations.NotNull; @@ -49,7 +49,7 @@ return this.value; } - public ArchParameterView(final ArchParameter param, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ArchetypeSet archetypeSet, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { + public ArchParameterView(final ArchParameter param, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { value = new ArchComboBox(gameObjectAttributesModel, archetypeSet, objectChooser); parameter = param; value.setSelectedItem(param.getValue()); Modified: trunk/crossfire/src/cfeditor/gui/script/parameter/MyCellRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/script/parameter/MyCellRenderer.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/gui/script/parameter/MyCellRenderer.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,10 +20,11 @@ package cfeditor.gui.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import java.awt.Component; import javax.swing.DefaultListCellRenderer; import javax.swing.JList; +import net.sf.gridarta.gameobject.ArchetypeSet; +import org.jetbrains.annotations.NotNull; class MyCellRenderer extends DefaultListCellRenderer { @@ -31,16 +32,21 @@ private static final long serialVersionUID = 1L; + @NotNull private final ArchComboBoxEditor archComboBoxEditor; - private final ArchetypeSet archetypeSet; + /** + * The archetype set to use. + */ + @NotNull + private final ArchetypeSet<?, ?, Archetype> archetypeSet; /** * Creates a new instance. * @param archComboBoxEditor the instance to use - * @param archetypeSet the instance to use + * @param archetypeSet the archetype set to use */ - public MyCellRenderer(final ArchComboBoxEditor archComboBoxEditor, final ArchetypeSet archetypeSet) { + public MyCellRenderer(@NotNull final ArchComboBoxEditor archComboBoxEditor, @NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet) { this.archComboBoxEditor = archComboBoxEditor; this.archetypeSet = archetypeSet; } Modified: trunk/crossfire/src/cfeditor/script/ScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/script/ScriptController.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/script/ScriptController.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -26,7 +26,6 @@ import cfeditor.CFilterControl; import cfeditor.CMainControl; import cfeditor.filter.Filter; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gui.script.ScriptView; import java.awt.Component; import java.io.CharArrayWriter; @@ -42,6 +41,7 @@ import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.event.EventListenerList; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jdom.Document; @@ -78,13 +78,13 @@ @NotNull private final CFilterControl filterControl; - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<?, ?, ?> archetypeSet; /** The default directory for saving scripts. */ @Nullable private File scriptsDir = null; - public ScriptController(final CMainControl mainControl, @NotNull final CFilterControl filterControl, final ArchetypeSet archetypeSet, @NotNull final Component parent) { + public ScriptController(final CMainControl mainControl, @NotNull final CFilterControl filterControl, final ArchetypeSet<?, ?, ?> archetypeSet, @NotNull final Component parent) { this.mainControl = mainControl; this.filterControl = filterControl; this.archetypeSet = archetypeSet; Modified: trunk/crossfire/src/cfeditor/script/parameter/ArchParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/script/parameter/ArchParameter.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/script/parameter/ArchParameter.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,11 +20,11 @@ package cfeditor.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.gui.script.parameter.ArchParameterView; import cfeditor.gui.script.parameter.PluginParameterView; import cfeditor.map.MapArchObject; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; import org.jdom.Element; @@ -33,7 +33,7 @@ public class ArchParameter extends PluginParameter { @NotNull - private static ArchetypeSet archetypeSet; + private static ArchetypeSet<?, ?, Archetype> archetypeSet; private String valueString; @@ -47,7 +47,7 @@ super(getParameterType()); } - public static void init(@NotNull final ArchetypeSet archetypeSet, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { + public static void init(@NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser) { ArchParameter.archetypeSet = archetypeSet; ArchParameter.gameObjectAttributesModel = gameObjectAttributesModel; ArchParameter.objectChooser = objectChooser; Modified: trunk/crossfire/src/cfeditor/script/parameter/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/script/parameter/PluginParameterFactory.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/crossfire/src/cfeditor/script/parameter/PluginParameterFactory.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,13 +20,13 @@ package cfeditor.script.parameter; import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.gui.map.CMapViewBasic; import cfeditor.map.MapArchObject; import java.util.LinkedHashMap; import java.util.Map; import net.sf.gridarta.MapManager; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; import org.apache.log4j.Logger; @@ -45,7 +45,7 @@ private static final Map<String, Class<? extends PluginParameter>> parameterTypes = new LinkedHashMap<String, Class<? extends PluginParameter>>(); - public static void init(@NotNull final ArchetypeSet archetypeSet, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager) { + public static void init(@NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet, @NotNull final GameObjectAttributesModel<GameObject, MapArchObject, Archetype> gameObjectAttributesModel, @NotNull final ObjectChooser<GameObject, MapArchObject, Archetype> objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager) { ArchParameter.init(archetypeSet, gameObjectAttributesModel, objectChooser); MapParameter.init(mapManager); parameterTypes.put(StringParameter.getParameterType(), StringParameter.class); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -269,8 +269,7 @@ */ public CMainControl() { super(new DaimoninObjectsFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects()); - final ArchetypeSet archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, gridartaObjectsFactory); - GameObject.setArchetypeSet(archetypeSet); + archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, gridartaObjectsFactory); ScriptedEvent.setArchetypeSet(archetypeSet); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "cleanCompletelyBlockedSquares", "zoom", "gc", "onlineHelp", "tod", "about"); @@ -396,7 +395,7 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeTypeSet, gameObjectMatchers); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers); copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); Modified: trunk/daimonin/src/daieditor/FileControl.java =================================================================== --- trunk/daimonin/src/daieditor/FileControl.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/daimonin/src/daieditor/FileControl.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -20,7 +20,6 @@ package daieditor; import daieditor.gameobject.Archetype; -import daieditor.gameobject.ArchetypeSet; import daieditor.gameobject.GameObject; import daieditor.gui.map.CMapViewBasic; import daieditor.map.MapArchObject; @@ -31,6 +30,7 @@ import javax.swing.filechooser.FileFilter; import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.MapManager; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gui.map.MapPreviewAccessory; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.map.MapControl; @@ -53,7 +53,7 @@ * The archetype set. */ @NotNull - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<?, ?, ?> archetypeSet; /** * The map preview accessory. @@ -105,7 +105,7 @@ * @param scriptFileFilter the script file filter * @param newMapDialogFactory the new map dialog factory */ - public FileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet archetypeSet, @NotNull final MapPreviewAccessory mapPreviewAccessory, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapDialogFactory) { + public FileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<?, ?, ?> archetypeSet, @NotNull final MapPreviewAccessory mapPreviewAccessory, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapDialogFactory) { this.globalSettings = globalSettings; this.archetypeSet = archetypeSet; this.mapPreviewAccessory = mapPreviewAccessory; Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -27,6 +27,7 @@ import java.io.IOException; import java.util.List; import net.sf.gridarta.gameobject.AbstractArchetypeParser; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; @@ -57,7 +58,7 @@ /** The archetype set. */ @NotNull - private final ArchetypeSet archetypeSet; + private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; /** The archetype chooser to add parsed archetypes to. */ private final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl; @@ -69,7 +70,7 @@ * @param animationObjects the animation objects instance to use * @param archetypeSet the archetype set */ - public ArchetypeParser(final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet archetypeSet) { + public ArchetypeParser(final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.archetypeChooserControl = archetypeChooserControl; this.animationObjects = animationObjects; this.archetypeSet = archetypeSet; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -25,6 +25,7 @@ import javax.swing.ImageIcon; import javax.swing.JList; import net.sf.gridarta.MapManager; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; @@ -103,13 +104,6 @@ GameObject.noFace = noFace; } - @Nullable - private static ArchetypeSet archetypeSet = null; - - public static void setArchetypeSet(@Nullable final ArchetypeSet archetypeSet) { - GameObject.archetypeSet = archetypeSet; - } - /** {@inheritDoc} */ public int getMultiShapeID() { return multi != null ? multi.getMultiShapeID() : 0; @@ -267,8 +261,8 @@ faceObjSource = FaceSource.FACE_NOT_FOUND; } if (!isArchetype()) { - normalFace = archetypeSet.getFace(this); - transFace = archetypeSet.getTrans(this); + normalFace = ((ArchetypeSet<GameObject, MapArchObject, Archetype>) (ArchetypeSet) archetypeSet).getFace(this); + transFace = ((daieditor.gameobject.ArchetypeSet) (ArchetypeSet) archetypeSet).getTrans(this); } } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -28,6 +28,7 @@ import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.anim.AnimationObjects; @@ -102,6 +103,11 @@ @NotNull protected final AnimationObjects<? extends AnimationObject> animationObjects; + /** + * The archetype set to use. + */ + protected ArchetypeSet<G, A, R> archetypeSet; + /** The updater instance. */ protected UpdaterManager updaterManager = null; Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-08-15 22:11:57 UTC (rev 4870) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-08-15 22:44:04 UTC (rev 4871) @@ -57,6 +57,11 @@ */ protected static final Pattern lineSeparatorPattern = Pattern.compile("\n"); + /** + * The archetype set to use. + */ + protected static ArchetypeSet<?, ?, ?> archetypeSet = null; + /** Static reference to the ArchetypeTypeSet (find syntax errors). */ protected static ArchetypeTypeSet archetypeTypeSet = null; @@ -184,10 +189,12 @@ /** * Sets the {@link ArchetypeTypeSet} that should be used for finding syntax * errors. + * @param archetypeSet the archetype set to use * @param archetypeTypeSet the archetype type set to use * @param gameObjectMatchers the instance to use */ - public static void initialize(final ArchetypeTypeSet archetypeTypeSet, final GameObjectMatchers gameObjectMatchers) { + public static void initialize(@Nullable final ArchetypeSet<?, ?, ?> archetypeSet, final ArchetypeTypeSet archetypeTypeSet, final GameObjectMatchers gameObjectMatchers) { + GameObject.archetypeSet = archetypeSet; GameObject.archetypeTypeSet = archetypeTypeSet; GameObject.gameObjectMatchers = gameObjectMatchers; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |