Revision 43663

View differences:

tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.newlayer.lib.api</artifactId>
5
  <packaging>jar</packaging>
6
  <name>${project.artifactId}</name>
7
  <parent>
8
      <groupId>org.gvsig</groupId>
9
      <artifactId>org.gvsig.newlayer.lib</artifactId>
10
    <version>2.0.213</version>
11
  </parent>
12

  
13
  <dependencies>
14
      <dependency>
15
          <groupId>org.gvsig</groupId>
16
          <artifactId>org.gvsig.tools.lib</artifactId>
17
          <scope>compile</scope>
18
      </dependency>
19
      <dependency>
20
          <groupId>org.gvsig</groupId>
21
          <artifactId>org.gvsig.tools.swing.api</artifactId>
22
          <scope>compile</scope>
23
      </dependency>
24
      <dependency>
25
          <groupId>org.gvsig</groupId>
26
          <artifactId>org.gvsig.fmap.dal.api</artifactId>
27
          <scope>compile</scope>
28
      </dependency>
29
      <dependency>
30
          <groupId>org.gvsig</groupId>
31
          <artifactId>org.gvsig.projection.api</artifactId>
32
          <scope>compile</scope>
33
      </dependency>
34
      <dependency>
35
          <groupId>org.gvsig</groupId>
36
          <artifactId>org.gvsig.ui</artifactId>
37
          <scope>compile</scope>
38
      </dependency>
39
      <dependency>
40
          <groupId>jwizardcomponent</groupId>
41
          <artifactId>jwizardcomponent</artifactId>
42
          <scope>compile</scope>
43
      </dependency>
44
      <dependency>
45
          <groupId>org.gvsig</groupId>
46
          <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
47
          <scope>compile</scope>
48
      </dependency>
49
  </dependencies>
50

  
51
</project>
52

  
53

  
0 54

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.newlayer.NewLayerLibrary
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/resources/filters.txt
1
point_geometries_only=
2
curve_geometries_only=
3
surface_geometries_only=
0 4

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerManager.java
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.newlayer;
25

  
26
import java.util.List;
27

  
28
import org.gvsig.fmap.mapcontext.MapContext;
29
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent;
30
import org.gvsig.tools.service.ServiceException;
31

  
32
/**
33
 * This class is responsible of the management of the library's business logic.
34
 * It is the library's main entry point, and provides all the services to manage
35
 * {@link NewLayerService}s.
36
 * 
37
 * @see NewLayerService
38
 * @author gvSIG team
39
 * @version $Id$
40
 */
