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 40556 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3 40435 jjdelcerro
 *
4 40556 jjdelcerro
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6 40435 jjdelcerro
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8 40556 jjdelcerro
 * as published by the Free Software Foundation; either version 3
9 40435 jjdelcerro
 * of the License, or (at your option) any later version.
10 40556 jjdelcerro
 *
11 40435 jjdelcerro
 * 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 40556 jjdelcerro
 *
16 40435 jjdelcerro
 * 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 40556 jjdelcerro
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 40435 jjdelcerro
 * MA  02110-1301, USA.
20 40556 jjdelcerro
 *
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 40435 jjdelcerro
 */
24
package org.gvsig.symbology.app.symbolinstaller.execution;
25
26 43126 jjdelcerro
import java.io.File;
27 40435 jjdelcerro
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 43126 jjdelcerro
    private final File symbolsFolder;
43 40435 jjdelcerro
44 43126 jjdelcerro
    public SymbolInstallerExecutionProviderFactory(File symbolsFolder) {
45
        this.symbolsFolder = symbolsFolder;
46
    }
47
48 40435 jjdelcerro
    @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 43126 jjdelcerro
        return new SymbolInstallerExecutionProvider(services,symbolsFolder);
59 40435 jjdelcerro
    }
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
}