Revision 35514

View differences:

branches/v2_0_0_prep/extensions/extDalTransform/src/main/java/org/gvsig/app/daltransform/gui/DataTransformGui.java
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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.app.daltransform.gui;
29

  
30
import java.awt.Dimension;
31
import java.util.List;
32

  
33
import org.gvsig.fmap.dal.exception.DataException;
34
import org.gvsig.fmap.dal.feature.FeatureStore;
35
import org.gvsig.fmap.dal.feature.FeatureStoreTransform;
36

  
37
/**
38
 * This interface is used to establish a relationship between 
39
 * feature transformations and their user interfaces. It creates 
40
 * the panels that are used to set the parameters that the 
41
 * transformation needs. 
42
 * 
43
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
44
 */
45
public interface DataTransformGui {
46
    
47
	/**
48
	 * Creates a feature transformation from a feature store. The
49
	 * class that implements this interface can create a transformation
50
	 * using this feature store and all the parameters that the user has
51
	 * selected. All these parameters must be known by this class
52
	 * @param featureStore
53
	 * The selected feature store
54
	 * @return
55
	 * the transformation
56
	 * @throws DataException
57
	 */
58
	public FeatureStoreTransform createFeatureStoreTransform(FeatureStore featureStore) throws DataException;
59
		
60
    /**
61
     * Creates a list of panels to set the parameters used on the transformation.
62
     * @return
63
     * a set of panels with the parameters of the transformation
64
     */
65
	public List<DataTransformWizardPanel> createPanels();
66

  
67
	/**
68
	 * @return the name that is displayed in the feature transformation
69
	 * list
70
	 */
71
	public String getName();
72
	
73
	/**
74
	 * @return a description of the feature transformation
75
	 */
76
	public String getDescription();
77
	
78
	/**
79
	 * Returns the minimum size that has to be the wizard to display
80
	 * the forms.
81
	 * @return
82
	 * The minimum size for the panels. 
83
	 */
84
	public Dimension getMinDimension();
85
}
86

  
branches/v2_0_0_prep/extensions/extDalTransform/src/main/java/org/gvsig/app/daltransform/gui/DataTransformWizard.java
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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.app.daltransform.gui;
29

  
30
import org.gvsig.andami.ui.mdiManager.IWindow;
31
import org.gvsig.fmap.dal.feature.FeatureStore;
32
import org.gvsig.fmap.dal.feature.FeatureStoreTransform;
33

  
34

  
35
/**
36
 * This interface has to be implemented by the transformation
37
 * wizard. It has to provide 
38
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
39
 */
40
public interface DataTransformWizard {
41
	
42
	/**
43
	 * Returns the window that has to be displayed to 
44
	 * apply transformation.
45
	 * @return
46
	 * The window to display.
47
	 */
48
	public IWindow getWindow();
49
	
50
	/**
51
	 * Returns <code>true</code> if the transformation 
52
	 * can be applied. 
53
	 * @param isApplicable
54
	 * If the transformation can be applied.
55
	 */
56
	public void setApplicable(boolean isApplicable);
57
	
58
	/**
59
	 * Returns the  {@link FeatureStore} that can is used
60
	 * to apply the transformation.
61
	 * @return
62
	 * The selected {@link FeatureStore}
63
	 */
64
	public FeatureStore getFeatureStore();
65
	
66
	/**
67
	 * Returns <code>true</code> if the selected {@link FeatureStore}
68
	 * has been selected from a layer. 
69
	 * @return
70
	 * If the selected {@link FeatureStore} has been selected
71
	 * from a layer. 
72
	 */
73
	public boolean isFeatureStoreLayer();
74
	
75
	/**
76
	 * Returns the selected {@link DataTransformGui}. It is used
77
	 * to create the {@link FeatureStoreTransform}.
78
	 * @return
79
	 * The selected {@link DataTransformGui}.
80
	 */
81
	public DataTransformGui getDataTransformGui();	
82
	
83
	/**
84
	 * Sets the value of the transformation to apply. The wizard
85
	 * uses this transformation like the selected transformation.
86
	 * @param dataTransformGui
87
	 * The transformation to apply.
88
	 */
89
	public void setDataTransformGui(DataTransformGui dataTransformGui);
90
}
91

  
branches/v2_0_0_prep/extensions/extDalTransform/src/main/java/org/gvsig/app/daltransform/gui/DataTransformWizardPanel.java
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

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {Iver T.I.}   {Task}
26
 */
27

  
28
package org.gvsig.app.daltransform.gui;
29

  
30
import javax.swing.JPanel;
31

  
32
/**
33
 * This class has to be inherited by all the classes
34
 * that appears on the transformation wizard. It contains
35
 * methods to manage the wizard.  
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
37
 */
38
public interface DataTransformWizardPanel {
39

  
40
	/**
41
	 * Returns a title for the panel.
42
	 * @return
43
	 * The panel title.
44
	 */
45
	public String getPanelTitle();
46

  
47
	/**
48
	 * This method is called when the next button is clicked
49
	 */
50
	public void nextPanel();
51

  
52
	/**
53
	 * This method is called when the last button is clicked
54
	 */
55
	public void lastPanel();
56
	
57
	/**
58
	 * This method is called when the panel is displayed
59
	 */
60
	public void updatePanel();
61
		
62
	/**
63
	 * Return the panel to display.
64
	 * @return
65
	 * The panel.
66
	 */
67
	public JPanel getJPanel();
68
	
69
	/**
70
	 * Sets the DataTransformWizard that contains information about
71
	 * all the wizard.
72
	 * @param dataTransformWizard
73
	 * The wizard to set.
74
	 */
75
	public void setDataTransformWizard(DataTransformWizard dataTransformWizard);
76
}
77

  
78

  

Also available in: Unified diff