Revision 8783 branches/v10+Piloto/libraries/libCq_CMS_praster/src/org/cresques/ui/cts/CSSelectionPanel.java
CSSelectionPanel.java | ||
---|---|---|
24 | 24 |
package org.cresques.ui.cts; |
25 | 25 |
|
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
|
|
27 |
import org.cresques.i18n.Messages; |
|
28 | 28 |
import org.cresques.ui.LoadableComboBox; |
29 | 29 |
|
30 | 30 |
import javax.swing.JLabel; |
... | ... | |
59 | 59 |
super(); |
60 | 60 |
|
61 | 61 |
if (tit == null) { |
62 |
tit = "Sistema de referencia"; |
|
62 |
//tit = "Sistema de referencia"; |
|
63 |
//TODO: add com.iver.andami.PluginServices to this project |
|
64 |
//change all the labels from fix text got from the internationalitation |
|
65 |
tit = Messages.getText("reference_system"); |
|
66 |
if (tit == null) tit="Reference System"; |
|
63 | 67 |
} |
64 | 68 |
|
65 | 69 |
this.tit = tit; |
... | ... | |
80 | 84 |
javax.swing.BorderFactory.createEmptyBorder(5,5,5,5)); */ |
81 | 85 |
setBorder(javax.swing.BorderFactory.createCompoundBorder(null, |
82 | 86 |
javax.swing.BorderFactory.createTitledBorder(null, |
83 |
"Sistema de Referencia",
|
|
87 |
Messages.getText("reference_system"),
|
|
84 | 88 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
85 | 89 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, |
86 | 90 |
null, |
... | ... | |
88 | 92 |
|
89 | 93 |
jLabel = new JLabel(); |
90 | 94 |
jLabel.setBounds(15, 15, 77, 23); |
91 |
jLabel.setText("Datum :");
|
|
95 |
jLabel.setText(Messages.getText("datum") + ":");
|
|
92 | 96 |
add(jLabel, null); |
93 | 97 |
add(getDatumComboBox(), null); |
94 | 98 |
|
95 | 99 |
jLabel1 = new JLabel(); |
96 | 100 |
jLabel1.setBounds(15, 60, 77, 23); |
97 |
jLabel1.setText("Proyecci?n :");
|
|
101 |
jLabel1.setText(Messages.getText("projection") + ":");
|
|
98 | 102 |
add(jLabel1, null); |
99 | 103 |
add(getProjComboBox(), null); |
100 | 104 |
|
101 | 105 |
jLabel2 = new JLabel(); |
102 | 106 |
jLabel2.setBounds(15, 105, 77, 23); |
103 |
jLabel2.setText("Huso :");
|
|
107 |
jLabel2.setText(Messages.getText("zone") + ":");
|
|
104 | 108 |
add(jLabel2, null); |
105 | 109 |
add(getHuseComboBox(), null); |
106 | 110 |
|
... | ... | |
110 | 114 |
public void setModel(CSSelectionModel model) { |
111 | 115 |
this.model = model; |
112 | 116 |
|
113 |
getHuseComboBox().loadData(model.getHuseList());
|
|
117 |
getHuseComboBox().loadData(model.getZoneList());
|
|
114 | 118 |
getDatumComboBox().loadData(model.getDatumList()); |
115 | 119 |
getProjComboBox().loadData(model.getProjectionList()); |
116 | 120 |
} |
... | ... | |
134 | 138 |
public void setProjection(IProjection proj) { |
135 | 139 |
model.setProjection(proj); |
136 | 140 |
|
137 |
if (model.getSelectedDatum() >= 0) { |
|
138 |
setDatumComboBoxEnabled(true); |
|
139 |
getDatumComboBox().setSelectedIndex(model.getSelectedDatum()); |
|
140 |
} else { |
|
141 |
setDatumComboBoxEnabled(false); |
|
142 |
getDatumComboBox().setSelectedIndex(0); |
|
143 |
} |
|
141 |
setDatumComboBoxEnabled(true); |
|
142 |
getDatumComboBox().setSelectedIndex(model.getSelectedDatum()); |
|
143 |
|
|
144 |
getProjComboBox().removeAllItems(); |
|
145 |
getProjComboBox().loadData(model.getProjectionList()); |
|
144 | 146 |
|
147 |
model.setProjection(proj); |
|
145 | 148 |
getProjComboBox().setSelectedIndex(model.getSelectedProj()); |
149 |
model.setProjection(proj); |
|
150 |
|
|
151 |
if (model.getSelectedZone() >= 0) { |
|
152 |
setHuseComboBoxEnabled(true); |
|
153 |
getHuseComboBox().removeAllItems(); |
|
154 |
getHuseComboBox().loadData(model.getZoneList()); |
|
146 | 155 |
|
147 |
if (model.getSelectedHuse() >= 0) { |
|
148 |
setHuseComboBoxEnabled(true); |
|
149 |
getHuseComboBox().setSelectedIndex(model.getSelectedHuse()); |
|
156 |
model.setProjection(proj); |
|
157 |
getHuseComboBox().setSelectedIndex(model.getSelectedZone()); |
|
150 | 158 |
} else { |
151 | 159 |
setHuseComboBoxEnabled(false); |
152 | 160 |
getHuseComboBox().setSelectedIndex(0); |
... | ... | |
167 | 175 |
datumComboBox.addItemListener(new java.awt.event.ItemListener() { |
168 | 176 |
public void itemStateChanged(java.awt.event.ItemEvent e) { |
169 | 177 |
model.setSelectedDatum(e.getItem()); |
178 |
getProjComboBox().removeAllItems(); |
|
179 |
getProjComboBox().loadData(model.getProjectionList()); |
|
170 | 180 |
} |
171 | 181 |
}); |
172 | 182 |
} |
... | ... | |
189 | 199 |
|
190 | 200 |
if (model.getSelectedProjType() == CSSelectionModel.TRANSVERSAL) { |
191 | 201 |
setHuseComboBoxEnabled(true); |
202 |
getHuseComboBox().removeAllItems(); |
|
203 |
getHuseComboBox().loadData(model.getZoneList()); |
|
204 |
|
|
192 | 205 |
} else { |
193 | 206 |
setHuseComboBoxEnabled(false); |
194 | 207 |
} |
195 | 208 |
|
196 |
if (model.getSelectedProjType() == CSSelectionModel.NONE) { |
|
197 |
setDatumComboBoxEnabled(false); |
|
198 |
} else { |
|
199 |
setDatumComboBoxEnabled(true); |
|
200 |
} |
|
209 |
// if (model.getSelectedProjType() == CSSelectionModel.NONE) {
|
|
210 |
// setDatumComboBoxEnabled(false);
|
|
211 |
// } else {
|
|
212 |
// setDatumComboBoxEnabled(true);
|
|
213 |
// }
|
|
201 | 214 |
} |
202 | 215 |
}); |
203 | 216 |
} |
... | ... | |
216 | 229 |
huseComboBox.setBounds(14, 125, 250, 23); |
217 | 230 |
huseComboBox.addItemListener(new java.awt.event.ItemListener() { |
218 | 231 |
public void itemStateChanged(java.awt.event.ItemEvent e) { |
219 |
model.setSelectedHuse(e.getItem());
|
|
232 |
model.setSelectedZone(e.getItem());
|
|
220 | 233 |
} |
221 | 234 |
}); |
222 | 235 |
} |
Also available in: Unified diff