root / branches / v2_0_0_prep / extensions / extDalTransformJoin / src / org / gvsig / app / join / daltransform / JoinTransformGui.java @ 38383
History | View | Annotate | Download (4.09 KB)
1 | 28897 | jpiera | /* 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.join.daltransform; |
||
29 | |||
30 | 29792 | jpiera | import java.awt.Dimension; |
31 | 28897 | jpiera | import java.util.ArrayList; |
32 | import java.util.List; |
||
33 | |||
34 | 38382 | jldominguez | import javax.swing.JOptionPane; |
35 | |||
36 | import org.slf4j.Logger; |
||
37 | import org.slf4j.LoggerFactory; |
||
38 | |||
39 | 29627 | jpiera | import org.gvsig.andami.PluginServices; |
40 | 38382 | jldominguez | import org.gvsig.andami.ui.mdiManager.IWindow; |
41 | import org.gvsig.app.ApplicationLocator; |
||
42 | 28897 | jpiera | import org.gvsig.app.join.dal.feature.JoinTransform; |
43 | 35520 | nfrancisco | import org.gvsig.daltransform.swing.DataTransformGui; |
44 | import org.gvsig.daltransform.swing.DataTransformWizardPanel; |
||
45 | 28897 | jpiera | import org.gvsig.fmap.dal.exception.DataException; |
46 | import org.gvsig.fmap.dal.feature.FeatureStore; |
||
47 | import org.gvsig.fmap.dal.feature.FeatureStoreTransform; |
||
48 | 38382 | jldominguez | import org.gvsig.fmap.mapcontrol.dal.feature.swing.FeatureTypesTablePanel; |
49 | import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.ConfigurableFeatureTableModel; |
||
50 | import org.gvsig.i18n.Messages; |
||
51 | 28897 | jpiera | |
52 | |||
53 | /**
|
||
54 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
55 | */
|
||
56 | public class JoinTransformGui implements DataTransformGui { |
||
57 | 38382 | jldominguez | |
58 | private static Logger logger = LoggerFactory.getLogger(JoinTransformGui.class); |
||
59 | |||
60 | 29164 | jpiera | private SelectSecondDataStoreWizardPanel secondDataStoreWizard = null; |
61 | private SelectParametersWizardPanel parametersWizard = null; |
||
62 | private List<DataTransformWizardPanel> panels = null; |
||
63 | 28897 | jpiera | |
64 | public JoinTransformGui() {
|
||
65 | super();
|
||
66 | } |
||
67 | |||
68 | /* (non-Javadoc)
|
||
69 | * @see org.gvsig.app.daltransform.gui.FeatureTransformGui#createFeatureStoreTransform(org.gvsig.fmap.dal.feature.FeatureStore)
|
||
70 | */
|
||
71 | public FeatureStoreTransform createFeatureStoreTransform(
|
||
72 | FeatureStore featureStore) throws DataException {
|
||
73 | JoinTransform transform = new JoinTransform();
|
||
74 | transform.initialize(featureStore, |
||
75 | secondDataStoreWizard.getSelectedFeatureStore(), |
||
76 | parametersWizard.getKeyAttr1(), |
||
77 | parametersWizard.getkeyAtrr2(), |
||
78 | parametersWizard.getPrefix1(), |
||
79 | parametersWizard.getPrefix2(), |
||
80 | parametersWizard.getAttributes() |
||
81 | ); |
||
82 | return transform;
|
||
83 | } |
||
84 | |||
85 | 38382 | jldominguez | |
86 | |||
87 | /* (non-Javadoc)
|
||
88 | 28897 | jpiera | * @see org.gvsig.app.daltransform.gui.FeatureTransformGui#getDescription()
|
89 | */
|
||
90 | public String getDescription() { |
||
91 | return PluginServices.getText(this, "join_description"); |
||
92 | } |
||
93 | |||
94 | /* (non-Javadoc)
|
||
95 | * @see org.gvsig.app.daltransform.gui.FeatureTransformGui#createPanels(org.gvsig.app.daltransform.gui.FeatureTransformWizardModel)
|
||
96 | */
|
||
97 | 29164 | jpiera | public List<DataTransformWizardPanel> createPanels() { |
98 | 28897 | jpiera | if (panels == null){ |
99 | 29164 | jpiera | parametersWizard = new SelectParametersWizardPanel();
|
100 | secondDataStoreWizard = new SelectSecondDataStoreWizardPanel(parametersWizard);
|
||
101 | panels = new ArrayList<DataTransformWizardPanel>(); |
||
102 | 28897 | jpiera | panels.add(secondDataStoreWizard); |
103 | panels.add(parametersWizard); |
||
104 | } |
||
105 | return panels;
|
||
106 | } |
||
107 | |||
108 | /* (non-Javadoc)
|
||
109 | * @see org.gvsig.app.daltransform.gui.FeatureTransformGui#getName()
|
||
110 | */
|
||
111 | public String getName() { |
||
112 | return PluginServices.getText(this, "join_name"); |
||
113 | } |
||
114 | |||
115 | 29792 | jpiera | /* (non-Javadoc)
|
116 | * @see org.gvsig.app.daltransform.gui.DataTransformGui#getMinDimension()
|
||
117 | */
|
||
118 | public Dimension getMinDimension() { |
||
119 | // TODO Auto-generated method stub
|
||
120 | return null; |
||
121 | } |
||
122 | |||
123 | 37522 | jpiera | public boolean accept(FeatureStore featureStore) { |
124 | return true; |
||
125 | } |
||
126 | 38382 | jldominguez | |
127 | 38383 | jldominguez | |
128 | 38382 | jldominguez | |
129 | public String toString() { |
||
130 | return getName();
|
||
131 | } |
||
132 | 28897 | jpiera | } |