001/**
002 * Copyright (C) 2014  Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/
003 *
004 * This file is part of Dicoogle/dicoogle.
005 *
006 * Dicoogle/dicoogle is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * Dicoogle/dicoogle is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with Dicoogle.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package pt.ua.dicoogle.rGUI.server.controllers;
020
021import java.rmi.RemoteException;
022import java.util.Collections;
023import java.util.List;
024
025import javax.swing.JMenuItem;
026import javax.swing.JPanel;
027
028import pt.ua.dicoogle.plugins.PluginController;
029import pt.ua.dicoogle.rGUI.interfaces.controllers.IPluginControllerUser;
030
031/**
032 *
033 * @author Carlos Ferreira
034 */
035@Deprecated
036public class PluginController4user implements IPluginControllerUser
037{
038    private static PluginController4user instance = null;
039    
040    private PluginController4user()
041    {
042    }
043
044    public static PluginController4user getInstance()
045    {
046        if(PluginController4user.instance == null)
047        {
048            PluginController4user.instance = new PluginController4user();
049        }
050        return PluginController4user.instance;
051    }
052    
053    @Override
054    public synchronized List<String> getPluginNames() throws RemoteException
055    {
056        return PluginController.getInstance().getQueryProvidersName(true);
057        //return PluginController.getInstance().getPluginsNames();
058        //TODO: DELETED
059    }
060
061    @Override
062    public boolean isRunning(String PluginName) throws RemoteException
063    {
064        return false;
065//        
066//        return PluginController.getInstance().isPluginRunning(PluginName);
067//        TODO: DELETED
068    }
069
070    @Override
071    public boolean isLocalPlugin(String PluginName) throws RemoteException
072    {
073        return false;
074        
075//        return PluginController.getInstance().isLocalPlugin(PluginName);
076//        TODO: DELETED
077    }
078
079    @Override
080    public List<JPanel> getTabPanels() throws RemoteException{
081        return PluginController.getInstance().getTabItems();
082    }
083
084    @Override
085    public List<String> getGraphicPluginNames() throws RemoteException {
086        throw new UnsupportedOperationException("Not supported yet.");
087    }
088
089    @Override
090    public List<JMenuItem> getRightButtonItems() throws RemoteException {
091        return PluginController.getInstance().getRightButtonItems();
092    }
093    
094    @Override
095    public List<JMenuItem> getPluginMenus() throws RemoteException{
096        return PluginController.getInstance().getMenuItems();
097    }
098}