Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / info / gui / CSSelectionDialog.java @ 24986

History | View | Annotate | Download (2 KB)

1
/*
2
 * Created on 26-ene-2005
3
 */
4
package com.iver.cit.gvsig.project.documents.view.info.gui;
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.IWindow;
11
import com.iver.andami.ui.mdiManager.WindowInfo;
12

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

    
21
        /**
22
         * 
23
         */
24
        public CSSelectionDialog() {
25
                super();
26
                this.init();
27
        }
28
        /**
29
         * This method initializes this
30
         * 
31
         * @return void
32
         */
33
        private void init() {
34
        this.setBounds(0, 0, 338, 260);
35
        getAcceptButton().addActionListener(new java.awt.event.ActionListener() {
36
            public void actionPerformed(java.awt.event.ActionEvent e) {
37
                PluginServices.getMDIManager().closeWindow(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
                setProjection(lastProj);
44
                PluginServices.getMDIManager().closeWindow(CSSelectionDialog.this);
45
                okPressed = false;
46
            }
47
        });
48
        }
49
        /* (non-Javadoc)
50
         * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
51
         */
52
        public WindowInfo getWindowInfo() {
53
                WindowInfo m_viewinfo=new WindowInfo(WindowInfo.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
        public Object getWindowProfile() {
74
                return WindowInfo.DIALOG_PROFILE;
75
        }
76
}