Statistics
| Revision:

root / branches / v10 / applications / appgvSIG / src / com / iver / cit / gvsig / InitialWarningExtension.java @ 20910

History | View | Annotate | Download (4.84 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. 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
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41

    
42
/* CVS MESSAGES:
43
*
44
* $Id: InitialWarningExtension.java 8765 2006-11-15 00:08:29Z jjdelcerro $
45
* $Log$
46
* Revision 1.3.4.1  2006-11-15 00:08:08  jjdelcerro
47
* *** empty log message ***
48
*
49
* Revision 1.4  2006/10/02 13:52:34  jaume
50
* organize impots
51
*
52
* Revision 1.3  2006/08/29 07:56:27  cesar
53
* Rename the *View* family of classes to *Window* (ie: SingletonView to SingletonWindow, ViewInfo to WindowInfo, etc)
54
*
55
* Revision 1.2  2006/08/29 07:13:53  cesar
56
* Rename class com.iver.andami.ui.mdiManager.View to com.iver.andami.ui.mdiManager.IWindow
57
*
58
* Revision 1.1  2006/05/25 16:27:21  jaume
59
* *** empty log message ***
60
*
61
*
62
*/
63
package com.iver.cit.gvsig;
64

    
65
import javax.swing.JButton;
66
import javax.swing.JCheckBox;
67
import javax.swing.JLabel;
68
import javax.swing.JPanel;
69

    
70
import com.iver.andami.PluginServices;
71
import com.iver.andami.plugins.Extension;
72
import com.iver.andami.ui.mdiManager.IWindow;
73
import com.iver.andami.ui.mdiManager.WindowInfo;
74

    
75
public class InitialWarningExtension extends Extension {
76
//        public static Preferences fPrefs = Preferences.userRoot().node( "gvsig.initial_warkning" );
77
//        private boolean show = fPrefs.getBoolean( "show_panel", true);
78
        private DlgWaring dlgWarning;
79
    /**
80
         * @see com.iver.andami.plugins.IExtension#isEnabled()
81
         */
82
        public boolean isEnabled() {
83
                return true;
84
        }
85

    
86
        /**
87
         * @see com.iver.mdiApp.plugins.IExtension#isVisible()
88
         */
89
        public boolean isVisible() {
90
                return true;
91
        }
92

    
93
        /**
94
         * @see com.iver.andami.plugins.IExtension#initialize()
95
         */
96
        public void initialize() {
97
//                if (show) {
98
                        dlgWarning = new DlgWaring();
99
                        dlgWarning.setText(PluginServices.getText(this, "initial_warning"));
100
                        PluginServices.getMDIManager().addWindow(dlgWarning);
101
//                }
102
        
103
        }
104

    
105
        /**
106
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
107
         */
108
        public void execute(String actionCommand) {
109
                
110
        }
111
    
112
        private class DlgWaring extends JPanel implements IWindow{
113

    
114
                private JButton btnOk = null;
115
                private JCheckBox chkBoxShowAgain = null;
116
                private JLabel lblText = null;
117

    
118
                /**
119
                 * This is the default constructor
120
                 */
121
                public DlgWaring() {
122
                        super();
123
                        initialize();
124
                }
125

    
126
                public void setText(String string) {
127
                        lblText.setText(string);
128
                }
129

    
130
                /**
131
                 * This method initializes this
132
                 * 
133
                 * @return void
134
                 */
135
                private void initialize() {
136
                        lblText = new JLabel();
137
                        lblText.setBounds(15, 15, 271, 200);
138
                        lblText.setText("JLabel");
139
                        this.setLayout(null);
140
                        this.setSize(300, 300);
141
                        this.add(getBtnOk(), null);
142
//                        this.add(getChkBoxShowAgain(), null);
143
                        this.add(lblText, null);
144
                }
145

    
146
                /**
147
                 * This method initializes btnOk        
148
                 *         
149
                 * @return javax.swing.JButton        
150
                 */    
151
                private JButton getBtnOk() {
152
                        if (btnOk == null) {
153
                                btnOk = new JButton();
154
                                btnOk.setBounds(100, 250, 100, 20);
155
                                btnOk.setText(PluginServices.getText(this, "aceptar"));
156
                                btnOk.addActionListener(new java.awt.event.ActionListener() { 
157
                                        public void actionPerformed(java.awt.event.ActionEvent e) {    
158
                                                PluginServices.getMDIManager().closeWindow(dlgWarning);
159
                                        }
160
                                });
161
                        }
162
                        return btnOk;
163
                }
164

    
165
                /**
166
                 * This method initializes chkBoxShowAgain        
167
                 *         
168
                 * @return javax.swing.JCheckBox        
169
                 */    
170
//                private JCheckBox getChkBoxShowAgain() {
171
//                        if (chkBoxShowAgain == null) {
172
//                                chkBoxShowAgain = new JCheckBox();
173
//                                chkBoxShowAgain.setBounds(44, 116, 241, 21);
174
//                                chkBoxShowAgain.setSelected(true);
175
//                                chkBoxShowAgain.setText(PluginServices.getText(this, "show_this_dialog_next_startup"));
176
//                        }
177
//                        return chkBoxShowAgain;
178
//                }
179

    
180
                public WindowInfo getWindowInfo() {
181
                        WindowInfo vi = new WindowInfo(WindowInfo.MODALDIALOG);
182
                        vi.setWidth(300+8);
183
                        vi.setHeight(250);
184
                        vi.setTitle(PluginServices.getText(this, "warning"));
185
                        return vi;
186
                }
187

    
188
        }  //  @jve:decl-index=0:visual-constraint="10,10"
189

    
190
}