Revision 843
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.153/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.lrs.swing.impl.DefaultLrsAlgorithmsSwingLibrary |
|
0 | 2 |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.153/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/EditRouteCalibrationTableModel.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 javax.swing.table.AbstractTableModel; |
|
26 |
|
|
27 |
import org.apache.commons.lang3.mutable.MutableInt; |
|
28 |
|
|
29 |
import org.gvsig.fmap.dal.feature.Feature; |
|
30 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
31 |
import org.gvsig.fmap.geom.Geometry; |
|
32 |
import org.gvsig.fmap.geom.aggregate.MultiLine; |
|
33 |
import org.gvsig.fmap.geom.primitive.Line; |
|
34 |
import org.gvsig.fmap.geom.primitive.Point; |
|
35 |
import org.gvsig.tools.exception.BaseException; |
|
36 |
|
|
37 |
public class EditRouteCalibrationTableModel extends AbstractTableModel { |
|
38 |
|
|
39 |
private static final long serialVersionUID = -2678580144252993562L; |
|
40 |
|
|
41 |
private String[] columnNames = { "IdRoute", "OrderPoint", "XCoordinate", "YCoordinate", "MCoordinate" }; |
|
42 |
private Object[][] data; |
|
43 |
private Feature editedFeature; |
|
44 |
private FeatureAttributeDescriptor fadIdRoute; |
|
45 |
private int rowCount; |
|
46 |
private Double valueUpdated; |
|
47 |
private Double maxValue; |
|
48 |
private Double minValue; |
|
49 |
|
|
50 |
public static int COLUMN_MCOORDINATE=4; |
|
51 |
|
|
52 |
public EditRouteCalibrationTableModel(Feature editedFeature, FeatureAttributeDescriptor fadIdRoute) throws BaseException { |
|
53 |
this.editedFeature = editedFeature; |
|
54 |
this.fadIdRoute = fadIdRoute; |
|
55 |
setRowCount(); |
|
56 |
this.data = new Object[getRowCount()][getColumnCount()]; |
|
57 |
fillData(); |
|
58 |
valueUpdated=Double.NaN; |
|
59 |
} |
|
60 |
|
|
61 |
private void fillData() throws BaseException { |
|
62 |
final MutableInt rowNumber=new MutableInt(0); |
|
63 |
maxValue=null; |
|
64 |
minValue=null; |
|
65 |
|
|
66 |
if (editedFeature.get(fadIdRoute.getName()) instanceof String ){ |
|
67 |
Geometry geometry=editedFeature.getDefaultGeometry(); |
|
68 |
int order = 0; |
|
69 |
if (geometry.getGeometryType().isTypeOf(Geometry.TYPES.LINE)){ |
|
70 |
Line line=(Line) geometry; |
|
71 |
for (int i=0;i<line.getNumVertices();i++){ |
|
72 |
data[rowNumber.getValue()][0]=editedFeature.get(fadIdRoute.getName()); //IDROUTE |
|
73 |
data[rowNumber.getValue()][1]=order++; //ORDER |
|
74 |
Point vertex=line.getVertex(i); |
|
75 |
data[rowNumber.getValue()][2]=vertex.getX(); //XCOORDINATE |
|
76 |
data[rowNumber.getValue()][3]=vertex.getY(); //YCOORDINATE |
|
77 |
|
|
78 |
Double mValue=vertex.getCoordinateAt(vertex.getDimension()-1); //MCOORDINATE |
|
79 |
|
|
80 |
data[rowNumber.getValue()][COLUMN_MCOORDINATE]=mValue; |
|
81 |
if (maxValue==null||maxValue.compareTo(mValue)<0){ |
|
82 |
maxValue=mValue; |
|
83 |
} |
|
84 |
if (minValue==null||minValue.compareTo(mValue)>0){ |
|
85 |
minValue=mValue; |
|
86 |
} |
|
87 |
|
|
88 |
rowNumber.setValue(rowNumber.getValue()+1); |
|
89 |
} |
|
90 |
} |
|
91 |
if (geometry.getGeometryType().isTypeOf(Geometry.TYPES.MULTILINE)){ |
|
92 |
MultiLine multiline=(MultiLine) geometry; |
|
93 |
for (int i=0;i<multiline.getPrimitivesNumber();i++){ |
|
94 |
Line line=(Line)multiline.getPrimitiveAt(i); |
|
95 |
for (int j=0;j<line.getNumVertices();j++){ |
|
96 |
data[rowNumber.getValue()][0]=editedFeature.get(fadIdRoute.getName()); //IDROUTE |
|
97 |
data[rowNumber.getValue()][1]=order++; //ORDER |
|
98 |
Point vertex=line.getVertex(j); |
|
99 |
data[rowNumber.getValue()][2]=vertex.getX(); //XCOORDINATE |
|
100 |
data[rowNumber.getValue()][3]=vertex.getY(); //YCOORDINATE |
|
101 |
|
|
102 |
//TODO Changed to test meanwhile class is developed |
|
103 |
Double mValue=vertex.getCoordinateAt(vertex.getDimension()-1); //MCOORDINATE |
|
104 |
|
|
105 |
data[rowNumber.getValue()][COLUMN_MCOORDINATE]=mValue; |
|
106 |
if (maxValue==null||maxValue.compareTo(mValue)<0){ |
|
107 |
maxValue=mValue; |
|
108 |
} |
|
109 |
if (minValue==null||minValue.compareTo(mValue)>0){ |
|
110 |
minValue=mValue; |
|
111 |
} |
|
112 |
|
|
113 |
rowNumber.setValue(rowNumber.getValue()+1); |
|
114 |
} |
|
115 |
} |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
} |
|
122 |
|
|
123 |
private void setRowCount() throws BaseException{ |
|
124 |
final MutableInt rowNumber=new MutableInt(0); |
|
125 |
|
|
126 |
if (editedFeature.get(fadIdRoute.getName()) instanceof String ){ |
|
127 |
Geometry geometry=editedFeature.getDefaultGeometry(); |
|
128 |
|
|
129 |
if (geometry.getGeometryType().isTypeOf(Geometry.TYPES.LINE)){ |
|
130 |
Line line=(Line) geometry; |
|
131 |
for (int i=0;i<line.getNumVertices();i++){ |
|
132 |
rowNumber.setValue(rowNumber.getValue()+1); |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
136 |
if (geometry.getGeometryType().isTypeOf(Geometry.TYPES.MULTILINE)){ |
|
137 |
MultiLine multiline=(MultiLine) geometry; |
|
138 |
for (int i=0;i<multiline.getPrimitivesNumber();i++){ |
|
139 |
Line line=(Line)multiline.getPrimitiveAt(i); |
|
140 |
for (int j=0;j<line.getNumVertices();j++){ |
|
141 |
rowNumber.setValue(rowNumber.getValue()+1); |
|
142 |
} |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
rowCount=rowNumber.toInteger(); |
|
147 |
} |
|
148 |
|
|
149 |
public int getColumnCount() { |
|
150 |
return columnNames.length; |
|
151 |
} |
|
152 |
|
|
153 |
public int getRowCount() { |
|
154 |
return rowCount; |
|
155 |
} |
|
156 |
|
|
157 |
@Override |
|
158 |
public String getColumnName(int col) { |
|
159 |
return columnNames[col]; |
|
160 |
} |
|
161 |
|
|
162 |
public Object getValueAt(int i, int j) { |
|
163 |
return data[i][j]; |
|
164 |
} |
|
165 |
|
|
166 |
public boolean isCellEditable(int row, int col) { |
|
167 |
if (col ==COLUMN_MCOORDINATE) return true; |
|
168 |
else return false; |
|
169 |
} |
|
170 |
|
|
171 |
public void setValueAt(Object value, int row, int col) { |
|
172 |
if (value!=null ){ |
|
173 |
try { |
|
174 |
valueUpdated = Double.parseDouble((String) value); |
|
175 |
fireTableCellUpdated(row,col); |
|
176 |
} catch (Exception ex) { |
|
177 |
//Do nothing |
|
178 |
} |
|
179 |
} |
|
180 |
} |
|
181 |
|
|
182 |
|
|
183 |
public Object[][] getData() { |
|
184 |
return data; |
|
185 |
} |
|
186 |
|
|
187 |
public void setData(Object[][] data){ |
|
188 |
this.data=data; |
|
189 |
} |
|
190 |
|
|
191 |
public Double getValueUpdated(){ |
|
192 |
return this.valueUpdated; |
|
193 |
} |
|
194 |
|
|
195 |
|
|
196 |
public Double getMaxValue() { |
|
197 |
return maxValue; |
|
198 |
} |
|
199 |
|
|
200 |
|
|
201 |
public Double getMinValue() { |
|
202 |
return minValue; |
|
203 |
} |
|
204 |
|
|
205 |
} |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.153/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsGenerateDynamicSegmentationParamsView.java | ||
---|---|---|
1 |
package org.gvsig.lrs.swing.impl; |
|
2 |
|
|
3 |
import com.jgoodies.forms.layout.CellConstraints; |
|
4 |
import com.jgoodies.forms.layout.FormLayout; |
|
5 |
import java.awt.BorderLayout; |
|
6 |
import java.awt.ComponentOrientation; |
|
7 |
import java.awt.Container; |
|
8 |
import java.awt.Dimension; |
|
9 |
import javax.swing.Box; |
|
10 |
import javax.swing.ImageIcon; |
|
11 |
import javax.swing.JButton; |
|
12 |
import javax.swing.JComboBox; |
|
13 |
import javax.swing.JFrame; |
|
14 |
import javax.swing.JLabel; |
|
15 |
import javax.swing.JPanel; |
|
16 |
import javax.swing.JTextField; |
|
17 |
|
|
18 |
|
|
19 |
public class JLrsGenerateDynamicSegmentationParamsView extends JPanel |
|
20 |
{ |
|
21 |
JLabel lblInputLayer = new JLabel(); |
|
22 |
JComboBox cmbInputLayer = new JComboBox(); |
|
23 |
JLabel lblIdRouteField = new JLabel(); |
|
24 |
JComboBox cmbIdRouteField = new JComboBox(); |
|
25 |
JLabel lblTable = new JLabel(); |
|
26 |
JComboBox cmbTable = new JComboBox(); |
|
27 |
JLabel lblTableIdRouteField = new JLabel(); |
|
28 |
JComboBox cmbTableIdRouteField = new JComboBox(); |
|
29 |
JLabel lblLandmarkField = new JLabel(); |
|
30 |
JComboBox cmbLandmarkField = new JComboBox(); |
|
31 |
JLabel lblFinalLandmarkField = new JLabel(); |
|
32 |
JLabel lblValueField = new JLabel(); |
|
33 |
JComboBox cmbFinalLandmarkField = new JComboBox(); |
|
34 |
JComboBox cmbValueField = new JComboBox(); |
|
35 |
JLabel lblOutputFile = new JLabel(); |
|
36 |
JTextField txtOutputFile = new JTextField(); |
|
37 |
JButton btnBrowser = new JButton(); |
|
38 |
JButton btnAccept = new JButton(); |
|
39 |
JButton btnCancel = new JButton(); |
|
40 |
|
|
41 |
/** |
|
42 |
* Default constructor |
|
43 |
*/ |
|
44 |
public JLrsGenerateDynamicSegmentationParamsView() |
|
45 |
{ |
|
46 |
initializePanel(); |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
51 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
52 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
53 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
54 |
*/ |
|
55 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
56 |
{ |
|
57 |
Dimension filler = new Dimension(10,10); |
|
58 |
|
|
59 |
boolean filled_cell_11 = false; |
|
60 |
CellConstraints cc = new CellConstraints(); |
|
61 |
if ( cols.length > 0 && rows.length > 0 ) |
|
62 |
{ |
|
63 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
64 |
{ |
|
65 |
/** add a rigid area */ |
|
66 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
67 |
filled_cell_11 = true; |
|
68 |
} |
|
69 |
} |
|
70 |
|
|
71 |
for( int index = 0; index < cols.length; index++ ) |
|
72 |
{ |
|
73 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
74 |
{ |
|
75 |
continue; |
|
76 |
} |
|
77 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
78 |
} |
|
79 |
|
|
80 |
for( int index = 0; index < rows.length; index++ ) |
|
81 |
{ |
|
82 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
83 |
{ |
|
84 |
continue; |
|
85 |
} |
|
86 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
87 |
} |
|
88 |
|
|
89 |
} |
|
90 |
|
|
91 |
/** |
|
92 |
* Helper method to load an image file from the CLASSPATH |
|
93 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
94 |
* @return an ImageIcon instance with the specified image file |
|
95 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
96 |
*/ |
|
97 |
public ImageIcon loadImage( String imageName ) |
|
98 |
{ |
|
99 |
try |
|
100 |
{ |
|
101 |
ClassLoader classloader = getClass().getClassLoader(); |
|
102 |
java.net.URL url = classloader.getResource( imageName ); |
|
103 |
if ( url != null ) |
|
104 |
{ |
|
105 |
ImageIcon icon = new ImageIcon( url ); |
|
106 |
return icon; |
|
107 |
} |
|
108 |
} |
|
109 |
catch( Exception e ) |
|
110 |
{ |
|
111 |
e.printStackTrace(); |
|
112 |
} |
|
113 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* Method for recalculating the component orientation for |
|
118 |
* right-to-left Locales. |
|
119 |
* @param orientation the component orientation to be applied |
|
120 |
*/ |
|
121 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
122 |
{ |
|
123 |
// Not yet implemented... |
|
124 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
125 |
super.applyComponentOrientation(orientation); |
|
126 |
} |
|
127 |
|
|
128 |
public JPanel createPanel() |
|
129 |
{ |
|
130 |
JPanel jpanel1 = new JPanel(); |
|
131 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:256PX:GROW(1.0),FILL: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),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); |
|
132 |
CellConstraints cc = new CellConstraints(); |
|
133 |
jpanel1.setLayout(formlayout1); |
|
134 |
|
|
135 |
lblInputLayer.setName("lblInputLayer"); |
|
136 |
lblInputLayer.setText("source"); |
|
137 |
jpanel1.add(lblInputLayer,cc.xy(2,2)); |
|
138 |
|
|
139 |
cmbInputLayer.setName("cmbInputLayer"); |
|
140 |
jpanel1.add(cmbInputLayer,cc.xy(4,2)); |
|
141 |
|
|
142 |
lblIdRouteField.setName("lblIdRouteField"); |
|
143 |
lblIdRouteField.setText("id_route_field"); |
|
144 |
jpanel1.add(lblIdRouteField,cc.xy(2,3)); |
|
145 |
|
|
146 |
cmbIdRouteField.setName("cmbIdRouteField"); |
|
147 |
jpanel1.add(cmbIdRouteField,cc.xy(4,3)); |
|
148 |
|
|
149 |
lblTable.setName("lblTable"); |
|
150 |
lblTable.setText("table"); |
|
151 |
jpanel1.add(lblTable,cc.xy(2,4)); |
|
152 |
|
|
153 |
cmbTable.setName("cmbTable"); |
|
154 |
jpanel1.add(cmbTable,cc.xy(4,4)); |
|
155 |
|
|
156 |
lblTableIdRouteField.setName("lblTableIdRouteField"); |
|
157 |
lblTableIdRouteField.setText("table_id_route_field"); |
|
158 |
jpanel1.add(lblTableIdRouteField,cc.xy(2,5)); |
|
159 |
|
|
160 |
cmbTableIdRouteField.setName("cmbTableIdRouteField"); |
|
161 |
jpanel1.add(cmbTableIdRouteField,cc.xy(4,5)); |
|
162 |
|
|
163 |
lblLandmarkField.setName("lblLandmarkField"); |
|
164 |
lblLandmarkField.setText("landmark_field"); |
|
165 |
jpanel1.add(lblLandmarkField,cc.xy(2,6)); |
|
166 |
|
|
167 |
cmbLandmarkField.setName("cmbLandmarkField"); |
|
168 |
jpanel1.add(cmbLandmarkField,cc.xy(4,6)); |
|
169 |
|
|
170 |
lblFinalLandmarkField.setName("lblFinalLandmarkField"); |
|
171 |
lblFinalLandmarkField.setText("final_landmark_field"); |
|
172 |
jpanel1.add(lblFinalLandmarkField,cc.xy(2,7)); |
|
173 |
|
|
174 |
lblValueField.setName("lblValueField"); |
|
175 |
lblValueField.setText("value_field"); |
|
176 |
jpanel1.add(lblValueField,cc.xy(2,8)); |
|
177 |
|
|
178 |
cmbFinalLandmarkField.setName("cmbFinalLandmarkField"); |
|
179 |
jpanel1.add(cmbFinalLandmarkField,cc.xy(4,7)); |
|
180 |
|
|
181 |
cmbValueField.setName("cmbValueField"); |
|
182 |
jpanel1.add(cmbValueField,cc.xy(4,8)); |
|
183 |
|
|
184 |
lblOutputFile.setName("lblOutputFile"); |
|
185 |
lblOutputFile.setText("output_file"); |
|
186 |
jpanel1.add(lblOutputFile,cc.xy(2,9)); |
|
187 |
|
|
188 |
jpanel1.add(createPanel1(),cc.xy(4,9)); |
|
189 |
jpanel1.add(createPanel2(),new CellConstraints(2,12,3,1,CellConstraints.RIGHT,CellConstraints.DEFAULT)); |
|
190 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13 }); |
|
191 |
return jpanel1; |
|
192 |
} |
|
193 |
|
|
194 |
public JPanel createPanel1() |
|
195 |
{ |
|
196 |
JPanel jpanel1 = new JPanel(); |
|
197 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:36PX:NONE","CENTER:DEFAULT:NONE"); |
|
198 |
CellConstraints cc = new CellConstraints(); |
|
199 |
jpanel1.setLayout(formlayout1); |
|
200 |
|
|
201 |
txtOutputFile.setName("txtOutputFile"); |
|
202 |
txtOutputFile.setHorizontalAlignment(JTextField.LEFT); |
|
203 |
jpanel1.add(txtOutputFile,cc.xy(1,1)); |
|
204 |
|
|
205 |
btnBrowser.setActionCommand("JButton"); |
|
206 |
btnBrowser.setName("btnBrowser"); |
|
207 |
btnBrowser.setOpaque(false); |
|
208 |
btnBrowser.setRolloverEnabled(true); |
|
209 |
btnBrowser.setText("..."); |
|
210 |
jpanel1.add(btnBrowser,cc.xy(2,1)); |
|
211 |
|
|
212 |
addFillComponents(jpanel1,new int[0],new int[0]); |
|
213 |
return jpanel1; |
|
214 |
} |
|
215 |
|
|
216 |
public JPanel createPanel2() |
|
217 |
{ |
|
218 |
JPanel jpanel1 = new JPanel(); |
|
219 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
|
220 |
CellConstraints cc = new CellConstraints(); |
|
221 |
jpanel1.setLayout(formlayout1); |
|
222 |
|
|
223 |
btnAccept.setActionCommand("_Accept"); |
|
224 |
btnAccept.setName("btnAccept"); |
|
225 |
btnAccept.setText("_Accept"); |
|
226 |
jpanel1.add(btnAccept,cc.xy(1,1)); |
|
227 |
|
|
228 |
btnCancel.setActionCommand("_Cancel"); |
|
229 |
btnCancel.setName("btnCancel"); |
|
230 |
btnCancel.setText("_Cancel"); |
|
231 |
jpanel1.add(btnCancel,cc.xy(3,1)); |
|
232 |
|
|
233 |
addFillComponents(jpanel1,new int[]{ 2 },new int[0]); |
|
234 |
return jpanel1; |
|
235 |
} |
|
236 |
|
|
237 |
/** |
|
238 |
* Initializer |
|
239 |
*/ |
|
240 |
protected void initializePanel() |
|
241 |
{ |
|
242 |
setLayout(new BorderLayout()); |
|
243 |
add(createPanel(), BorderLayout.CENTER); |
|
244 |
} |
|
245 |
|
|
246 |
|
|
247 |
} |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.153/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsCalibrateRouteParamsController.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.Dimension; |
|
10 |
import java.awt.event.ActionEvent; |
|
11 |
import java.awt.event.ActionListener; |
|
12 |
import java.awt.event.ItemEvent; |
|
13 |
import java.awt.event.ItemListener; |
|
14 |
import java.io.File; |
|
15 |
import java.util.Locale; |
|
16 |
|
|
17 |
import javax.swing.ComboBoxModel; |
|
18 |
import javax.swing.DefaultComboBoxModel; |
|
19 |
import javax.swing.JComponent; |
|
20 |
import javax.swing.JOptionPane; |
|
21 |
import javax.swing.ListCellRenderer; |
|
22 |
|
|
23 |
import org.apache.commons.io.FileUtils; |
|
24 |
import org.apache.commons.lang3.StringUtils; |
|
25 |
import org.cresques.cts.IProjection; |
|
26 |
import org.slf4j.Logger; |
|
27 |
import org.slf4j.LoggerFactory; |
|
28 |
|
|
29 |
import org.gvsig.fmap.dal.exception.DataException; |
|
30 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
31 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
32 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
33 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.store.shp.SHPNewStoreParameters; |
|
35 |
import org.gvsig.fmap.geom.DataTypes; |
|
36 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.operations.LayerCollection; |
|
38 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
39 |
import org.gvsig.lrs.lib.api.DistanceUnits; |
|
40 |
import org.gvsig.lrs.lib.api.LrsAlgorithmParams; |
|
41 |
import org.gvsig.lrs.lib.api.LrsAlgorithmsLocator; |
|
42 |
import org.gvsig.lrs.lib.api.LrsAlgorithmsManager; |
|
43 |
import org.gvsig.lrs.lib.api.LrsCalibrateRouteAlgorithmParams; |
|
44 |
import org.gvsig.lrs.lib.api.LrsMeasureCalculationMethods; |
|
45 |
import org.gvsig.lrs.lib.api.exceptions.LrsGettingParametersException; |
|
46 |
import org.gvsig.lrs.lib.api.exceptions.LrsNeededParameterException; |
|
47 |
import org.gvsig.lrs.swing.api.JLrsAlgorithmParams; |
|
48 |
import org.gvsig.tools.ToolsLocator; |
|
49 |
import org.gvsig.tools.i18n.I18nManager; |
|
50 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
51 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
52 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
53 |
|
|
54 |
public class JLrsCalibrateRouteParamsController extends JLrsCalibrateRouteParamsView implements JLrsAlgorithmParams{ |
|
55 |
|
|
56 |
/** |
|
57 |
* |
|
58 |
*/ |
|
59 |
private static final long serialVersionUID = -9145489136943076981L; |
|
60 |
|
|
61 |
private static final Logger logger = LoggerFactory.getLogger(JLrsCalibrateRouteParamsController.class); |
|
62 |
|
|
63 |
private boolean canceled; |
|
64 |
private ActionListenerSupport listeners = ToolsSwingLocator.getToolsSwingManager().createActionListenerSupport(); |
|
65 |
|
|
66 |
private LayerCollection layers; |
|
67 |
|
|
68 |
/** |
|
69 |
* @param layers |
|
70 |
* @throws LrsNeededParameterException |
|
71 |
* |
|
72 |
*/ |
|
73 |
public JLrsCalibrateRouteParamsController(LayerCollection layers, LrsAlgorithmParams params) throws LrsNeededParameterException { |
|
74 |
super(); |
|
75 |
this.layers = layers; |
|
76 |
initComponents(); |
|
77 |
translate(); |
|
78 |
setParams(params); |
|
79 |
} |
|
80 |
|
|
81 |
public void addActionListener(ActionListener listener) { |
|
82 |
listeners.addActionListener(listener); |
|
83 |
} |
|
84 |
|
|
85 |
public void removeActionListener(ActionListener listener) { |
|
86 |
listeners.removeActionListener(listener); |
|
87 |
} |
|
88 |
|
|
89 |
private void translate() { |
|
90 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
91 |
|
|
92 |
lblInputLayer.setText(i18nManager.getTranslation(lblInputLayer.getText())); |
|
93 |
lblIdRouteField.setText(i18nManager.getTranslation(lblIdRouteField.getText())); |
|
94 |
lblCalibratePointLayer.setText(i18nManager.getTranslation(lblCalibratePointLayer.getText())); |
|
95 |
lblCalibrationPointIdRouteField.setText(i18nManager.getTranslation(lblCalibrationPointIdRouteField.getText())); |
|
96 |
lblMeasureField.setText(i18nManager.getTranslation(lblMeasureField.getText())); |
|
97 |
lblOutputFile.setText(i18nManager.getTranslation(lblOutputFile.getText())); |
|
98 |
lblMeasureCalcMethod.setText(i18nManager.getTranslation(lblMeasureCalcMethod.getText())); |
|
99 |
lblSearchRadius.setText(i18nManager.getTranslation(lblSearchRadius.getText())); |
|
100 |
chkInterpolateBetweenCalibrationPoints.setText(i18nManager.getTranslation(chkInterpolateBetweenCalibrationPoints.getText())); |
|
101 |
chkExtrapolateBeforeCalibrationPoints.setText(i18nManager.getTranslation(chkExtrapolateBeforeCalibrationPoints.getText())); |
|
102 |
chkExtrapolateAfterCalibrationPoints.setText(i18nManager.getTranslation(chkExtrapolateAfterCalibrationPoints.getText())); |
|
103 |
chkIgnoreSpatialGaps.setText(i18nManager.getTranslation(chkIgnoreSpatialGaps.getText())); |
|
104 |
chkIncludeAll.setText(i18nManager.getTranslation(chkIncludeAll.getText())); |
|
105 |
btnBrowser.setText("\u2026"); |
|
106 |
btnAccept.setText(i18nManager.getTranslation(btnAccept.getText())); |
|
107 |
btnCancel.setText(i18nManager.getTranslation(btnCancel.getText())); |
|
108 |
|
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* |
|
113 |
*/ |
|
114 |
public void setLocate(Locale locale) { |
|
115 |
Locale l = super.getLocale(); |
|
116 |
if (!l.equals(locale)) { |
|
117 |
translate(); |
|
118 |
} |
|
119 |
super.setLocale(locale); |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* Validates the layers: |
|
124 |
* - At least 2 layers |
|
125 |
* - At least 1 curve layer with at least 1 non-geometric field |
|
126 |
* - At least 1 point layer with at least 1 non-geometric field and 1 numeric field |
|
127 |
* if they are not correct throws an exception |
|
128 |
* @throws LrsNeededParameterException |
|
129 |
*/ |
|
130 |
public static void validateLayers(LayerCollection layers)throws LrsNeededParameterException { |
|
131 |
logger.debug("Validating layers for Calibrate Route"); |
|
132 |
if (layers==null||layers.getLayersCount()<2){ |
|
133 |
logger.error("Two or more layers are needed"); |
|
134 |
throw new LrsNeededParameterException("two_or_more_layers_are_needed", null); |
|
135 |
} |
|
136 |
|
|
137 |
if (!JLrsUtils.validatedMCurveAndPointLayer(layers)){ |
|
138 |
logger.error("Impossible to find the layers needed"); |
|
139 |
throw new LrsNeededParameterException("impossible_to_find_needed_layers",null); |
|
140 |
} |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* @throws LrsNeededParameterException |
|
145 |
*/ |
|
146 |
private void initComponents() throws LrsNeededParameterException { |
|
147 |
|
|
148 |
validateLayers(layers); |
|
149 |
|
|
150 |
// Modelos de los combos |
|
151 |
FLayersMComboBoxModel inputLayerModel = new FLayersMComboBoxModel(this.layers); |
|
152 |
FeatureAttributeDescriptorsComboBoxModel idRouteFieldComboBoxModel = |
|
153 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
154 |
|
|
155 |
PointLayersComboBoxModel calibratePointLayerModel = new PointLayersComboBoxModel(this.layers); |
|
156 |
FeatureAttributeDescriptorsComboBoxModel idCalibrationPointFieldComboBoxModel = |
|
157 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
158 |
FeatureAttributeDescriptorsComboBoxModel fromMeasureFieldComboBoxModel = |
|
159 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
160 |
|
|
161 |
|
|
162 |
// Renderer para los combos de attributeDescriptors |
|
163 |
ListCellRenderer featureAttributeDescriptorCellRenderer = new FLayersAttributeDescriptorCellRenderer(); |
|
164 |
// asignaci?n de renderers y modelos |
|
165 |
cmbIdRouteField.setRenderer(featureAttributeDescriptorCellRenderer); |
|
166 |
cmbCalibrationPointIdRouteField.setRenderer(featureAttributeDescriptorCellRenderer); |
|
167 |
cmbMeasureField.setRenderer(featureAttributeDescriptorCellRenderer); |
|
168 |
cmbIdRouteField.setModel(idRouteFieldComboBoxModel); |
|
169 |
cmbCalibrationPointIdRouteField.setModel(idCalibrationPointFieldComboBoxModel); |
|
170 |
cmbMeasureField.setModel(fromMeasureFieldComboBoxModel); |
|
171 |
|
|
172 |
// renderer para el combo de capas |
|
173 |
ListCellRenderer layerNameCellRenderer=new FLayersLayerNameCellRenderer(); |
|
174 |
cmbInputLayer.setRenderer(layerNameCellRenderer); |
|
175 |
cmbCalibratePointLayer.setRenderer(layerNameCellRenderer); |
|
176 |
// asignaci?n modelo al combo de capas |
|
177 |
cmbInputLayer.setModel(inputLayerModel); |
|
178 |
cmbCalibratePointLayer.setModel(calibratePointLayerModel); |
|
179 |
// listener del combo de capas para que actualice el resto de |
|
180 |
// componentes |
|
181 |
cmbInputLayer.addItemListener(new ItemListener() { |
|
182 |
|
|
183 |
public void itemStateChanged(ItemEvent e) { |
|
184 |
Object item = e.getItem(); |
|
185 |
if (item instanceof FLyrVect) { |
|
186 |
FLyrVect layer = (FLyrVect) item; |
|
187 |
updateLayerSource(layer); |
|
188 |
} |
|
189 |
} |
|
190 |
}); |
|
191 |
cmbCalibratePointLayer.addItemListener(new ItemListener() { |
|
192 |
|
|
193 |
public void itemStateChanged(ItemEvent e) { |
|
194 |
Object item = e.getItem(); |
|
195 |
if (item instanceof FLyrVect) { |
|
196 |
FLyrVect layer = (FLyrVect) item; |
|
197 |
updateLayerCalibratePoint(layer); |
|
198 |
} |
|
199 |
} |
|
200 |
}); |
|
201 |
|
|
202 |
ComboBoxModel<LrsMeasureCalculationMethods> measureCalculationMethodsModel = |
|
203 |
new DefaultComboBoxModel<LrsMeasureCalculationMethods>(LrsMeasureCalculationMethods.values()); |
|
204 |
|
|
205 |
cmbMeasureCalcMethod.setModel(measureCalculationMethodsModel); |
|
206 |
|
|
207 |
ComboBoxModel<DistanceUnits> measureUnitsModel = |
|
208 |
new DefaultComboBoxModel<DistanceUnits>(DistanceUnits.values()); |
|
209 |
|
|
210 |
cmbMeasureUnits.setModel(measureUnitsModel); |
|
211 |
cmbMeasureUnits.setRenderer(new DistanceUnitsCellRenderer()); |
|
212 |
|
|
213 |
this.btnBrowser.addActionListener(new ActionListener() { |
|
214 |
|
|
215 |
public void actionPerformed(ActionEvent e) { |
|
216 |
doSelectOuputFile(); |
|
217 |
} |
|
218 |
}); |
|
219 |
|
|
220 |
this.btnAccept.addActionListener(new ActionListener() { |
|
221 |
|
|
222 |
public void actionPerformed(ActionEvent e) { |
|
223 |
canceled = false; |
|
224 |
doClose(); |
|
225 |
listeners.fireActionEvent(new ActionEvent(JLrsCalibrateRouteParamsController.this, 0, "accept")); |
|
226 |
|
|
227 |
} |
|
228 |
}); |
|
229 |
|
|
230 |
this.btnCancel.addActionListener(new ActionListener() { |
|
231 |
|
|
232 |
public void actionPerformed(ActionEvent e) { |
|
233 |
canceled = true; |
|
234 |
doClose(); |
|
235 |
listeners.fireActionEvent(new ActionEvent(JLrsCalibrateRouteParamsController.this, 0, "cancel")); |
|
236 |
} |
|
237 |
}); |
|
238 |
|
|
239 |
setVisibleAceptCancel(false); |
|
240 |
canceled = false; |
|
241 |
} |
|
242 |
|
|
243 |
private void doSelectOuputFile() { |
|
244 |
final I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
245 |
ThreadSafeDialogsManager manager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
246 |
File[] files = manager.showSaveFileDialog(i18nManager.getTranslation("output_file"), null); |
|
247 |
if (files != null && files.length > 0) { |
|
248 |
File file = files[0]; |
|
249 |
String absolutePath = file.getAbsolutePath(); |
|
250 |
if(!StringUtils.endsWithIgnoreCase(absolutePath, ".shp")){ |
|
251 |
absolutePath = new StringBuilder().append(absolutePath).append(".shp").toString(); |
|
252 |
} |
|
253 |
File outputFile = FileUtils.getFile(absolutePath); |
|
254 |
if(outputFile.exists()) { |
|
255 |
int resp = JOptionPane.showOptionDialog( |
|
256 |
this.asJComponent(), |
|
257 |
i18nManager.getTranslation("file_already_exists_do_you_want_overwrite_it"), |
|
258 |
i18nManager.getTranslation("output_file"), |
|
259 |
JOptionPane.OK_CANCEL_OPTION, |
|
260 |
JOptionPane.QUESTION_MESSAGE, |
|
261 |
null, |
|
262 |
null, |
|
263 |
JOptionPane.OK_OPTION); |
|
264 |
if (resp == JOptionPane.OK_OPTION){ |
|
265 |
this.txtOutputFile.setText(absolutePath); |
|
266 |
} else { |
|
267 |
doSelectOuputFile(); |
|
268 |
} |
|
269 |
} else { |
|
270 |
this.txtOutputFile.setText(absolutePath); |
|
271 |
} |
|
272 |
} |
|
273 |
|
|
274 |
} |
|
275 |
|
|
276 |
private void doClose() { |
|
277 |
this.setVisible(false); |
|
278 |
} |
|
279 |
|
|
280 |
public boolean isCanceled() { |
|
281 |
return this.canceled; |
|
282 |
} |
|
283 |
|
|
284 |
public void setVisibleAceptCancel(boolean visible) { |
|
285 |
this.btnAccept.setVisible(visible); |
|
286 |
this.btnCancel.setVisible(visible); |
|
287 |
} |
|
288 |
|
|
289 |
public boolean getVisibleAceptCancel() { |
|
290 |
return this.btnAccept.isVisible(); |
|
291 |
} |
|
292 |
|
|
293 |
public JComponent asJComponent() { |
|
294 |
return this; |
|
295 |
} |
|
296 |
|
|
297 |
public LrsAlgorithmParams getParams() throws LrsGettingParametersException, LrsNeededParameterException { |
|
298 |
LrsAlgorithmsManager manager = LrsAlgorithmsLocator.getLrsAlgorithmsManager(); |
|
299 |
LrsCalibrateRouteAlgorithmParams params = manager.createLrsCalibrateRouteAlgorithmParams(); |
|
300 |
// Recorrer todo del interfaz y rellenar los parametros |
|
301 |
|
|
302 |
//cmbInputLayer |
|
303 |
if (!(this.cmbInputLayer.getSelectedItem() instanceof FLyrVect)){ |
|
304 |
logger.error("Error getting selected item from cmbInputLayer"); |
|
305 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbInputLayer", null); |
|
306 |
} |
|
307 |
FLyrVect fLyrVect = (FLyrVect) this.cmbInputLayer.getSelectedItem(); |
|
308 |
IProjection projection= fLyrVect.getProjection(); |
|
309 |
if (!(fLyrVect.getFeatureStore() instanceof FeatureStore)){ |
|
310 |
logger.error("Error getting selected item from cmbInputLayer"); |
|
311 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbInputLayer", null); |
|
312 |
} |
|
313 |
FeatureStore sourceFeatureStore = (FeatureStore)fLyrVect.getFeatureStore(); |
|
314 |
if (sourceFeatureStore == null) { |
|
315 |
throw new LrsNeededParameterException("need_to_select_a_source_layer", null); |
|
316 |
} |
|
317 |
params.setSourceFeatureStore(sourceFeatureStore); |
|
318 |
|
|
319 |
//cmbIdRouteField |
|
320 |
if (!(this.cmbIdRouteField.getSelectedItem() instanceof FeatureAttributeDescriptor)){ |
|
321 |
logger.error("Error getting selected item from cmbIdRouteField"); |
|
322 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbIdRouteField", null); |
|
323 |
} |
|
324 |
FeatureAttributeDescriptor idRouteField = (FeatureAttributeDescriptor) this.cmbIdRouteField.getSelectedItem(); |
|
325 |
if (idRouteField == null) { |
|
326 |
throw new LrsNeededParameterException("need_to_select_a_route_identifier_field", null); |
|
327 |
} |
|
328 |
params.setIdRouteField(idRouteField); |
|
329 |
|
|
330 |
//cmbCalibratePointLayer |
|
331 |
if (!(this.cmbCalibratePointLayer.getSelectedItem() instanceof FLyrVect)){ |
|
332 |
logger.error("Error getting selected item from cmbCalibratePointLayer"); |
|
333 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbCalibratePointLayer", null); |
|
334 |
} |
|
335 |
FLyrVect fLyrVectCalibratePoint = (FLyrVect) this.cmbCalibratePointLayer.getSelectedItem(); |
|
336 |
if (!(fLyrVectCalibratePoint.getFeatureStore() instanceof FeatureStore)){ |
|
337 |
logger.error("Error getting selected item from cmbCalibratePointLayer"); |
|
338 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbCalibratePointLayer", null); |
|
339 |
} |
|
340 |
FeatureStore calibratePointFeatureStore = (FeatureStore)fLyrVectCalibratePoint.getFeatureStore(); |
|
341 |
if (calibratePointFeatureStore == null) { |
|
342 |
throw new LrsNeededParameterException("need_to_select_a_calibrate_point_layer", null); |
|
343 |
} |
|
344 |
params.setCalibratePointFeatureStore(calibratePointFeatureStore); |
|
345 |
|
|
346 |
//cmbCalibrationPointIdRouteField |
|
347 |
if (!(this.cmbCalibrationPointIdRouteField.getSelectedItem() instanceof FeatureAttributeDescriptor)){ |
|
348 |
logger.error("Error getting selected item from cmbCalibrationPointIdRouteField"); |
|
349 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbCalibrationPointIdRouteField", null); |
|
350 |
} |
|
351 |
FeatureAttributeDescriptor idRouteFieldCalibratePoint = |
|
352 |
(FeatureAttributeDescriptor) this.cmbCalibrationPointIdRouteField.getSelectedItem(); |
|
353 |
if (idRouteFieldCalibratePoint == null) { |
|
354 |
throw new LrsNeededParameterException("need_to_select_a_route_identifier_calibration_point_field", null); |
|
355 |
} |
|
356 |
params.setCalibratePointIdRouteField(idRouteFieldCalibratePoint); |
|
357 |
|
|
358 |
//cmbFromMeasureField |
|
359 |
if (!(this.cmbMeasureField.getSelectedItem() instanceof FeatureAttributeDescriptor)){ |
|
360 |
logger.error("Error getting selected item from cmbFromMeasureField"); |
|
361 |
throw new LrsGettingParametersException("error_getting_selected_item_from_cmbFromMeasureField", null); |
|
362 |
} |
|
363 |
FeatureAttributeDescriptor fromMeasureField = |
|
364 |
(FeatureAttributeDescriptor) this.cmbMeasureField.getSelectedItem(); |
|
365 |
if (fromMeasureField == null) { |
|
366 |
throw new LrsNeededParameterException("need_to_select_a_from_Measure_field", null); |
|
367 |
} |
|
368 |
params.setFromMeasureField(fromMeasureField); |
|
369 |
|
|
370 |
//OutputStore |
|
371 |
String outputLayerPathFile = this.txtOutputFile.getText(); |
|
372 |
if(StringUtils.isEmpty(outputLayerPathFile)){ |
|
373 |
throw new LrsNeededParameterException("need_to_fill_the_target_path", null); |
|
374 |
} |
|
375 |
try { |
|
376 |
NewFeatureStoreParameters newFeatureStoreParams=JLrsUtils.createFeatureStoreParams(outputLayerPathFile, projection); |
|
377 |
params.setNewFeatureStoreParameters(newFeatureStoreParams); |
|
378 |
} catch (Exception e) { |
|
379 |
throw new LrsNeededParameterException("error_creating_outputStore", e); |
|
380 |
} |
|
381 |
|
|
382 |
|
|
383 |
LrsMeasureCalculationMethods measureCalculationMethods = (LrsMeasureCalculationMethods) this.cmbMeasureCalcMethod.getSelectedItem(); |
|
384 |
params.setMeasureCalculationMethods(measureCalculationMethods); |
|
385 |
DistanceUnits measureUnits = (DistanceUnits) this.cmbMeasureUnits.getSelectedItem(); |
|
386 |
params.setMeasureUnits(measureUnits); |
|
387 |
|
|
388 |
String searchRadius = this.txtSearchRadius.getText(); |
|
389 |
if (searchRadius!=null && !searchRadius.isEmpty()){ |
|
390 |
try{ |
|
391 |
params.setSearchRadius(Double.valueOf(searchRadius)); |
|
392 |
}catch (Exception e){ |
|
393 |
params.setSearchRadius(Double.valueOf(0)); |
|
394 |
} |
|
395 |
}else { |
|
396 |
params.setSearchRadius(0); |
|
397 |
} |
|
398 |
|
|
399 |
params.setInterpolateBetweenCalibrationPoints(this.chkInterpolateBetweenCalibrationPoints.isSelected()); |
|
400 |
params.setExtrapolateBeforeCalibrationPoints(this.chkExtrapolateBeforeCalibrationPoints.isSelected()); |
|
401 |
params.setExtrapolateAfterCalibrationPoints(this.chkExtrapolateAfterCalibrationPoints.isSelected()); |
|
402 |
params.setIgnoreSpatialGaps(this.chkIgnoreSpatialGaps.isSelected()); |
|
403 |
params.setIncludeAll(this.chkIncludeAll.isSelected()); |
|
404 |
|
|
405 |
return params; |
|
406 |
} |
|
407 |
|
|
408 |
public void setParams(LrsAlgorithmParams params) { |
|
409 |
if (params == null) { |
|
410 |
clear(); |
|
411 |
return; |
|
412 |
} |
|
413 |
// Rellena los campos con los valores de params |
|
414 |
LrsCalibrateRouteAlgorithmParams parameters = (LrsCalibrateRouteAlgorithmParams) params; |
|
415 |
|
|
416 |
this.cmbMeasureCalcMethod.setSelectedItem(parameters.getMeasureCalculationMethods()); |
|
417 |
this.cmbMeasureUnits.setSelectedItem(parameters.getMeasureUnits()); |
|
418 |
|
|
419 |
FeatureStore sourceFeatureStore = parameters.getSourceFeatureStore(); |
|
420 |
if(layers!=null && sourceFeatureStore!=null){ |
|
421 |
FLayer layer = layers.getLayer(sourceFeatureStore.getName()); |
|
422 |
this.cmbInputLayer.setSelectedItem(layer); |
|
423 |
} |
|
424 |
FeatureStore calibratePointFeaturesStore=parameters.getCalibratePointFeatureStore(); |
|
425 |
if(layers!=null && calibratePointFeaturesStore!=null){ |
|
426 |
FLayer layer = layers.getLayer(calibratePointFeaturesStore.getName()); |
|
427 |
this.cmbCalibratePointLayer.setSelectedItem(layer); |
|
428 |
} |
|
429 |
NewFeatureStoreParameters newFeatureStoreParameters = parameters.getNewFeatureStoreParameters(); |
|
430 |
if(newFeatureStoreParameters!=null && newFeatureStoreParameters instanceof SHPNewStoreParameters){ |
|
431 |
this.txtOutputFile.setText(((SHPNewStoreParameters)newFeatureStoreParameters).getSHPFile().getAbsolutePath()); |
|
432 |
} |
|
433 |
|
|
434 |
this.cmbIdRouteField.setSelectedItem(parameters.getIdRouteField()); |
|
435 |
this.cmbCalibrationPointIdRouteField.setSelectedItem(parameters.getCalibratePointIdRouteField()); |
|
436 |
this.cmbMeasureField.setSelectedItem(parameters.getFromMeasureField()); |
|
437 |
|
|
438 |
this.txtSearchRadius.setText(String.valueOf(parameters.getSearchRadius())); |
|
439 |
this.chkInterpolateBetweenCalibrationPoints.setSelected(parameters.interpolateBetweenCalibrationPoints()); |
|
440 |
this.chkExtrapolateBeforeCalibrationPoints.setSelected(parameters.extrapolateBeforeCalibrationPoints()); |
|
441 |
this.chkExtrapolateAfterCalibrationPoints.setSelected(parameters.extrapolateAfterCalibrationPoints()); |
|
442 |
this.chkIgnoreSpatialGaps.setSelected(parameters.ignoreSpatialGaps()); |
|
443 |
this.chkIncludeAll.setSelected(parameters.includeAll()); |
|
444 |
|
|
445 |
} |
|
446 |
|
|
447 |
public void clear() { |
|
448 |
this.txtOutputFile.setText(""); |
|
449 |
this.txtSearchRadius.setText("0.0"); |
|
450 |
|
|
451 |
this.cmbInputLayer.setSelectedIndex(0); |
|
452 |
Object inputLayerSelected = this.cmbInputLayer.getSelectedItem(); |
|
453 |
if (inputLayerSelected != null) { |
|
454 |
this.updateLayerSource((FLyrVect) inputLayerSelected); |
|
455 |
} |
|
456 |
this.cmbCalibratePointLayer.setSelectedIndex(0); |
|
457 |
Object calibratePointLayerSelected = this.cmbCalibratePointLayer.getSelectedItem(); |
|
458 |
if (calibratePointLayerSelected != null) { |
|
459 |
this.updateLayerCalibratePoint((FLyrVect) calibratePointLayerSelected); |
|
460 |
} |
|
461 |
this.cmbIdRouteField.setSelectedIndex(0); |
|
462 |
this.cmbCalibrationPointIdRouteField.setSelectedIndex(0); |
|
463 |
this.cmbMeasureField.setSelectedIndex(0); |
|
464 |
this.cmbMeasureCalcMethod.setSelectedIndex(0); |
|
465 |
this.cmbMeasureUnits.setSelectedIndex(0); |
|
466 |
this.chkInterpolateBetweenCalibrationPoints.setSelected(false); |
|
467 |
this.chkExtrapolateBeforeCalibrationPoints.setSelected(false); |
|
468 |
this.chkExtrapolateAfterCalibrationPoints.setSelected(false); |
|
469 |
this.chkIgnoreSpatialGaps.setSelected(false); |
|
470 |
this.chkIncludeAll.setSelected(false); |
|
471 |
|
|
472 |
} |
|
473 |
|
|
474 |
private void updateLayerSource(FLyrVect layer) { |
|
475 |
logger.info(new StringBuilder().append("Setting layer ").append(layer.getName()).toString()); |
|
476 |
FeatureStore featureStore = layer.getFeatureStore(); |
|
477 |
try { |
|
478 |
FeatureType type = featureStore.getDefaultFeatureType(); |
|
479 |
// Se renuevan los combos de attributeDescriptors |
|
480 |
FeatureAttributeDescriptorsComboBoxModel idRouteFieldComboBoxModel = |
|
481 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
482 |
|
|
483 |
this.cmbIdRouteField.setModel(idRouteFieldComboBoxModel); |
|
484 |
|
|
485 |
FeatureAttributeDescriptor[] attributeDescriptors = type.getAttributeDescriptors(); |
|
486 |
for (int i = 0; i < attributeDescriptors.length; i++) { |
|
487 |
FeatureAttributeDescriptor featureAttributeDescriptor = attributeDescriptors[i]; |
|
488 |
if (featureAttributeDescriptor.getDataType().getType() != DataTypes.GEOMETRY) { |
|
489 |
logger.info(new StringBuilder().append("Adding field ") |
|
490 |
.append(featureAttributeDescriptor.getName()).toString()); |
|
491 |
|
|
492 |
JLrsCalibrateRouteParamsController.this.cmbIdRouteField.addItem(featureAttributeDescriptor); |
|
493 |
} |
|
494 |
} |
|
495 |
this.cmbIdRouteField.invalidate(); |
|
496 |
this.cmbIdRouteField.setSelectedIndex(0); |
|
497 |
|
|
498 |
} catch (DataException e1) { |
|
499 |
logger.warn( |
|
500 |
new StringBuilder().append("Error getting default feature type from layer ").append(layer.getName()) |
|
501 |
.toString(), e1); |
|
502 |
} |
|
503 |
} |
|
504 |
|
|
505 |
|
|
506 |
|
|
507 |
private void updateLayerCalibratePoint(FLyrVect layer) { |
|
508 |
logger.info(new StringBuilder().append("Setting layer ").append(layer.getName()).toString()); |
|
509 |
FeatureStore featureStore = layer.getFeatureStore(); |
|
510 |
try { |
|
511 |
FeatureType type = featureStore.getDefaultFeatureType(); |
|
512 |
// Se renuevan los combos de attributeDescriptors |
|
513 |
FeatureAttributeDescriptorsComboBoxModel calibrationPointIdRouteFieldComboBoxModel = |
|
514 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
515 |
FeatureAttributeDescriptorsComboBoxModel measureFieldComboBoxModel = |
|
516 |
new FeatureAttributeDescriptorsComboBoxModel(); |
|
517 |
|
|
518 |
this.cmbCalibrationPointIdRouteField.setModel(calibrationPointIdRouteFieldComboBoxModel); |
|
519 |
this.cmbMeasureField.setModel(measureFieldComboBoxModel); |
|
520 |
|
|
521 |
FeatureAttributeDescriptor[] attributeDescriptors = type.getAttributeDescriptors(); |
|
522 |
for (int i = 0; i < attributeDescriptors.length; i++) { |
|
523 |
FeatureAttributeDescriptor featureAttributeDescriptor = attributeDescriptors[i]; |
|
524 |
if (featureAttributeDescriptor.getDataType().getType() != DataTypes.GEOMETRY) { |
|
525 |
logger.info(new StringBuilder().append("Adding field ") |
|
526 |
.append(featureAttributeDescriptor.getName()).toString()); |
|
527 |
|
|
528 |
//calibrationPointIdRouteFieldComboBoxModel.addElement(featureAttributeDescriptor); |
|
529 |
this.cmbCalibrationPointIdRouteField.addItem(featureAttributeDescriptor); |
|
530 |
if (featureAttributeDescriptor.getDataType().isNumeric()) { |
|
531 |
//measureFieldComboBoxModel.addElement(featureAttributeDescriptor); |
|
532 |
this.cmbMeasureField.addItem(featureAttributeDescriptor); |
|
533 |
} |
|
534 |
} |
|
535 |
} |
|
536 |
|
|
537 |
this.cmbCalibrationPointIdRouteField.setSelectedIndex(0); |
|
538 |
this.cmbMeasureField.setSelectedIndex(0); |
|
539 |
// calibrationPointIdRouteFieldComboBoxModel.setSelectedItem(calibrationPointIdRouteFieldComboBoxModel.getElementAt(0)); |
|
540 |
// measureFieldComboBoxModel.setSelectedItem(measureFieldComboBoxModel.getElementAt(0)); |
|
541 |
|
|
542 |
this.cmbCalibrationPointIdRouteField.invalidate(); |
|
543 |
this.cmbMeasureField.invalidate(); |
|
544 |
|
|
545 |
} catch (DataException e1) { |
|
546 |
logger.warn( |
|
547 |
new StringBuilder().append("Error getting default feature type from layer ").append(layer.getName()) |
|
548 |
.toString(), e1); |
|
549 |
} |
|
550 |
} |
|
551 |
|
|
552 |
/* (non-Javadoc) |
|
553 |
* @see javax.swing.JComponent#getPreferredSize() |
|
554 |
*/ |
|
555 |
@Override |
|
556 |
public Dimension getPreferredSize() { |
|
557 |
return new Dimension(650, 350); |
|
558 |
} |
|
559 |
|
|
560 |
|
|
561 |
|
|
562 |
} |
org.gvsig.lrs/tags/org.gvsig.lrs-1.0.153/org.gvsig.lrs.swing/org.gvsig.lrs.swing.impl/src/main/java/org/gvsig/lrs/swing/impl/JLrsEditRouteCalibrationSelectIdRouteView.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/daniel/tmp/abeille/JLrsEditRouteCalibrationSelectIdRouteView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
29 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:334PX:GROW(1.0),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">id_route_field</at> |
|
57 |
<at name="height">14</at> |
|
58 |
<at name="width">76</at> |
|
59 |
<at name="name">lblIdRouteField</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">1</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">827</at> |
|
123 |
<at name="name">cmbIdRouteField</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.FormMemento"> |
|
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">4</at> |
|
159 |
<at name="colspan">3</at> |
|
160 |
<at name="rowspan">1</at> |
|
161 |
<at name="halign">right</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.FormComponent</at> |
|
167 |
</super> |
|
168 |
<at name="id">embedded.1550168189</at> |
|
169 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
|
170 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE</at> |
|
171 |
<at name="components"> |
|
172 |
<object classname="java.util.LinkedList"> |
|
173 |
<item > |
|
174 |
<at name="value"> |
|
175 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
176 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
177 |
<at name="cellconstraints"> |
|
178 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
179 |
<at name="column">1</at> |
|
180 |
<at name="row">1</at> |
|
181 |
<at name="colspan">1</at> |
|
182 |
<at name="rowspan">1</at> |
|
183 |
<at name="halign">default</at> |
|
184 |
<at name="valign">default</at> |
|
185 |
<at name="insets" object="insets">0,0,0,0</at> |
|
186 |
</object> |
|
187 |
</at> |
|
188 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
189 |
</super> |
|
190 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
191 |
<at name="beanclass">javax.swing.JButton</at> |
|
192 |
<at name="beanproperties"> |
|
193 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
194 |
<at name="classname">javax.swing.JButton</at> |
|
195 |
<at name="properties"> |
|
196 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
197 |
<at name="text">_Accept</at> |
|
198 |
<at name="height">22</at> |
|
199 |
<at name="width">75</at> |
|
200 |
<at name="name">btnAccept</at> |
|
201 |
<at name="actionCommand">_Accept</at> |
|
202 |
<at name="border"> |
|
203 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
204 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
205 |
<at name="name">border</at> |
|
206 |
</super> |
|
207 |
<at name="borders"> |
|
208 |
<object classname="java.util.LinkedList"> |
|
209 |
<item > |
|
210 |
<at name="value"> |
|
211 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
212 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
213 |
<at name="name">border</at> |
|
214 |
</super> |
|
215 |
</object> |
|
216 |
</at> |
|
217 |
</item> |
|
218 |
</object> |
|
219 |
</at> |
|
220 |
</object> |
|
221 |
</at> |
|
222 |
</object> |
|
223 |
</at> |
|
224 |
</object> |
|
225 |
</at> |
|
226 |
</object> |
|
227 |
</at> |
|
228 |
</item> |
|
229 |
<item > |
|
230 |
<at name="value"> |
|
231 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
232 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
233 |
<at name="cellconstraints"> |
|
234 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
235 |
<at name="column">3</at> |
|
236 |
<at name="row">1</at> |
|
237 |
<at name="colspan">1</at> |
|
238 |
<at name="rowspan">1</at> |
|
239 |
<at name="halign">default</at> |
|
240 |
<at name="valign">default</at> |
|
241 |
<at name="insets" object="insets">0,0,0,0</at> |
|
242 |
</object> |
|
243 |
</at> |
|
244 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
245 |
</super> |
|
246 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
247 |
<at name="beanclass">javax.swing.JButton</at> |
|
248 |
<at name="beanproperties"> |
|
249 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
250 |
<at name="classname">javax.swing.JButton</at> |
|
251 |
<at name="properties"> |
|
252 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
253 |
<at name="text">_Cancel</at> |
|
254 |
<at name="height">22</at> |
|
255 |
<at name="width">76</at> |
|
256 |
<at name="name">btnCancel</at> |
|
257 |
<at name="actionCommand">_Cancel</at> |
|
258 |
<at name="border"> |
|
259 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
260 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
261 |
<at name="name">border</at> |
|
262 |
</super> |
|
263 |
<at name="borders"> |
|
264 |
<object classname="java.util.LinkedList"> |
|
265 |
<item > |
|
266 |
<at name="value"> |
|
267 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
268 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
269 |
<at name="name">border</at> |
|
270 |
</super> |
|
271 |
</object> |
|
272 |
</at> |
|
273 |
</item> |
|
274 |
</object> |
|
275 |
</at> |
|
276 |
</object> |
|
277 |
</at> |
|
278 |
</object> |
|
279 |
</at> |
|
280 |
</object> |
|
281 |
</at> |
|
282 |
</object> |
|
283 |
</at> |
|
284 |
</item> |
|
285 |
</object> |
|
286 |
</at> |
|
287 |
<at name="properties"> |
|
288 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
289 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
290 |
<at name="properties"> |
|
291 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
292 |
<at name="name"></at> |
|
293 |
<at name="fill"> |
|
294 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
295 |
<at name="name">fill</at> |
|
296 |
</object> |
|
297 |
</at> |
|
298 |
<at name="scollBars"> |
|
299 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
300 |
<at name="name">scollBars</at> |
|
301 |
<at name="verticalpolicy">21</at> |
|
302 |
<at name="horizontalpolicy">31</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 |
<at name="border"> |
|
326 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
327 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
328 |
<at name="name">border</at> |
|
329 |
</super> |
|
330 |
<at name="borders"> |
|
331 |
<object classname="java.util.LinkedList"/> |
|
332 |
</at> |
|
333 |
</object> |
|
334 |
</at> |
|
335 |
</object> |
|
336 |
</at> |
|
337 |
</object> |
|
338 |
</at> |
|
339 |
<at name="cellpainters"> |
|
340 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
341 |
<at name="rows"> |
|
342 |
<object classname="[Ljava.lang.Object;" size="1"> |
|
343 |
<at name="item" index="0"> |
|
344 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
345 |
</at> |
|
346 |
</object> |
|
347 |
</at> |
|
348 |
</object> |
|
349 |
</at> |
|
350 |
<at name="rowgroups"> |
|
351 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
352 |
<at name="groups"> |
|
353 |
<object classname="java.util.HashMap"/> |
|
354 |
</at> |
|
355 |
</object> |
|
356 |
</at> |
|
357 |
<at name="colgroups"> |
|
358 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
359 |
<at name="groups"> |
|
360 |
<object classname="java.util.HashMap"/> |
|
361 |
</at> |
|
362 |
</object> |
|
363 |
</at> |
|
364 |
</object> |
|
365 |
</at> |
|
366 |
</item> |
|
367 |
</object> |
|
368 |
</at> |
|
369 |
<at name="properties"> |
|
370 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
371 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
372 |
<at name="properties"> |
|
373 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
374 |
<at name="name"></at> |
|
375 |
<at name="fill"> |
|
376 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
377 |
<at name="name">fill</at> |
|
378 |
</object> |
|
379 |
</at> |
|
380 |
<at name="scollBars"> |
|
381 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
382 |
<at name="name">scollBars</at> |
|
383 |
<at name="verticalpolicy">21</at> |
|
384 |
<at name="horizontalpolicy">31</at> |
|
385 |
<at name="border"> |
|
386 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
387 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
388 |
<at name="name">border</at> |
|
389 |
</super> |
|
390 |
<at name="borders"> |
|
391 |
<object classname="java.util.LinkedList"> |
|
392 |
<item > |
|
393 |
<at name="value"> |
|
394 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
395 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
396 |
<at name="name">border</at> |
|
397 |
</super> |
|
398 |
</object> |
|
399 |
</at> |
|
400 |
</item> |
|
401 |
</object> |
|
402 |
</at> |
|
403 |
</object> |
|
404 |
</at> |
|
405 |
</object> |
|
406 |
</at> |
|
407 |
<at name="border"> |
|
408 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
409 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
410 |
<at name="name">border</at> |
|
411 |
</super> |
|
412 |
<at name="borders"> |
|
413 |
<object classname="java.util.LinkedList"/> |
|
414 |
</at> |
|
415 |
</object> |
|
416 |
</at> |
|
417 |
</object> |
|
418 |
</at> |
|
419 |
</object> |
|
420 |
</at> |
|
421 |
<at name="cellpainters"> |
|
422 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
423 |
<at name="rows"> |
|
424 |
<object classname="[Ljava.lang.Object;" size="5"> |
|
425 |
<at name="item" index="0"> |
|
426 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
427 |
</at> |
|
428 |
<at name="item" index="1"> |
|
429 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
430 |
</at> |
|
431 |
<at name="item" index="2"> |
|
432 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
433 |
</at> |
|
434 |
<at name="item" index="3"> |
|
435 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
436 |
</at> |
|
437 |
<at name="item" index="4"> |
Also available in: Unified diff