41
public interface NewLayerManager {
42

  
43
    public enum STORETYPE{ANY,TABULAR,SPATIAL};
44
    
45

  
46
    /**
47
     * Create an instance of a {@link NewLayerService}.
48
     * @return {@link NewLayerService}
49
     * @throws ServiceException
50
     *             if there is an error getting the service
51
     */
52
    public NewLayerService createNewLayerService(MapContext mapContext);
53
    
54
    public void registerProvider(NewLayerProviderFactory factory);
55
    
56
    public List<NewLayerProviderFactory> getProviders(STORETYPE filter);
57

  
58
    public List<NewLayerProviderFactory> getProviders();
59
    
60
    public NewLayerWizard createNewLayerWizard(NewLayerService service);
61

  
62
    /**
63
     * Returns the provider factory with the given name.
64
     * 
65
     * @param name
66
     *            of the provider
67
     * @return the provider factory
68
     * @throws ServiceException
69
     *             if there is an error getting the provider factory
70
     */
71
    public NewLayerProviderFactory getNewLayerProviderFactory(
72
        String providerName) throws ServiceException;
73

  
74
    /**
75
     * Enables or disables a new layer provider.
76
     * 
77
     * @param factory
78
     *            of the provider to enable or disable
79
     * @param value
80
     *            if the provider must be enabled or disabled
81
     */
82
    public void enableProvider(NewLayerProviderFactory factory, Boolean false1);
83

  
84
    /**
85
     * Creates a preferences component to manage the export to properties.
86
     * 
87
     * @return a preferences component
88
     */
89
    public NewLayerPreferencesComponent createNewLayerProvidersPreferences();
90

  
91
    /**
92
     * Returns if the provider whose factory is provided is enabled.
93
     * 
94
     * @param factory
95
     *            of the provider to check
96
     * @return if the provider whose factory is provided is enabled
97
     */
98
    public boolean isProviderEnabled(NewLayerProviderFactory factory);
99

  
100
}
0 101

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerProvider.java
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.newlayer;
25

  
26
import java.util.List;
27

  
28
import org.gvsig.fmap.dal.DataServerExplorer;
29
import org.gvsig.fmap.dal.DataStoreParameters;
30
import org.gvsig.fmap.dal.feature.EditableFeatureType;
31
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
32
import org.gvsig.tools.service.spi.Provider;
33

  
34
public interface NewLayerProvider extends Provider{
35
	
36
	public NewLayerService getService();
37
	
38
	public DataServerExplorer getExplorer();
39
	
40
	public String getStoreName();
41

  
42
	public EditableFeatureType getFeatureType();
43
	
44
	public NewFeatureStoreParameters getNewStoreParameters();
45
	
46
	public DataStoreParameters getOpenStoreParameters();
47

  
48
	public List<NewLayerProviderPanel> getPanels();
49
}
0 50

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerProviderPanel.java
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.newlayer;
25

  
26
import javax.swing.JPanel;
27

  
28

  
29
public abstract class NewLayerProviderPanel extends JPanel{
30

  
31

  
32
	protected NewLayerProvider provider;
33

  
34
	protected NewLayerProviderPanel(NewLayerProvider provider){
35
		this.provider = provider;
36
	}
37

  
38
	public abstract String getTitle();
39
	
40
	public abstract boolean isValidPanel() throws NewLayerException;
41
	
42
	public abstract void updatePanel();
43
	
44
	
45
	
46
}
0 47

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/preferences/NewLayerPreferencesComponent.java
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.newlayer.preferences;
25

  
26
import java.util.Set;
27

  
28
import org.gvsig.newlayer.NewLayerProviderFactory;
29
import org.gvsig.tools.swing.api.Component;
30

  
31
/**
32
 * API for the Export to swing preferences component panel.
33
 * 
34
 * @author gvSIG Team
35
 * @version $Id$
36
 */
37
public interface NewLayerPreferencesComponent extends Component {
38

  
39
    /**
40
     * Returns the providers disabled by the user.
41
     * 
42
     * @return the providers disabled by the user
43
     */
44
    Set<NewLayerProviderFactory> getDisabledProviders();
45

  
46
    /**
47
     * Undoes all the user changes in the preferences.
48
     */
49
    void initializeDefaults();
50

  
51
    /**
52
     * Is the user has made any change in the preferences.
53
     * 
54
     * @return the user has made any change
55
     */
56
    boolean isValueChanged();
57

  
58
    /**
59
     * Tells the component the changes made by the user to the properties
60
     * had been performed.
61
     */
62
    void setChangesApplied();
63
}
0 64

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerException.java
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.newlayer;
25

  
26
import org.gvsig.tools.exception.BaseException;
27

  
28
/**
29
 * Generic exception thrown in the NewLayer API when the exception or error
30
 * may be dealt by the program or the user of the program which is a client of
31
 * the NewLayer API.
32
 * 
33
 * @see {@link NewLayerService}
34
 * @see {@link NewLayerManager}
35
 * @author gvSIG team.
36
 * @version $Id$
37
 */
