Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.spi / src / main / java / org / gvsig / exportto / swing / spi / ExporttoSwingProviderManager.java @ 37890

History | View | Annotate | Download (5.72 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22
package org.gvsig.exportto.swing.spi;
23

    
24
import java.util.List;
25

    
26
import javax.print.attribute.standard.OutputDeviceAssigned;
27

    
28
import org.cresques.cts.IProjection;
29

    
30
import org.gvsig.exportto.swing.ExporttoSwingManager;
31
import org.gvsig.exportto.swing.preferences.ExporttoSwingPreferencesComponent;
32
import org.gvsig.fmap.dal.feature.FeatureSet;
33
import org.gvsig.fmap.dal.feature.FeatureStore;
34
import org.gvsig.fmap.dal.feature.FeatureType;
35
import org.gvsig.tools.service.ServiceException;
36
import org.gvsig.tools.service.spi.ProviderManager;
37

    
38
/**
39
 * Responsible of the management of the providers business logic.
40
 * 
41
 * @see ExporttoSwingProvider
42
 * @author gvSIG Team
43
 * @version $Id$
44
 */
45
public interface ExporttoSwingProviderManager extends ProviderManager {
46

    
47
    /**
48
     * @return
49
     *         the list of providers that has been registered.
50
     * @deprecated use {@link #getProviderFactories()} instead.
51
     */
52
    public List<String> getProviderNames();
53

    
54
    /**
55
     * Returns a list of providers that support all the
56
     * provider types.
57
     * 
58
     * @param a
59
     *            list of provider types, that are constants
60
     *            defined in the {@link ExporttoSwingManager}.
61
     * @return
62
     *         the list of providers that has been registered.
63
     * @deprecated use {@link #getProviderFactories(int[])} instead.
64
     */
65
    public List<String> getProviderNames(int[] providerTypes);
66

    
67
    /**
68
     * Returns all the available {@link ExporttoSwingProviderFactory}s.
69
     * 
70
     * @return all the available {@link ExporttoSwingProviderFactory}s
71
     */
72
    public List<ExporttoSwingProviderFactory> getProviderFactories();
73

    
74
    /**
75
     * Returns the {@link ExporttoSwingProviderFactory}s that support the
76
     * given factory types.
77
     * 
78
     * @see ExporttoSwingManager#VECTORIAL_TABLE_WITH_GEOMETRY
79
     * @see ExporttoSwingManager#VECTORIAL_TABLE_WITHOUT_GEOMETRY
80
     * @param providerTypes
81
     *            the types of factories
82
     * @return the list of factories for the given factory types
83
     */
84
    public List<ExporttoSwingProviderFactory> getProviderFactories(
85
        int[] providerTypes);
86

    
87
    /**
88
     * Returns the description for a concrete provider
89
     * 
90
     * @param providerName
91
     *            the exportto provider.
92
     * @return
93
     *         the description of the provider.
94
     */
95
    public String getDescription(String providerName);
96

    
97
    /**
98
     * Return if a provider supports a data type.
99
     * 
100
     * @param providerName
101
     *            the provider name.
102
     * @param providerType
103
     *            the provider type. One of the constants defined in the
104
     *            {@link ExporttoSwingManager}.
105
     * @return
106
     *         if the provider supports a dataType.
107
     * @throws ServiceException
108
     */
109
    public boolean support(String providerName, int providerType)
110
        throws ServiceException;
111

    
112
    /**
113
     * Creates a {@link ExporttoSwingProvider} that is used to export a
114
     * {@link FeatureSet}.
115
     * 
116
     * @param providerName
117
     *            the name of the provider that has to be created.
118
     * @param featureStore
119
     *            the source feature store. It can be used to fix some
120
     *            parameters like the {@link FeatureType} of the destination
121
     *            {@link FeatureStore}.
122
     * @param projection
123
     *            the projection of the {@link OutputDeviceAssigned} store.
124
     * @return
125
     *         a provider that has to be used to export a {@link FeatureSet}.
126
     */
127
    public ExporttoSwingProvider createExporttoSwingProvider(
128
        String providerName, FeatureStore featureStore, IProjection projection)
129
        throws ServiceException;
130

    
131
    /**
132
     * Returns if the provider whose factory is provided is enabled.
133
     * 
134
     * @param factory
135
     *            of the provider to check
136
     * @return if the provider whose factory is provided is enabled
137
     */
138
    public boolean isProviderEnabled(ExporttoSwingProviderFactory factory);
139

    
140
    /**
141
     * Enables or disables an exportto provider.
142
     * 
143
     * @param factory
144
     *            of the provider to enable or disable
145
     * @param value
146
     *            if the provider must be enabled or disabled
147
     */
148
    public void enableProvider(ExporttoSwingProviderFactory factory,
149
        boolean value);
150

    
151
    /**
152
     * Returns the provider factory with the given name.
153
     * 
154
     * @param name
155
     *            of the provider
156
     * @return the provider factory
157
     * @throws ServiceException
158
     *             if there is an error getting the provider factory
159
     */
160
    public ExporttoSwingProviderFactory getExporttoSwingProviderFactory(
161
        String name) throws ServiceException;
162

    
163
    /**
164
     * Creates a preferences component to manage the export to properties.
165
     * 
166
     * @return a preferences component
167
     */
168
    public ExporttoSwingPreferencesComponent createExporttoSwingProvidersPreferences();
169
}