Revision 10786 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/TransformationRecentsPanel.java
TransformationRecentsPanel.java | ||
---|---|---|
40 | 40 |
|
41 | 41 |
package org.gvsig.crs.gui.panels; |
42 | 42 |
|
43 |
import java.awt.Dimension;
|
|
43 |
import java.awt.BorderLayout;
|
|
44 | 44 |
import java.awt.FlowLayout; |
45 |
import java.awt.GridLayout; |
|
46 |
import java.awt.event.ActionEvent; |
|
47 |
import java.awt.event.ActionListener; |
|
48 | 45 |
|
49 | 46 |
import javax.swing.BorderFactory; |
50 | 47 |
import javax.swing.JButton; |
... | ... | |
57 | 54 |
|
58 | 55 |
import org.gvsig.crs.CrsException; |
59 | 56 |
import org.gvsig.crs.CrsFactory; |
60 |
import org.gvsig.crs.CrsWkt; |
|
61 | 57 |
import org.gvsig.crs.EpsgConnection; |
62 | 58 |
import org.gvsig.crs.ICrs; |
63 | 59 |
import org.gvsig.crs.persistence.RecentCRSsPersistence; |
... | ... | |
70 | 66 |
/** |
71 | 67 |
* Panel para la gesti?n de las transformaciones recientes |
72 | 68 |
* @author Jos? Luis G?mez Mart?nez (jolugomar@gmail.com) |
69 |
* @author Luisa Marina Fern?ndez (luisam.fernandez@uclm.es) |
|
73 | 70 |
* |
74 | 71 |
*/ |
75 | 72 |
public class TransformationRecentsPanel extends JPanel { |
76 |
|
|
73 |
|
|
74 |
private static final long serialVersionUID = 1L; |
|
77 | 75 |
int code = 0; |
78 | 76 |
private JTable transformationTable; |
79 | 77 |
private JScrollPane jScrollPane = null; |
... | ... | |
101 | 99 |
private void initialize(){ |
102 | 100 |
connect = new EpsgConnection(); |
103 | 101 |
connect.setConnectionEPSG(); |
104 |
setLayout(new GridLayout(2,1)); |
|
105 |
setLayout(new FlowLayout(FlowLayout.LEADING,5,10)); |
|
106 |
setPreferredSize(new Dimension(525, 100)); |
|
107 |
setBorder( |
|
102 |
//**setLayout(new GridLayout(2,1)); |
|
103 |
//**setLayout(new FlowLayout(FlowLayout.LEADING,5,10)); |
|
104 |
//**setPreferredSize(new Dimension(525, 100)); |
|
105 |
setLayout(new BorderLayout()); |
|
106 |
setBorder( |
|
108 | 107 |
BorderFactory.createCompoundBorder( |
109 | 108 |
BorderFactory.createCompoundBorder( |
110 | 109 |
BorderFactory.createTitledBorder(PluginServices.getText(this,"recents_transformation")), |
111 | 110 |
BorderFactory.createEmptyBorder(2,2,2,2)), |
112 | 111 |
getBorder())); |
113 |
add(getJButtonInfo()); |
|
114 |
add(getJScrollPane()); |
|
112 |
JPanel p=new JPanel(); |
|
113 |
p.setLayout(new FlowLayout(FlowLayout.LEFT,10,10)); |
|
114 |
p.add(getJButtonInfo()); |
|
115 |
add(p,BorderLayout.NORTH); |
|
116 |
add(getJScrollPane(),BorderLayout.CENTER); |
|
115 | 117 |
//loadRecents(); |
116 | 118 |
} |
117 | 119 |
|
... | ... | |
125 | 127 |
Object[][]data = {}; |
126 | 128 |
dtm = new DefaultTableModel(data, columnNames) |
127 | 129 |
{ |
130 |
private static final long serialVersionUID = 1L; |
|
128 | 131 |
public boolean isCellEditable(int row, int column) { |
129 | 132 |
return false; |
130 | 133 |
} |
... | ... | |
168 | 171 |
private JScrollPane getJScrollPane() { |
169 | 172 |
if (jScrollPane == null) { |
170 | 173 |
jScrollPane = new JScrollPane(); |
171 |
jScrollPane.setPreferredSize(new Dimension(525,200)); |
|
174 |
//jScrollPane.setPreferredSize(new Dimension(525,200));
|
|
172 | 175 |
jScrollPane.setBorder( |
173 | 176 |
BorderFactory.createCompoundBorder( |
174 | 177 |
BorderFactory.createCompoundBorder( |
175 | 178 |
BorderFactory.createTitledBorder(PluginServices.getText(this,"transformations")), |
176 |
BorderFactory.createEmptyBorder(5,5,5,5)),
|
|
179 |
BorderFactory.createEmptyBorder(12,5,70,5)),
|
|
177 | 180 |
jScrollPane.getBorder())); |
178 | 181 |
jScrollPane.setViewportView(getJTable()); |
179 | 182 |
} |
... | ... | |
183 | 186 |
public JButton getJButtonInfo() { |
184 | 187 |
if(JButtonInfo == null) { |
185 | 188 |
JButtonInfo = new JButton(); |
186 |
JButtonInfo.setPreferredSize(new Dimension(200,20));
|
|
189 |
//Poner: JButtonInfo.setPreferredSize(new Dimension(100,20));
|
|
187 | 190 |
JButtonInfo.setText(PluginServices.getText(this,"info_transformations")); |
188 | 191 |
JButtonInfo.setMnemonic('I'); |
189 | 192 |
JButtonInfo.setEnabled(false); |
... | ... | |
202 | 205 |
crs = new CrsFactory().getCRS(getCode(), |
203 | 206 |
getWKT(),getParams()); |
204 | 207 |
} catch (CrsException e) { |
205 |
// TODO Auto-generated catch block |
|
206 | 208 |
e.printStackTrace(); |
207 | 209 |
} |
208 | 210 |
return crs; |
... | ... | |
367 | 369 |
* Carga en la tabla los CRSs leidos del sistema de persistencia. |
368 | 370 |
*/ |
369 | 371 |
public void loadRecents(int source, int target){ |
372 |
|
|
373 |
// Eliminar filas en cada nueva bsqueda |
|
374 |
int numRow = dtm.getRowCount(); |
|
375 |
while (numRow != 0) { |
|
376 |
numRow = numRow - 1; |
|
377 |
dtm.removeRow(numRow); |
|
378 |
} |
|
370 | 379 |
RecentTrsPersistence persistence = new RecentTrsPersistence(RecentCRSsPersistence.pluginClassInstance); |
371 | 380 |
trDataArray = persistence.getArrayOfTrData(); |
372 | 381 |
|
Also available in: Unified diff