From: <aki...@us...> - 2008-08-22 18:05:25
|
Revision: 4993 http://gridarta.svn.sourceforge.net/gridarta/?rev=4993&view=rev Author: akirschbaum Date: 2008-08-22 18:05:34 +0000 (Fri, 22 Aug 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-08-22 08:24:57 UTC (rev 4992) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 18:05:34 UTC (rev 4993) @@ -317,19 +317,6 @@ return mainView; } - /** Invoked when user wants to begin editing a new (empty) map. */ - public void createNew() { - newLevelWanted(null); - } - - /** - * Invoked when user wants to begin editing a new (empty) map. - * @param filename desired filename for the new map, null if not specified - */ - public void newLevelWanted(final String filename) { - newMapDialogFactory.showNewMapDialog(filename); - } - /** Invoked when user wants to open a file. */ public void open() { fileControl.openFileWanted(true); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 08:24:57 UTC (rev 4992) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 18:05:34 UTC (rev 4993) @@ -185,21 +185,15 @@ private final ViewGameObjectMatcherManager vaommAlpha = new ViewGameObjectMatcherManager(moaomAlpha); /** - * The file control instance. - */ - @NotNull - private final FileControl<GameObject, MapArchObject, Archetype, CMapViewBasic> fileControl; - - /** * Constructs the main controller and its model and view. * @param gridartaObjectsFactory the gridarta objects factory to use * @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, }); - ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "cleanCompletelyBlockedSquares", "zoom", "gc", "onlineHelp", "tod"); + ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "zoom", "gc", "onlineHelp", "tod"); + ACTION_FACTORY.createActions(true, this, "controlServer", "controlClient", "cleanCompletelyBlockedSquares", "collectSpells"); ACTION_FACTORY.createToggles(true, this, "drawDouble"); - ACTION_FACTORY.createAction(true, "collectSpells", this); mainView.init(gameObjectAttributesControl, selectedSquareView, archetypeTypeSet, mapTileListBottom, gameObjectMatchers, archetypeChooserControl, pickmapChooserControl, objectChooser, leftPanel); mapActions.updateMenuState(); final ArchetypeParser archetypeParser = new ArchetypeParser(archetypeChooserControl, animationObjects, archetypeSet); @@ -492,25 +486,7 @@ return mainView; } - /** Invoked when user wants to begin editing a new (empty) map. */ - public void createNew() { - newLevelWanted(null); - } - /** - * Invoked when user wants to begin editing a new (empty) map. - * @param filename desired filename for the new map, null if not specified - */ - public void newLevelWanted(final String filename) { - newMapDialogFactory.showNewMapDialog(filename); - } - - /** Invoked when user wants to open a file. */ - public void open() { - fileControl.openFileWanted(true); - } - - /** * Load a list of map files. * @param filenames collection of filenames to load */ Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 08:24:57 UTC (rev 4992) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 18:05:34 UTC (rev 4993) @@ -496,6 +496,12 @@ protected abstract void init2(); /** + * The file control instance. + */ + @NotNull + protected FileControl<G, A, R, V> fileControl; + + /** * Initializes the map validators. * @return A MapValidator that delegates to other map validators. */ @@ -641,4 +647,22 @@ new MapPreview(rendererFactory.newSimpleLevelRenderer(currentMap.getMapModel()).getFullImage()); } + /** Invoked when user wants to begin editing a new (empty) map. */ + public void createNew() { + newLevelWanted(null); + } + + /** + * Invoked when user wants to begin editing a new (empty) map. + * @param filename desired filename for the new map, null if not specified + */ + public void newLevelWanted(final String filename) { + newMapDialogFactory.showNewMapDialog(filename); + } + + /** Invoked when user wants to open a file. */ + public void open() { + fileControl.openFileWanted(true); + } + } // class AbstractMainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |