Statistics
| Revision:

svn-gvsig-desktop / tags / Root_gvSIG_CAD_Layout_version / applications / appgvSIG / src / com / iver / cit / gvsig / gui / Dialogs / CSSelectionDialog.java @ 1648

History | View | Annotate | Download (1.89 KB)

1
/*
2
 * Created on 26-ene-2005
3
 */
4
package com.iver.cit.gvsig.gui.Dialogs;
5

    
6
import org.cresques.cts.IProjection;
7
import org.cresques.ui.cts.CSSelectionDialogPanel;
8

    
9
import com.iver.andami.PluginServices;
10
import com.iver.andami.ui.mdiManager.View;
11
import com.iver.andami.ui.mdiManager.ViewInfo;
12

    
13
/**
14
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
15
 */
16
public class CSSelectionDialog
17
        extends CSSelectionDialogPanel implements View {
18
        private boolean okPressed = false;
19
        private IProjection lastProj = null;
20

    
21
        /**
22
         * 
23
         */
24
        public CSSelectionDialog() {
25
                super();
26
                this.initialize();
27
        }
28
        /**
29
         * This method initializes this
30
         * 
31
         * @return void
32
         */
33
        private void initialize() {
34
        this.setBounds(0, 0, 323, 233);
35
        getAcceptButton().addActionListener(new java.awt.event.ActionListener() {
36
            public void actionPerformed(java.awt.event.ActionEvent e) {
37
                PluginServices.getMDIManager().closeView(CSSelectionDialog.this);
38
                okPressed = true;
39
            }
40
        });
41
        getCancelButton().addActionListener(new java.awt.event.ActionListener() {
42
            public void actionPerformed(java.awt.event.ActionEvent e) {
43
                PluginServices.getMDIManager().closeView(CSSelectionDialog.this);
44
                okPressed = false;
45
                setProjection(lastProj);
46
            }
47
        });
48
        }
49
        /* (non-Javadoc)
50
         * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
51
         */
52
        public ViewInfo getViewInfo() {
53
                ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
54
                   m_viewinfo.setTitle(PluginServices.getText(this, "selecciona_sistema_de_referencia"));
55
                return m_viewinfo;
56
        }
57

    
58
        public boolean isOkPressed() { return okPressed; }
59
        
60
        /**
61
         * @return
62
         */
63
        public IProjection getProjection() {
64
                return getProjPanel().getProjection();
65
        }
66
        /**
67
         * @param proj
68
         */
69
        public void setProjection(IProjection proj) {
70
                lastProj = proj;
71
                getProjPanel().setProjection(proj);
72
        }
73
}