Revision 10603 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/wizard/DefSistCoordenadas.java
DefSistCoordenadas.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import javax.swing.BorderFactory; |
11 | 11 |
import javax.swing.ButtonGroup; |
12 |
import javax.swing.ImageIcon; |
|
12 | 13 |
import javax.swing.JButton; |
13 | 14 |
import javax.swing.JComboBox; |
14 | 15 |
import javax.swing.JLabel; |
... | ... | |
16 | 17 |
import javax.swing.JRadioButton; |
17 | 18 |
import javax.swing.JScrollPane; |
18 | 19 |
import javax.swing.JTable; |
20 |
import javax.swing.SwingConstants; |
|
19 | 21 |
import javax.swing.border.TitledBorder; |
22 |
import javax.swing.table.DefaultTableCellRenderer; |
|
20 | 23 |
import javax.swing.table.DefaultTableModel; |
21 | 24 |
import javax.swing.table.TableColumn; |
25 |
import javax.swing.text.TableView.TableRow; |
|
22 | 26 |
|
27 |
import com.iver.andami.PluginServices; |
|
23 | 28 |
|
24 | 29 |
|
30 |
|
|
25 | 31 |
/** |
26 | 32 |
* Panel de Definici?n del Sistema de Coordenadas |
27 | 33 |
* |
... | ... | |
44 | 50 |
private JTable tableParametros; |
45 | 51 |
private JScrollPane scrollTable; |
46 | 52 |
|
47 |
private int theigth=120;
|
|
53 |
private int theigth=140;
|
|
48 | 54 |
private int twidth=300; |
49 | 55 |
|
50 | 56 |
final static String PROYECTADOPANEL = "Proyectado"; |
... | ... | |
108 | 114 |
proyectadoPanel=new JPanel(b); |
109 | 115 |
proyectadoPanel.setBorder(BorderFactory.createEmptyBorder(0,3,0,3)); |
110 | 116 |
//JPanel p=new JPanel(new FlowLayout(FlowLayout.CENTER,10,10)); |
111 |
JPanel p=new JPanel(new GridLayout(1,0)); |
|
117 |
JPanel p=new JPanel(new GridLayout(1,0,10,10));
|
|
112 | 118 |
JPanel in=new JPanel(new FlowLayout(FlowLayout.RIGHT,3,5)); |
113 | 119 |
in.add(getLblProyeccion()); |
114 | 120 |
p.add(in); |
... | ... | |
185 | 191 |
{"", "", "Metros"}, |
186 | 192 |
{"", "", "Metros"}, |
187 | 193 |
{"", "", "Metros"}}; |
188 |
|
|
189 |
Object[] headers = {"Parametros", "Valor", |
|
190 |
"Unidades"}; |
|
194 |
//TODO: Comprobar que funcionan las traducciones |
|
195 |
/*String col1=PluginServices.getText(this,"jpSistCoor_Parametro"); |
|
196 |
String col2=PluginServices.getText(this,"jpSistCoor_Valor"); |
|
197 |
String col3=PluginServices.getText(this,"jpSistCoor_Unidades"); |
|
198 |
Object[] headers = {col1, col2, col3};*/ |
|
199 |
Object[] headers = {"Parametro", "Valor", "Unidades"}; |
|
191 | 200 |
model.setDataVector(data,headers); |
192 |
|
|
193 |
/*Agrega otra fila |
|
201 |
/*Agrega otra fila |
|
194 | 202 |
model.addRow(new Object[]{"fila","","Metros"});*/ |
195 | 203 |
//TODO: Agregar los items "Unidades" al combo |
196 | 204 |
//define los items del combo |
... | ... | |
203 | 211 |
tableParametros.setPreferredScrollableViewportSize(new Dimension(twidth,theigth)); |
204 | 212 |
//la posicion de las columnas es fija |
205 | 213 |
tableParametros.getTableHeader().setReorderingAllowed( false ); |
206 |
redimensionarColumnas(); |
|
214 |
//Ajustar ancho y alto de las filas y columnas |
|
215 |
ajustarTama?oTabla(); |
|
207 | 216 |
} |
217 |
|
|
208 | 218 |
return tableParametros; |
209 | 219 |
} |
210 | 220 |
|
... | ... | |
239 | 249 |
return cbProyeccion; |
240 | 250 |
} |
241 | 251 |
/* |
242 |
* Redimensiona el tama?o de las columnas
|
|
252 |
* Redimensiona el tama?o de las filas y columnas de la tabla
|
|
243 | 253 |
* |
244 | 254 |
*/ |
245 |
public void redimensionarColumnas(){
|
|
255 |
public void ajustarTama?oTabla(){
|
|
246 | 256 |
TableColumn column = null; |
247 |
/* for (int i = 0; i < parametrosJtable.getColumnCount(); i++) { |
|
248 |
column = parametrosJtable.getColumnModel().getColumn(i); |
|
249 |
if (i == 2) { |
|
250 |
column.setPreferredWidth(200); |
|
251 |
} else { |
|
252 |
column.setPreferredWidth(30); |
|
253 |
} |
|
254 |
}*/ |
|
255 |
column = tableParametros.getColumnModel().getColumn(0); |
|
256 |
column.setPreferredWidth(80); |
|
257 |
column = tableParametros.getColumnModel().getColumn(1); |
|
258 |
column.setPreferredWidth(80); |
|
259 |
column = tableParametros.getColumnModel().getColumn(2); |
|
260 |
column.setPreferredWidth(100); |
|
257 |
//Fijar el alto de las filas |
|
258 |
getTableParametros().setRowHeight(20); |
|
259 |
//Fijar el ancho de las columnas |
|
260 |
column = getTableParametros().getColumnModel().getColumn(0); |
|
261 |
column.setPreferredWidth(30); |
|
262 |
column = getTableParametros().getColumnModel().getColumn(1); |
|
263 |
column.setPreferredWidth(90); |
|
264 |
column = getTableParametros().getColumnModel().getColumn(2); |
|
265 |
column.setPreferredWidth(120); |
|
266 |
|
|
261 | 267 |
} |
262 | 268 |
|
263 | 269 |
/** |
Also available in: Unified diff