root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / InitialWarningExtension.java @ 9212
History | View | Annotate | Download (4.76 KB)
1 | 5464 | jaume | /* 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$
|
||
45 | * $Log$
|
||
46 | 7738 | jaume | * Revision 1.4 2006-10-02 13:52:34 jaume
|
47 | * organize impots
|
||
48 | *
|
||
49 | * Revision 1.3 2006/08/29 07:56:27 cesar
|
||
50 | 6880 | cesar | * Rename the *View* family of classes to *Window* (ie: SingletonView to SingletonWindow, ViewInfo to WindowInfo, etc)
|
51 | *
|
||
52 | * Revision 1.2 2006/08/29 07:13:53 cesar
|
||
53 | 6877 | cesar | * Rename class com.iver.andami.ui.mdiManager.View to com.iver.andami.ui.mdiManager.IWindow
|
54 | *
|
||
55 | * Revision 1.1 2006/05/25 16:27:21 jaume
|
||
56 | 5464 | jaume | * *** empty log message ***
|
57 | *
|
||
58 | *
|
||
59 | */
|
||
60 | package com.iver.cit.gvsig; |
||
61 | |||
62 | import javax.swing.JButton; |
||
63 | import javax.swing.JCheckBox; |
||
64 | import javax.swing.JLabel; |
||
65 | import javax.swing.JPanel; |
||
66 | |||
67 | import com.iver.andami.PluginServices; |
||
68 | import com.iver.andami.plugins.Extension; |
||
69 | 6877 | cesar | import com.iver.andami.ui.mdiManager.IWindow; |
70 | 6880 | cesar | import com.iver.andami.ui.mdiManager.WindowInfo; |
71 | 5464 | jaume | |
72 | public class InitialWarningExtension extends Extension { |
||
73 | // public static Preferences fPrefs = Preferences.userRoot().node( "gvsig.initial_warkning" );
|
||
74 | // private boolean show = fPrefs.getBoolean( "show_panel", true);
|
||
75 | private DlgWaring dlgWarning;
|
||
76 | /**
|
||
77 | * @see com.iver.andami.plugins.IExtension#isEnabled()
|
||
78 | */
|
||
79 | public boolean isEnabled() { |
||
80 | return true; |
||
81 | } |
||
82 | |||
83 | /**
|
||
84 | * @see com.iver.mdiApp.plugins.IExtension#isVisible()
|
||
85 | */
|
||
86 | public boolean isVisible() { |
||
87 | return true; |
||
88 | } |
||
89 | |||
90 | /**
|
||
91 | * @see com.iver.andami.plugins.IExtension#initialize()
|
||
92 | */
|
||
93 | public void initialize() { |
||
94 | // if (show) {
|
||
95 | dlgWarning = new DlgWaring();
|
||
96 | dlgWarning.setText(PluginServices.getText(this, "initial_warning")); |
||
97 | 6880 | cesar | PluginServices.getMDIManager().addWindow(dlgWarning); |
98 | 5464 | jaume | // }
|
99 | |||
100 | } |
||
101 | |||
102 | /**
|
||
103 | * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
|
||
104 | */
|
||
105 | public void execute(String actionCommand) { |
||
106 | |||
107 | } |
||
108 | |||
109 | 6877 | cesar | private class DlgWaring extends JPanel implements IWindow{ |
110 | 5464 | jaume | |
111 | private JButton btnOk = null; |
||
112 | private JCheckBox chkBoxShowAgain = null; |
||
113 | private JLabel lblText = null; |
||
114 | |||
115 | /**
|
||
116 | * This is the default constructor
|
||
117 | */
|
||
118 | public DlgWaring() {
|
||
119 | super();
|
||
120 | initialize(); |
||
121 | } |
||
122 | |||
123 | public void setText(String string) { |
||
124 | lblText.setText(string); |
||
125 | } |
||
126 | |||
127 | /**
|
||
128 | * This method initializes this
|
||
129 | *
|
||
130 | * @return void
|
||
131 | */
|
||
132 | private void initialize() { |
||
133 | lblText = new JLabel(); |
||
134 | lblText.setBounds(15, 15, 271, 200); |
||
135 | lblText.setText("JLabel");
|
||
136 | this.setLayout(null); |
||
137 | this.setSize(300, 300); |
||
138 | this.add(getBtnOk(), null); |
||
139 | // this.add(getChkBoxShowAgain(), null);
|
||
140 | this.add(lblText, null); |
||
141 | } |
||
142 | |||
143 | /**
|
||
144 | * This method initializes btnOk
|
||
145 | *
|
||
146 | * @return javax.swing.JButton
|
||
147 | */
|
||
148 | private JButton getBtnOk() { |
||
149 | if (btnOk == null) { |
||
150 | btnOk = new JButton(); |
||
151 | btnOk.setBounds(100, 250, 100, 20); |
||
152 | btnOk.setText(PluginServices.getText(this, "aceptar")); |
||
153 | btnOk.addActionListener(new java.awt.event.ActionListener() {
|
||
154 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
155 | 6880 | cesar | PluginServices.getMDIManager().closeWindow(dlgWarning); |
156 | 5464 | jaume | } |
157 | }); |
||
158 | } |
||
159 | return btnOk;
|
||
160 | } |
||
161 | |||
162 | /**
|
||
163 | * This method initializes chkBoxShowAgain
|
||
164 | *
|
||
165 | * @return javax.swing.JCheckBox
|
||
166 | */
|
||
167 | // private JCheckBox getChkBoxShowAgain() {
|
||
168 | // if (chkBoxShowAgain == null) {
|
||
169 | // chkBoxShowAgain = new JCheckBox();
|
||
170 | // chkBoxShowAgain.setBounds(44, 116, 241, 21);
|
||
171 | // chkBoxShowAgain.setSelected(true);
|
||
172 | // chkBoxShowAgain.setText(PluginServices.getText(this, "show_this_dialog_next_startup"));
|
||
173 | // }
|
||
174 | // return chkBoxShowAgain;
|
||
175 | // }
|
||
176 | |||
177 | 6880 | cesar | public WindowInfo getWindowInfo() {
|
178 | WindowInfo vi = new WindowInfo(WindowInfo.MODALDIALOG);
|
||
179 | 5464 | jaume | vi.setWidth(300+8); |
180 | vi.setHeight(250);
|
||
181 | vi.setTitle(PluginServices.getText(this, "warning")); |
||
182 | return vi;
|
||
183 | } |
||
184 | |||
185 | } // @jve:decl-index=0:visual-constraint="10,10"
|
||
186 | |||
187 | } |