38
public class NewLayerException extends BaseException {
39

  
40
    /**
41
	 * 
42
	 */
43
	private static final long serialVersionUID = -2954242107118688337L;
44

  
45
	private static final String MESSAGE =
46
        "An error has been produced in the NewLayer library";
47

  
48
    private static final String KEY = "_NewLayerException";
49

  
50
    /**
51
     * Constructor to be used in rare cases, usually you must create a new child
52
     * exception class for each case.
53
     * <strong>Don't use this constructor in child classes.</strong>
54
     */
55
    public NewLayerException() {
56
        super(MESSAGE, KEY, serialVersionUID);
57
    }
58

  
59
    /**
60
     * Constructor to be used in rare cases, usually you must create a new child
61
     * exception class for each case.
62
     * <p>
63
     * <strong>Don't use this constructor in child classes.</strong>
64
     * </p>
65
     * 
66
     * @param cause
67
     *            the original cause of the exception
68
     */
69
    public NewLayerException(Exception cause) {
70
        super(MESSAGE, cause, KEY, serialVersionUID);
71
    }
72

  
73
    /**
74
     * @see BaseException#BaseException(String, String, long).
75
     * @param message
76
     *            the default messageFormat to describe the exception
77
     * @param key
78
     *            the key to use to search a localized messageFormnata
79
     * @param code
80
     *            the unique code to identify the exception
81
     */
82
    protected NewLayerException(String message, String key, long code) {
83
        super(message, key, code);
84
    }
85

  
86
    /**
87
     * @see BaseException#BaseException(String, Throwable, String, long).
88
     * @param message
89
     *            the default messageFormat to describe the exception
90
     * @param cause
91
     *            the original cause of the exception
92
     * @param key
93
     *            the key to use to search a localized messageFormnata
94
     * @param code
95
     *            the unique code to identify the exception
96
     */
97
    protected NewLayerException(String message, Throwable cause,
98
        String key, long code) {
99
        super(message, cause, key, code);
100
    }
101
}
0 102

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerServiceException.java
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.newlayer;
25

  
26
import org.gvsig.tools.exception.BaseException;
27
import org.gvsig.tools.service.ServiceException;
28

  
29
/**
30
 * Exception thrown when there is an error getting a NewLayer message.
31
 * 
32
 * @author gvSIG team
33
 * @version $Id$
34
 */
35
public class NewLayerServiceException extends ServiceException {
36
    /**
37
	 * 
38
	 */
39
	private static final long serialVersionUID = -4395786952326742397L;
40

  
41
	private static final String MESSAGE =
42
        "An error has been produced creating a store";
43

  
44
    private static final String KEY = "_NewLayerServiceException";
45
    
46
	/**
47
	 * @see BaseException#BaseException(String, String, long)
48
	 */
49
	protected NewLayerServiceException(String message, String key, long code) {
50
		super(message, key, code);
51
	}
52

  
53
	/**
54
	 * @see BaseException#BaseException(String, Throwable, String, long)
55
	 */
56
	protected NewLayerServiceException(String message, Throwable cause, String key,
57
			long code) {
58
		super(message, cause, key, code);
59
	}
60

  
61
    /**
62
     * Creates a new {@link NewLayerServiceException}.
63
     * 
64
     * @param cause
65
     *            the original cause
66
     */
67
    public NewLayerServiceException(Throwable cause) {
68
        super(MESSAGE, cause, KEY, serialVersionUID);
69
    }
70
    
71
}
0 72

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerService.java
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.newlayer;
25

  
26
import java.util.List;
27

  
28
import org.gvsig.fmap.dal.DataServerExplorer;
29
import org.gvsig.fmap.dal.DataStoreParameters;
30
import org.gvsig.fmap.dal.feature.EditableFeatureType;
31
import org.gvsig.fmap.dal.feature.FeatureStore;
32
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
33
import org.gvsig.fmap.mapcontext.MapContext;
34

  
35
/**
36
 * <p>
37
 * This service is used to create a new {@link FeatureStore}.
38
 * </p>
39
 * 
40
 * @author gvSIG team
41
 * @version $Id$
42
 */
