Revision 38112 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/info/gui/CSSelectionDialog.java
CSSelectionDialog.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import org.cresques.cts.IProjection; |
9 | 9 |
import org.cresques.ui.cts.CSSelectionDialogPanel; |
10 |
|
|
10 | 11 |
import org.gvsig.andami.PluginServices; |
11 | 12 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
12 | 13 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
13 | 14 |
import org.gvsig.app.gui.panels.crs.ISelectCrsPanel; |
14 | 15 |
|
15 |
|
|
16 | 16 |
/** |
17 | 17 |
* @author Luis W. Sevilla (sevilla_lui@gva.es) |
18 | 18 |
*/ |
19 |
public class CSSelectionDialog |
|
20 |
extends CSSelectionDialogPanel implements IWindow, ISelectCrsPanel { |
|
21 |
private boolean okPressed = false; |
|
22 |
private IProjection lastProj = null; |
|
19 |
public class CSSelectionDialog extends CSSelectionDialogPanel implements |
|
20 |
IWindow, ISelectCrsPanel { |
|
23 | 21 |
|
24 |
/** |
|
22 |
private boolean okPressed = false; |
|
23 |
private IProjection lastProj = null; |
|
24 |
|
|
25 |
/** |
|
25 | 26 |
* |
26 | 27 |
*/ |
27 |
public CSSelectionDialog() { |
|
28 |
super(); |
|
29 |
this.init(); |
|
30 |
} |
|
31 |
/** |
|
32 |
* This method initializes this |
|
33 |
* |
|
34 |
* @return void |
|
35 |
*/ |
|
36 |
private void init() { |
|
37 |
this.setBounds(0, 0, 350, 260); |
|
38 |
this.setPreferredSize(new Dimension(350, 260)); |
|
39 |
getAcceptButton().addActionListener(new java.awt.event.ActionListener() { |
|
40 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
41 |
PluginServices.getMDIManager().closeWindow(CSSelectionDialog.this); |
|
42 |
okPressed = true; |
|
43 |
} |
|
44 |
}); |
|
45 |
getCancelButton().addActionListener(new java.awt.event.ActionListener() { |
|
46 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
47 |
setProjection(lastProj); |
|
48 |
PluginServices.getMDIManager().closeWindow(CSSelectionDialog.this); |
|
49 |
okPressed = false; |
|
50 |
} |
|
51 |
}); |
|
52 |
} |
|
53 |
/* (non-Javadoc) |
|
54 |
* @see com.iver.andami.ui.mdiManager.View#getViewInfo() |
|
55 |
*/ |
|
56 |
public WindowInfo getWindowInfo() { |
|
57 |
WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE); |
|
58 |
m_viewinfo.setTitle(PluginServices.getText(this, "selecciona_sistema_de_referencia")); |
|
59 |
return m_viewinfo; |
|
60 |
} |
|
28 |
public CSSelectionDialog() { |
|
29 |
super(); |
|
30 |
this.init(); |
|
31 |
} |
|
61 | 32 |
|
62 |
public boolean isOkPressed() { return okPressed; } |
|
33 |
/** |
|
34 |
* This method initializes this |
|
35 |
* |
|
36 |
* @return void |
|
37 |
*/ |
|
38 |
private void init() { |
|
39 |
getAcceptButton().addActionListener( |
|
40 |
new java.awt.event.ActionListener() { |
|
63 | 41 |
|
64 |
/** |
|
65 |
* @return |
|
66 |
*/ |
|
67 |
public IProjection getProjection() { |
|
68 |
return getProjPanel().getProjection(); |
|
69 |
} |
|
70 |
/** |
|
71 |
* @param proj |
|
72 |
*/ |
|
73 |
public void setProjection(IProjection proj) { |
|
74 |
lastProj = proj; |
|
75 |
getProjPanel().setProjection(proj); |
|
76 |
} |
|
42 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
43 |
PluginServices.getMDIManager().closeWindow( |
|
44 |
CSSelectionDialog.this); |
|
45 |
okPressed = true; |
|
46 |
} |
|
47 |
}); |
|
48 |
getCancelButton().addActionListener( |
|
49 |
new java.awt.event.ActionListener() { |
|
77 | 50 |
|
78 |
public Object getWindowProfile() { |
|
79 |
return WindowInfo.DIALOG_PROFILE; |
|
80 |
} |
|
51 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
52 |
setProjection(lastProj); |
|
53 |
PluginServices.getMDIManager().closeWindow( |
|
54 |
CSSelectionDialog.this); |
|
55 |
okPressed = false; |
|
56 |
} |
|
57 |
}); |
|
58 |
} |
|
59 |
|
|
60 |
public WindowInfo getWindowInfo() { |
|
61 |
WindowInfo m_viewinfo = |
|
62 |
new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE); |
|
63 |
m_viewinfo.setTitle(PluginServices.getText(this, |
|
64 |
"selecciona_sistema_de_referencia")); |
|
65 |
Dimension dim = getPreferredSize(); |
|
66 |
m_viewinfo.setWidth(dim.width); |
|
67 |
m_viewinfo.setHeight(dim.height); |
|
68 |
return m_viewinfo; |
|
69 |
} |
|
70 |
|
|
71 |
public boolean isOkPressed() { |
|
72 |
return okPressed; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* @return |
|
77 |
*/ |
|
78 |
public IProjection getProjection() { |
|
79 |
return getProjPanel().getProjection(); |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* @param proj |
|
84 |
*/ |
|
85 |
public void setProjection(IProjection proj) { |
|
86 |
lastProj = proj; |
|
87 |
getProjPanel().setProjection(proj); |
|
88 |
} |
|
89 |
|
|
90 |
public Object getWindowProfile() { |
|
91 |
return WindowInfo.DIALOG_PROFILE; |
|
92 |
} |
|
81 | 93 |
} |
Also available in: Unified diff