From: <aki...@us...> - 2008-07-27 21:55:09
|
Revision: 4511 http://gridarta.svn.sourceforge.net/gridarta/?rev=4511&view=rev Author: akirschbaum Date: 2008-07-27 21:55:17 +0000 (Sun, 27 Jul 2008) Log Message: ----------- Remove calls to MainControl.getArchetypeSet(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/gui/MainActions.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-27 21:50:37 UTC (rev 4510) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-27 21:55:17 UTC (rev 4511) @@ -235,7 +235,7 @@ pickmapChooserControl = new PickmapChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(newMapDialogFactory, this, new File(globalSettings.getMapDir(), IGUIConstants.PICKMAP_DIR), getMapManager()); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); objectChooser = new DefaultObjectChooser<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, selectedSquareView, archetypeChooserControl, pickmapChooserControl, getCopyBuffer()); - mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser); + mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, archetypeSet, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser); getGridartaObjectsFactory().init(faceObjects, objectChooser, archetypeChooserControl, selectedSquareView, this); mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction(), faceObjects); new About("cfeditor", mainView); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-07-27 21:50:37 UTC (rev 4510) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-07-27 21:55:17 UTC (rev 4511) @@ -293,7 +293,7 @@ pickmapChooserControl = new PickmapChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(newMapDialogFactory, this, new File(globalSettings.getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), getMapManager()); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); objectChooser = new DefaultObjectChooser<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, selectedSquareView, archetypeChooserControl, pickmapChooserControl, getCopyBuffer()); - mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser); + mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, archetypeSet, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser); getGridartaObjectsFactory().init(faceObjects, objectChooser, archetypeChooserControl, selectedSquareView, this); mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction(), faceObjects); new About("daieditor", mainView); Modified: trunk/src/app/net/sf/gridarta/gui/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-07-27 21:50:37 UTC (rev 4510) +++ trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-07-27 21:55:17 UTC (rev 4511) @@ -65,6 +65,9 @@ /** The MainControl. */ private final MainControl<G, A, R, V> mainControl; + /** The archetype set instance. */ + private final ArchetypeSet<G, A, R> archetypeSet; + /** The pickmap chooser control instance. */ @NotNull private final PickmapChooserControl<G, A, R, V> pickmapChooserControl; @@ -281,14 +284,16 @@ /** * Create a new instance. * @param mainControl the MainControl + * @param archetypeSet the archetype set * @param pickmapChooserControl the pickmap chooser control instance to use * @param animationObjects the animation object instance to use * @param actionFactory The action factory to create actions. * @param faceObjects the FaceObjects instance to use * @param objectChooser the animation objects instance to use */ - public MainActions(@NotNull final MainControl<G, A, R, V> mainControl, @NotNull final PickmapChooserControl<G, A, R, V> pickmapChooserControl, @NotNull final AnimationObjects<?> animationObjects, @NotNull final ActionFactory actionFactory, @NotNull final FaceObjects faceObjects, @NotNull final ObjectChooser<G, A, R> objectChooser) { + public MainActions(@NotNull final MainControl<G, A, R, V> mainControl, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final PickmapChooserControl<G, A, R, V> pickmapChooserControl, @NotNull final AnimationObjects<?> animationObjects, @NotNull final ActionFactory actionFactory, @NotNull final FaceObjects faceObjects, @NotNull final ObjectChooser<G, A, R> objectChooser) { this.mainControl = mainControl; + this.archetypeSet = archetypeSet; this.pickmapChooserControl = pickmapChooserControl; this.animationObjects = animationObjects; this.actionFactory = actionFactory; @@ -324,7 +329,7 @@ /** Must be called after object creation. */ public void init() { mainControl.getCopyBuffer().addMapModelListener(mapModelListener); - mainControl.getArchetypeSet().addArchetypeSetListener(archetypeSetListener); + archetypeSet.addArchetypeSetListener(archetypeSetListener); refreshMenus(); } @@ -350,7 +355,7 @@ aFloodfill.setEnabled(getFloodfillEnabled() != null); aSelectAll.setEnabled(getSelectAllEnabled() != null); aCollectArches.setEnabled(isCollectArchesEnabled()); - aReloadFaces.setEnabled(!mainControl.getArchetypeSet().isLoadedFromArchive()); + aReloadFaces.setEnabled(!archetypeSet.isLoadedFromArchive()); aValidateMap.setEnabled(getValidateMapEnabled() != null); } @@ -596,7 +601,7 @@ final List<Collectable> collectables = new ArrayList<Collectable>(); collector = new Collector(collectArches); - collectables.add(mainControl.getArchetypeSet()); + collectables.add(archetypeSet); collectables.add(animationObjects); collectables.add(faceObjects); collector.setCollectables(collectables); @@ -758,7 +763,7 @@ * @return whether "collect archetypes" is enabled */ private boolean isCollectArchesEnabled() { - return collector == null && !mainControl.getArchetypeSet().isLoadedFromArchive(); + return collector == null && !archetypeSet.isLoadedFromArchive(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |