Statistics
| Revision:

root / branches / F2 / extensions / extJCRS / src / org / gvsig / crs / gui / CRSSelectionTrDialog.java @ 10786

History | View | Annotate | Download (3.04 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

    
41
package org.gvsig.crs.gui;
42

    
43
import javax.swing.JPanel;
44

    
45
import org.gvsig.crs.CrsWkt;
46
import org.gvsig.crs.ICrs;
47
import org.gvsig.crs.persistence.CrsData;
48
import org.gvsig.crs.persistence.RecentCRSsPersistence;
49

    
50
import com.iver.andami.PluginServices;
51
import com.iver.andami.ui.mdiManager.IWindow;
52
import com.iver.cit.gvsig.project.documents.view.gui.View;
53

    
54
/**
55
 * Di?logo contenedor del panel de la selecci?n de CRS y transformaci?n
56
 * de la capa a a?adir
57
 * 
58
 * @author Jos? Luis G?mez Mart?nez
59
 *
60
 */
61

    
62
public class CRSSelectionTrDialog extends JPanel {
63
        
64
        private static final long serialVersionUID = 1L;
65
        
66
        JPanel contentPane = null;
67
        ICrs curProj = null;
68

    
69
        public CRSSelectionTrDialog(ICrs proj) {
70
                super(false);
71
                curProj = proj;
72
                CrsData crsData = new CrsData(proj.getCrsWkt().getAuthority()[0], proj.getCode(),proj.getCrsWkt().getName());
73
                RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
74
                persistence.addCrsData(crsData);
75
                inicializate();
76
        }
77
        public void inicializate(){
78
                this.add(getContentPanel(), null);        
79
        }
80
                        
81
    public CRSMainTrPanel getProjPanel() {
82
        return (CRSMainTrPanel) getContentPanel();
83
    }
84

    
85
        public JPanel getContentPanel() {
86
            if (contentPane == null) {                    
87
                    IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
88
                    View activeView = (com.iver.cit.gvsig.project.documents.view.gui.View) activeWindow;
89
                    int target = ((ICrs) activeView.getMapControl().getProjection()).getCode();
90
                    CrsWkt crsWktTarget = ((ICrs) activeView.getMapControl().getProjection()).getCrsWkt();
91
                    if (crsWktTarget.getDatumName().equals("")){                            
92
                    }
93
                contentPane = new CRSMainTrPanel(target, crsWktTarget, curProj);                
94
                                  
95
       }
96
           return contentPane;
97
    }
98
        
99
}