43
public interface NewLayerService {
44

  
45
    /**
46
     * @deprecated use {@link #setProviderFactory(NewLayerProviderFactory)}
47
     *             instead
48
     */
49
    public void setType(String type);
50

  
51
    /**
52
     * @deprecated use {@link #getProviderFactory()} instead
53
     */
54
    public String getType();
55

  
56
    /**
57
     * @deprecated use {@link #getProviderFactories()} instead
58
     */
59
    public List<String> getTypes();
60

  
61
    public void setProviderFactory(NewLayerProviderFactory type);
62
    
63
    public NewLayerProviderFactory getProviderFactory();
64

  
65
    public List<NewLayerProviderFactory> getProviderFactories();
66
    
67
    public void createLayer() throws NewLayerServiceException;
68

  
69
	public void loadLayer() throws NewLayerServiceException;
70

  
71
    public DataServerExplorer getExplorer();
72
    
73
    public String getStoreName();
74
    
75
    public EditableFeatureType getFeatureType();
76
    
77
    public NewFeatureStoreParameters getNewStoreParameters();
78
    
79
    public DataStoreParameters getOpenStoreParameters();
80
    
81
    public NewLayerProvider getProvider();
82
    
83
    public void addLayerToView(boolean b);
84
    
85
    public MapContext getMapContext();
86
    
87
}
0 88

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerWizard.java
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.newlayer;
25

  
26
import javax.swing.ImageIcon;
27

  
28
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo;
29

  
30

  
31
public abstract class NewLayerWizard extends WizardPanelWithLogo{
32

  
33
	private static final long serialVersionUID = -9070328984844239279L;
34

  
35
	public NewLayerWizard(ImageIcon logo) {
36
		super(logo);
37
	}
38

  
39
	public abstract NewLayerService getService();
40

  
41
    public abstract void setType(NewLayerProviderFactory currentType);
42

  
43
}
0 44

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerProviderFactory.java
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.newlayer;
25

  
26
import org.gvsig.tools.service.spi.ProviderFactory;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 */
32
public interface NewLayerProviderFactory extends ProviderFactory {
33

  
34
    public boolean isSpatial();
35

  
36
    public NewLayerProvider create(NewLayerService service);
37

  
38
    /**
39
     * If the provider this factory creates is enabled. This option might
40
     * be used as a way to show or not some providers to the user.
41
     * 
42
     * @return if the provider is enabled
43
     */
44
    public boolean isEnabled();
45

  
46
    /**
47
     * Enable or disable this provider factory.
48
     * 
49
     * @param value
50
     *            if to enable or disable the factory
51
     */
52
    public void setEnabled(boolean value);
53

  
54
    /**
55
     * Returns a description of the provider.
56
     * 
57
     * @return a description for the provider
58
     */
59
    public String getDescription();
60

  
61
    /**
62
     * Returns a label or short description for the provider.
63
     * 
64
     * @return a label or short description for the provider
65
     */
66
    public String getLabel();
67
}
0 68

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerLocator.java
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.newlayer;
25

  
26
import org.gvsig.tools.locator.BaseLocator;
27
import org.gvsig.tools.locator.Locator;
28
import org.gvsig.tools.locator.LocatorException;
29

  
30
/**
31
 * This locator is the entry point for the NewLayer library, providing
32
 * access to all NewLayer services through the {@link NewLayerManager}
33
 * .
34
 * 
35
 * @author gvSIG team
36
 * @version $Id$
37
 */
38
public class NewLayerLocator extends BaseLocator {
39

  
40
    /**
41
     * NewLayer manager name.
42
     */
43
    public static final String MANAGER_NAME = "NewLayer.manager";
44

  
45
    /**
46
     * NewLayer manager description.
47
     */
48
    public static final String MANAGER_DESCRIPTION = "NewLayer Manager";
49

  
50
    private static final String LOCATOR_NAME = "NewLayer.locator";
51

  
52
    /**
53
     * Unique instance.
54
     */
55
    private static final NewLayerLocator INSTANCE =
56
        new NewLayerLocator();
57

  
58
    /**
59
     * Return the singleton instance.
60
     * 
61
     * @return the singleton instance
62
     */
63
    public static NewLayerLocator getInstance() {
64
        return INSTANCE;
65
    }
66

  
67
    /**
68
     * Return the Locator's name.
69
     * 
70
     * @return a String with the Locator's name
71
     */
72
    public final String getLocatorName() {
73
        return LOCATOR_NAME;
74
    }
75

  
76
    /**
77
     * Return a reference to the NewLayerManager.
78
     * 
79
     * @return a reference to the NewLayerManager
80
     * @throws LocatorException
81
     *             if there is no access to the class or the class cannot be
82
     *             instantiated
83
     * @see Locator#get(String)
84
     */
85
    public static NewLayerManager getManager() throws LocatorException {
86
        return (NewLayerManager) getInstance().get(MANAGER_NAME);
87
    }
88

  
89
    /**
90
     * Registers the Class implementing the NewLayerManager interface.
91
     * 
92
     * @param clazz
93
     *            implementing the NewLayerManager interface
94
     */
95
    public static void registerManager(
96
        Class<? extends NewLayerManager> clazz) {
97
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
98
    }
99

  
100
}
0 101

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/NewLayerLibrary.java
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.newlayer;
25

  
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
29

  
30
/**
31
 * Library for API initialization and configuration.
32
 * 
33
 * @author gvSIG team
34
 * @version $Id$
35
 */
