Revision 1030
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.189/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/FeatureAttributeDescriptorsComboBoxModel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2015 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.lrs.swing.impl; |
|
24 |
|
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import javax.swing.AbstractListModel; |
|
29 |
import javax.swing.MutableComboBoxModel; |
|
30 |
|
|
31 |
import org.slf4j.Logger; |
|
32 |
import org.slf4j.LoggerFactory; |
|
33 |
|
|
34 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
35 |
|
|
36 |
/** |
|
37 |
* @author fdiaz |
|
38 |
* |
|
39 |
*/ |
|
40 |
public class FeatureAttributeDescriptorsComboBoxModel extends AbstractListModel<FeatureAttributeDescriptor> implements MutableComboBoxModel<FeatureAttributeDescriptor> { |
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
private static final Logger logger = LoggerFactory.getLogger(FeatureAttributeDescriptorsComboBoxModel.class); |
|
45 |
|
|
46 |
private List<FeatureAttributeDescriptor> descriptors; |
|
47 |
private FeatureAttributeDescriptor selected; |
|
48 |
|
|
49 |
/** |
|
50 |
* |
|
51 |
*/ |
|
52 |
public FeatureAttributeDescriptorsComboBoxModel() { |
|
53 |
descriptors = new ArrayList<FeatureAttributeDescriptor>(); |
|
54 |
} |
|
55 |
|
|
56 |
/* |
|
57 |
* (non-Javadoc) |
|
58 |
* |
|
59 |
* @see javax.swing.ListModel#getSize() |
|
60 |
*/ |
|
61 |
public int getSize() { |
|
62 |
return descriptors.size(); |
|
63 |
} |
|
64 |
|
|
65 |
/* |
|
66 |
* (non-Javadoc) |
|
67 |
* |
|
68 |
* @see javax.swing.ListModel#getElementAt(int) |
|
69 |
*/ |
|
70 |
public FeatureAttributeDescriptor getElementAt(int index) { |
|
71 |
return descriptors.get(index); |
|
72 |
} |
|
73 |
|
|
74 |
/* |
|
75 |
* (non-Javadoc) |
|
76 |
* |
|
77 |
* @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object) |
|
78 |
*/ |
|
79 |
public void setSelectedItem(final Object anItem) { |
|
80 |
selected = (FeatureAttributeDescriptor) anItem; |
|
81 |
fireContentsChanged(this, -1, -1); |
|
82 |
} |
|
83 |
|
|
84 |
/* |
|
85 |
* (non-Javadoc) |
|
86 |
* |
|
87 |
* @see javax.swing.ComboBoxModel#getSelectedItem() |
|
88 |
*/ |
|
89 |
public Object getSelectedItem() { |
|
90 |
return selected; |
|
91 |
} |
|
92 |
|
|
93 |
/* (non-Javadoc) |
|
94 |
* @see javax.swing.MutableComboBoxModel#addElement(java.lang.Object) |
|
95 |
*/ |
|
96 |
public void addElement(FeatureAttributeDescriptor item) { |
|
97 |
descriptors.add(item); |
|
98 |
fireIntervalAdded(this, descriptors.size()-1, descriptors.size()-1); |
|
99 |
|
|
100 |
} |
|
101 |
|
|
102 |
/* (non-Javadoc) |
|
103 |
* @see javax.swing.MutableComboBoxModel#removeElement(java.lang.Object) |
|
104 |
*/ |
|
105 |
public void removeElement(Object obj) { |
|
106 |
int index = descriptors.indexOf(obj); |
|
107 |
descriptors.remove(obj); |
|
108 |
fireIntervalRemoved(this, index, index); |
|
109 |
|
|
110 |
} |
|
111 |
|
|
112 |
/* (non-Javadoc) |
|
113 |
* @see javax.swing.MutableComboBoxModel#insertElementAt(java.lang.Object, int) |
|
114 |
*/ |
|
115 |
public void insertElementAt(FeatureAttributeDescriptor item, int index) { |
|
116 |
descriptors.add(index, item); |
|
117 |
fireIntervalAdded(this, index, index); |
|
118 |
|
|
119 |
} |
|
120 |
|
|
121 |
/* (non-Javadoc) |
|
122 |
* @see javax.swing.MutableComboBoxModel#removeElementAt(int) |
|
123 |
*/ |
|
124 |
public void removeElementAt(int index) { |
|
125 |
descriptors.remove(index); |
|
126 |
fireIntervalRemoved(this, index, index); |
|
127 |
|
|
128 |
} |
|
129 |
|
|
130 |
} |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.189/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsEditRouteCalibrationController.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2015 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.lrs.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.lrs.swing.impl; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.event.ActionEvent; |
|
11 |
import java.awt.event.ActionListener; |
|
12 |
import java.awt.event.ItemEvent; |
|
13 |
import java.text.MessageFormat; |
|
14 |
import java.util.ArrayList; |
|
15 |
import java.util.HashMap; |
|
16 |
import java.util.List; |
|
17 |
import java.util.Locale; |
|
18 |
import java.util.Map; |
|
19 |
import javax.swing.ComboBoxModel; |
|
20 |
import javax.swing.DefaultComboBoxModel; |
|
21 |
import javax.swing.JComponent; |
|
22 |
import javax.swing.SwingUtilities; |
|
23 |
import javax.swing.event.DocumentEvent; |
|
24 |
import javax.swing.event.DocumentListener; |
|
25 |
import javax.swing.event.ListSelectionEvent; |
|
26 |
import javax.swing.event.ListSelectionListener; |
|
27 |
import javax.swing.event.TableModelEvent; |
|
28 |
import javax.swing.table.TableModel; |
|
29 |
import org.cresques.cts.ICoordTrans; |
|
30 |
import org.gvsig.fmap.dal.exception.DataException; |
|
31 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
32 |
import org.gvsig.fmap.dal.feature.Feature; |
|
33 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
34 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
38 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
39 |
import org.gvsig.fmap.geom.Geometry; |
|
40 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
41 |
import org.gvsig.fmap.geom.GeometryManager; |
|
42 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
43 |
import org.gvsig.fmap.geom.primitive.Point; |
|
44 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
45 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
46 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
47 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
48 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
|
49 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
50 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
|
51 |
import org.gvsig.lrs.lib.api.LrsAlgorithmParams; |
|
52 |
import org.gvsig.lrs.lib.api.LrsAlgorithmsLocator; |
|
53 |
import org.gvsig.lrs.lib.api.LrsAlgorithmsManager; |
|
54 |
import org.gvsig.lrs.lib.api.LrsEditRouteCalibrationAlgorithmParams; |
|
55 |
import org.gvsig.lrs.lib.api.MeasuresCalculator; |
|
56 |
import org.gvsig.lrs.lib.api.exceptions.LrsGettingParametersException; |
|
57 |
import org.gvsig.lrs.lib.api.exceptions.LrsNeededParameterException; |
|
58 |
import org.gvsig.lrs.swing.api.JLrsAlgorithmParams; |
|
59 |
import org.gvsig.tools.ToolsLocator; |
|
60 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
61 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
62 |
import org.gvsig.tools.exception.BaseException; |
|
63 |
import org.gvsig.tools.i18n.I18nManager; |
|
64 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
65 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
66 |
import org.gvsig.tools.util.LabeledValue; |
|
67 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
68 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
69 |
import org.gvsig.tools.visitor.Visitor; |
|
70 |
import org.slf4j.Logger; |
|
71 |
import org.slf4j.LoggerFactory; |
|
72 |
|
|
73 |
public class JLrsEditRouteCalibrationController extends |
|
74 |
JLrsEditRouteCalibrationParamsView implements JLrsAlgorithmParams { |
|
75 |
|
|
76 |
/** |
|
77 |
* |
|
78 |
*/ |
|
79 |
private static final long serialVersionUID = 7762321351616631999L; |
|
80 |
|
|
81 |
private static final Logger logger = LoggerFactory |
|
82 |
.getLogger(JLrsEditRouteCalibrationController.class); |
|
83 |
|
|
84 |
private boolean canceled; |
|
85 |
private boolean hasWarnings; |
|
86 |
private List<String> warnings; |
|
87 |
private final ActionListenerSupport listeners = |
|
88 |
ToolsSwingLocator.getToolsSwingManager().createActionListenerSupport(); |
|
89 |
|
|
90 |
private final FLyrVect layer; |
|
91 |
private FeatureAttributeDescriptor fieldIdRoute; |
|
92 |
private FeatureSet selectedFeatures; |
|
93 |
private Feature editedFeature; |
|
94 |
private Double editedFeatureMax; |
|
95 |
private Double editedFeatureMin; |
|
96 |
private final MapContext mapContext; |
|
97 |
GraphicLayer graphics; |
|
98 |
private int idMarkerSymbol; |
|
99 |
private int idLineSymbol; |
|
100 |
|
|
101 |
private final Map<FeatureReference, List<Double>> mCoordinatesByFeature; |
|
102 |
|
|
103 |
public static final String EDIT_ROUTECALIBRATION_GRAPHICS_ID = "EditRouteCalibration"; |
|
104 |
|
|
105 |
/** |
|
106 |
* @param layer |
|
107 |
* @param mapContext |
|
108 |
* @param fieldIdRoute |
|
109 |
* @param params |
|
110 |
* @throws LrsNeededParameterException |
|
111 |
* @throws LrsGettingParametersException |
|
112 |
* |
|
113 |
*/ |
|
114 |
public JLrsEditRouteCalibrationController(FLyrVect layer, MapContext mapContext, FeatureAttributeDescriptor fieldIdRoute, |
|
115 |
LrsAlgorithmParams params) throws LrsNeededParameterException, LrsGettingParametersException { |
|
116 |
super(); |
|
117 |
this.layer = layer; |
|
118 |
this.fieldIdRoute=fieldIdRoute; |
|
119 |
this.mapContext = mapContext; |
|
120 |
mCoordinatesByFeature = new HashMap<>(); |
|
121 |
initializeGraphics(mapContext); |
|
122 |
initComponents(); |
|
123 |
translate(); |
|
124 |
setParams(params); |
|
125 |
|
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* @param mapContext |
|
130 |
*/ |
|
131 |
private void initializeGraphics(MapContext mapContext) { |
|
132 |
this.graphics = mapContext.getGraphicsLayer(); |
|
133 |
SymbolManager symbolManager = MapContextLocator.getSymbolManager(); |
|
134 |
|
|
135 |
ISymbol markerSymbol = symbolManager.createSymbol(Geometry.TYPES.POINT, Color.RED); |
|
136 |
ISymbol lineSymbol = symbolManager.createSymbol(Geometry.TYPES.CURVE, Color.YELLOW); |
|
137 |
this.idLineSymbol = this.graphics.addSymbol(lineSymbol); |
|
138 |
this.idMarkerSymbol = this.graphics.addSymbol(markerSymbol); |
|
139 |
} |
|
140 |
|
|
141 |
@Override |
|
142 |
public void addActionListener(ActionListener listener) { |
|
143 |
listeners.addActionListener(listener); |
|
144 |
} |
|
145 |
|
|
146 |
@Override |
|
147 |
public void removeActionListener(ActionListener listener) { |
|
148 |
listeners.removeActionListener(listener); |
|
149 |
} |
|
150 |
|
|
151 |
private void translate() { |
|
152 |
|
|
153 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
154 |
lblIdRouteField |
|
155 |
.setText(i18nManager.getTranslation(lblIdRouteField.getText())); |
|
156 |
lblMaximum.setText(i18nManager.getTranslation(lblMaximum.getText())); |
|
157 |
lblMinimum.setText(i18nManager.getTranslation(lblMinimum.getText())); |
|
158 |
btnInvert.setText(i18nManager.getTranslation(btnInvert.getText())); |
|
159 |
btnApply.setText(i18nManager.getTranslation(btnApply.getText())); |
|
160 |
btnAccept.setText(i18nManager.getTranslation(btnAccept.getText())); |
|
161 |
btnCancel.setText(i18nManager.getTranslation(btnCancel.getText())); |
|
162 |
btnRecalibrate.setText(i18nManager.getTranslation(btnRecalibrate.getText())); |
|
163 |
} |
|
164 |
|
|
165 |
/** |
|
166 |
* |
|
167 |
* @param locale |
|
168 |
*/ |
|
169 |
public void setLocate(Locale locale) { |
|
170 |
Locale l = super.getLocale(); |
|
171 |
if (!l.equals(locale)) { |
|
172 |
translate(); |
|
173 |
} |
|
174 |
super.setLocale(locale); |
|
175 |
} |
|
176 |
|
|
177 |
/** |
|
178 |
* Validates it is an editable curve layer with at least 1 non-geometric |
|
179 |
* field |
|
180 |
* if it is not correct throws an exception |
|
181 |
* |
|
182 |
* @param layer |
|
183 |
* @throws LrsNeededParameterException |
|
184 |
*/ |
|
185 |
public static void validateLayer(FLayer layer) |
|
186 |
throws LrsNeededParameterException { |
|
187 |
logger.debug("Validating layer for Edit Route"); |
|
188 |
if (layer == null) { |
|
189 |
logger.error("A layer is needed"); |
|
190 |
throw new LrsNeededParameterException("a_layer_is_needed", null); |
|
191 |
} |
|
192 |
|
|
193 |
if (!layer.isEditing()) { |
|
194 |
logger.error("An editing layer is needed"); |
|
195 |
throw new LrsNeededParameterException("an_editing_layer_is_needed", |
|
196 |
null); |
|
197 |
} |
|
198 |
|
|
199 |
if (!JLrsUtils.isMlayerWithNonGeomField(layer)) { |
|
200 |
logger.error("Impossible to find the layers needed"); |
|
201 |
throw new LrsNeededParameterException( |
|
202 |
"impossible_to_find_needed_layer", null); |
|
203 |
} |
|
204 |
} |
|
205 |
|
|
206 |
/** |
|
207 |
* Checks if the selectedIdRoute is contained in the layer |
|
208 |
* |
|
209 |
* @throws LrsNeededParameterException |
|
210 |
* @throws ReadException |
|
211 |
*/ |
|
212 |
public static void validateSelectedIdRoute(FLayer layer, FeatureAttributeDescriptor selectedIdRoute) |
|
213 |
throws LrsNeededParameterException { |
|
214 |
logger.debug("Validating selected id route for Edit Route"); |
|
215 |
if (selectedIdRoute == null) { |
|
216 |
logger.error("A selectedIdRoute is needed"); |
|
217 |
throw new LrsNeededParameterException("a_selectedIdRoute_is_needed", null); |
|
218 |
} |
|
219 |
|
|
220 |
if (!isCorrectIdRoute(layer,selectedIdRoute)) { |
|
221 |
logger.error("Selected id route is not contained in editing layer"); |
|
222 |
throw new LrsNeededParameterException( |
|
223 |
"route_not_contained", null); |
|
224 |
} |
|
225 |
} |
|
226 |
|
|
227 |
public void validateSelectedFeatures() throws LrsGettingParametersException{ |
|
228 |
//TODO added to Test |
|
229 |
if (selectedFeatures!=null) return; |
|
230 |
|
|
231 |
final List<String> routeNames=new ArrayList<>(); |
|
232 |
try { |
|
233 |
selectedFeatures.accept((Object obj) -> { |
|
234 |
if(obj instanceof Feature){ |
|
235 |
Feature feature=(Feature)obj; |
|
236 |
if (feature.get(fieldIdRoute.getName()) instanceof String){ |
|
237 |
String routeName=(String)feature.get(fieldIdRoute.getName()); |
|
238 |
if (routeNames.contains(routeName)){ |
|
239 |
logger.error("Duplicate route name found"); |
|
240 |
throw new LrsGettingParametersException("Duplicate route name found",null); |
|
241 |
}else{ |
|
242 |
routeNames.add(routeName); |
|
243 |
} |
|
244 |
} |
|
245 |
} |
|
246 |
}); |
|
247 |
} catch (BaseException e1) { |
|
248 |
logger.error("Impossible to validate selected features",e1); |
|
249 |
throw new LrsGettingParametersException("Impossible to validate selected features", e1); |
|
250 |
} |
|
251 |
} |
|
252 |
|
|
253 |
/** |
|
254 |
* @throws LrsNeededParameterException |
|
255 |
* @throws LrsGettingParametersException |
|
256 |
*/ |
|
257 |
private void initComponents() throws LrsNeededParameterException, LrsGettingParametersException { |
|
258 |
|
|
259 |
validateLayer(layer); |
|
260 |
validateSelectedIdRoute(layer, fieldIdRoute); |
|
261 |
|
|
262 |
selectedFeatures=getSelectedFeatures(layer); |
|
263 |
validateSelectedFeatures(); |
|
264 |
|
|
265 |
String selectedRouteName = initCombosRouteAndStretch(); |
|
266 |
|
|
267 |
routeChanged(selectedRouteName); |
|
268 |
|
|
269 |
this.btnRecalibrate.addActionListener((ActionEvent e) -> { |
|
270 |
canceled = false; |
|
271 |
doRecalibrate(); |
|
272 |
}); |
|
273 |
|
|
274 |
this.btnApply.addActionListener((ActionEvent e) -> { |
|
275 |
canceled = false; |
|
276 |
doApply(); |
|
277 |
}); |
|
278 |
|
|
279 |
this.btnInvert.addActionListener((ActionEvent e) -> { |
|
280 |
canceled = false; |
|
281 |
doInvert(); |
|
282 |
}); |
|
283 |
|
|
284 |
this.btnAccept.addActionListener((ActionEvent e) -> { |
|
285 |
canceled = false; |
|
286 |
validateData(); |
|
287 |
doClose(); |
|
288 |
listeners.fireActionEvent(new ActionEvent( |
|
289 |
JLrsEditRouteCalibrationController.this, 0, |
|
290 |
"accept")); |
|
291 |
}); |
|
292 |
|
|
293 |
this.btnCancel.addActionListener((ActionEvent e) -> { |
|
294 |
canceled = true; |
|
295 |
doClose(); |
|
296 |
listeners.fireActionEvent(new ActionEvent( |
|
297 |
JLrsEditRouteCalibrationController.this, 0, |
|
298 |
"cancel")); |
|
299 |
}); |
|
300 |
|
|
301 |
this.tblLayerInfo.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> { |
|
302 |
GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
|
303 |
|
|
304 |
graphics.removeGraphics(EDIT_ROUTECALIBRATION_GRAPHICS_ID); |
|
305 |
showEditingRoute(); |
|
306 |
int[] selectedRows = tblLayerInfo.getSelectedRows(); |
|
307 |
for (int i = 0; i < selectedRows.length; i++) { |
|
308 |
Point point = null; |
|
309 |
try { |
|
310 |
point = (Point) geomManager.create(Geometry.TYPES.POINT, Geometry.SUBTYPES.GEOM2D); |
|
311 |
point.setX((Double)tblLayerInfo.getValueAt(selectedRows[i], 2)); |
|
312 |
point.setY((Double)tblLayerInfo.getValueAt(selectedRows[i], 3)); |
|
313 |
|
|
314 |
ICoordTrans ct = layer.getCoordTrans(); |
|
315 |
point.reProject(ct); |
|
316 |
|
|
317 |
} catch (CreateGeometryException e1) { |
|
318 |
logger.warn("Can't create a point", e); |
|
319 |
} |
|
320 |
if(point != null){ |
|
321 |
graphics.addGraphic( |
|
322 |
EDIT_ROUTECALIBRATION_GRAPHICS_ID, |
|
323 |
point, |
|
324 |
idMarkerSymbol); |
|
325 |
} |
|
326 |
} |
|
327 |
mapContext.invalidate(); |
|
328 |
}); |
|
329 |
|
|
330 |
setVisibleAceptCancel(false); |
|
331 |
canceled = false; |
|
332 |
} |
|
333 |
|
|
334 |
private void reloadMaxMin(EditRouteCalibrationTableModel tableModel){ |
|
335 |
this.txtMaximum.getDocument().addDocumentListener(new DocumentListener() { |
|
336 |
@Override |
|
337 |
public void changedUpdate(DocumentEvent e) { |
|
338 |
enableApply(e); |
|
339 |
} |
|
340 |
@Override |
|
341 |
public void removeUpdate(DocumentEvent e) { |
|
342 |
enableApply(e); |
|
343 |
} |
|
344 |
@Override |
|
345 |
public void insertUpdate(DocumentEvent e) { |
|
346 |
enableApply(e); |
|
347 |
} |
|
348 |
|
|
349 |
public void enableApply(DocumentEvent e) { |
|
350 |
try { |
|
351 |
e.getType(); |
|
352 |
Double max = Double.valueOf(txtMaximum.getText()); |
|
353 |
Double min = Double.valueOf(txtMinimum.getText()); |
|
354 |
} catch (Exception ex) { |
|
355 |
btnApply.setEnabled(false); |
|
356 |
return; |
|
357 |
} |
|
358 |
btnApply.setEnabled(true); |
|
359 |
} |
|
360 |
}); |
|
361 |
|
|
362 |
this.txtMinimum.getDocument().addDocumentListener(new DocumentListener() { |
|
363 |
@Override |
|
364 |
public void changedUpdate(DocumentEvent e) { |
|
365 |
enableApply(e); |
|
366 |
} |
|
367 |
@Override |
|
368 |
public void removeUpdate(DocumentEvent e) { |
|
369 |
enableApply(e); |
|
370 |
} |
|
371 |
@Override |
|
372 |
public void insertUpdate(DocumentEvent e) { |
|
373 |
enableApply(e); |
|
374 |
} |
|
375 |
|
|
376 |
public void enableApply(DocumentEvent e) { |
|
377 |
try{ |
|
378 |
Double max = Double.valueOf(txtMaximum.getText()); |
|
379 |
Double min = Double.valueOf(txtMinimum.getText()); |
|
380 |
}catch(Exception ex){ |
|
381 |
btnApply.setEnabled(false); |
|
382 |
return; |
|
383 |
} |
|
384 |
btnApply.setEnabled(true); |
|
385 |
} |
|
386 |
}); |
|
387 |
|
|
388 |
editedFeatureMax=tableModel.getMaxValue(); |
|
389 |
editedFeatureMin=tableModel.getMinValue(); |
|
390 |
this.txtMaximum.setText(editedFeatureMax.toString()); |
|
391 |
this.txtMinimum.setText(editedFeatureMin.toString()); |
|
392 |
} |
|
393 |
|
|
394 |
private void doInvert(){ |
|
395 |
String max = txtMaximum.getText(); |
|
396 |
String min = txtMinimum.getText(); |
|
397 |
|
|
398 |
txtMaximum.setText(min); |
|
399 |
txtMinimum.setText(max); |
|
400 |
} |
|
401 |
|
|
402 |
private void doApply(){ |
|
403 |
reloadTableModel(); |
|
404 |
EditRouteCalibrationTableModel tableModel=(EditRouteCalibrationTableModel)tblLayerInfo.getModel(); |
|
405 |
Object[][] data=tableModel.getData(); |
|
406 |
Double newMax= Double.valueOf(txtMaximum.getText()); |
|
407 |
Double newMin= Double.valueOf(txtMinimum.getText()); |
|
408 |
|
|
409 |
Double oldMin=editedFeatureMin; |
|
410 |
Double oldMax=editedFeatureMax; |
|
411 |
|
|
412 |
if (data!=null&&data.length>1){ |
|
413 |
for (int i=0;data.length-1>=i;i++){ |
|
414 |
Double mCoordinate =(Double)data[i][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]; |
|
415 |
Double newMCoordinate=calculateNewM(oldMax, oldMin, newMax, newMin, mCoordinate); |
|
416 |
data[i][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]=newMCoordinate; |
|
417 |
} |
|
418 |
} |
|
419 |
tableModel.setData(data); |
|
420 |
this.tblLayerInfo.setModel(tableModel); |
|
421 |
this.tblLayerInfo.invalidate(); |
|
422 |
this.tblLayerInfo.repaint(); |
|
423 |
fetchCoordinates(); |
|
424 |
} |
|
425 |
|
|
426 |
private void doRecalibrate(){ |
|
427 |
reloadTableModel(); |
|
428 |
EditRouteCalibrationTableModel tableModel=(EditRouteCalibrationTableModel)tblLayerInfo.getModel(); |
|
429 |
Object[][] data=tableModel.getData(); |
|
430 |
Double newMax= Double.valueOf(txtMaximum.getText()); |
|
431 |
Double newMin= Double.valueOf(txtMinimum.getText()); |
|
432 |
|
|
433 |
LrsAlgorithmsManager lrsAlgMng = LrsAlgorithmsLocator.getLrsAlgorithmsManager(); |
|
434 |
MeasuresCalculator mcalc = lrsAlgMng.createMeasuresCalculator(this.editedFeature.getDefaultGeometry(), false); |
|
435 |
mcalc.setFirstMeasure(newMin); |
|
436 |
mcalc.setLastMeasure(newMax); |
|
437 |
mcalc.calculate(); |
|
438 |
Geometry mgeom = mcalc.getResult(); |
|
439 |
|
|
440 |
reloadTableModel(mgeom); |
|
441 |
|
|
442 |
fetchCoordinates(); |
|
443 |
} |
|
444 |
|
|
445 |
|
|
446 |
private double calculateNewM(double oldMax, double oldMin, double newMax, double newMin, double mCoordinate){ |
|
447 |
double result; |
|
448 |
if (oldMax==oldMin){ |
|
449 |
return Double.POSITIVE_INFINITY; |
|
450 |
} |
|
451 |
result=((newMax-newMin)*(mCoordinate-oldMin)/(oldMax-oldMin))+newMin; |
|
452 |
|
|
453 |
return result; |
|
454 |
} |
|
455 |
|
|
456 |
|
|
457 |
private void cellUpdated(int row){ |
|
458 |
EditRouteCalibrationTableModel tableModel=(EditRouteCalibrationTableModel)tblLayerInfo.getModel(); |
|
459 |
Object[][] data=tableModel.getData(); |
|
460 |
Double newValue=tableModel.getValueUpdated(); |
|
461 |
|
|
462 |
data[row][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]=newValue; |
|
463 |
|
|
464 |
tableModel.setData(data); |
|
465 |
this.tblLayerInfo.setModel(tableModel); |
|
466 |
this.tblLayerInfo.invalidate(); |
|
467 |
this.tblLayerInfo.repaint(); |
|
468 |
} |
|
469 |
|
|
470 |
private String initCombosRouteAndStretch() { |
|
471 |
final List<String> routeNames=new ArrayList<>(); |
|
472 |
try { |
|
473 |
selectedFeatures.accept((Object obj) -> { |
|
474 |
if(obj instanceof Feature){ |
|
475 |
Feature feature=(Feature)obj; |
|
476 |
if (feature.get(fieldIdRoute.getName()) instanceof String){ |
|
477 |
String routeName=(String)feature.get(fieldIdRoute.getName()); |
|
478 |
if (!routeNames.contains(routeName)){ |
|
479 |
routeNames.add(routeName); |
|
480 |
} |
|
481 |
} |
|
482 |
} |
|
483 |
}); |
|
484 |
} catch (BaseException e1) { |
|
485 |
logger.error("Impossible to obtain route names to fill ComboBox",e1); |
|
486 |
} |
|
487 |
|
|
488 |
cmbStretch.addItemListener((ItemEvent event) -> { |
|
489 |
if (event.getStateChange() == ItemEvent.SELECTED) { |
|
490 |
LabeledValue item = (LabeledValue) event.getItem(); |
|
491 |
SwingUtilities.invokeLater(() -> {stretchChanged((FeatureReference) item.getValue());}); |
|
492 |
} |
|
493 |
}); |
|
494 |
|
|
495 |
String[] routeNamesArray = routeNames.toArray(new String[0]); |
|
496 |
ComboBoxModel<String> routeModel = |
|
497 |
new DefaultComboBoxModel<>(routeNamesArray); |
|
498 |
cmbRoute.setModel(routeModel); |
|
499 |
|
|
500 |
cmbRoute.addItemListener((ItemEvent event) -> { |
|
501 |
if (event.getStateChange() == ItemEvent.SELECTED) { |
|
502 |
String item = (String) event.getItem(); |
|
503 |
SwingUtilities.invokeLater(() -> {routeChanged((String)item);}); |
|
504 |
} |
|
505 |
}); |
|
506 |
|
|
507 |
|
|
508 |
return (String)cmbRoute.getSelectedItem(); |
|
509 |
} |
|
510 |
|
|
511 |
|
|
512 |
private void routeChanged(String selectedRouteName) { |
|
513 |
|
|
514 |
final String routeName = selectedRouteName; |
|
515 |
|
|
516 |
DefaultComboBoxModel<LabeledValue> stretchComboModel = new DefaultComboBoxModel<>(); |
|
517 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
518 |
DisposableIterator it = null; |
|
519 |
try { |
|
520 |
it = selectedFeatures.fastIterator(); |
|
521 |
int i = 1; |
|
522 |
while (it.hasNext()) { |
|
523 |
Feature feature = (Feature) it.next(); |
|
524 |
if (feature.get(fieldIdRoute.getName()) instanceof String |
|
525 |
&& routeName.equals((String) feature.get(fieldIdRoute.getName()))) { |
|
526 |
LabeledValue<FeatureReference> item = new LabeledValueImpl( |
|
527 |
i18n.getTranslation("_Stretch_{0}",new String[] {String.valueOf(i)}), |
|
528 |
feature.getReference() |
|
529 |
); |
|
530 |
stretchComboModel.addElement(item); |
|
531 |
i++; |
|
532 |
} |
|
533 |
} |
|
534 |
if (stretchComboModel.getSize() > 0) { |
|
535 |
cmbStretch.setEnabled(true); |
|
536 |
cmbStretch.setModel(stretchComboModel); |
|
537 |
cmbStretch.setSelectedIndex(0); |
|
538 |
stretchChanged( |
|
539 |
(FeatureReference) ((LabeledValue)(cmbStretch.getItemAt(0))).getValue() |
|
540 |
); |
|
541 |
|
|
542 |
} else { |
|
543 |
cmbStretch.setEnabled(false); |
|
544 |
} |
|
545 |
} catch (DataException e) { |
|
546 |
logger.error("Error getting table info", e); |
|
547 |
} finally { |
|
548 |
if (it != null) { |
|
549 |
it.dispose(); |
|
550 |
} |
|
551 |
} |
|
552 |
} |
|
553 |
|
|
554 |
private void stretchChanged(FeatureReference featRef) { |
|
555 |
fetchCoordinates(); |
|
556 |
try { |
|
557 |
editedFeature = featRef.getFeature().getCopy(); |
|
558 |
} catch (DataException ex) { |
|
559 |
logger.error("Error getting table info", ex); |
|
560 |
} |
|
561 |
|
|
562 |
FeatureStore store; // = null; |
|
563 |
FeatureSelection selection; // = null; |
|
564 |
try { |
|
565 |
store = layer.getFeatureStore(); |
|
566 |
selection = store.createFeatureSelection(); |
|
567 |
selection.select(editedFeature); |
|
568 |
store.setSelection(selection); |
|
569 |
} catch (DataException ex) { |
|
570 |
logger.warn("Error getting table info", ex); |
|
571 |
} finally { |
|
572 |
// DisposeUtils.disposeQuietly(selection); |
|
573 |
// DisposeUtils.disposeQuietly(store); |
|
574 |
} |
|
575 |
reloadTableModel(); |
|
576 |
reloadMaxMin((EditRouteCalibrationTableModel) tblLayerInfo.getModel()); |
|
577 |
|
|
578 |
graphics.removeGraphics(EDIT_ROUTECALIBRATION_GRAPHICS_ID); |
|
579 |
showEditingRoute(); |
|
580 |
mapContext.invalidate(); |
|
581 |
|
|
582 |
} |
|
583 |
|
|
584 |
/** |
|
585 |
* |
|
586 |
*/ |
|
587 |
private void showEditingRoute() { |
|
588 |
if (editedFeature != null) { |
|
589 |
Geometry geom = editedFeature.getDefaultGeometry().cloneGeometry(); |
|
590 |
ICoordTrans ct = layer.getCoordTrans(); |
|
591 |
geom.reProject(ct); |
|
592 |
graphics.addGraphic(EDIT_ROUTECALIBRATION_GRAPHICS_ID, geom, idLineSymbol); |
|
593 |
} |
|
594 |
} |
|
595 |
|
|
596 |
private void reloadTableModel(){ |
|
597 |
reloadTableModel(editedFeature.getDefaultGeometry()); |
|
598 |
} |
|
599 |
|
|
600 |
private void reloadTableModel(Geometry geometry){ |
|
601 |
EditRouteCalibrationTableModel tableModel; |
|
602 |
tableModel =null; |
|
603 |
try { |
|
604 |
if (editedFeature!=null){ |
|
605 |
tableModel = new EditRouteCalibrationTableModel( |
|
606 |
editedFeature.getString(fieldIdRoute.getName()), |
|
607 |
geometry, |
|
608 |
this.mCoordinatesByFeature.get(editedFeature.getReference())); |
|
609 |
tableModel.addTableModelListener((TableModelEvent e) -> { |
|
610 |
cellUpdated(e.getFirstRow()); |
|
611 |
}); |
|
612 |
} |
|
613 |
} catch (BaseException e) { |
|
614 |
logger.error("Error getting table info",e); |
|
615 |
} |
|
616 |
|
|
617 |
tblLayerInfo.setModel(tableModel); |
|
618 |
this.tblLayerInfo.invalidate(); |
|
619 |
} |
|
620 |
|
|
621 |
private void doClose() { |
|
622 |
DisposeUtils.disposeQuietly(this.selectedFeatures); |
|
623 |
graphics.removeGraphics(EDIT_ROUTECALIBRATION_GRAPHICS_ID); |
|
624 |
mapContext.invalidate(); |
|
625 |
this.setVisible(false); |
|
626 |
} |
|
627 |
|
|
628 |
public void close(){ |
|
629 |
this.doClose(); |
|
630 |
} |
|
631 |
|
|
632 |
private void validateData(){ |
|
633 |
hasWarnings=true; |
|
634 |
EditRouteCalibrationTableModel tableModel=(EditRouteCalibrationTableModel)tblLayerInfo.getModel(); |
|
635 |
Object[][] data=tableModel.getData(); |
|
636 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
637 |
warnings=new ArrayList<>(); |
|
638 |
|
|
639 |
if (data==null){ |
|
640 |
warnings.add(i18nManager.getTranslation("warn_Not_data_found_in_table")); |
|
641 |
return; |
|
642 |
} |
|
643 |
if (data.length<2){ |
|
644 |
warnings.add(i18nManager.getTranslation("warn_Not_enough_data_found_in_table")); |
|
645 |
} |
|
646 |
for (int i=0;data.length-1>=i;i++){ |
|
647 |
Double mCoordinate=(Double)data[i][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]; |
|
648 |
if(mCoordinate.compareTo(new Double(0))<0){ |
|
649 |
warnings.add(MessageFormat.format(i18nManager.getTranslation("warn_Negative_value_at_row"), i+1)); |
|
650 |
} |
|
651 |
if(i>0 && i+1<data.length-1){ |
|
652 |
Double preMCoordinate=(Double)data[i-1][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]; |
|
653 |
Double postMCoordinate=(Double)data[i+1][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]; |
|
654 |
boolean orderedUpwardsPre=mCoordinate.compareTo(preMCoordinate)>=0; |
|
655 |
boolean orderedUpwardsPost=postMCoordinate.compareTo(mCoordinate)>=0; |
|
656 |
//if both,pre and post, are ordered upwards or downwards, it is correct |
|
657 |
if(orderedUpwardsPre!=orderedUpwardsPost){ |
|
658 |
warnings.add(MessageFormat.format(i18nManager.getTranslation("warn_Out_of_sequence_value_at_row"), i+1)); |
|
659 |
} |
|
660 |
} |
|
661 |
|
|
662 |
for (int j=i+1;data.length-2>=j;j++){ |
|
663 |
Double auxMCoordinate=(Double)data[j][EditRouteCalibrationTableModel.COLUMN_MCOORDINATE]; |
|
664 |
if(mCoordinate.equals(auxMCoordinate)){ |
|
665 |
warnings.add(MessageFormat.format(i18nManager.getTranslation("warn_Repeated_value_at_row"), i+1,j+1)); |
|
666 |
} |
|
667 |
} |
|
668 |
} |
|
669 |
|
|
670 |
if(warnings.isEmpty()){ |
|
671 |
hasWarnings=false; |
|
672 |
} |
|
673 |
} |
|
674 |
|
|
675 |
public boolean hasWarnings(){ |
|
676 |
return this.hasWarnings; |
|
677 |
} |
|
678 |
|
|
679 |
public List<String> getWarnings(){ |
|
680 |
return this.warnings; |
|
681 |
} |
|
682 |
|
|
683 |
@Override |
|
684 |
public boolean isCanceled() { |
|
685 |
return this.canceled; |
|
686 |
} |
|
687 |
|
|
688 |
@Override |
|
689 |
public void setVisibleAceptCancel(boolean visible) { |
|
690 |
this.btnAccept.setVisible(visible); |
|
691 |
this.btnCancel.setVisible(visible); |
|
692 |
} |
|
693 |
|
|
694 |
@Override |
|
695 |
public boolean getVisibleAceptCancel() { |
|
696 |
return this.btnAccept.isVisible(); |
|
697 |
} |
|
698 |
|
|
699 |
@Override |
|
700 |
public JComponent asJComponent() { |
|
701 |
return this; |
|
702 |
} |
|
703 |
|
|
704 |
@Override |
|
705 |
public LrsAlgorithmParams getParams() |
|
706 |
throws LrsGettingParametersException, LrsNeededParameterException { |
|
707 |
fetchCoordinates(); |
|
708 |
LrsAlgorithmsManager manager = |
|
709 |
LrsAlgorithmsLocator.getLrsAlgorithmsManager(); |
|
710 |
LrsEditRouteCalibrationAlgorithmParams params = |
|
711 |
manager.createLrsEditRouteCalibrationAlgorithmParams(); |
|
712 |
// Recorrer todo del interfaz y rellenar los parametros |
|
713 |
|
|
714 |
params.setIdRouteField(fieldIdRoute); |
|
715 |
params.setSelectedRouteName((String)cmbRoute.getSelectedItem()); |
|
716 |
|
|
717 |
params.setModifiedMCoordinates(this.mCoordinatesByFeature); |
|
718 |
|
|
719 |
return params; |
|
720 |
} |
|
721 |
|
|
722 |
@Override |
|
723 |
public void setParams(LrsAlgorithmParams params) { |
|
724 |
if (params == null) { |
|
725 |
clear(); |
|
726 |
return; |
|
727 |
} |
|
728 |
// Rellena los campos con los valores de params |
|
729 |
LrsEditRouteCalibrationAlgorithmParams parameters = |
|
730 |
(LrsEditRouteCalibrationAlgorithmParams) params; |
|
731 |
|
|
732 |
if (parameters.getSelectedRouteName()!=null){ |
|
733 |
this.cmbRoute.setSelectedItem(parameters.getSelectedRouteName()); |
|
734 |
} |
|
735 |
if (parameters.getIdRouteField()!=null && |
|
736 |
parameters.getIdRouteField() instanceof FeatureAttributeDescriptor){ |
|
737 |
this.fieldIdRoute=parameters.getIdRouteField(); |
|
738 |
} |
|
739 |
} |
|
740 |
|
|
741 |
@Override |
|
742 |
public void clear() { |
|
743 |
if (cmbRoute!=null){ |
|
744 |
this.cmbRoute.setSelectedItem(0); |
|
745 |
} |
|
746 |
} |
|
747 |
|
|
748 |
|
|
749 |
/** |
|
750 |
* Returns true if selectedIdRoute is contained in layer |
|
751 |
* @param layer |
|
752 |
* @param selectedIdRoute |
|
753 |
* @return |
|
754 |
*/ |
|
755 |
private static boolean isCorrectIdRoute(FLayer layer, FeatureAttributeDescriptor selectedIdRoute){ |
|
756 |
// Validates is FLyrVect |
|
757 |
FLyrVect lyrVect; |
|
758 |
if (layer == null || !(layer instanceof FLyrVect)) { |
|
759 |
return false; |
|
760 |
} |
|
761 |
lyrVect = (FLyrVect) layer; |
|
762 |
try { |
|
763 |
FeatureStore featureStore = lyrVect.getFeatureStore(); |
|
764 |
try { |
|
765 |
FeatureType type = featureStore.getDefaultFeatureType(); |
|
766 |
FeatureAttributeDescriptor[] attributeDescriptors |
|
767 |
= type.getAttributeDescriptors(); |
|
768 |
for (int i = 0; i < attributeDescriptors.length; i++) { |
|
769 |
FeatureAttributeDescriptor featureAttributeDescriptor |
|
770 |
= attributeDescriptors[i]; |
|
771 |
if (featureAttributeDescriptor.equals(selectedIdRoute)) { |
|
772 |
logger.debug("SelectedIdRoute founded in layer"); |
|
773 |
return true; |
|
774 |
} |
|
775 |
} |
|
776 |
} catch (DataException e1) { |
|
777 |
logger.warn(new StringBuilder() |
|
778 |
.append( |
|
779 |
"Error getting default feature type from layer ") |
|
780 |
.append(lyrVect.getName()).toString(), e1); |
|
781 |
} |
|
782 |
} catch (Exception e) { |
|
783 |
logger.error("Can't get linear vector layers", e); |
|
784 |
} |
|
785 |
return false; |
|
786 |
} |
|
787 |
|
|
788 |
private static FeatureSet getSelectedFeatures(FLayer layer) { |
|
789 |
FLyrVect lyrVect = null; |
|
790 |
if (layer instanceof FLyrVect) { |
|
791 |
lyrVect = (FLyrVect) layer; |
|
792 |
} else |
|
793 |
return null; |
|
794 |
FeatureStore featureStore=lyrVect.getFeatureStore(); |
|
795 |
if(featureStore!=null){ |
|
796 |
try { |
|
797 |
FeatureSelection selectedFeatures= featureStore.getFeatureSelection(); |
|
798 |
if (selectedFeatures!=null && !selectedFeatures.isEmpty()){ |
|
799 |
DisposeUtils.bind(selectedFeatures); |
|
800 |
return selectedFeatures; |
|
801 |
}else{ |
|
802 |
//If there is not selected features, all features are used |
|
803 |
return featureStore.getFeatureSet(); |
|
804 |
} |
|
805 |
} catch (DataException e) { |
|
806 |
logger.warn("Can't get selected features", e); |
|
807 |
} |
|
808 |
} |
|
809 |
return null; |
|
810 |
} |
|
811 |
|
|
812 |
private void fetchCoordinates() { |
|
813 |
TableModel tableModel = tblLayerInfo.getModel(); |
|
814 |
if(!(tableModel instanceof EditRouteCalibrationTableModel)){ |
|
815 |
return; |
|
816 |
} |
|
817 |
Object[][] data=((EditRouteCalibrationTableModel)tableModel).getData(); |
|
818 |
List<Double> mValues = new ArrayList<>(); |
|
819 |
for (Object[] line : data) { |
|
820 |
Double mValue=(Double)line[4]; |
|
821 |
mValues.add(mValue); |
|
822 |
} |
|
823 |
this.mCoordinatesByFeature.put(editedFeature.getReference(), mValues); |
|
824 |
} |
|
825 |
} |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.189/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsView.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/paco/projects/externals/gvsig-desktop/gvSIG_v2.1/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:GROW(1.0),BOTTOM:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
29 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at> |
|
30 |
<at name="components"> |
|
31 |
<object classname="java.util.LinkedList"> |
|
32 |
<item > |
|
33 |
<at name="value"> |
|
34 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
35 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
36 |
<at name="cellconstraints"> |
|
37 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
38 |
<at name="column">2</at> |
|
39 |
<at name="row">2</at> |
|
40 |
<at name="colspan">1</at> |
|
41 |
<at name="rowspan">1</at> |
|
42 |
<at name="halign">default</at> |
|
43 |
<at name="valign">default</at> |
|
44 |
<at name="insets" object="insets">0,0,0,0</at> |
|
45 |
</object> |
|
46 |
</at> |
|
47 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
48 |
</super> |
|
49 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
50 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
51 |
<at name="beanproperties"> |
|
52 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
53 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
54 |
<at name="properties"> |
|
55 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
56 |
<at name="text">source</at> |
|
57 |
<at name="height">14</at> |
|
58 |
<at name="width">175</at> |
|
59 |
<at name="name">lblInputLayer</at> |
|
60 |
<at name="fill"> |
|
61 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
62 |
<at name="name">fill</at> |
|
63 |
</object> |
|
64 |
</at> |
|
65 |
<at name="border"> |
|
66 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
<at name="borders"> |
|
71 |
<object classname="java.util.LinkedList"> |
|
72 |
<item > |
|
73 |
<at name="value"> |
|
74 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
75 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
76 |
<at name="name">border</at> |
|
77 |
</super> |
|
78 |
</object> |
|
79 |
</at> |
|
80 |
</item> |
|
81 |
</object> |
|
82 |
</at> |
|
83 |
</object> |
|
84 |
</at> |
|
85 |
</object> |
|
86 |
</at> |
|
87 |
</object> |
|
88 |
</at> |
|
89 |
</object> |
|
90 |
</at> |
|
91 |
</item> |
|
92 |
<item > |
|
93 |
<at name="value"> |
|
94 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
95 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
96 |
<at name="cellconstraints"> |
|
97 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
98 |
<at name="column">4</at> |
|
99 |
<at name="row">2</at> |
|
100 |
<at name="colspan">2</at> |
|
101 |
<at name="rowspan">1</at> |
|
102 |
<at name="halign">default</at> |
|
103 |
<at name="valign">default</at> |
|
104 |
<at name="insets" object="insets">0,0,0,0</at> |
|
105 |
</object> |
|
106 |
</at> |
|
107 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
108 |
</super> |
|
109 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
110 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
111 |
<at name="beanproperties"> |
|
112 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
113 |
<at name="classname">javax.swing.JComboBox</at> |
|
114 |
<at name="properties"> |
|
115 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
116 |
<at name="height">20</at> |
|
117 |
<at name="items"> |
|
118 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
119 |
<at name="name">items</at> |
|
120 |
</object> |
|
121 |
</at> |
|
122 |
<at name="width">728</at> |
|
123 |
<at name="name">cmbInputLayer</at> |
|
124 |
<at name="border"> |
|
125 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
126 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
127 |
<at name="name">border</at> |
|
128 |
</super> |
|
129 |
<at name="borders"> |
|
130 |
<object classname="java.util.LinkedList"> |
|
131 |
<item > |
|
132 |
<at name="value"> |
|
133 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
134 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
135 |
<at name="name">border</at> |
|
136 |
</super> |
|
137 |
</object> |
|
138 |
</at> |
|
139 |
</item> |
|
140 |
</object> |
|
141 |
</at> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
</object> |
|
145 |
</at> |
|
146 |
</object> |
|
147 |
</at> |
|
148 |
</object> |
|
149 |
</at> |
|
150 |
</item> |
|
151 |
<item > |
|
152 |
<at name="value"> |
|
153 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
154 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
155 |
<at name="cellconstraints"> |
|
156 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
157 |
<at name="column">2</at> |
|
158 |
<at name="row">3</at> |
|
159 |
<at name="colspan">1</at> |
|
160 |
<at name="rowspan">1</at> |
|
161 |
<at name="halign">default</at> |
|
162 |
<at name="valign">default</at> |
|
163 |
<at name="insets" object="insets">0,0,0,0</at> |
|
164 |
</object> |
|
165 |
</at> |
|
166 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
167 |
</super> |
|
168 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
169 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
170 |
<at name="beanproperties"> |
|
171 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
172 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
173 |
<at name="properties"> |
|
174 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
175 |
<at name="text">id_route_field</at> |
|
176 |
<at name="height">14</at> |
|
177 |
<at name="width">175</at> |
|
178 |
<at name="name">lblIdRouteField</at> |
|
179 |
<at name="fill"> |
|
180 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
181 |
<at name="name">fill</at> |
|
182 |
</object> |
|
183 |
</at> |
|
184 |
<at name="border"> |
|
185 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
186 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
187 |
<at name="name">border</at> |
|
188 |
</super> |
|
189 |
<at name="borders"> |
|
190 |
<object classname="java.util.LinkedList"> |
|
191 |
<item > |
|
192 |
<at name="value"> |
|
193 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
194 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
195 |
<at name="name">border</at> |
|
196 |
</super> |
|
197 |
</object> |
|
198 |
</at> |
|
199 |
</item> |
|
200 |
</object> |
|
201 |
</at> |
|
202 |
</object> |
|
203 |
</at> |
|
204 |
</object> |
|
205 |
</at> |
|
206 |
</object> |
|
207 |
</at> |
|
208 |
</object> |
|
209 |
</at> |
|
210 |
</item> |
|
211 |
<item > |
|
212 |
<at name="value"> |
|
213 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
214 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
215 |
<at name="cellconstraints"> |
|
216 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
217 |
<at name="column">4</at> |
|
218 |
<at name="row">3</at> |
|
219 |
<at name="colspan">2</at> |
|
220 |
<at name="rowspan">1</at> |
|
221 |
<at name="halign">default</at> |
|
222 |
<at name="valign">default</at> |
|
223 |
<at name="insets" object="insets">0,0,0,0</at> |
|
224 |
</object> |
|
225 |
</at> |
|
226 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
227 |
</super> |
|
228 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
229 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
230 |
<at name="beanproperties"> |
|
231 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
232 |
<at name="classname">javax.swing.JComboBox</at> |
|
233 |
<at name="properties"> |
|
234 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
235 |
<at name="height">20</at> |
|
236 |
<at name="items"> |
|
237 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
238 |
<at name="name">items</at> |
|
239 |
</object> |
|
240 |
</at> |
|
241 |
<at name="width">728</at> |
|
242 |
<at name="name">cmbIdRouteField</at> |
|
243 |
<at name="border"> |
|
244 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
245 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
246 |
<at name="name">border</at> |
|
247 |
</super> |
|
248 |
<at name="borders"> |
|
249 |
<object classname="java.util.LinkedList"> |
|
250 |
<item > |
|
251 |
<at name="value"> |
|
252 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
253 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
254 |
<at name="name">border</at> |
|
255 |
</super> |
|
256 |
</object> |
|
257 |
</at> |
|
258 |
</item> |
|
259 |
</object> |
|
260 |
</at> |
|
261 |
</object> |
|
262 |
</at> |
|
263 |
</object> |
|
264 |
</at> |
|
265 |
</object> |
|
266 |
</at> |
|
267 |
</object> |
|
268 |
</at> |
|
269 |
</item> |
|
270 |
<item > |
|
271 |
<at name="value"> |
|
272 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
273 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
274 |
<at name="cellconstraints"> |
|
275 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
276 |
<at name="column">2</at> |
|
277 |
<at name="row">6</at> |
|
278 |
<at name="colspan">1</at> |
|
279 |
<at name="rowspan">1</at> |
|
280 |
<at name="halign">default</at> |
|
281 |
<at name="valign">default</at> |
|
282 |
<at name="insets" object="insets">0,0,0,0</at> |
|
283 |
</object> |
|
284 |
</at> |
|
285 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
286 |
</super> |
|
287 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
288 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
289 |
<at name="beanproperties"> |
|
290 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
291 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
292 |
<at name="properties"> |
|
293 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
294 |
<at name="text">measures_field</at> |
|
295 |
<at name="height">14</at> |
|
296 |
<at name="width">175</at> |
|
297 |
<at name="name">lblMeasureField</at> |
|
298 |
<at name="fill"> |
|
299 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
300 |
<at name="name">fill</at> |
|
301 |
</object> |
|
302 |
</at> |
|
303 |
<at name="border"> |
|
304 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
305 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
306 |
<at name="name">border</at> |
|
307 |
</super> |
|
308 |
<at name="borders"> |
|
309 |
<object classname="java.util.LinkedList"> |
|
310 |
<item > |
|
311 |
<at name="value"> |
|
312 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
313 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
314 |
<at name="name">border</at> |
|
315 |
</super> |
|
316 |
</object> |
|
317 |
</at> |
|
318 |
</item> |
|
319 |
</object> |
|
320 |
</at> |
|
321 |
</object> |
|
322 |
</at> |
|
323 |
</object> |
|
324 |
</at> |
|
325 |
</object> |
|
326 |
</at> |
|
327 |
</object> |
|
328 |
</at> |
|
329 |
</item> |
|
330 |
<item > |
|
331 |
<at name="value"> |
|
332 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
333 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
334 |
<at name="cellconstraints"> |
|
335 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
336 |
<at name="column">4</at> |
|
337 |
<at name="row">6</at> |
|
338 |
<at name="colspan">2</at> |
|
339 |
<at name="rowspan">1</at> |
|
340 |
<at name="halign">default</at> |
|
341 |
<at name="valign">default</at> |
|
342 |
<at name="insets" object="insets">0,0,0,0</at> |
|
343 |
</object> |
|
344 |
</at> |
|
345 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
346 |
</super> |
|
347 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
348 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
349 |
<at name="beanproperties"> |
|
350 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
351 |
<at name="classname">javax.swing.JComboBox</at> |
|
352 |
<at name="properties"> |
|
353 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
354 |
<at name="height">20</at> |
|
355 |
<at name="items"> |
|
356 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
357 |
<at name="name">items</at> |
|
358 |
</object> |
|
359 |
</at> |
|
360 |
<at name="width">728</at> |
|
361 |
<at name="name">cmbMeasureField</at> |
|
362 |
<at name="border"> |
|
363 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
364 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
365 |
<at name="name">border</at> |
|
366 |
</super> |
|
367 |
<at name="borders"> |
|
368 |
<object classname="java.util.LinkedList"> |
|
369 |
<item > |
|
370 |
<at name="value"> |
|
371 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
372 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
373 |
<at name="name">border</at> |
|
374 |
</super> |
|
375 |
</object> |
|
376 |
</at> |
|
377 |
</item> |
|
378 |
</object> |
|
379 |
</at> |
|
380 |
</object> |
|
381 |
</at> |
|
382 |
</object> |
|
383 |
</at> |
|
384 |
</object> |
|
385 |
</at> |
|
386 |
</object> |
|
387 |
</at> |
|
388 |
</item> |
|
389 |
<item > |
|
390 |
<at name="value"> |
|
391 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
392 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
393 |
<at name="cellconstraints"> |
|
394 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
395 |
<at name="column">2</at> |
|
396 |
<at name="row">7</at> |
|
397 |
<at name="colspan">1</at> |
|
398 |
<at name="rowspan">1</at> |
|
399 |
<at name="halign">default</at> |
|
400 |
<at name="valign">default</at> |
|
401 |
<at name="insets" object="insets">0,0,0,0</at> |
|
402 |
</object> |
|
403 |
</at> |
|
404 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
405 |
</super> |
|
406 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
407 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
408 |
<at name="beanproperties"> |
|
409 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
410 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
411 |
<at name="properties"> |
|
412 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
413 |
<at name="text">output_file</at> |
|
414 |
<at name="height">14</at> |
|
415 |
<at name="width">175</at> |
|
416 |
<at name="name">lblOutputFile</at> |
|
417 |
<at name="fill"> |
|
418 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
419 |
<at name="name">fill</at> |
|
420 |
</object> |
|
421 |
</at> |
|
422 |
<at name="border"> |
|
423 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
424 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
425 |
<at name="name">border</at> |
|
426 |
</super> |
|
427 |
<at name="borders"> |
|
428 |
<object classname="java.util.LinkedList"> |
|
429 |
<item > |
|
430 |
<at name="value"> |
|
431 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
432 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
433 |
<at name="name">border</at> |
|
434 |
</super> |
|
435 |
</object> |
|
436 |
</at> |
|
437 |
</item> |
|
438 |
</object> |
|
439 |
</at> |
|
440 |
</object> |
|
441 |
</at> |
|
442 |
</object> |
|
443 |
</at> |
|
444 |
</object> |
|
445 |
</at> |
|
446 |
</object> |
|
447 |
</at> |
|
448 |
</item> |
|
449 |
<item > |
|
450 |
<at name="value"> |
|
451 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
452 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
453 |
<at name="cellconstraints"> |
|
454 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
455 |
<at name="column">4</at> |
|
456 |
<at name="row">4</at> |
|
457 |
<at name="colspan">2</at> |
|
458 |
<at name="rowspan">1</at> |
|
459 |
<at name="halign">default</at> |
|
460 |
<at name="valign">default</at> |
|
461 |
<at name="insets" object="insets">0,0,0,0</at> |
|
462 |
</object> |
|
463 |
</at> |
|
464 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
465 |
</super> |
|
466 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
467 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
468 |
<at name="beanproperties"> |
|
469 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
470 |
<at name="classname">javax.swing.JComboBox</at> |
|
471 |
<at name="properties"> |
|
472 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
473 |
<at name="height">20</at> |
|
474 |
<at name="items"> |
|
475 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
476 |
<at name="name">items</at> |
|
477 |
</object> |
|
478 |
</at> |
|
479 |
<at name="width">728</at> |
|
480 |
<at name="name">cmbCalibratePointLayer</at> |
|
481 |
<at name="border"> |
|
482 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
483 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
484 |
<at name="name">border</at> |
|
485 |
</super> |
|
486 |
<at name="borders"> |
|
487 |
<object classname="java.util.LinkedList"> |
|
488 |
<item > |
|
489 |
<at name="value"> |
|
490 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
491 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
492 |
<at name="name">border</at> |
|
493 |
</super> |
|
494 |
</object> |
|
495 |
</at> |
|
496 |
</item> |
|
497 |
</object> |
|
498 |
</at> |
|
499 |
</object> |
|
500 |
</at> |
|
501 |
</object> |
|
502 |
</at> |
|
503 |
</object> |
|
504 |
</at> |
|
505 |
</object> |
|
506 |
</at> |
|
507 |
</item> |
Also available in: Unified diff