Revision 10786 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/CrsRecentsPanel.java
CrsRecentsPanel.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 | 45 |
|
46 |
|
|
47 | 47 |
import javax.swing.BorderFactory; |
48 | 48 |
import javax.swing.JLabel; |
49 | 49 |
import javax.swing.JPanel; |
50 | 50 |
import javax.swing.JScrollPane; |
51 | 51 |
import javax.swing.JTable; |
52 | 52 |
import javax.swing.ListSelectionModel; |
53 |
|
|
53 | 54 |
import javax.swing.table.DefaultTableModel; |
54 | 55 |
import javax.swing.table.TableColumn; |
55 | 56 |
|
... | ... | |
68 | 69 |
* |
69 | 70 |
* @author Jos? Luis G?mez Mart?nez (jolugomar@gmail.com) |
70 | 71 |
* @author Diego Guerrero Sevilla (diego.guerrero@uclm.es) |
72 |
* @author Luisa Marina Fern?ndez (luisam.fernandez@uclm.es) |
|
71 | 73 |
* |
72 | 74 |
*/ |
73 | 75 |
public class CrsRecentsPanel extends JPanel { |
... | ... | |
94 | 96 |
} |
95 | 97 |
|
96 | 98 |
private void initialize(){ |
97 |
this.setLayout(new GridLayout(1,2)); |
|
98 |
this.setLayout(new FlowLayout(FlowLayout.LEFT,10,10)); |
|
99 |
this.add(getJLabel(), null); |
|
100 |
this.add(getJScrollPane(), null); |
|
99 |
this.setLayout(new BorderLayout()); |
|
100 |
JPanel p=new JPanel(new FlowLayout(FlowLayout.LEFT,15,15)); |
|
101 |
p.add(getJLabel()); |
|
102 |
this.add(p, BorderLayout.NORTH); |
|
103 |
this.add(getJScrollPane(), BorderLayout.CENTER); |
|
101 | 104 |
} |
102 | 105 |
|
103 | 106 |
private JLabel getJLabel(){ |
104 | 107 |
JLabel label = new JLabel(); |
105 |
label.setPreferredSize(new Dimension(500, 30)); |
|
106 | 108 |
label.setText(PluginServices.getText(this, "ultimos_crs_utilizados")+":"); |
107 | 109 |
return label; |
108 | 110 |
} |
109 |
|
|
111 |
/** |
|
112 |
* Inicializa el panel que contiene la tabla con los crs |
|
113 |
* @return |
|
114 |
*/ |
|
110 | 115 |
private JScrollPane getJScrollPane() { |
111 | 116 |
if (jScrollPane == null) { |
112 | 117 |
jScrollPane = new JScrollPane(); |
113 |
jScrollPane.setPreferredSize(new Dimension(500,150)); |
|
114 | 118 |
jScrollPane.setBorder( |
115 |
BorderFactory.createCompoundBorder( |
|
116 |
BorderFactory.createCompoundBorder( |
|
117 |
BorderFactory.createTitledBorder(PluginServices.getText(this,"coordinate_reference_systems")), |
|
118 |
BorderFactory.createEmptyBorder(5,5,5,5)), |
|
119 |
jScrollPane.getBorder())); |
|
119 |
BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,3,3,3),jScrollPane.getBorder())); |
|
120 | 120 |
jScrollPane.setViewportView(getJTable()); |
121 | 121 |
} |
122 | 122 |
return jScrollPane; |
123 | 123 |
} |
124 |
|
|
124 |
/** |
|
125 |
* Inicializa la tabla que contiene los crs |
|
126 |
* @return |
|
127 |
*/ |
|
125 | 128 |
public JTable getJTable() { |
126 | 129 |
if (jTable == null) { |
127 | 130 |
String[] columnNames= {PluginServices.getText(this,"fuente"), |
... | ... | |
130 | 133 |
Object[][]data = {}; |
131 | 134 |
dtm = new DefaultTableModel(data, columnNames) |
132 | 135 |
{ |
136 |
private static final long serialVersionUID = 1L; |
|
133 | 137 |
public boolean isCellEditable(int row, int column) { |
134 | 138 |
return false; |
135 | 139 |
} |
... | ... | |
217 | 221 |
try { |
218 | 222 |
crs = new CrsFactory().getCRS(authority+":"+String.valueOf(codeCRS)); |
219 | 223 |
} catch (CrsException e) { |
220 |
// TODO Auto-generated catch block |
|
221 | 224 |
e.printStackTrace(); |
222 | 225 |
} |
223 | 226 |
} |
Also available in: Unified diff