36
public class NewLayerLibrary extends AbstractLibrary {
37
       
38
    @Override
39
    public void doRegistration() {
40
        registerAsAPI(NewLayerLibrary.class);
41
    }
42

  
43
    @Override
44
    protected void doInitialize() throws LibraryException {
45
        // Do nothing
46
    }
47

  
48
    @Override
49
    protected void doPostInitialize() throws LibraryException {
50
        // Validate there is any implementation registered.
51
        NewLayerManager manager = NewLayerLocator.getManager();
52
        if (manager == null) {
53
            throw new ReferenceNotRegisteredException(
54
                NewLayerLocator.MANAGER_NAME, NewLayerLocator
55
                    .getInstance());
56
        }
57
    }
58

  
59
}
0 60

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/spi/AbstractNewLayerProviderFactory.java
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.newlayer.spi;
25

  
26
import org.gvsig.newlayer.NewLayerLocator;
27
import org.gvsig.newlayer.NewLayerProviderFactory;
28
import org.gvsig.tools.dynobject.DynClass;
29
import org.gvsig.tools.dynobject.DynObject;
30
import org.gvsig.tools.service.ServiceException;
31
import org.gvsig.tools.service.spi.Provider;
32
import org.gvsig.tools.service.spi.ProviderServices;
33

  
34
public abstract class AbstractNewLayerProviderFactory implements NewLayerProviderFactory{
35

  
36
	public final Provider doCreate(DynObject parameters, ProviderServices services) {
37
		throw new UnsupportedOperationException();
38
	}
39

  
40
	public DynObject createParameters() {
41
		throw new UnsupportedOperationException();
42
	}
43

  
44
	public void initialize() {
45
		throw new UnsupportedOperationException();
46
	}
47

  
48
	protected DynClass createParametersDynClass() {
49
		throw new UnsupportedOperationException();
50
	}
51

  
52
	public Provider create(DynObject parameters, ProviderServices services)
53
	throws ServiceException {
54
		throw new UnsupportedOperationException();
55
	}
56

  
57
    public boolean isEnabled() {
58
        return NewLayerLocator.getManager().isProviderEnabled(this);
59
    }
60

  
61
    public void setEnabled(boolean value) {
62
        NewLayerLocator.getManager().enableProvider(this, value);
63
    }
64

  
65
    @Override
66
    public String toString() {
67
        return getLabel();
68
    }
69
}
0 70

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.api/src/main/java/org/gvsig/newlayer/spi/AbstractNewLayerProvider.java
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.newlayer.spi;
25

  
26
import org.gvsig.fmap.dal.DataServerExplorer;
27
import org.gvsig.newlayer.NewLayerProvider;
28
import org.gvsig.newlayer.NewLayerService;
29
import org.gvsig.tools.service.spi.ProviderServices;
30

  
31
public abstract class AbstractNewLayerProvider implements NewLayerProvider{
32

  
33
	private NewLayerService service;
34
	protected DataServerExplorer explorer;
35
	protected String storeName;
36

  
37
	protected AbstractNewLayerProvider(NewLayerService service){
38
		this.service = service;
39
	}
40
	
41
	public NewLayerService getService() {
42
		return service;
43
	}
44
	
45
	public DataServerExplorer getExplorer() {
46
		return explorer;
47
	}
48
	
49
	public String getStoreName() {
50
		return storeName;
51
	}
52
	
53
	public void setProviderServices(ProviderServices services) {
54
		throw new UnsupportedOperationException();
55
	}
56
	
57
	
58

  
59
}
0 60

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3

  
4
  <modelVersion>4.0.0</modelVersion>
