package org.jtheque.views.impl;

/*
 * Copyright JTheque (Baptiste Wicht)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.jtheque.core.Core;
import org.jtheque.core.utils.SwingSpringProxy;
import org.jtheque.states.StateService;
import org.jtheque.utils.SimplePropertiesCache;
import org.jtheque.images.ImageService;
import org.jtheque.utils.annotations.ThreadSafe;
import org.jtheque.utils.ui.SwingUtils;
import org.jtheque.views.ViewService;
import org.jtheque.views.panel.CollectionView;
import org.jtheque.views.windows.AboutView;
import org.jtheque.views.windows.MainView;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import java.awt.Window;

/**
 * A view manager implementation.
 *
 * @author Baptiste Wicht
 */
@ThreadSafe
public final class ViewServiceImpl implements ViewService, ApplicationContextAware {
    private SwingSpringProxy<CollectionView> collectionPane;
    private SwingSpringProxy<AboutView> aboutPane;

    /**
     * Construct a new ViewServiceImpl.
     *
     * @param stateService The state service.
     * @param core         The core.
     * @param imageService The resource service.
     */
    public ViewServiceImpl(StateService stateService, Core core, ImageService imageService) {
        super();

        ViewsResources.registerResources(imageService);
    }

    @Override
    public void displayAboutView() {
        SwingUtils.inEdt(new Runnable(){
            @Override
            public void run() {
                SimplePropertiesCache.get("mainView", MainView.class).setGlassPane(aboutPane.get().getImpl());

                aboutPane.get().appear();
            }
        });
    }

    @Override
    public void displayCollectionView() {
        SwingUtils.inEdt(new Runnable() {
            @Override
            public void run() {
                SimplePropertiesCache.get("mainView", MainView.class).setGlassPane(collectionPane.get().getImpl());

                collectionPane.get().appear();
            }
        });
    }

    @Override
    public void closeCollectionView() {
        SwingUtils.inEdt(new Runnable() {
            @Override
            public void run() {
                SimplePropertiesCache.get("mainView", MainView.class).setGlassPane(null);
            }
        });
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        collectionPane = new SwingSpringProxy<CollectionView>(CollectionView.class, applicationContext);
        aboutPane = new SwingSpringProxy<AboutView>(AboutView.class, applicationContext);
    }
}
@@ -654,100 +654,30 @@
 ore.
-Core;%0Aimport org.jtheque.core.utils.SwingSpringProxy;%0Aimport org.jtheque.states.StateService
+utils.SwingSpringProxy
 ;%0Aim
@@ -1144,33 +1144,8 @@
 e;%0A%0A
-import java.awt.Window;%0A%0A
 /**%0A
@@ -1480,91 +1480,8 @@
   *%0A
-     * @param stateService The state service.%0A     * @param core         The core.%0A
     
@@ -1564,46 +1564,8 @@
 mpl(
-StateService stateService, Core core, 
 Imag

Remove unused constructor parameters