Revision 866 org.gvsig.proj/branches/refactor2018/org.gvsig.proj/org.gvsig.proj.swing/org.gvsig.proj.swing.impl/src/main/java/org/gvsig/proj/swing/impl/CrsSelectorView.java
CrsSelectorView.java | ||
---|---|---|
25 | 25 |
{ |
26 | 26 |
JPanel mainPanel = new JPanel(); |
27 | 27 |
JLabel lblCurrentCrs = new JLabel(); |
28 |
JTree treeResults = new JTree(); |
|
29 |
JTabbedPane pnlDetails = new JTabbedPane(); |
|
30 |
JPanel DescriptionTab = new JPanel(); |
|
31 |
JTextArea txtDescription = new JTextArea(); |
|
32 |
JPanel WktTab = new JPanel(); |
|
33 |
JTextArea txtCrsWkt = new JTextArea(); |
|
28 | 34 |
JPanel pnl_filter = new JPanel(); |
29 | 35 |
JButton btnSearch = new JButton(); |
30 | 36 |
JButton btnSearchRemove = new JButton(); |
... | ... | |
35 | 41 |
JPanel pnl_filterType = new JPanel(); |
36 | 42 |
JLabel lblFilterAlpha = new JLabel(); |
37 | 43 |
JLabel lblFilterSpatial = new JLabel(); |
38 |
JTree treeResults = new JTree(); |
|
39 | 44 |
JPanel grd_buttonBar = new JPanel(); |
40 | 45 |
JButton btnFavoritesAdd = new JButton(); |
41 | 46 |
JButton btnFavoritesRemove = new JButton(); |
42 | 47 |
JButton btnCrsAdd = new JButton(); |
43 | 48 |
JButton btnRecentCrsRemove = new JButton(); |
44 |
JTabbedPane DetailsPanel = new JTabbedPane(); |
|
45 |
JPanel DescriptionTab = new JPanel(); |
|
46 |
JTextArea txtDescription = new JTextArea(); |
|
47 |
JPanel WktTab = new JPanel(); |
|
48 |
JTextArea txtCrsWkt = new JTextArea(); |
|
49 | 49 |
|
50 | 50 |
/** |
51 | 51 |
* Default constructor |
... | ... | |
145 | 145 |
lblCurrentCrs.setText("Current coordinate system:"); |
146 | 146 |
mainPanel.add(lblCurrentCrs,cc.xy(2,8)); |
147 | 147 |
|
148 |
mainPanel.add(createpnl_filter(),cc.xy(2,2)); |
|
149 | 148 |
treeResults.setLargeModel(true); |
150 | 149 |
treeResults.setName("treeResults"); |
151 | 150 |
treeResults.setRootVisible(false); |
... | ... | |
156 | 155 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
157 | 156 |
mainPanel.add(jscrollpane1,cc.xy(2,4)); |
158 | 157 |
|
159 |
mainPanel.add(creategrd_buttonBar(),cc.xy(2,6)); |
|
160 |
DetailsPanel.setName("DetailsPanel"); |
|
161 |
DetailsPanel.setTabPlacement(JTabbedPane.BOTTOM); |
|
162 |
DetailsPanel.addTab("Description",null,createDescriptionTab()); |
|
163 |
DetailsPanel.addTab("WKT",null,createWktTab()); |
|
164 |
mainPanel.add(DetailsPanel,cc.xy(2,10)); |
|
158 |
pnlDetails.setName("pnlDetails"); |
|
159 |
pnlDetails.setTabPlacement(JTabbedPane.BOTTOM); |
|
160 |
pnlDetails.addTab("Description",null,createDescriptionTab()); |
|
161 |
pnlDetails.addTab("WKT",null,createWktTab()); |
|
162 |
mainPanel.add(pnlDetails,cc.xy(2,10)); |
|
165 | 163 |
|
164 |
mainPanel.add(createpnl_filter(),cc.xy(2,2)); |
|
165 |
mainPanel.add(creategrd_buttonBar(),cc.xy(2,6)); |
|
166 | 166 |
addFillComponents(mainPanel,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11 }); |
167 | 167 |
return mainPanel; |
168 | 168 |
} |
169 | 169 |
|
170 |
public JPanel createDescriptionTab() |
|
171 |
{ |
|
172 |
DescriptionTab.setName("DescriptionTab"); |
|
173 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
174 |
CellConstraints cc = new CellConstraints(); |
|
175 |
DescriptionTab.setLayout(formlayout1); |
|
176 |
|
|
177 |
txtDescription.setName("txtDescription"); |
|
178 |
txtDescription.setRows(4); |
|
179 |
txtDescription.setSelectionEnd(74); |
|
180 |
txtDescription.setSelectionStart(74); |
|
181 |
txtDescription.setText("Aqui vendria la informacion que tiene la descripcion del CRS del catalogo."); |
|
182 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
183 |
jscrollpane1.setViewportView(txtDescription); |
|
184 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
185 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
186 |
DescriptionTab.add(jscrollpane1,cc.xy(2,2)); |
|
187 |
|
|
188 |
addFillComponents(DescriptionTab,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
189 |
return DescriptionTab; |
|
190 |
} |
|
191 |
|
|
192 |
public JPanel createWktTab() |
|
193 |
{ |
|
194 |
WktTab.setName("WktTab"); |
|
195 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
196 |
CellConstraints cc = new CellConstraints(); |
|
197 |
WktTab.setLayout(formlayout1); |
|
198 |
|
|
199 |
txtCrsWkt.setLineWrap(true); |
|
200 |
txtCrsWkt.setName("txtCrsWkt"); |
|
201 |
txtCrsWkt.setRows(4); |
|
202 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
203 |
jscrollpane1.setViewportView(txtCrsWkt); |
|
204 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
205 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
206 |
WktTab.add(jscrollpane1,cc.xy(2,2)); |
|
207 |
|
|
208 |
addFillComponents(WktTab,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
209 |
return WktTab; |
|
210 |
} |
|
211 |
|
|
170 | 212 |
public JPanel createpnl_filter() |
171 | 213 |
{ |
172 | 214 |
pnl_filter.setName("pnl_filter"); |
... | ... | |
174 | 216 |
CellConstraints cc = new CellConstraints(); |
175 | 217 |
pnl_filter.setLayout(formlayout1); |
176 | 218 |
|
177 |
btnSearch.setIcon(loadImage("search.png")); |
|
178 | 219 |
btnSearch.setName("btnSearch"); |
179 | 220 |
btnSearch.setToolTipText("Search"); |
180 | 221 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
181 | 222 |
btnSearch.setBorder(emptyborder1); |
182 | 223 |
pnl_filter.add(btnSearch,cc.xy(6,1)); |
183 | 224 |
|
184 |
btnSearchRemove.setIcon(loadImage("search_remove.png")); |
|
185 | 225 |
btnSearchRemove.setName("btnSearchRemove"); |
186 | 226 |
btnSearchRemove.setToolTipText("Clear search"); |
187 | 227 |
EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2); |
188 | 228 |
btnSearchRemove.setBorder(emptyborder2); |
189 | 229 |
pnl_filter.add(btnSearchRemove,cc.xy(8,1)); |
190 | 230 |
|
191 |
btnFilterDropdown.setIcon(loadImage("dropdown.png")); |
|
192 | 231 |
btnFilterDropdown.setName("btnFilterDropdown"); |
193 | 232 |
EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2); |
194 | 233 |
btnFilterDropdown.setBorder(emptyborder3); |
... | ... | |
230 | 269 |
CellConstraints cc = new CellConstraints(); |
231 | 270 |
pnl_filterType.setLayout(formlayout1); |
232 | 271 |
|
233 |
lblFilterAlpha.setIcon(loadImage("filter_alpha.png")); |
|
234 | 272 |
lblFilterAlpha.setName("lblFilterAlpha"); |
235 | 273 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
236 | 274 |
lblFilterAlpha.setBorder(emptyborder1); |
237 | 275 |
pnl_filterType.add(lblFilterAlpha,cc.xy(1,1)); |
238 | 276 |
|
239 |
lblFilterSpatial.setIcon(loadImage("filter_spatial.png")); |
|
240 | 277 |
lblFilterSpatial.setName("lblFilterSpatial"); |
241 | 278 |
EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2); |
242 | 279 |
lblFilterSpatial.setBorder(emptyborder2); |
... | ... | |
253 | 290 |
CellConstraints cc = new CellConstraints(); |
254 | 291 |
grd_buttonBar.setLayout(formlayout1); |
255 | 292 |
|
256 |
btnFavoritesAdd.setIcon(loadImage("favourite_add.png")); |
|
257 | 293 |
btnFavoritesAdd.setName("btnFavoritesAdd"); |
258 | 294 |
btnFavoritesAdd.setToolTipText("Add selected CRS to favorites"); |
259 | 295 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
260 | 296 |
btnFavoritesAdd.setBorder(emptyborder1); |
261 | 297 |
grd_buttonBar.add(btnFavoritesAdd,cc.xy(8,1)); |
262 | 298 |
|
263 |
btnFavoritesRemove.setIcon(loadImage("favourite_remove.png")); |
|
264 | 299 |
btnFavoritesRemove.setName("btnFavoritesRemove"); |
265 | 300 |
btnFavoritesRemove.setToolTipText("Remove selected CRS from favorites"); |
266 | 301 |
EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2); |
267 | 302 |
btnFavoritesRemove.setBorder(emptyborder2); |
268 | 303 |
grd_buttonBar.add(btnFavoritesRemove,cc.xy(6,1)); |
269 | 304 |
|
270 |
btnCrsAdd.setIcon(loadImage("crs_add.png")); |
|
271 | 305 |
btnCrsAdd.setName("btnCrsAdd"); |
272 | 306 |
btnCrsAdd.setToolTipText("Create a new CRS"); |
273 | 307 |
EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2); |
274 | 308 |
btnCrsAdd.setBorder(emptyborder3); |
275 | 309 |
grd_buttonBar.add(btnCrsAdd,cc.xy(2,1)); |
276 | 310 |
|
277 |
btnRecentCrsRemove.setIcon(loadImage("recent_remove.png")); |
|
278 | 311 |
btnRecentCrsRemove.setName("btnRecentCrsRemove"); |
279 | 312 |
btnRecentCrsRemove.setToolTipText("Remove selected CRS from recents"); |
280 | 313 |
EmptyBorder emptyborder4 = new EmptyBorder(2,2,2,2); |
... | ... | |
285 | 318 |
return grd_buttonBar; |
286 | 319 |
} |
287 | 320 |
|
288 |
public JPanel createDescriptionTab() |
|
289 |
{ |
|
290 |
DescriptionTab.setName("DescriptionTab"); |
|
291 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
292 |
CellConstraints cc = new CellConstraints(); |
|
293 |
DescriptionTab.setLayout(formlayout1); |
|
294 |
|
|
295 |
txtDescription.setName("txtDescription"); |
|
296 |
txtDescription.setRows(4); |
|
297 |
txtDescription.setSelectionEnd(74); |
|
298 |
txtDescription.setSelectionStart(74); |
|
299 |
txtDescription.setText("Aqui vendria la informacion que tiene la descripcion del CRS del catalogo."); |
|
300 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
301 |
jscrollpane1.setViewportView(txtDescription); |
|
302 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
303 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
304 |
DescriptionTab.add(jscrollpane1,cc.xy(2,2)); |
|
305 |
|
|
306 |
addFillComponents(DescriptionTab,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
307 |
return DescriptionTab; |
|
308 |
} |
|
309 |
|
|
310 |
public JPanel createWktTab() |
|
311 |
{ |
|
312 |
WktTab.setName("WktTab"); |
|
313 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
314 |
CellConstraints cc = new CellConstraints(); |
|
315 |
WktTab.setLayout(formlayout1); |
|
316 |
|
|
317 |
txtCrsWkt.setLineWrap(true); |
|
318 |
txtCrsWkt.setName("txtCrsWkt"); |
|
319 |
txtCrsWkt.setRows(4); |
|
320 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
321 |
jscrollpane1.setViewportView(txtCrsWkt); |
|
322 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
323 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
324 |
WktTab.add(jscrollpane1,cc.xy(2,2)); |
|
325 |
|
|
326 |
addFillComponents(WktTab,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
327 |
return WktTab; |
|
328 |
} |
|
329 |
|
|
330 | 321 |
/** |
331 | 322 |
* Initializer |
332 | 323 |
*/ |
Also available in: Unified diff