5
  <artifactId>org.gvsig.newlayer.lib</artifactId>
6
  <packaging>pom</packaging>
7
  <name>org.gvsig.newlayer.lib</name>
8
  <parent>
9
    <groupId>org.gvsig</groupId>
10
    <artifactId>org.gvsig.newlayer</artifactId>
11
    <version>2.0.213</version>
12
  </parent>
13

  
14
  <modules>
15
    <module>org.gvsig.newlayer.lib.api</module>
16
    <module>org.gvsig.newlayer.lib.impl</module>
17
  </modules>
18
</project>
19

  
20

  
0 21

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
0 9

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 3
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
28

  
29
<!-- 
30
Log4J configuration file for unit tests execution.
31
 -->
32
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
33

  
34
	<!-- Appender configuration to show logging messages through the console -->
35
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
36
		<layout class="org.apache.log4j.PatternLayout">
37
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
38
		</layout>
39
	</appender>
40

  
41
	<!-- 
42
	Activate logging messages of DEBUG level of higher only for the
43
	org.gvsig.tools packages.
44
	You can put full classes names or packages instead, to configure
45
	logging for all the classes and subpackages of the package.
46
	-->
47
	<category name="org.gvsig.tools">
48
		<priority value="DEBUG" />
49
	</category>
50
	<category name="org.gvsig.newlayer">
51
		<priority value="DEBUG" />
52
	</category>
53

  
54
	<!-- 
55
	By default, show only logging messages of INFO level or higher, 
56
	through the previously configured CONSOLE appender. 
57
	-->
58
	<root>
59
		<priority value="INFO" />
60
		<appender-ref ref="CONSOLE" />
61
	</root>
62
</log4j:configuration>
0 63

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.newlayer.impl.NewLayerDefaultImplLibrary
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/newlayerfilters.properties
1
#point_geometries_only=
2
#curve_geometries_only=
3
#surface_geometries_only=
4
prov_demo=PROV < '10'
0 5

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/i18n/text_en.properties
1
cant_create_new_layer=Can't create the new layer
2
new_layer_parameters_missing=Can't create a new layer.\n The store paremeters are missing.\n Go back and enter it, please.
3
new_layer_not_store_name=Can't create a new layer.\n The store name is missing.\n Go back and enter it, please.
4
not_applicable=Not applicable
5
_Invalid_geometry_type=Invalid geometry type
6
_Add_layer_to_view=Add layer to view
7
_Field_definitions=Field definitions
8
_Output_format=Output format
9
_Adding_layer=Adding layer
10
_Name=Name
11
_Geometry_type=Geom. type
12
_Dimensions=Dimensions
13
_Primary_key=Primary key
14
_Mandatory=Mandatory
15
_Mandatory_(short_text)=Mand.
16

  
0 17

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/i18n/text.properties
1
cant_create_new_layer=No se puede crear la nueva capa
2
new_layers_parameters_missing=No se puede crear una nueva capa.\nFaltan los par?metros.\nVuelva atr?s e introd?zcalos.
3
new_layer_not_store_name=No se puede crear la nueva capa.\nEl nombre del store no existe.\nVuelva atr?s e introd?zcalo.
4
not_applicable=No aplicable
5
_Invalid_geometry_type=Tipo de geometr?a no v?lido
6
_Add_layer_to_view=A?adir capa a la vista
7
_Field_definitions=Definiciones de campos
8
_Output_format=Formato de salida
9
_Adding_layer=A?adir capa
10
_Name=Nombre
11
_Geometry_type=Tipo geom.
12
_Dimensions=Dimensiones
13
_Primary_key=Clave primaria
14
_Mandatory=Obligatorio
15
_Mandatory_(short_text)=Oblig.
16

  
17

  
0 18

  
tags/org.gvsig.desktop-2.0.213/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/preferences/DefaultNewLayerPreferencesComponent.java
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.newlayer.impl.preferences;
25

  
26
import java.awt.GridBagConstraints;
27
import java.awt.GridBagLayout;
28
import java.awt.Insets;
29
import java.util.ArrayList;
30
import java.util.HashSet;
31
import java.util.List;
32
import java.util.Set;
33

  
34
import javax.swing.JCheckBox;
35
import javax.swing.JComponent;
36
import javax.swing.JPanel;
37
import javax.swing.event.ChangeEvent;
38
import javax.swing.event.ChangeListener;
39

  
40
import org.gvsig.newlayer.NewLayerLocator;
41
import org.gvsig.newlayer.NewLayerProviderFactory;
42
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent;
43

  
44
/**
45
 * Default implementation for the {@link NewLayerPreferencesComponent}.
46
 * 
47
 * @author gvSIG Team
48
 * @version $Id$
49
 */
