Revision 47
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.app/org.gvsig.lrs.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
45 | 45 |
|
46 | 46 |
#CALIBRATE ROUTE |
47 | 47 |
calibrate_point_layer=Capa de puntos de calibraci\u00f3n |
48 |
id_calibration_point_route_field=Identificador de ruta en la capa de puntos de calibraci\u00f3n |
|
48 |
id_calibration_point_route_field=Identificador de ruta en la capa de puntos |
|
49 |
measures_field=Campo de medidas |
|
49 | 50 |
measure_calc_method=M\u00E9todo de c\u00e1lculo de mediciones |
50 | 51 |
search_radius=Radio de b\u00FAsqueda |
51 | 52 |
interpolate_between_calibration_points=Interpolar entre puntos de calibraci\u00f3n |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.app/org.gvsig.lrs.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
46 | 46 |
#CALIBRATE ROUTE |
47 | 47 |
calibrate_point_layer=Calibration points layer |
48 | 48 |
id_calibration_point_route_field=Route identifier in calibration points layer |
49 |
measures_field=Measures field |
|
49 | 50 |
measure_calc_method=Measure calculations method |
50 | 51 |
search_radius=Search radius |
51 | 52 |
interpolate_between_calibration_points=Interpolate between calibration points |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.app/org.gvsig.lrs.app.mainplugin/src/main/java/org/gvsig/lrs/app/calibrateroute/CalibrateRouteExtension.java | ||
---|---|---|
201 | 201 |
if (view!=null){ |
202 | 202 |
ViewDocument viewDocument = view.getViewDocument(); |
203 | 203 |
FLayers layers = viewDocument.getMapContext().getLayers(); |
204 |
return JLrsUtils.validatedCurveAndPointLayer(layers); |
|
204 |
return JLrsUtils.validatedMCurveAndPointLayer(layers);
|
|
205 | 205 |
} |
206 | 206 |
|
207 | 207 |
return false; |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.lib/org.gvsig.lrs.lib.api/src/main/java/org/gvsig/lrs/lib/api/DistanceUnits.java | ||
---|---|---|
30 | 30 |
* |
31 | 31 |
*/ |
32 | 32 |
public enum DistanceUnits { |
33 |
KILOMETER("kilometer","km",1000),
|
|
33 |
KILOMETER("Kilometer","Km",1000),
|
|
34 | 34 |
METER("meter","m",1), |
35 | 35 |
CENTIMETER("centimeter","cm",0.01), |
36 | 36 |
MILLIMETER("millimeter","mm",0.001), |
37 | 37 |
MILE("mile","mi",1609.344), |
38 | 38 |
YARD("yard","Ya",0.9144), |
39 | 39 |
FOOT("foot","ft",0.3048), |
40 |
INCH("inch","inche",0.0254);
|
|
40 |
INCH("inch","in",0.0254); |
|
41 | 41 |
|
42 | 42 |
private final String name; |
43 | 43 |
private final String abrev; |
... | ... | |
53 | 53 |
return this.name; |
54 | 54 |
} |
55 | 55 |
|
56 |
public String getAbrev(){ |
|
57 |
return this.abrev; |
|
58 |
} |
|
59 |
|
|
56 | 60 |
public double getTransToMeter(){ |
57 | 61 |
return this.transToMeter; |
58 | 62 |
} |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/FLayersComboBoxModel.java | ||
---|---|---|
52 | 52 |
|
53 | 53 |
private static final Logger logger = LoggerFactory.getLogger(FLayersComboBoxModel.class); |
54 | 54 |
|
55 |
// private LayerCollection layers; |
|
56 | 55 |
private List<FLyrVect> vectLayers; |
57 | 56 |
private FLayer selectedLayer; |
58 | 57 |
|
... | ... | |
60 | 59 |
* |
61 | 60 |
*/ |
62 | 61 |
public FLayersComboBoxModel(LayerCollection layers) { |
63 |
// LayerCollection layers = layers; |
|
64 | 62 |
vectLayers = new ArrayList<FLyrVect>(); |
65 | 63 |
try { |
66 | 64 |
layers.accept(new LayersVisitor() { |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/FLayersMComboBoxModel.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.ComboBoxModel; |
|
30 |
|
|
31 |
import org.slf4j.Logger; |
|
32 |
import org.slf4j.LoggerFactory; |
|
33 |
|
|
34 |
import org.gvsig.fmap.geom.Geometry; |
|
35 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
36 |
import org.gvsig.fmap.mapcontext.layers.operations.LayerCollection; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.operations.LayersVisitor; |
|
38 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
39 |
import org.gvsig.tools.exception.BaseException; |
|
40 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
41 |
|
|
42 |
/** |
|
43 |
* @author fdiaz |
|
44 |
* |
|
45 |
*/ |
|
46 |
public class FLayersMComboBoxModel extends AbstractListModel<FLayer> implements ComboBoxModel<FLayer> { |
|
47 |
|
|
48 |
/** |
|
49 |
* |
|
50 |
*/ |
|
51 |
private static final long serialVersionUID = 3596872067610443726L; |
|
52 |
|
|
53 |
private static final Logger logger = LoggerFactory.getLogger(FLayersMComboBoxModel.class); |
|
54 |
|
|
55 |
private List<FLyrVect> vectLayers; |
|
56 |
private FLayer selectedLayer; |
|
57 |
|
|
58 |
/** |
|
59 |
* |
|
60 |
*/ |
|
61 |
public FLayersMComboBoxModel(LayerCollection layers) { |
|
62 |
vectLayers = new ArrayList<FLyrVect>(); |
|
63 |
try { |
|
64 |
layers.accept(new LayersVisitor() { |
|
65 |
|
|
66 |
public void visit(Object obj) throws VisitCanceledException, BaseException { |
|
67 |
// TODO Auto-generated method stub |
|
68 |
|
|
69 |
} |
|
70 |
|
|
71 |
public void visit(FLayer layer) throws BaseException { |
|
72 |
if (layer instanceof FLyrVect) { |
|
73 |
FLyrVect lyrVect = (FLyrVect) layer; |
|
74 |
if ((lyrVect.getGeometryType().isTypeOf(Geometry.TYPES.CURVE) |
|
75 |
|| lyrVect.getGeometryType().isTypeOf(Geometry.TYPES.MULTICURVE)) |
|
76 |
&& |
|
77 |
(lyrVect.getGeometryType().isSubTypeOf(Geometry.SUBTYPES.GEOM2DM) |
|
78 |
|| lyrVect.getGeometryType().isSubTypeOf(Geometry.SUBTYPES.GEOM3DM)) |
|
79 |
) { |
|
80 |
vectLayers.add(lyrVect); |
|
81 |
if(lyrVect.isActive()){ |
|
82 |
selectedLayer = lyrVect; |
|
83 |
} |
|
84 |
} |
|
85 |
} |
|
86 |
} |
|
87 |
}); |
|
88 |
} catch (BaseException e1) { |
|
89 |
logger.warn("Can't get linear vector layers", e1); |
|
90 |
} |
|
91 |
} |
|
92 |
|
|
93 |
/* |
|
94 |
* (non-Javadoc) |
|
95 |
* |
|
96 |
* @see javax.swing.ListModel#getSize() |
|
97 |
*/ |
|
98 |
public int getSize() { |
|
99 |
return vectLayers.size(); //.getLayersCount(); |
|
100 |
} |
|
101 |
|
|
102 |
/* |
|
103 |
* (non-Javadoc) |
|
104 |
* |
|
105 |
* @see javax.swing.ListModel#getElementAt(int) |
|
106 |
*/ |
|
107 |
public FLayer getElementAt(int index) { |
|
108 |
return vectLayers.get(index); //.getLayer(index); |
|
109 |
} |
|
110 |
|
|
111 |
/* |
|
112 |
* (non-Javadoc) |
|
113 |
* |
|
114 |
* @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object) |
|
115 |
*/ |
|
116 |
public void setSelectedItem(final Object anItem) { |
|
117 |
selectedLayer = (FLayer) anItem; |
|
118 |
} |
|
119 |
|
|
120 |
/* |
|
121 |
* (non-Javadoc) |
|
122 |
* |
|
123 |
* @see javax.swing.ComboBoxModel#getSelectedItem() |
|
124 |
*/ |
|
125 |
public Object getSelectedItem() { |
|
126 |
return selectedLayer; |
|
127 |
} |
|
128 |
|
|
129 |
} |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsView.java | ||
---|---|---|
24 | 24 |
JComboBox cmbInputLayer = new JComboBox(); |
25 | 25 |
JLabel lblIdRouteField = new JLabel(); |
26 | 26 |
JComboBox cmbIdRouteField = new JComboBox(); |
27 |
JLabel lblFromMeasureField = new JLabel();
|
|
28 |
JComboBox cmbFromMeasureField = new JComboBox();
|
|
27 |
JLabel lblMeasureField = new JLabel(); |
|
28 |
JComboBox cmbMeasureField = new JComboBox(); |
|
29 | 29 |
JLabel lblOutputFile = new JLabel(); |
30 | 30 |
JComboBox cmbCalibratePointLayer = new JComboBox(); |
31 | 31 |
JLabel lblCalibratePointLayer = new JLabel(); |
... | ... | |
41 | 41 |
JLabel lblSearchRadius = new JLabel(); |
42 | 42 |
JTextField txtOutputFile = new JTextField(); |
43 | 43 |
JButton btnBrowser = new JButton(); |
44 |
JLabel lblMeasureUnits = new JLabel(); |
|
45 | 44 |
JComboBox cmbMeasureUnits = new JComboBox(); |
46 | 45 |
JFormattedTextField txtSearchRadius = new JFormattedTextField(); |
47 | 46 |
JButton btnAccept = new JButton(); |
... | ... | |
155 | 154 |
cmbIdRouteField.setName("cmbIdRouteField"); |
156 | 155 |
jpanel1.add(cmbIdRouteField,cc.xywh(4,3,2,1)); |
157 | 156 |
|
158 |
lblFromMeasureField.setName("lblFromMeasureField");
|
|
159 |
lblFromMeasureField.setText("from_measure_field");
|
|
160 |
jpanel1.add(lblFromMeasureField,cc.xy(2,6));
|
|
157 |
lblMeasureField.setName("lblMeasureField");
|
|
158 |
lblMeasureField.setText("measures_field");
|
|
159 |
jpanel1.add(lblMeasureField,cc.xy(2,6)); |
|
161 | 160 |
|
162 |
cmbFromMeasureField.setName("cmbFromMeasureField");
|
|
163 |
jpanel1.add(cmbFromMeasureField,cc.xywh(4,6,2,1));
|
|
161 |
cmbMeasureField.setName("cmbMeasureField");
|
|
162 |
jpanel1.add(cmbMeasureField,cc.xywh(4,6,2,1)); |
|
164 | 163 |
|
165 | 164 |
lblOutputFile.setName("lblOutputFile"); |
166 | 165 |
lblOutputFile.setText("output_file"); |
... | ... | |
248 | 247 |
public JPanel createPanel2() |
249 | 248 |
{ |
250 | 249 |
JPanel jpanel1 = new JPanel(); |
251 |
FormLayout formlayout1 = new FormLayout("FILL:20DLU:GROW(1.0),FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
|
|
250 |
FormLayout formlayout1 = new FormLayout("FILL:20DLU:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
|
252 | 251 |
CellConstraints cc = new CellConstraints(); |
253 | 252 |
jpanel1.setLayout(formlayout1); |
254 | 253 |
|
255 |
lblMeasureUnits.setName("lblMeasureUnits"); |
|
256 |
lblMeasureUnits.setText("units"); |
|
257 |
jpanel1.add(lblMeasureUnits,cc.xy(2,1)); |
|
258 |
|
|
259 | 254 |
cmbMeasureUnits.setName("cmbMeasureUnits"); |
260 |
jpanel1.add(cmbMeasureUnits,cc.xy(4,1));
|
|
255 |
jpanel1.add(cmbMeasureUnits,cc.xy(2,1));
|
|
261 | 256 |
|
262 | 257 |
txtSearchRadius.setName("txtSearchRadius"); |
263 | 258 |
jpanel1.add(txtSearchRadius,cc.xy(1,1)); |
264 | 259 |
|
265 |
addFillComponents(jpanel1,new int[]{ 3 },new int[0]);
|
|
260 |
addFillComponents(jpanel1,new int[0],new int[0]);
|
|
266 | 261 |
return jpanel1; |
267 | 262 |
} |
268 | 263 |
|
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsController.java | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
package org.gvsig.lrs.swing.impl; |
8 | 8 |
|
9 |
import java.awt.Dimension; |
|
9 | 10 |
import java.awt.event.ActionEvent; |
10 | 11 |
import java.awt.event.ActionListener; |
11 | 12 |
import java.awt.event.ItemEvent; |
12 | 13 |
import java.awt.event.ItemListener; |
13 | 14 |
import java.io.File; |
14 |
import java.util.Iterator; |
|
15 | 15 |
import java.util.Locale; |
16 | 16 |
|
17 | 17 |
import javax.swing.ComboBoxModel; |
... | ... | |
23 | 23 |
import org.apache.commons.io.FileUtils; |
24 | 24 |
import org.apache.commons.lang3.StringUtils; |
25 | 25 |
import org.cresques.cts.IProjection; |
26 |
import org.gvsig.fmap.dal.DALLocator;
|
|
27 |
import org.gvsig.fmap.dal.DataManager;
|
|
28 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
26 |
import org.slf4j.Logger;
|
|
27 |
import org.slf4j.LoggerFactory;
|
|
28 |
|
|
29 | 29 |
import org.gvsig.fmap.dal.exception.DataException; |
30 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
31 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
32 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
33 | 30 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
34 | 31 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
35 | 32 |
import org.gvsig.fmap.dal.feature.FeatureType; |
36 | 33 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
37 | 34 |
import org.gvsig.fmap.dal.store.shp.SHPNewStoreParameters; |
38 | 35 |
import org.gvsig.fmap.geom.DataTypes; |
39 |
import org.gvsig.fmap.geom.Geometry; |
|
40 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
41 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
42 |
import org.gvsig.fmap.geom.GeometryException; |
|
43 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
44 | 36 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
45 | 37 |
import org.gvsig.fmap.mapcontext.layers.operations.LayerCollection; |
46 |
import org.gvsig.fmap.mapcontext.layers.operations.LayersVisitor; |
|
47 | 38 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
48 | 39 |
import org.gvsig.lrs.lib.api.DistanceUnits; |
49 | 40 |
import org.gvsig.lrs.lib.api.LrsAlgorithmParams; |
... | ... | |
55 | 46 |
import org.gvsig.lrs.lib.api.exceptions.LrsNeededParameterException; |
56 | 47 |
import org.gvsig.lrs.swing.api.JLrsAlgorithmParams; |
57 | 48 |
import org.gvsig.tools.ToolsLocator; |
58 |
import org.gvsig.tools.exception.BaseException; |
|
59 | 49 |
import org.gvsig.tools.i18n.I18nManager; |
60 |
import org.gvsig.tools.locator.LocatorException; |
|
61 | 50 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
62 | 51 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
63 | 52 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
64 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
65 |
import org.slf4j.Logger; |
|
66 |
import org.slf4j.LoggerFactory; |
|
67 | 53 |
|
68 | 54 |
public class JLrsCalibrateRouteParamsController extends JLrsCalibrateRouteParamsView implements JLrsAlgorithmParams{ |
69 | 55 |
|
... | ... | |
107 | 93 |
lblIdRouteField.setText(i18nManager.getTranslation(lblIdRouteField.getText())); |
108 | 94 |
lblCalibratePointLayer.setText(i18nManager.getTranslation(lblCalibratePointLayer.getText())); |
109 | 95 |
lblCalibrationPointIdRouteField.setText(i18nManager.getTranslation(lblCalibrationPointIdRouteField.getText())); |
110 |
lblFromMeasureField.setText(i18nManager.getTranslation(lblFromMeasureField.getText()));
|
|
96 |
lblMeasureField.setText(i18nManager.getTranslation(lblMeasureField.getText()));
|
|
111 | 97 |
lblOutputFile.setText(i18nManager.getTranslation(lblOutputFile.getText())); |
112 | 98 |
lblMeasureCalcMethod.setText(i18nManager.getTranslation(lblMeasureCalcMethod.getText())); |
113 | 99 |
lblSearchRadius.setText(i18nManager.getTranslation(lblSearchRadius.getText())); |
114 |
lblMeasureUnits.setText(i18nManager.getTranslation(lblMeasureUnits.getText())); |
|
115 | 100 |
chkInterpolateBetweenCalibrationPoints.setText(i18nManager.getTranslation(chkInterpolateBetweenCalibrationPoints.getText())); |
116 | 101 |
chkExtrapolateBeforeCalibrationPoints.setText(i18nManager.getTranslation(chkExtrapolateBeforeCalibrationPoints.getText())); |
117 | 102 |
chkExtrapolateAfterCalibrationPoints.setText(i18nManager.getTranslation(chkExtrapolateAfterCalibrationPoints.getText())); |
... | ... | |
149 | 134 |
throw new LrsNeededParameterException("two_or_more_layers_are_needed", null); |
150 | 135 |
} |
151 | 136 |
|
152 |
if (!JLrsUtils.validatedCurveAndPointLayer(layers)){ |
|
137 |
if (!JLrsUtils.validatedMCurveAndPointLayer(layers)){
|
|
153 | 138 |
logger.error("Impossible to find the layers needed"); |
154 | 139 |
throw new LrsNeededParameterException("impossible_to_find_needed_layers",null); |
155 | 140 |
} |
... | ... | |
163 | 148 |
validateLayers(layers); |
164 | 149 |
|
165 | 150 |
// Modelos de los combos |
166 |
FLayersComboBoxModel inputLayerModel = new FLayersComboBoxModel(this.layers);
|
|
151 |
FLayersMComboBoxModel inputLayerModel = new FLayersMComboBoxModel(this.layers);
|
|
167 | 152 |
FeatureAttributeDescriptorsComboBoxModel idRouteFieldComboBoxModel = |
168 | 153 |
new FeatureAttributeDescriptorsComboBoxModel(); |
169 | 154 |
|
... | ... | |
179 | 164 |
// asignaci?n de renderers y modelos |
180 | 165 |
cmbIdRouteField.setRenderer(featureAttributeDescriptorCellRenderer); |
181 | 166 |
cmbCalibrationPointIdRouteField.setRenderer(featureAttributeDescriptorCellRenderer); |
182 |
cmbFromMeasureField.setRenderer(featureAttributeDescriptorCellRenderer);
|
|
167 |
cmbMeasureField.setRenderer(featureAttributeDescriptorCellRenderer); |
|
183 | 168 |
cmbIdRouteField.setModel(idRouteFieldComboBoxModel); |
184 | 169 |
cmbCalibrationPointIdRouteField.setModel(idCalibrationPointFieldComboBoxModel); |
185 |
cmbFromMeasureField.setModel(fromMeasureFieldComboBoxModel);
|
|
170 |
cmbMeasureField.setModel(fromMeasureFieldComboBoxModel); |
|
186 | 171 |
|
187 | 172 |
// renderer para el combo de capas |
188 | 173 |
ListCellRenderer layerNameCellRenderer=new FLayersLayerNameCellRenderer(); |
... | ... | |
223 | 208 |
new DefaultComboBoxModel<DistanceUnits>(DistanceUnits.values()); |
224 | 209 |
|
225 | 210 |
cmbMeasureUnits.setModel(measureUnitsModel); |
211 |
cmbMeasureUnits.setRenderer(new DistanceUnitsCellRenderer()); |
|
226 | 212 |
|
227 | 213 |
txtSearchRadius.setValue(new Double(0)); |
228 | 214 |
|
... | ... | |
372 | 358 |
params.setCalibratePointIdRouteField(idRouteFieldCalibratePoint); |
373 | 359 |
|
374 | 360 |
//cmbFromMeasureField |
375 |
if (!(this.cmbFromMeasureField.getSelectedItem() instanceof FeatureAttributeDescriptor)){
|
|
361 |
if (!(this.cmbMeasureField.getSelectedItem() instanceof FeatureAttributeDescriptor)){ |
|
376 | 362 |
logger.error("Error getting selected item from cmbFromMeasureField"); |
377 | 363 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbFromMeasureField", null); |
378 | 364 |
} |
379 | 365 |
FeatureAttributeDescriptor fromMeasureField = |
380 |
(FeatureAttributeDescriptor) this.cmbFromMeasureField.getSelectedItem();
|
|
366 |
(FeatureAttributeDescriptor) this.cmbMeasureField.getSelectedItem(); |
|
381 | 367 |
if (fromMeasureField == null) { |
382 | 368 |
throw new LrsNeededParameterException("need_to_select_a_from_Measure_field", null); |
383 | 369 |
} |
... | ... | |
445 | 431 |
|
446 | 432 |
this.cmbIdRouteField.setSelectedItem(parameters.getIdRouteField()); |
447 | 433 |
this.cmbCalibrationPointIdRouteField.setSelectedItem(parameters.getCalibratePointIdRouteField()); |
448 |
this.cmbFromMeasureField.setSelectedItem(parameters.getFromMeasureField());
|
|
434 |
this.cmbMeasureField.setSelectedItem(parameters.getFromMeasureField()); |
|
449 | 435 |
|
450 | 436 |
this.txtSearchRadius.setValue(parameters.getSearchRadius()); |
451 | 437 |
this.chkInterpolateBetweenCalibrationPoints.setSelected(parameters.interpolateBetweenCalibrationPoints()); |
... | ... | |
472 | 458 |
} |
473 | 459 |
this.cmbIdRouteField.setSelectedIndex(0); |
474 | 460 |
this.cmbCalibrationPointIdRouteField.setSelectedIndex(0); |
475 |
// this.cmbFromMeasureField.setSelectedIndex(0);
|
|
461 |
this.cmbMeasureField.setSelectedIndex(0);
|
|
476 | 462 |
this.cmbMeasureCalcMethod.setSelectedIndex(0); |
477 | 463 |
this.cmbMeasureUnits.setSelectedIndex(0); |
478 | 464 |
this.chkInterpolateBetweenCalibrationPoints.setSelected(false); |
... | ... | |
523 | 509 |
// Se renuevan los combos de attributeDescriptors |
524 | 510 |
FeatureAttributeDescriptorsComboBoxModel calibrationPointIdRouteFieldComboBoxModel = |
525 | 511 |
new FeatureAttributeDescriptorsComboBoxModel(); |
526 |
FeatureAttributeDescriptorsComboBoxModel fromMeasureFieldComboBoxModel =
|
|
512 |
FeatureAttributeDescriptorsComboBoxModel measureFieldComboBoxModel =
|
|
527 | 513 |
new FeatureAttributeDescriptorsComboBoxModel(); |
528 | 514 |
|
529 | 515 |
this.cmbCalibrationPointIdRouteField.setModel(calibrationPointIdRouteFieldComboBoxModel); |
530 |
this.cmbFromMeasureField.setModel(fromMeasureFieldComboBoxModel);
|
|
516 |
this.cmbMeasureField.setModel(measureFieldComboBoxModel);
|
|
531 | 517 |
|
532 | 518 |
FeatureAttributeDescriptor[] attributeDescriptors = type.getAttributeDescriptors(); |
533 | 519 |
for (int i = 0; i < attributeDescriptors.length; i++) { |
... | ... | |
538 | 524 |
|
539 | 525 |
JLrsCalibrateRouteParamsController.this.cmbCalibrationPointIdRouteField.addItem(featureAttributeDescriptor); |
540 | 526 |
if (featureAttributeDescriptor.getDataType().isNumeric()) { |
541 |
JLrsCalibrateRouteParamsController.this.cmbFromMeasureField.addItem(featureAttributeDescriptor);
|
|
527 |
JLrsCalibrateRouteParamsController.this.cmbMeasureField.addItem(featureAttributeDescriptor); |
|
542 | 528 |
} |
543 | 529 |
} |
544 | 530 |
} |
545 | 531 |
this.cmbCalibrationPointIdRouteField.invalidate(); |
546 |
this.cmbFromMeasureField.invalidate();
|
|
532 |
this.cmbMeasureField.invalidate(); |
|
547 | 533 |
|
548 | 534 |
} catch (DataException e1) { |
549 | 535 |
logger.warn( |
... | ... | |
552 | 538 |
} |
553 | 539 |
} |
554 | 540 |
|
541 |
/* (non-Javadoc) |
|
542 |
* @see javax.swing.JComponent#getPreferredSize() |
|
543 |
*/ |
|
544 |
@Override |
|
545 |
public Dimension getPreferredSize() { |
|
546 |
return new Dimension(650, 350); |
|
547 |
} |
|
555 | 548 |
|
556 | 549 |
|
557 | 550 |
|
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsView.xml | ||
---|---|---|
24 | 24 |
</at> |
25 | 25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
26 | 26 |
</super> |
27 |
<at name="id">/home/daniel/projects/externals/gvSIG/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsView.xml</at>
|
|
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 | 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 | 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 | 30 |
<at name="components"> |
... | ... | |
291 | 291 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
292 | 292 |
<at name="properties"> |
293 | 293 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
294 |
<at name="text">from_measure_field</at>
|
|
294 |
<at name="text">measures_field</at>
|
|
295 | 295 |
<at name="height">14</at> |
296 | 296 |
<at name="width">175</at> |
297 |
<at name="name">lblFromMeasureField</at>
|
|
297 |
<at name="name">lblMeasureField</at> |
|
298 | 298 |
<at name="fill"> |
299 | 299 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
300 | 300 |
<at name="name">fill</at> |
... | ... | |
358 | 358 |
</object> |
359 | 359 |
</at> |
360 | 360 |
<at name="width">728</at> |
361 |
<at name="name">cmbFromMeasureField</at>
|
|
361 |
<at name="name">cmbMeasureField</at> |
|
362 | 362 |
<at name="border"> |
363 | 363 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
364 | 364 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
... | ... | |
1160 | 1160 |
</at> |
1161 | 1161 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
1162 | 1162 |
</super> |
1163 |
<at name="id">embedded.249315505</at>
|
|
1163 |
<at name="id">embedded.1932726646</at>
|
|
1164 | 1164 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
1165 | 1165 |
<at name="colspecs">FILL:DEFAULT:GROW(1.0),FILL:36PX:NONE</at> |
1166 | 1166 |
<at name="components"> |
... | ... | |
1377 | 1377 |
</at> |
1378 | 1378 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
1379 | 1379 |
</super> |
1380 |
<at name="id">embedded.616715470</at>
|
|
1380 |
<at name="id">embedded.952486635</at>
|
|
1381 | 1381 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
1382 |
<at name="colspecs">FILL:20DLU:GROW(1.0),FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE</at>
|
|
1382 |
<at name="colspecs">FILL:20DLU:GROW(1.0),FILL:DEFAULT:NONE</at> |
|
1383 | 1383 |
<at name="components"> |
1384 | 1384 |
<object classname="java.util.LinkedList"> |
1385 | 1385 |
<item > |
... | ... | |
1400 | 1400 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
1401 | 1401 |
</super> |
1402 | 1402 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
1403 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
1404 |
<at name="beanproperties"> |
|
1405 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
1406 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
1407 |
<at name="properties"> |
|
1408 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
1409 |
<at name="text">units</at> |
|
1410 |
<at name="height">14</at> |
|
1411 |
<at name="width">28</at> |
|
1412 |
<at name="name">lblMeasureUnits</at> |
|
1413 |
<at name="fill"> |
|
1414 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
1415 |
<at name="name">fill</at> |
|
1416 |
</object> |
|
1417 |
</at> |
|
1418 |
<at name="border"> |
|
1419 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
1420 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1421 |
<at name="name">border</at> |
|
1422 |
</super> |
|
1423 |
<at name="borders"> |
|
1424 |
<object classname="java.util.LinkedList"> |
|
1425 |
<item > |
|
1426 |
<at name="value"> |
|
1427 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
1428 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1429 |
<at name="name">border</at> |
|
1430 |
</super> |
|
1431 |
</object> |
|
1432 |
</at> |
|
1433 |
</item> |
|
1434 |
</object> |
|
1435 |
</at> |
|
1436 |
</object> |
|
1437 |
</at> |
|
1438 |
</object> |
|
1439 |
</at> |
|
1440 |
</object> |
|
1441 |
</at> |
|
1442 |
</object> |
|
1443 |
</at> |
|
1444 |
</item> |
|
1445 |
<item > |
|
1446 |
<at name="value"> |
|
1447 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
1448 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
1449 |
<at name="cellconstraints"> |
|
1450 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
1451 |
<at name="column">4</at> |
|
1452 |
<at name="row">1</at> |
|
1453 |
<at name="colspan">1</at> |
|
1454 |
<at name="rowspan">1</at> |
|
1455 |
<at name="halign">default</at> |
|
1456 |
<at name="valign">default</at> |
|
1457 |
<at name="insets" object="insets">0,0,0,0</at> |
|
1458 |
</object> |
|
1459 |
</at> |
|
1460 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
1461 |
</super> |
|
1462 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
1463 | 1403 |
<at name="beanclass">javax.swing.JComboBox</at> |
1464 | 1404 |
<at name="beanproperties"> |
1465 | 1405 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
... | ... | |
1526 | 1466 |
<at name="properties"> |
1527 | 1467 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
1528 | 1468 |
<at name="height">20</at> |
1529 |
<at name="width">654</at>
|
|
1469 |
<at name="width">693</at>
|
|
1530 | 1470 |
<at name="name">txtSearchRadius</at> |
1531 | 1471 |
<at name="border"> |
1532 | 1472 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
1562 | 1502 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
1563 | 1503 |
<at name="properties"> |
1564 | 1504 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
1565 |
<at name="name"></at>
|
|
1505 |
<at name="name"/>
|
|
1566 | 1506 |
<at name="fill"> |
1567 | 1507 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
1568 | 1508 |
<at name="name">fill</at> |
... | ... | |
1614 | 1554 |
<at name="rows"> |
1615 | 1555 |
<object classname="[Ljava.lang.Object;" size="1"> |
1616 | 1556 |
<at name="item" index="0"> |
1617 |
<object classname="[Ljava.lang.Object;" size="4"/>
|
|
1557 |
<object classname="[Ljava.lang.Object;" size="2"/>
|
|
1618 | 1558 |
</at> |
1619 | 1559 |
</object> |
1620 | 1560 |
</at> |
... | ... | |
1654 | 1594 |
</at> |
1655 | 1595 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
1656 | 1596 |
</super> |
1657 |
<at name="id">embedded.1448976003</at>
|
|
1597 |
<at name="id">embedded.2067442593</at>
|
|
1658 | 1598 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
1659 | 1599 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE</at> |
1660 | 1600 |
<at name="components"> |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsGenerateDynamicSegmentationParamsController.java | ||
---|---|---|
182 | 182 |
validateTables(tables); |
183 | 183 |
|
184 | 184 |
// Modelos de los combos |
185 |
FLayersComboBoxModel inputLayerModel = |
|
186 |
new FLayersComboBoxModel(this.layers); |
|
185 |
FLayersMComboBoxModel inputLayerModel =
|
|
186 |
new FLayersMComboBoxModel(this.layers);
|
|
187 | 187 |
FeatureAttributeDescriptorsComboBoxModel idRouteFieldComboBoxModel = |
188 | 188 |
new FeatureAttributeDescriptorsComboBoxModel(); |
189 | 189 |
|
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsUtils.java | ||
---|---|---|
111 | 111 |
/** |
112 | 112 |
* Tries to find the correct layers: |
113 | 113 |
* - At least 2 layers |
114 |
* - At least 1 curve layer with at least 1 non-geometrical field |
|
114 |
* - At least 1 curve layer with M coordinates and at least 1 non-geometrical field
|
|
115 | 115 |
* - At least 1 point layer with at least 1 non-geometrical field and 1 numeric field |
116 | 116 |
* @param LayerCollection layers |
117 | 117 |
* @return true if finds the correct layers |
118 | 118 |
*/ |
119 |
public static boolean validatedCurveAndPointLayer(LayerCollection layers){ |
|
119 |
public static boolean validatedMCurveAndPointLayer(LayerCollection layers){
|
|
120 | 120 |
boolean correctCurveLayerFound = false; |
121 | 121 |
boolean correctPointLayerFound = false; |
122 | 122 |
boolean layersFound=false; |
... | ... | |
128 | 128 |
try { |
129 | 129 |
if (!correctCurveLayerFound) { |
130 | 130 |
logger.debug( |
131 |
"Finding a curve layer with at least one non-geometrical field"); |
|
132 |
correctCurveLayerFound = |
|
133 |
CurveLayerFoundWithOneNonGeomField(lyrVect); |
|
131 |
"Finding a M curve layer with at least one non-geometrical field"); |
|
132 |
if (lyrVect.getGeometryType().isSubTypeOf(Geometry.SUBTYPES.GEOM2DM) |
|
133 |
|| lyrVect.getGeometryType().isSubTypeOf(Geometry.SUBTYPES.GEOM3DM)) { |
|
134 |
|
|
135 |
correctCurveLayerFound = CurveLayerFoundWithOneNonGeomField(lyrVect); |
|
136 |
} |
|
134 | 137 |
} |
135 | 138 |
if (!correctPointLayerFound) { |
136 | 139 |
logger.debug( |
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/DistanceUnitsCellRenderer.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.Component; |
|
10 |
|
|
11 |
import javax.swing.DefaultListCellRenderer; |
|
12 |
import javax.swing.JLabel; |
|
13 |
import javax.swing.JList; |
|
14 |
import javax.swing.ListCellRenderer; |
|
15 |
|
|
16 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
17 |
import org.gvsig.lrs.lib.api.DistanceUnits; |
|
18 |
|
|
19 |
public class DistanceUnitsCellRenderer implements ListCellRenderer{ |
|
20 |
|
|
21 |
|
|
22 |
protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); |
|
23 |
|
|
24 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, |
|
25 |
boolean cellHasFocus) { |
|
26 |
JLabel renderer = |
|
27 |
(JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
|
28 |
if (value instanceof DistanceUnits) { |
|
29 |
renderer.setText(((DistanceUnits) value).getAbrev()); |
|
30 |
} |
|
31 |
return renderer; |
|
32 |
} |
|
33 |
|
|
34 |
} |
Also available in: Unified diff