Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.symbology.app / org.gvsig.symbology.app.symbolinstaller / src / main / java / org / gvsig / symbology / app / symbolinstaller / execution / SymbolInstallerExecutionProviderFactory.java @ 43126

History | View | Annotate | Download (2.43 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.symbology.app.symbolinstaller.execution;
25

    
26
import java.io.File;
27
import org.gvsig.tools.ToolsLocator;
28
import org.gvsig.tools.dynobject.DynClass;
29
import org.gvsig.tools.dynobject.DynObject;
30
import org.gvsig.tools.dynobject.DynObjectManager;
31
import org.gvsig.tools.service.spi.AbstractProviderFactory;
32
import org.gvsig.tools.service.spi.Provider;
33
import org.gvsig.tools.service.spi.ProviderServices;
34

    
35
public class SymbolInstallerExecutionProviderFactory extends
36
    AbstractProviderFactory {
37

    
38
    public static final String PROVIDER_NAME = "symbols";
39
    public static final String PROVIDER_DESCRIPTION = "";
40

    
41
    private DynClass dynclass;
42
    private final File symbolsFolder;
43

    
44
    public SymbolInstallerExecutionProviderFactory(File symbolsFolder) {
45
        this.symbolsFolder = symbolsFolder;
46
    }
47
    
48
    @Override
49
    protected DynClass createParametersDynClass() {
50
        if (dynclass == null) {
51
            initialize();
52
        }
53
        return dynclass;
54
    }
55

    
56
    @Override
57
    protected Provider doCreate(DynObject parameters, ProviderServices services) {
58
        return new SymbolInstallerExecutionProvider(services,symbolsFolder);
59
    }
60

    
61
    public void initialize() {
62
        if (dynclass == null) {
63
            DynObjectManager dynObjectManager =
64
                ToolsLocator.getDynObjectManager();
65
            dynclass =
66
                dynObjectManager.createDynClass(PROVIDER_NAME,
67
                    PROVIDER_DESCRIPTION);
68
            dynObjectManager.add(dynclass);
69
        }
70
    }
71

    
72
}