50
public class DefaultNewLayerPreferencesComponent extends JPanel implements
51
    NewLayerPreferencesComponent, ChangeListener {
52

  
53
    private static final long serialVersionUID = -4392838062470171181L;
54

  
55
    private JCheckBox[] providerChecks;
56
    private List<NewLayerProviderFactory> providers;
57
    private boolean valueChanged = false;
58

  
59
    /**
60
     * Creates a new DefaultNewLayerPreferencesComponent.
61
     * 
62
     * @see JPanel#JPanel()
63
     */
64
    public DefaultNewLayerPreferencesComponent() {
65
        this(true);
66
    }
67

  
68
    /**
69
     * Creates a new DefaultNewLayerPreferencesComponent.
70
     * 
71
     * @param isDoubleBuffered
72
     *            a boolean, true for double-buffering, which
73
     *            uses additional memory space to achieve fast, flicker-free
74
     *            updates
75
     * @see JPanel#JPanel(boolean)
76
     */
77
    public DefaultNewLayerPreferencesComponent(boolean isDoubleBuffered) {
78
        super(isDoubleBuffered);
79
        initialize();
80
    }
81

  
82
    private void initialize() {
83
        this.setLayout(new GridBagLayout());
84

  
85
        Insets insets = new Insets(1, 0, 1, 0);
86

  
87
        GridBagConstraints gbc = new GridBagConstraints();
88
        gbc.gridx = 0;
89
        gbc.gridy = 1;
90
        gbc.gridheight = 1;
91
        gbc.gridwidth = GridBagConstraints.REMAINDER;
92
        gbc.fill = GridBagConstraints.NONE;
93
        gbc.anchor = GridBagConstraints.WEST;
94
        gbc.weightx = 1.0f;
95
        gbc.insets = insets;
96

  
97
        providers =
98
            new ArrayList<NewLayerProviderFactory>(NewLayerLocator.getManager()
99
                .getProviders());
100
        providerChecks = new JCheckBox[providers.size()];
101
        for (int i = 0; i < providers.size(); i++) {
102
            NewLayerProviderFactory factory = providers.get(i);
103
            providerChecks[i] =
104
                new JCheckBox(factory.getLabel(), factory.isEnabled());
105
            providerChecks[i].addChangeListener(this);
106
            providerChecks[i].setToolTipText(factory.getDescription());
107
            add(providerChecks[i], gbc);
108
            gbc.gridy++;
109
        }
110
    }
111

  
112
    public JComponent asJComponent() {
113
        return this;
114
    }
115

  
116
    public void initializeDefaults() {
117
        for (int i = 0; i < providers.size(); i++) {
118
            NewLayerProviderFactory factory = providers.get(i);
119
            providerChecks[i].setSelected(factory.isEnabled());
120
        }
121
        valueChanged = false;
122
        validate();
123
    }
124

  
125
    public Set<NewLayerProviderFactory> getDisabledProviders() {
126
        Set<NewLayerProviderFactory> disabledFactories =
127
            new HashSet<NewLayerProviderFactory>();
128

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff