Revision 45788
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowLayerAsForm.java | ||
---|---|---|
199 | 199 |
private JFeaturesForm createform(FeatureStore featureStore) throws CreateJFeatureFormException, ServiceException, DataException { |
200 | 200 |
final DataSwingManager swingManager = DALSwingLocator.getSwingManager(); |
201 | 201 |
final JFeaturesForm form = swingManager.createJFeaturesForm(featureStore); |
202 |
form.setPreferredSize(new Dimension(400, 300)); |
|
202 |
// form.setPreferredSize(new Dimension(400, 300));
|
|
203 | 203 |
return form; |
204 | 204 |
} |
205 | 205 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ShowEditedFeatures.java | ||
---|---|---|
1 |
package org.gvsig.app.extension; |
|
2 |
|
|
3 |
import org.gvsig.andami.plugins.Extension; |
|
4 |
import org.gvsig.app.ApplicationLocator; |
|
5 |
import org.gvsig.app.ApplicationManager; |
|
6 |
import org.gvsig.app.extension.editedfeatures.EditedFeaturesPanel; |
|
7 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
8 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
9 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
10 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
11 |
import org.gvsig.tools.ToolsLocator; |
|
12 |
import org.gvsig.tools.i18n.I18nManager; |
|
13 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
14 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
15 |
|
|
16 |
@SuppressWarnings("UseSpecificCatch") |
|
17 |
public class ShowEditedFeatures extends Extension { |
|
18 |
|
|
19 |
@Override |
|
20 |
public void initialize() { |
|
21 |
} |
|
22 |
|
|
23 |
@Override |
|
24 |
public void execute(String actionCommand) { |
|
25 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
26 |
if ("layer-show-editedfeatures".equalsIgnoreCase(actionCommand)) { |
|
27 |
FLayer layer = application.getCurrentLayer(); |
|
28 |
if (layer == null || !(layer instanceof FLyrVect)) { |
|
29 |
return; |
|
30 |
} |
|
31 |
FLyrVect vectLayer = (FLyrVect)layer; |
|
32 |
FeatureStore featureStore = vectLayer.getFeatureStore(); |
|
33 |
if( !featureStore.isEditing() ) { |
|
34 |
return; |
|
35 |
} |
|
36 |
try { |
|
37 |
FeatureType type = featureStore.getDefaultFeatureType(); |
|
38 |
if( !type.supportReferences() ) { |
|
39 |
return; |
|
40 |
} |
|
41 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
42 |
EditedFeaturesPanel panel = new EditedFeaturesPanel(featureStore); |
|
43 |
WindowManager windowManager = ToolsSwingLocator.getWindowManager(); |
|
44 |
String title = String.format("%s (%s)", |
|
45 |
featureStore.getName(), |
|
46 |
i18n.getTranslation("_Edited_features") |
|
47 |
); |
|
48 |
windowManager.showWindow( |
|
49 |
panel.asJComponent(), |
|
50 |
title, |
|
51 |
WindowManager.MODE.WINDOW |
|
52 |
); |
|
53 |
} catch (Exception ex) { |
|
54 |
logger.warn("Can't show form of edited features",ex); |
|
55 |
} |
|
56 |
} |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public boolean isEnabled() { |
|
61 |
return true; |
|
62 |
} |
|
63 |
|
|
64 |
@Override |
|
65 |
public boolean isVisible() { |
|
66 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
67 |
FLayer layer = application.getCurrentLayer(); |
|
68 |
if (layer == null || !(layer instanceof FLyrVect)) { |
|
69 |
return false; |
|
70 |
} |
|
71 |
return ((FLyrVect)layer).getFeatureStore().isEditing(); |
|
72 |
} |
|
73 |
|
|
74 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/editedfeatures/EditedFeaturesPanel.java | ||
---|---|---|
1 |
package org.gvsig.app.extension.editedfeatures; |
|
2 |
|
|
3 |
import java.awt.Color; |
|
4 |
import java.awt.event.ActionEvent; |
|
5 |
import java.awt.event.ComponentAdapter; |
|
6 |
import java.awt.event.ComponentEvent; |
|
7 |
import java.awt.event.MouseAdapter; |
|
8 |
import java.awt.event.MouseEvent; |
|
9 |
import java.util.List; |
|
10 |
import javax.swing.ImageIcon; |
|
11 |
import javax.swing.JComponent; |
|
12 |
import javax.swing.JTable; |
|
13 |
import javax.swing.ListSelectionModel; |
|
14 |
import javax.swing.event.ListSelectionEvent; |
|
15 |
import javax.swing.table.AbstractTableModel; |
|
16 |
import javax.swing.table.DefaultTableCellRenderer; |
|
17 |
import javax.swing.table.DefaultTableColumnModel; |
|
18 |
import javax.swing.table.TableColumn; |
|
19 |
import javax.swing.table.TableColumnModel; |
|
20 |
import org.gvsig.featureform.swing.CreateJFeatureFormException; |
|
21 |
import org.gvsig.featureform.swing.JFeatureReferencesForm; |
|
22 |
import org.gvsig.fmap.dal.exception.DataException; |
|
23 |
import org.gvsig.fmap.dal.feature.Feature; |
|
24 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_BASIC; |
|
25 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_REQUIREDS; |
|
26 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
27 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
28 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
29 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
31 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
32 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
|
33 |
import org.gvsig.tools.ToolsLocator; |
|
34 |
import org.gvsig.tools.dataTypes.Coercion; |
|
35 |
import org.gvsig.tools.dataTypes.CoercionException; |
|
36 |
import org.gvsig.tools.dataTypes.DataTypes; |
|
37 |
import org.gvsig.tools.dynform.AbortActionException; |
|
38 |
import org.gvsig.tools.dynform.JDynFormSet; |
|
39 |
import org.gvsig.tools.dynform.JDynFormSetAdapter; |
|
40 |
import org.gvsig.tools.i18n.I18nManager; |
|
41 |
import org.gvsig.tools.swing.api.Component; |
|
42 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
43 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
44 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
|
45 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
46 |
import org.slf4j.Logger; |
|
47 |
import org.slf4j.LoggerFactory; |
|
48 |
|
|
49 |
/** |
|
50 |
* |
|
51 |
* @author gvSIG Team |
|
52 |
*/ |
|
53 |
@SuppressWarnings("UseSpecificCatch") |
|
54 |
public class EditedFeaturesPanel extends EditedFeaturesPanelView implements Component { |
|
55 |
|
|
56 |
private static final Logger LOGGER = LoggerFactory.getLogger(EditedFeaturesPanel.class); |
|
57 |
|
|
58 |
private class FeatureAttributeCellRenderer extends DefaultTableCellRenderer { |
|
59 |
|
|
60 |
private final FeatureAttributeDescriptor descriptor; |
|
61 |
|
|
62 |
public FeatureAttributeCellRenderer(FeatureAttributeDescriptor descriptor) { |
|
63 |
this.descriptor = descriptor; |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public java.awt.Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
|
68 |
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
|
69 |
if (value == null) { |
|
70 |
setText(""); |
|
71 |
} else { |
|
72 |
try { |
|
73 |
value = toString.coerce(value); |
|
74 |
} catch (CoercionException ex) { |
|
75 |
LOGGER.debug("Can't coerce value to string.", ex); |
|
76 |
} |
|
77 |
setText((String) value); |
|
78 |
} |
|
79 |
if (!isSelected) { |
|
80 |
this.setBackground(table.getBackground()); |
|
81 |
try { |
|
82 |
Feature feature = references.get(row).getFeature(); |
|
83 |
feature.validate(Feature.CHECK_RULES_AT_FINISH | CHECK_REQUIREDS | CHECK_BASIC); |
|
84 |
} catch (Exception ex) { |
|
85 |
this.setBackground(backgroundColorWarning); |
|
86 |
} |
|
87 |
} |
|
88 |
return this; |
|
89 |
} |
|
90 |
|
|
91 |
} |
|
92 |
|
|
93 |
private class MyTableModel extends AbstractTableModel { |
|
94 |
|
|
95 |
public MyTableModel() { |
|
96 |
|
|
97 |
} |
|
98 |
|
|
99 |
@Override |
|
100 |
public int getRowCount() { |
|
101 |
if (references == null) { |
|
102 |
return 0; |
|
103 |
} |
|
104 |
return references.size(); |
|
105 |
} |
|
106 |
|
|
107 |
@Override |
|
108 |
public int getColumnCount() { |
|
109 |
if (featureType == null) { |
|
110 |
return 0; |
|
111 |
} |
|
112 |
return featureType.size(); |
|
113 |
} |
|
114 |
|
|
115 |
@Override |
|
116 |
public Object getValueAt(int rowIndex, int columnIndex) { |
|
117 |
try { |
|
118 |
if (references == null) { |
|
119 |
return ""; |
|
120 |
} |
|
121 |
Feature feature = references.get(rowIndex).getFeature(); |
|
122 |
return feature.get(columnIndex); |
|
123 |
} catch (DataException ex) { |
|
124 |
return ""; |
|
125 |
} |
|
126 |
} |
|
127 |
|
|
128 |
} |
|
129 |
|
|
130 |
private final FeatureStore store; |
|
131 |
private final Coercion toString; |
|
132 |
private final FeatureType featureType; |
|
133 |
private List<FeatureReference> references; |
|
134 |
private JFeatureReferencesForm form; |
|
135 |
private Color backgroundColorWarning; |
|
136 |
private DefaultTableColumnModel columnModel; |
|
137 |
|
|
138 |
public EditedFeaturesPanel(FeatureStore store) { |
|
139 |
this.store = store; |
|
140 |
this.featureType = this.store.getDefaultFeatureTypeQuietly(); |
|
141 |
this.toString = ToolsLocator.getDataTypesManager().get(DataTypes.STRING).getCoercion(); |
|
142 |
this.initComponents(); |
|
143 |
} |
|
144 |
|
|
145 |
private void initComponents() { |
|
146 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
147 |
|
|
148 |
this.backgroundColorWarning = toolsSwingManager.getWarningBackgroundColor(); |
|
149 |
|
|
150 |
this.addComponentListener(new ComponentAdapter() { |
|
151 |
@Override |
|
152 |
public void componentHidden(ComponentEvent e) { |
|
153 |
if (form != null && form.asJComponent().isVisible()) { |
|
154 |
form.asJComponent().setVisible(false); |
|
155 |
} |
|
156 |
} |
|
157 |
}); |
|
158 |
|
|
159 |
toolsSwingManager.translate(this.chkOnlyNotValidatedFeatures); |
|
160 |
this.chkOnlyNotValidatedFeatures.addActionListener((ActionEvent e) -> { |
|
161 |
doOnlyNotValidatedFeaturesChange(); |
|
162 |
}); |
|
163 |
|
|
164 |
this.btnShowForm.addActionListener((ActionEvent e) -> { |
|
165 |
doShowForm(); |
|
166 |
}); |
|
167 |
|
|
168 |
this.tblFeatures.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
|
169 |
this.tblFeatures.addMouseListener(new MouseAdapter() { |
|
170 |
@Override |
|
171 |
public void mouseClicked(MouseEvent e) { |
|
172 |
if (e.getClickCount() == 2) { |
|
173 |
int x = tblFeatures.rowAtPoint(e.getPoint()); |
|
174 |
tblFeatures.getSelectionModel().setSelectionInterval(x, x); |
|
175 |
doShowForm(); |
|
176 |
} |
|
177 |
} |
|
178 |
|
|
179 |
}); |
|
180 |
this.tblFeatures.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> { |
|
181 |
if (e.getValueIsAdjusting()) { |
|
182 |
return; |
|
183 |
} |
|
184 |
doSelectCurrentFeature(); |
|
185 |
}); |
|
186 |
this.columnModel = new DefaultTableColumnModel(); |
|
187 |
FeatureType ftype = store.getDefaultFeatureTypeQuietly(); |
|
188 |
int modelIndex = 0; |
|
189 |
for (FeatureAttributeDescriptor attr : ftype) { |
|
190 |
TableColumn column = new TableColumn(); |
|
191 |
column.setHeaderValue(attr.getLabel()); |
|
192 |
column.setCellRenderer(new FeatureAttributeCellRenderer(attr)); |
|
193 |
column.setResizable(true); |
|
194 |
column.setModelIndex(modelIndex++); |
|
195 |
columnModel.addColumn(column); |
|
196 |
} |
|
197 |
|
|
198 |
this.references = this.store.getEditedFeatures(); |
|
199 |
doOnlyNotValidatedFeaturesChange(); |
|
200 |
|
|
201 |
ToolsSwingUtils.ensureRowsCols(this, 15, 90, 30, 100); |
|
202 |
|
|
203 |
} |
|
204 |
|
|
205 |
private void doSelectCurrentFeature() { |
|
206 |
int row = tblFeatures.getSelectedRow(); |
|
207 |
if (row >= 0) { |
|
208 |
try { |
|
209 |
FeatureSelection selection = store.getFeatureSelection(); |
|
210 |
selection.deselectAll(); |
|
211 |
selection.select(references.get(row)); |
|
212 |
} catch (DataException ex) { |
|
213 |
} |
|
214 |
} |
|
215 |
} |
|
216 |
|
|
217 |
private void doOnlyNotValidatedFeaturesChange() { |
|
218 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
219 |
DataSwingManager dataSwingManager = DALSwingLocator.getDataSwingManager(); |
|
220 |
|
|
221 |
if (this.chkOnlyNotValidatedFeatures.isSelected()) { |
|
222 |
this.references = this.store.getEditedFeaturesNotValidated(); |
|
223 |
} else { |
|
224 |
this.references = this.store.getEditedFeatures(); |
|
225 |
} |
|
226 |
this.tblFeatures.setModel(new MyTableModel()); |
|
227 |
this.tblFeatures.setColumnModel(columnModel); |
|
228 |
toolsSwingManager.createTableColumnAdjuster(this.tblFeatures); |
|
229 |
if (this.form != null) { |
|
230 |
if (this.form.getFormset().getForm().isModified()) { |
|
231 |
this.form.getFormset().fireEvent(JDynFormSet.ACTION_SAVE, null); |
|
232 |
} |
|
233 |
this.form.setFeatures(this.references); |
|
234 |
this.form.getFormset().addListener(new JDynFormSetAdapter() { |
|
235 |
@Override |
|
236 |
public void formMovedTo(int currentPosition) throws AbortActionException { |
|
237 |
tblFeatures.getSelectionModel().setSelectionInterval(currentPosition, currentPosition); |
|
238 |
} |
|
239 |
}); |
|
240 |
} |
|
241 |
} |
|
242 |
|
|
243 |
private void doShowForm() { |
|
244 |
|
|
245 |
if (this.references.isEmpty()) { |
|
246 |
return; |
|
247 |
} |
|
248 |
int index = this.tblFeatures.getSelectedRow(); |
|
249 |
if (index < 0) { |
|
250 |
index = 0; |
|
251 |
} |
|
252 |
|
|
253 |
if (this.form == null) { |
|
254 |
try { |
|
255 |
WindowManager winmgr = ToolsSwingLocator.getWindowManager(); |
|
256 |
DataSwingManager dataSwingManager = DALSwingLocator.getDataSwingManager(); |
|
257 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
258 |
|
|
259 |
this.form = dataSwingManager.createJFeatureReferencesForm(store, references); |
|
260 |
this.form.getFormset().setAutosave(false); |
|
261 |
|
|
262 |
this.form.asJComponent().addComponentListener(new ComponentAdapter() { |
|
263 |
@Override |
|
264 |
public void componentHidden(ComponentEvent e) { |
|
265 |
form = null; |
|
266 |
} |
|
267 |
}); |
|
268 |
this.form.getFormset().addListener(new JDynFormSetAdapter() { |
|
269 |
@Override |
|
270 |
public void formMovedTo(int currentPosition) throws AbortActionException { |
|
271 |
tblFeatures.getSelectionModel().setSelectionInterval(currentPosition, currentPosition); |
|
272 |
} |
|
273 |
}); |
|
274 |
String title = String.format("%s (%s)", |
|
275 |
this.store.getName(), |
|
276 |
i18n.getTranslation("_Edited_features") |
|
277 |
); |
|
278 |
winmgr.showWindow( |
|
279 |
this.form.asJComponent(), |
|
280 |
title, |
|
281 |
WindowManager.MODE.WINDOW |
|
282 |
); |
|
283 |
|
|
284 |
} catch (CreateJFeatureFormException ex) { |
|
285 |
// TODO: falta tratamiento de las excepciones |
|
286 |
} |
|
287 |
} |
|
288 |
JDynFormSet formset = this.form.getFormset(); |
|
289 |
if (formset.getCurrentIndex() != index) { |
|
290 |
if (formset.getForm().isModified()) { |
|
291 |
formset.fireEvent(JDynFormSet.ACTION_SAVE, null); |
|
292 |
} |
|
293 |
formset.setCurrentIndex(index); |
|
294 |
} |
|
295 |
} |
|
296 |
|
|
297 |
@Override |
|
298 |
public JComponent asJComponent() { |
|
299 |
return this; |
|
300 |
} |
|
301 |
|
|
302 |
@Override |
|
303 |
public ImageIcon loadImage(String imageName) { |
|
304 |
return ToolsSwingUtils.loadImage(this, imageName); |
|
305 |
} |
|
306 |
|
|
307 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/editedfeatures/EditedFeaturesPanelView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/editedfeatures/EditedFeaturesPanelView.xml</at> |
|
28 |
<at name="path">datos/devel/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/editedfeatures/EditedFeaturesPanelView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">1</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">javax.swing.JTable</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">javax.swing.JTable</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="name">tblFeatures</at> |
|
78 |
<at name="width">1298</at> |
|
79 |
<at name="scollBars"> |
|
80 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
81 |
<at name="name">scollBars</at> |
|
82 |
<at name="verticalpolicy">20</at> |
|
83 |
<at name="horizontalpolicy">30</at> |
|
84 |
<at name="border"> |
|
85 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
86 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
87 |
<at name="name">border</at> |
|
88 |
</super> |
|
89 |
<at name="borders"> |
|
90 |
<object classname="java.util.LinkedList"> |
|
91 |
<item > |
|
92 |
<at name="value"> |
|
93 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
94 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
95 |
<at name="name">border</at> |
|
96 |
</super> |
|
97 |
</object> |
|
98 |
</at> |
|
99 |
</item> |
|
100 |
</object> |
|
101 |
</at> |
|
102 |
</object> |
|
103 |
</at> |
|
104 |
</object> |
|
105 |
</at> |
|
106 |
<at name="height">32</at> |
|
107 |
</object> |
|
108 |
</at> |
|
109 |
</object> |
|
110 |
</at> |
|
111 |
</object> |
|
112 |
</at> |
|
113 |
</item> |
|
114 |
<item > |
|
115 |
<at name="value"> |
|
116 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
117 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
118 |
<at name="cellconstraints"> |
|
119 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
120 |
<at name="column">2</at> |
|
121 |
<at name="row">4</at> |
|
122 |
<at name="colspan">1</at> |
|
123 |
<at name="rowspan">1</at> |
|
124 |
<at name="halign">default</at> |
|
125 |
<at name="valign">default</at> |
|
126 |
<at name="insets" object="insets">0,0,0,0</at> |
|
127 |
</object> |
|
128 |
</at> |
|
129 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
130 |
</super> |
|
131 |
<at name="id">embedded.Z608d98d4X17aa8da5927SK7ff9</at> |
|
132 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
|
133 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE</at> |
|
134 |
<at name="components"> |
|
135 |
<object classname="java.util.LinkedList"> |
|
136 |
<item > |
|
137 |
<at name="value"> |
|
138 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
139 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
140 |
<at name="cellconstraints"> |
|
141 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
142 |
<at name="column">1</at> |
|
143 |
<at name="row">1</at> |
|
144 |
<at name="colspan">1</at> |
|
145 |
<at name="rowspan">1</at> |
|
146 |
<at name="halign">default</at> |
|
147 |
<at name="valign">default</at> |
|
148 |
<at name="insets" object="insets">0,0,0,0</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
152 |
</super> |
|
153 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
154 |
<at name="beanclass">javax.swing.JCheckBox</at> |
|
155 |
<at name="beanproperties"> |
|
156 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
157 |
<at name="classname">javax.swing.JCheckBox</at> |
|
158 |
<at name="properties"> |
|
159 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
160 |
<at name="border"> |
|
161 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
162 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
163 |
<at name="name">border</at> |
|
164 |
</super> |
|
165 |
<at name="borders"> |
|
166 |
<object classname="java.util.LinkedList"> |
|
167 |
<item > |
|
168 |
<at name="value"> |
|
169 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
170 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
171 |
<at name="name">border</at> |
|
172 |
</super> |
|
173 |
</object> |
|
174 |
</at> |
|
175 |
</item> |
|
176 |
</object> |
|
177 |
</at> |
|
178 |
</object> |
|
179 |
</at> |
|
180 |
<at name="actionCommand">_Check_only_not_validated_features</at> |
|
181 |
<at name="name">chkOnlyNotValidatedFeatures</at> |
|
182 |
<at name="width">340</at> |
|
183 |
<at name="text">_Show_only_not_validated_features</at> |
|
184 |
<at name="height">28</at> |
|
185 |
</object> |
|
186 |
</at> |
|
187 |
</object> |
|
188 |
</at> |
|
189 |
</object> |
|
190 |
</at> |
|
191 |
</item> |
|
192 |
<item > |
|
193 |
<at name="value"> |
|
194 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
195 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
196 |
<at name="cellconstraints"> |
|
197 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
198 |
<at name="column">4</at> |
|
199 |
<at name="row">1</at> |
|
200 |
<at name="colspan">1</at> |
|
201 |
<at name="rowspan">1</at> |
|
202 |
<at name="halign">default</at> |
|
203 |
<at name="valign">default</at> |
|
204 |
<at name="insets" object="insets">0,0,0,0</at> |
|
205 |
</object> |
|
206 |
</at> |
|
207 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
208 |
</super> |
|
209 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
210 |
<at name="beanclass">javax.swing.JButton</at> |
|
211 |
<at name="beanproperties"> |
|
212 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
213 |
<at name="classname">javax.swing.JButton</at> |
|
214 |
<at name="properties"> |
|
215 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
216 |
<at name="border"> |
|
217 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
218 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
219 |
<at name="name">border</at> |
|
220 |
</super> |
|
221 |
<at name="borders"> |
|
222 |
<object classname="java.util.LinkedList"> |
|
223 |
<item > |
|
224 |
<at name="value"> |
|
225 |
<object classname="com.jeta.forms.store.properties.EmptyBorderProperty"> |
|
226 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
227 |
<at name="name">border</at> |
|
228 |
<at name="title"></at> |
|
229 |
</super> |
|
230 |
<at name="top">2</at> |
|
231 |
<at name="left">2</at> |
|
232 |
<at name="bottom">2</at> |
|
233 |
<at name="right">2</at> |
|
234 |
</object> |
|
235 |
</at> |
|
236 |
</item> |
|
237 |
</object> |
|
238 |
</at> |
|
239 |
</object> |
|
240 |
</at> |
|
241 |
<at name="icon"> |
|
242 |
<object classname="com.jeta.forms.store.properties.IconProperty"> |
|
243 |
<at name="embedded">false</at> |
|
244 |
<at name="path">datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/resources/org/gvsig/vcsgis/swing/impl/images/common-showform.png</at> |
|
245 |
<at name="description">common-showform.png</at> |
|
246 |
<at name="width">16</at> |
|
247 |
<at name="height">16</at> |
|
248 |
</object> |
|
249 |
</at> |
|
250 |
<at name="name">btnShowForm</at> |
|
251 |
<at name="width">20</at> |
|
252 |
<at name="height">20</at> |
|
253 |
</object> |
|
254 |
</at> |
|
255 |
</object> |
|
256 |
</at> |
|
257 |
</object> |
|
258 |
</at> |
|
259 |
</item> |
|
260 |
</object> |
|
261 |
</at> |
|
262 |
<at name="properties"> |
|
263 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
264 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
265 |
<at name="properties"> |
|
266 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
267 |
<at name="border"> |
|
268 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
269 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
270 |
<at name="name">border</at> |
|
271 |
</super> |
|
272 |
<at name="borders"> |
|
273 |
<object classname="java.util.LinkedList"/> |
|
274 |
</at> |
|
275 |
</object> |
|
276 |
</at> |
|
277 |
<at name="name"></at> |
|
278 |
<at name="fill"> |
|
279 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
280 |
<at name="name">fill</at> |
|
281 |
</object> |
|
282 |
</at> |
|
283 |
<at name="scollBars"> |
|
284 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
285 |
<at name="name">scollBars</at> |
|
286 |
<at name="verticalpolicy">21</at> |
|
287 |
<at name="horizontalpolicy">31</at> |
|
288 |
</object> |
|
289 |
</at> |
|
290 |
</object> |
|
291 |
</at> |
|
292 |
</object> |
|
293 |
</at> |
|
294 |
<at name="cellpainters"> |
|
295 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
296 |
<at name="rows"> |
|
297 |
<object classname="[Ljava.lang.Object;" size="1"> |
|
298 |
<at name="item" index="0"> |
|
299 |
<object classname="[Ljava.lang.Object;" size="4"/> |
|
300 |
</at> |
|
301 |
</object> |
|
302 |
</at> |
|
303 |
</object> |
|
304 |
</at> |
|
305 |
<at name="rowgroups"> |
|
306 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
307 |
<at name="groups"> |
|
308 |
<object classname="java.util.HashMap"/> |
|
309 |
</at> |
|
310 |
</object> |
|
311 |
</at> |
|
312 |
<at name="colgroups"> |
|
313 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
314 |
<at name="groups"> |
|
315 |
<object classname="java.util.HashMap"/> |
|
316 |
</at> |
|
317 |
</object> |
|
318 |
</at> |
|
319 |
</object> |
|
320 |
</at> |
|
321 |
</item> |
|
322 |
</object> |
|
323 |
</at> |
|
324 |
<at name="properties"> |
|
325 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
326 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
327 |
<at name="properties"> |
|
328 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
329 |
<at name="border"> |
|
330 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
331 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
332 |
<at name="name">border</at> |
|
333 |
</super> |
|
334 |
<at name="borders"> |
|
335 |
<object classname="java.util.LinkedList"/> |
|
336 |
</at> |
|
337 |
</object> |
|
338 |
</at> |
|
339 |
<at name="name"></at> |
|
340 |
<at name="fill"> |
|
341 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
342 |
<at name="name">fill</at> |
|
343 |
</object> |
|
344 |
</at> |
|
345 |
<at name="scollBars"> |
|
346 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
347 |
<at name="name">scollBars</at> |
|
348 |
<at name="verticalpolicy">21</at> |
|
349 |
<at name="horizontalpolicy">31</at> |
|
350 |
<at name="border"> |
|
351 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
352 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
353 |
<at name="name">border</at> |
|
354 |
</super> |
|
355 |
<at name="borders"> |
|
356 |
<object classname="java.util.LinkedList"> |
|
357 |
<item > |
|
358 |
<at name="value"> |
|
359 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
360 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
361 |
<at name="name">border</at> |
|
362 |
</super> |
|
363 |
</object> |
|
364 |
</at> |
|
365 |
</item> |
|
366 |
</object> |
|
367 |
</at> |
|
368 |
</object> |
|
369 |
</at> |
|
370 |
</object> |
|
371 |
</at> |
|
372 |
</object> |
|
373 |
</at> |
|
374 |
</object> |
|
375 |
</at> |
|
376 |
<at name="cellpainters"> |
|
377 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
378 |
<at name="rows"> |
|
379 |
<object classname="[Ljava.lang.Object;" size="5"> |
|
380 |
<at name="item" index="0"> |
|
381 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
382 |
</at> |
|
383 |
<at name="item" index="1"> |
|
384 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
385 |
</at> |
|
386 |
<at name="item" index="2"> |
|
387 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
388 |
</at> |
|
389 |
<at name="item" index="3"> |
|
390 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
391 |
</at> |
|
392 |
<at name="item" index="4"> |
|
393 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
394 |
</at> |
|
395 |
</object> |
|
396 |
</at> |
|
397 |
</object> |
|
398 |
</at> |
|
399 |
<at name="rowgroups"> |
|
400 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
401 |
<at name="groups"> |
|
402 |
<object classname="java.util.HashMap"/> |
|
403 |
</at> |
|
404 |
</object> |
|
405 |
</at> |
|
406 |
<at name="colgroups"> |
|
407 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
408 |
<at name="groups"> |
|
409 |
<object classname="java.util.HashMap"/> |
|
410 |
</at> |
|
411 |
</object> |
|
412 |
</at> |
|
413 |
</object> |
|
414 |
</at> |
|
415 |
</object> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/editedfeatures/EditedFeaturesPanelView.java | ||
---|---|---|
1 |
package org.gvsig.app.extension.editedfeatures; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JButton; |
|
13 |
import javax.swing.JCheckBox; |
|
14 |
import javax.swing.JFrame; |
|
15 |
import javax.swing.JPanel; |
|
16 |
import javax.swing.JScrollPane; |
|
17 |
import javax.swing.JTable; |
|
18 |
import javax.swing.border.EmptyBorder; |
|
19 |
|
|
20 |
|
|
21 |
public class EditedFeaturesPanelView extends JPanel |
|
22 |
{ |
|
23 |
JTable tblFeatures = new JTable(); |
|
24 |
JCheckBox chkOnlyNotValidatedFeatures = new JCheckBox(); |
|
25 |
JButton btnShowForm = new JButton(); |
|
26 |
|
|
27 |
/** |
|
28 |
* Default constructor |
|
29 |
*/ |
|
30 |
public EditedFeaturesPanelView() |
|
31 |
{ |
|
32 |
initializePanel(); |
|
33 |
} |
|
34 |
|
|
35 |
/** |
|
36 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
37 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
38 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
39 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
40 |
*/ |
|
41 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
42 |
{ |
|
43 |
Dimension filler = new Dimension(10,10); |
|
44 |
|
|
45 |
boolean filled_cell_11 = false; |
|
46 |
CellConstraints cc = new CellConstraints(); |
|
47 |
if ( cols.length > 0 && rows.length > 0 ) |
|
48 |
{ |
|
49 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
50 |
{ |
|
51 |
/** add a rigid area */ |
|
52 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
53 |
filled_cell_11 = true; |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
for( int index = 0; index < cols.length; index++ ) |
|
58 |
{ |
|
59 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
60 |
{ |
|
61 |
continue; |
|
62 |
} |
|
63 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
64 |
} |
|
65 |
|
|
66 |
for( int index = 0; index < rows.length; index++ ) |
|
67 |
{ |
|
68 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
69 |
{ |
|
70 |
continue; |
|
71 |
} |
|
72 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
73 |
} |
|
74 |
|
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* Helper method to load an image file from the CLASSPATH |
|
79 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
80 |
* @return an ImageIcon instance with the specified image file |
|
81 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
82 |
*/ |
|
83 |
public ImageIcon loadImage( String imageName ) |
|
84 |
{ |
|
85 |
try |
|
86 |
{ |
|
87 |
ClassLoader classloader = getClass().getClassLoader(); |
|
88 |
java.net.URL url = classloader.getResource( imageName ); |
|
89 |
if ( url != null ) |
|
90 |
{ |
|
91 |
ImageIcon icon = new ImageIcon( url ); |
|
92 |
return icon; |
|
93 |
} |
|
94 |
} |
|
95 |
catch( Exception e ) |
|
96 |
{ |
|
97 |
e.printStackTrace(); |
|
98 |
} |
|
99 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
100 |
} |
|
101 |
|
|
102 |
/** |
|
103 |
* Method for recalculating the component orientation for |
|
104 |
* right-to-left Locales. |
|
105 |
* @param orientation the component orientation to be applied |
|
106 |
*/ |
|
107 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
108 |
{ |
|
109 |
// Not yet implemented... |
|
110 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
111 |
super.applyComponentOrientation(orientation); |
|
112 |
} |
|
113 |
|
|
114 |
public JPanel createPanel() |
|
115 |
{ |
|
116 |
JPanel jpanel1 = new JPanel(); |
|
117 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE"); |
|
118 |
CellConstraints cc = new CellConstraints(); |
|
119 |
jpanel1.setLayout(formlayout1); |
|
120 |
|
|
121 |
tblFeatures.setName("tblFeatures"); |
|
122 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
123 |
jscrollpane1.setViewportView(tblFeatures); |
|
124 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
125 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
126 |
jpanel1.add(jscrollpane1,cc.xy(2,2)); |
|
127 |
|
|
128 |
jpanel1.add(createPanel1(),cc.xy(2,4)); |
|
129 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5 }); |
|
130 |
return jpanel1; |
|
131 |
} |
|
132 |
|
|
133 |
public JPanel createPanel1() |
|
134 |
{ |
|
135 |
JPanel jpanel1 = new JPanel(); |
|
136 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
|
137 |
CellConstraints cc = new CellConstraints(); |
|
138 |
jpanel1.setLayout(formlayout1); |
|
139 |
|
|
140 |
chkOnlyNotValidatedFeatures.setActionCommand("_Check_only_not_validated_features"); |
|
141 |
chkOnlyNotValidatedFeatures.setName("chkOnlyNotValidatedFeatures"); |
|
142 |
chkOnlyNotValidatedFeatures.setText("_Show_only_not_validated_features"); |
|
143 |
jpanel1.add(chkOnlyNotValidatedFeatures,cc.xy(1,1)); |
|
144 |
|
|
145 |
btnShowForm.setIcon(loadImage("datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/resources/org/gvsig/vcsgis/swing/impl/images/common-showform.png")); |
|
146 |
btnShowForm.setName("btnShowForm"); |
|
147 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
|
148 |
btnShowForm.setBorder(emptyborder1); |
|
149 |
jpanel1.add(btnShowForm,cc.xy(4,1)); |
|
150 |
|
|
151 |
addFillComponents(jpanel1,new int[]{ 2,3 },new int[0]); |
|
152 |
return jpanel1; |
|
153 |
} |
|
154 |
|
|
155 |
/** |
|
156 |
* Initializer |
|
157 |
*/ |
|
158 |
protected void initializePanel() |
|
159 |
{ |
|
160 |
setLayout(new BorderLayout()); |
|
161 |
add(createPanel(), BorderLayout.CENTER); |
|
162 |
} |
|
163 |
|
|
164 |
|
|
165 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1559 | 1559 |
_Name=Nombre |
1560 | 1560 |
_Value=Valor |
1561 | 1561 |
_Main=Principal |
1562 |
_Filter_for_values=Filtro para los valores |
|
1562 |
_Filter_for_values=Filtro para los valores |
|
1563 |
_Edited_features=Features editadas |
|
1564 |
_Show_only_not_validated_features=Mostrar las features no validadas |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1477 | 1477 |
_Name=Name |
1478 | 1478 |
_Value=Value |
1479 | 1479 |
_Main=Main |
1480 |
_Filter_for_values=Filter for values |
|
1480 |
_Filter_for_values=Filter for values |
|
1481 |
_Edited_features=Edited features |
|
1482 |
_Show_only_not_validated_features=Show only not validated features |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1533 | 1533 |
/> |
1534 | 1534 |
|
1535 | 1535 |
</extension> |
1536 |
<extension |
|
1536 |
|
|
1537 |
<extension class-name="org.gvsig.app.extension.ShowEditedFeatures" |
|
1538 |
description="Muestra las features editadas en la sesion de edicion." |
|
1539 |
active="true"> |
|
1540 |
|
|
1541 |
<action |
|
1542 |
name="layer-show-editedfeatures" |
|
1543 |
label="_Show_edited_features" |
|
1544 |
tooltip="_Show_edited_features" |
|
1545 |
position="601300001" |
|
1546 |
action-command="layer-show-editedfeatures" |
|
1547 |
icon="layer-show-editedfeatures" |
|
1548 |
accelerator="" |
|
1549 |
/> |
|
1550 |
|
|
1551 |
<menu |
|
1552 |
name="layer-show-editedfeatures" |
|
1553 |
text="Layer/Show edited features" |
|
1554 |
/> |
|
1555 |
|
|
1556 |
</extension> |
|
1557 |
|
|
1558 |
|
|
1559 |
<extension |
|
1537 | 1560 |
class-name="org.gvsig.app.extension.geometriespalette.GeometriesPaletteExtension" |
1538 | 1561 |
description="" active="true"> |
1539 | 1562 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java | ||
---|---|---|
947 | 947 |
public String getEditingSession() { |
948 | 948 |
return null; |
949 | 949 |
} |
950 |
|
|
951 |
@Override |
|
952 |
public List<FeatureReference> getEditedFeatures() { |
|
953 |
return Collections.EMPTY_LIST; |
|
954 |
} |
|
955 |
|
|
956 |
@Override |
|
957 |
public List<FeatureReference> getEditedFeaturesNotValidated() { |
|
958 |
return Collections.EMPTY_LIST; |
|
959 |
} |
|
950 | 960 |
|
951 | 961 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java | ||
---|---|---|
1391 | 1391 |
public boolean isFeatureModified(Feature feature); |
1392 | 1392 |
|
1393 | 1393 |
public String getEditingSession(); |
1394 |
|
|
1395 |
public List<FeatureReference> getEditedFeatures(); |
|
1396 |
|
|
1397 |
public List<FeatureReference> getEditedFeaturesNotValidated(); |
|
1398 |
|
|
1394 | 1399 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java | ||
---|---|---|
72 | 72 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
73 | 73 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
74 | 74 |
import org.gvsig.fmap.dal.feature.Feature; |
75 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_BASIC; |
|
75 | 76 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_REQUIREDS; |
76 | 77 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_RULES_AT_EDITING; |
77 | 78 |
import static org.gvsig.fmap.dal.feature.Feature.CHECK_RULES_AT_FINISH; |
... | ... | |
84 | 85 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
85 | 86 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
86 | 87 |
import org.gvsig.fmap.dal.feature.FeatureReferenceSelection; |
87 |
import org.gvsig.fmap.dal.feature.FeatureRules; |
|
88 | 88 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
89 | 89 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
90 | 90 |
import org.gvsig.fmap.dal.feature.FeatureSet.DisposableFeatureSetIterable; |
... | ... | |
2004 | 2004 |
private void saveDALFile() { |
2005 | 2005 |
org.gvsig.tools.resourcesstorage.ResourcesStorage.Resource resource = null; |
2006 | 2006 |
try { |
2007 |
ResourcesStorage resourcesStorage = this.getResourcesStorage();
|
|
2008 |
if (resourcesStorage == null || resourcesStorage.isReadOnly()) {
|
|
2007 |
ResourcesStorage theResourcesStorage = this.getResourcesStorage();
|
|
2008 |
if (theResourcesStorage == null || theResourcesStorage.isReadOnly()) {
|
|
2009 | 2009 |
return; |
2010 | 2010 |
} |
2011 |
resource = resourcesStorage.getResource("dal");
|
|
2011 |
resource = theResourcesStorage.getResource("dal");
|
|
2012 | 2012 |
if (resource == null || resource.isReadOnly()) { |
2013 | 2013 |
return; |
2014 | 2014 |
} |
... | ... | |
2026 | 2026 |
|
2027 | 2027 |
private void loadDALFile() { |
2028 | 2028 |
org.gvsig.tools.resourcesstorage.ResourcesStorage.Resource resource = null; |
2029 |
ResourcesStorage resourcesStorage = null;
|
|
2029 |
ResourcesStorage theResourcesStorage = null;
|
|
2030 | 2030 |
try { |
2031 |
resourcesStorage = this.getResourcesStorage();
|
|
2032 |
if (resourcesStorage == null) {
|
|
2031 |
theResourcesStorage = this.getResourcesStorage();
|
|
2032 |
if (theResourcesStorage == null) {
|
|
2033 | 2033 |
return; |
2034 | 2034 |
} |
2035 |
resource = resourcesStorage.getResource("dal");
|
|
2035 |
resource = theResourcesStorage.getResource("dal");
|
|
2036 | 2036 |
if (resource == null || !resource.exists()) { |
2037 | 2037 |
return; |
2038 | 2038 |
} |
... | ... | |
2041 | 2041 |
dalFile.updateStore(this); |
2042 | 2042 |
} |
2043 | 2043 |
} catch (Throwable ex) { |
2044 |
if (resource == null || resourcesStorage == null) {
|
|
2045 |
if (resourcesStorage == null) {
|
|
2044 |
if (resource == null || theResourcesStorage == null) {
|
|
2045 |
if (theResourcesStorage == null) {
|
|
2046 | 2046 |
LOGGER.warn("Can't load DAL resource (resname=null, resurl=null, storage=null)", ex); |
2047 | 2047 |
} else { |
2048 |
LOGGER.warn("Can't load DAL resource (resname=null, resurl=null, storage=" + resourcesStorage.getClass().getName() + ").", ex);
|
|
2048 |
LOGGER.warn("Can't load DAL resource (resname=null, resurl=null, storage=" + theResourcesStorage.getClass().getName() + ").", ex);
|
|
2049 | 2049 |
} |
2050 | 2050 |
} else { |
2051 |
LOGGER.warn("Can't load DAL resource (resname=" + resource.getName() + ", resurl=" + Objects.toString(resource.getURL()) + ", storage=" + resourcesStorage.getClass().getName() + ").", ex);
|
|
2051 |
LOGGER.warn("Can't load DAL resource (resname=" + resource.getName() + ", resurl=" + Objects.toString(resource.getURL()) + ", storage=" + theResourcesStorage.getClass().getName() + ").", ex);
|
|
2052 | 2052 |
} |
2053 | 2053 |
} finally { |
2054 | 2054 |
IOUtils.closeQuietly(resource); |
... | ... | |
3755 | 3755 |
return s; |
3756 | 3756 |
} |
3757 | 3757 |
|
3758 |
@Override |
|
3759 |
public List<FeatureReference> getEditedFeatures() { |
|
3760 |
if( this.featureManager == null ) { |
|
3761 |
return Collections.EMPTY_LIST; |
|
3762 |
} |
|
3763 |
List<FeatureReference> references = this.featureManager.getAddedAndUpdatedFeatures(); |
|
3764 |
if( references==null ) { |
|
3765 |
return Collections.EMPTY_LIST; |
|
3766 |
} |
|
3767 |
return references; |
|
3768 |
} |
|
3769 |
|
|
3770 |
public List<FeatureReference> getEditedFeaturesNotValidated() { |
|
3771 |
|
|
3772 |
try { |
|
3773 |
if (this.featureManager == null) { |
|
3774 |
return Collections.EMPTY_LIST; |
|
3775 |
} |
|
3776 |
|
|
3777 |
FeatureType type = this.getDefaultFeatureTypeQuietly(); |
|
3778 |
DefaultFeatureRules rules = (DefaultFeatureRules) this.getDefaultFeatureType().getRules(); |
|
3779 |
|
|
3780 |
int checks = type.isCheckFeaturesAtFinishEditing() ? CHECK_REQUIREDS | CHECK_BASIC : 0; |
|
3781 |
checks = rules.isEmpty() ? checks : checks | CHECK_RULES_AT_FINISH; |
|
3782 |
if (checks == 0) { |
|
3783 |
return Collections.EMPTY_LIST; |
|
3784 |
} |
|
3785 |
List<FeatureReference> references = this.featureManager |
|
3786 |
.getAddedAndUpdatedFeaturesNotValidated(rules, checks); |
|
3787 |
if (references == null) { |
|
3788 |
return Collections.EMPTY_LIST; |
|
3789 |
} |
|
3790 |
return references; |
|
3791 |
} catch (DataException ex) { |
|
3792 |
return null; |
|
3793 |
} |
|
3794 |
|
|
3795 |
} |
|
3796 |
|
|
3758 | 3797 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/editing/memory/FeatureManager.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.fmap.dal.feature.impl.editing.memory; |
25 | 25 |
|
26 |
import java.util.ArrayList; |
|
26 | 27 |
import java.util.Collection; |
27 | 28 |
import java.util.HashMap; |
28 | 29 |
import java.util.Iterator; |
29 | 30 |
import java.util.LinkedHashMap; |
30 | 31 |
import java.util.LinkedHashSet; |
32 |
import java.util.List; |
|
31 | 33 |
import java.util.Map; |
32 | 34 |
import java.util.NoSuchElementException; |
33 | 35 |
import org.gvsig.fmap.dal.exception.DataException; |
... | ... | |
37 | 39 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
38 | 40 |
import org.gvsig.fmap.dal.feature.FeatureType; |
39 | 41 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeature; |
42 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureRules; |
|
40 | 43 |
import org.gvsig.fmap.dal.feature.impl.featurereference.FeatureReferenceFactory; |
41 | 44 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
42 | 45 |
|
46 |
@SuppressWarnings("UseSpecificCatch") |
|
43 | 47 |
public class FeatureManager { |
44 | 48 |
|
45 | 49 |
private int deltaSize; |
... | ... | |
361 | 365 |
} |
362 | 366 |
|
363 | 367 |
} |
368 |
|
|
369 |
public List<FeatureReference> getAddedAndUpdatedFeatures() { |
|
370 |
List<FeatureReference> references = new ArrayList<>(); |
|
371 |
references.addAll(this.modifiedFromOriginal.keySet()); |
|
372 |
references.addAll(this.added.keySet()); |
|
373 |
return references; |
|
374 |
} |
|
364 | 375 |
|
376 |
public List<FeatureReference> getAddedAndUpdatedFeaturesNotValidated(DefaultFeatureRules rules, int checks) { |
|
377 |
List<FeatureReference> references = new ArrayList<>(); |
|
378 |
for (FeatureReference ref : this.modifiedFromOriginal.keySet()) { |
|
379 |
Integer index = this.modifiedFromOriginal.get(ref); |
|
380 |
if( index!=null ) { |
|
381 |
EditableFeature feature = (EditableFeature) this.expansionAdapter.getObject(index); |
|
382 |
try { |
|
383 |
rules.validate(feature, checks); |
|
384 |
} catch (DataException ex) { |
|
385 |
references.add(ref); |
|
386 |
} |
|
387 |
} |
|
388 |
} |
|
389 |
for (FeatureReference ref : this.added.keySet()) { |
|
390 |
Integer index = this.added.get(ref); |
|
391 |
if( index!=null ) { |
|
392 |
EditableFeature feature = (EditableFeature) this.expansionAdapter.getObject(index); |
|
393 |
try { |
|
394 |
rules.validate(feature, checks); |
|
395 |
} catch (Exception ex) { |
|
396 |
references.add(ref); |
|
397 |
} |
|
398 |
} |
|
399 |
} |
|
400 |
return references; |
|
401 |
} |
|
402 |
|
|
365 | 403 |
public Iterator<EditableFeature> getUpdatedFeatures() { |
366 | 404 |
return new UpdatedFeaturesIterator(); |
367 | 405 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.api/src/main/java/org/gvsig/featureform/swing/JFeatureReferencesForm.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.featureform.swing; |
|
24 |
|
|
25 |
import java.awt.Dimension; |
|
26 |
import java.util.List; |
|
27 |
import javax.swing.Action; |
|
28 |
import org.gvsig.fmap.dal.StoresRepository; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.feature.Feature; |
|
31 |
|
|
32 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
33 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
34 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
36 |
import org.gvsig.tools.dynform.JDynForm.DynFormContext; |
|
37 |
import org.gvsig.tools.dynform.JDynFormSet; |
|
38 |
import org.gvsig.tools.swing.api.Component; |
|
39 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE; |
|
40 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
|
41 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
42 |
|
|
43 |
/** |
|
44 |
* @author gvSIG Team |
|
45 |
* |
|
46 |
*/ |
|
47 |
public interface JFeatureReferencesForm extends Component, ActionListenerSupport { |
|
48 |
public static final String ACTION_CONTEXT_NAME = "FormActionContext"; |
|
49 |
|
|
50 |
public interface FeaturesFormContext extends DynFormContext { |
|
51 |
@Override |
|
52 |
public ResourcesStorage getResourcesStorage(); |
|
53 |
public StoresRepository getStoresRepository(); |
|
54 |
public FeatureStore getFeatureStore(); |
|
55 |
public FeatureType getFeatureType(); |
|
56 |
} |
|
57 |
|
|
58 |
public void setPreferredSize(Dimension dimension); |
|
59 |
|
|
60 |
public void bind(FeatureStore store, List<FeatureReference> references); |
|
61 |
|
|
62 |
public long getDataSetSize(); |
|
63 |
|
|
64 |
public void showForm(MODE mode); |
|
65 |
|
|
66 |
public void saveChanges(); |
|
67 |
|
|
68 |
public JDynFormSet getFormset(); |
|
69 |
|
|
70 |
public FeatureStore getFeatureStore(); |
|
71 |
|
|
72 |
public long getCurrentIndex(); |
|
73 |
|
|
74 |
public Feature get(long index); |
|
75 |
|
|
76 |
public void setFeatures(List<FeatureReference> features); |
|
77 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.api/src/main/java/org/gvsig/fmap/dal/swing/DataSwingManager.java | ||
---|---|---|
38 | 38 |
import org.gvsig.expressionevaluator.swing.JExpressionBuilder; |
39 | 39 |
import org.gvsig.featureform.swing.CreateJFeatureFormException; |
40 | 40 |
import org.gvsig.featureform.swing.JFeatureForm; |
41 |
import org.gvsig.featureform.swing.JFeatureReferencesForm; |
|
41 | 42 |
import org.gvsig.featureform.swing.JFeaturesForm; |
42 | 43 |
import org.gvsig.fmap.dal.feature.Feature; |
43 | 44 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
44 | 45 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
46 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
45 | 47 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
46 | 48 |
import org.gvsig.fmap.dal.feature.FeatureType; |
47 | 49 |
import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper; |
... | ... | |
58 | 60 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionDialog; |
59 | 61 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel.SearchConditionPanelFactory; |
60 | 62 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryOrderPanel; |
63 |
import org.gvsig.fmap.dal.swing.featuretable.SimpleFeaturesTableModel; |
|
61 | 64 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributeListCellRenderer; |
62 | 65 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributesSelectionPanel; |
63 | 66 |
|
... | ... | |
78 | 81 |
|
79 | 82 |
public JFeatureForm createJFeatureForm(FeatureStore store) throws CreateJFeatureFormException; |
80 | 83 |
|
84 |
public JFeatureReferencesForm createJFeatureReferencesForm(FeatureStore store, List<FeatureReference> references) throws CreateJFeatureFormException; |
|
85 |
|
|
81 | 86 |
public JFeatureForm createJFeatureForm(DynFormDefinition definicion) throws CreateJFeatureFormException; |
82 | 87 |
|
83 | 88 |
public JFeatureForm createJFeatureForm(Feature feature) throws CreateJFeatureFormException; |
... | ... | |
140 | 145 |
public PickerController<JDBCServerExplorerParameters> createJDBCConnectionPickerController( |
141 | 146 |
JComboBox cboConnection, JButton btnConnection |
142 | 147 |
); |
143 |
public TableModel createSimpleFeaturesTableModel(FeatureStore store); |
|
148 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureStore store);
|
|
144 | 149 |
|
145 |
public TableModel createSimpleFeaturesTableModel(FeatureType featureType, List<String> columnNames, List<Feature> features); |
|
150 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureType featureType, List<String> columnNames, List<Feature> features);
|
|
146 | 151 |
|
147 | 152 |
public FeatureAttributeListCellRenderer createDefaultFeatureAttributeListCellRenderer(); |
148 | 153 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/featureform/swing/impl/DefaultJFeatureReferencesForm.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.featureform.swing.impl; |
|
24 |
|
|
25 |
import java.awt.BorderLayout; |
|
26 |
import java.awt.Dimension; |
|
27 |
import java.awt.event.ActionEvent; |
|
28 |
import java.awt.event.ActionListener; |
|
29 |
import java.awt.event.ComponentAdapter; |
|
30 |
import java.awt.event.ComponentEvent; |
|
31 |
import java.util.AbstractList; |
|
32 |
import java.util.List; |
|
33 |
import javax.swing.AbstractAction; |
|
34 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
|
35 |
import static javax.swing.Action.NAME; |
|
36 |
import static javax.swing.Action.SHORT_DESCRIPTION; |
|
37 |
import static javax.swing.Action.SMALL_ICON; |
|
38 |
import javax.swing.JComponent; |
|
39 |
import javax.swing.JPanel; |
|
40 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
|
41 |
import org.gvsig.featureform.swing.JFeatureReferencesForm; |
|
42 |
import org.gvsig.fmap.dal.StoresRepository; |
|
43 |
import org.gvsig.fmap.dal.exception.DataException; |
|
44 |
import org.gvsig.fmap.dal.feature.FacadeOfAFeature; |
|
45 |
import org.gvsig.fmap.dal.feature.Feature; |
|
46 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
47 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
48 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
49 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
50 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
51 |
import org.gvsig.fmap.dal.swing.impl.DefaultDataSwingManager; |
|
52 |
import org.gvsig.tools.ToolsLocator; |
|
53 |
import org.gvsig.tools.dispose.Disposable; |
|
54 |
import org.gvsig.tools.dynform.AbortActionException; |
|
55 |
import org.gvsig.tools.dynform.DynFormDefinition; |
|
56 |
import org.gvsig.tools.dynform.DynFormLocator; |
|
57 |
import org.gvsig.tools.dynform.DynFormManager; |
|
58 |
import org.gvsig.tools.dynform.JDynForm; |
|
59 |
import org.gvsig.tools.dynform.JDynFormField; |
|
60 |
import org.gvsig.tools.dynform.JDynFormSet; |
|
61 |
import static org.gvsig.tools.dynform.JDynFormSet.ACTION_NAVIGATION; |
|
62 |
import static org.gvsig.tools.dynform.JDynFormSet.ACTION_SAVE; |
|
63 |
import org.gvsig.tools.dynform.JDynFormSet.JDynFormSetListener; |
|
64 |
import org.gvsig.tools.dynobject.DynClass; |
|
65 |
import org.gvsig.tools.dynobject.DynObject; |
|
66 |
import org.gvsig.tools.i18n.I18nManager; |
|
67 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
|
68 |
import org.gvsig.tools.script.ScriptManager; |
|
69 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
70 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
71 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
|
72 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
73 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE; |
|
74 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
|
75 |
import org.slf4j.Logger; |
|
76 |
import org.slf4j.LoggerFactory; |
|
77 |
|
|
78 |
/** |
|
79 |
* @author fdiaz |
|
80 |
* |
|
81 |
*/ |
|
82 |
@SuppressWarnings("UseSpecificCatch") |
|
83 |
public class DefaultJFeatureReferencesForm implements Disposable, JFeatureReferencesForm { |
|
84 |
|
|
85 |
private final String REFRESHFORM_ACTION = "refreshForm"; |
|
86 |
|
|
87 |
public static class FeaturesList extends AbstractList<Feature> { |
|
88 |
|
Also available in: Unified diff