root / trunk / libraries / libJCRS / src / org / gvsig / crs / gui / CRSSelectionTrDialog.java @ 8158
History | View | Annotate | Download (1.22 KB)
1 |
package org.gvsig.crs.gui; |
---|---|
2 |
|
3 |
import javax.swing.JPanel; |
4 |
|
5 |
import org.gvsig.crs.ICrs; |
6 |
|
7 |
import com.iver.andami.PluginServices; |
8 |
import com.iver.andami.ui.mdiManager.IWindow; |
9 |
import com.iver.cit.gvsig.gui.View; |
10 |
|
11 |
public class CRSSelectionTrDialog extends JPanel { |
12 |
|
13 |
private static final long serialVersionUID = 1L; |
14 |
|
15 |
JPanel contentPane = null; |
16 |
ICrs curProj = null;
|
17 |
|
18 |
public CRSSelectionTrDialog(ICrs proj) {
|
19 |
super(false); |
20 |
curProj = proj; |
21 |
inicializate(); |
22 |
} |
23 |
public void inicializate(){ |
24 |
this.add(getContentPanel(), null); |
25 |
} |
26 |
|
27 |
public CRSMainTrPanel getProjPanel() {
|
28 |
return (CRSMainTrPanel) getContentPanel();
|
29 |
} |
30 |
|
31 |
public JPanel getContentPanel() { |
32 |
if (contentPane == null) { |
33 |
IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow(); |
34 |
View activeView = (com.iver.cit.gvsig.gui.View) activeWindow;
|
35 |
int target = ((ICrs) activeView.getMapControl().getProjection()).getCode();
|
36 |
String datum = ((ICrs) activeView.getMapControl().getProjection()).getCrsWkt().getDatumName();
|
37 |
if (datum.equals("")){ |
38 |
datum = "EuropeanDatum1950";
|
39 |
} |
40 |
contentPane = new CRSMainTrPanel(target, datum, curProj);
|
41 |
|
42 |
} |
43 |
return contentPane;
|
44 |
} |
45 |
|
46 |
} |