svn-gvsig-desktop / trunk / extensions / extRasterTools / src / com / iver / cit / gvsig / rasterTools / saveRaster / gui / ProgressSaveRasterPanel.java @ 4216
History | View | Annotate | Download (7.41 KB)
1 |
/*
|
---|---|
2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 |
*
|
4 |
* Copyright (C) 2004-5.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* cresques@gmail.com
|
23 |
*/
|
24 |
package com.iver.cit.gvsig.rasterTools.saveRaster.gui; |
25 |
|
26 |
import java.awt.BorderLayout; |
27 |
|
28 |
import javax.swing.JLabel; |
29 |
import javax.swing.JPanel; |
30 |
import javax.swing.JProgressBar; |
31 |
import java.awt.GridBagLayout; |
32 |
import java.awt.GridBagConstraints; |
33 |
import java.awt.FlowLayout; |
34 |
import javax.swing.JButton; |
35 |
|
36 |
|
37 |
/**
|
38 |
* Panel que contiene la barra de progreso para salvar a raster
|
39 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
40 |
*/
|
41 |
public class ProgressSaveRasterPanel extends JPanel { |
42 |
final private static long serialVersionUID = -3370601314380922368L; |
43 |
private JPanel pGeneral = null; |
44 |
private JProgressBar jProgressBar = null; |
45 |
|
46 |
private JPanel pBar = null; |
47 |
private JPanel pCancel = null; |
48 |
private JPanel pCurrentElement = null; |
49 |
private JPanel pWait = null; |
50 |
private JLabel lWait = null; |
51 |
private JButton bCancel = null; |
52 |
private JLabel lCurrentElement = null; |
53 |
private JPanel pPercent = null; |
54 |
private JLabel lPercent = null; |
55 |
|
56 |
/**
|
57 |
* This method initializes
|
58 |
*
|
59 |
*/
|
60 |
public ProgressSaveRasterPanel() {
|
61 |
super();
|
62 |
initialize(); |
63 |
} |
64 |
|
65 |
/**
|
66 |
* This method initializes this
|
67 |
*
|
68 |
* @return void
|
69 |
*/
|
70 |
private void initialize() { |
71 |
this.setSize(375, 130); |
72 |
this.setPreferredSize(new java.awt.Dimension(364,125)); |
73 |
this.add(getPGeneral(), null); |
74 |
} |
75 |
|
76 |
/**
|
77 |
* This method initializes jPanel
|
78 |
*
|
79 |
* @return javax.swing.JPanel
|
80 |
*/
|
81 |
private JPanel getPGeneral() { |
82 |
if (pGeneral == null) { |
83 |
GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
84 |
gridBagConstraints3.gridx = 0;
|
85 |
gridBagConstraints3.gridy = 0;
|
86 |
GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); |
87 |
gridBagConstraints21.gridx = 0;
|
88 |
gridBagConstraints21.gridy = 2;
|
89 |
GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); |
90 |
gridBagConstraints11.gridx = 0;
|
91 |
gridBagConstraints11.gridy = 3;
|
92 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
93 |
gridBagConstraints1.gridx = 0;
|
94 |
gridBagConstraints1.ipadx = -6;
|
95 |
gridBagConstraints1.gridy = 1;
|
96 |
pGeneral = new JPanel(); |
97 |
pGeneral.setLayout(new GridBagLayout()); |
98 |
pGeneral.setPreferredSize(new java.awt.Dimension(360,120)); |
99 |
pGeneral.add(getPBar(), gridBagConstraints1); |
100 |
pGeneral.add(getPCancel(), gridBagConstraints11); |
101 |
pGeneral.add(getPCurrentElement(), gridBagConstraints21); |
102 |
pGeneral.add(getPWait(), gridBagConstraints3); |
103 |
} |
104 |
|
105 |
return pGeneral;
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* This method initializes jProgressBar
|
110 |
*
|
111 |
* @return javax.swing.JProgressBar
|
112 |
*/
|
113 |
public JProgressBar getJProgressBar() { |
114 |
if (jProgressBar == null) { |
115 |
jProgressBar = new JProgressBar(); |
116 |
jProgressBar.setVisible(true);
|
117 |
jProgressBar.show(); |
118 |
jProgressBar.setValue(0);
|
119 |
jProgressBar.setPreferredSize(new java.awt.Dimension(350, 25)); |
120 |
} |
121 |
|
122 |
return jProgressBar;
|
123 |
} |
124 |
|
125 |
/**
|
126 |
* This method initializes jPanel2
|
127 |
*
|
128 |
* @return javax.swing.JPanel
|
129 |
*/
|
130 |
private JPanel getPBar() { |
131 |
if (pBar == null) { |
132 |
pBar = new JPanel(); |
133 |
pBar.add(getJProgressBar(), null);
|
134 |
} |
135 |
|
136 |
return pBar;
|
137 |
} |
138 |
|
139 |
/**
|
140 |
* This method initializes jPanel
|
141 |
*
|
142 |
* @return javax.swing.JPanel
|
143 |
*/
|
144 |
private JPanel getPCancel() { |
145 |
if (pCancel == null) { |
146 |
FlowLayout flowLayout1 = new FlowLayout(); |
147 |
flowLayout1.setAlignment(java.awt.FlowLayout.CENTER); |
148 |
pCancel = new JPanel(); |
149 |
pCancel.setLayout(flowLayout1); |
150 |
pCancel.setPreferredSize(new java.awt.Dimension(350,30)); |
151 |
pCancel.add(getBCancel(), null);
|
152 |
} |
153 |
return pCancel;
|
154 |
} |
155 |
|
156 |
/**
|
157 |
* This method initializes jPanel
|
158 |
*
|
159 |
* @return javax.swing.JPanel
|
160 |
*/
|
161 |
private JPanel getPCurrentElement() { |
162 |
if (pCurrentElement == null) { |
163 |
lCurrentElement = new JLabel(); |
164 |
lCurrentElement.setText("");
|
165 |
lCurrentElement.setPreferredSize(new java.awt.Dimension(340,15)); |
166 |
FlowLayout flowLayout2 = new FlowLayout(); |
167 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
168 |
pCurrentElement = new JPanel(); |
169 |
pCurrentElement.setLayout(flowLayout2); |
170 |
pCurrentElement.setPreferredSize(new java.awt.Dimension(350,25)); |
171 |
pCurrentElement.add(lCurrentElement, null);
|
172 |
} |
173 |
return pCurrentElement;
|
174 |
} |
175 |
|
176 |
/**
|
177 |
* This method initializes jPanel
|
178 |
*
|
179 |
* @return javax.swing.JPanel
|
180 |
*/
|
181 |
private JPanel getPWait() { |
182 |
if (pWait == null) { |
183 |
GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
184 |
gridBagConstraints2.gridx = 1;
|
185 |
gridBagConstraints2.gridy = 0;
|
186 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
187 |
gridBagConstraints.insets = new java.awt.Insets(2,2,2,2); |
188 |
gridBagConstraints.gridy = 0;
|
189 |
gridBagConstraints.gridx = 0;
|
190 |
lWait = new JLabel(); |
191 |
lWait.setText("Por favor, espere,...");
|
192 |
pWait = new JPanel(); |
193 |
pWait.setLayout(new GridBagLayout()); |
194 |
pWait.setPreferredSize(new java.awt.Dimension(350,25)); |
195 |
pWait.add(lWait, gridBagConstraints); |
196 |
pWait.add(getPPercent(), gridBagConstraints2); |
197 |
} |
198 |
return pWait;
|
199 |
} |
200 |
|
201 |
/**
|
202 |
* This method initializes jButton
|
203 |
*
|
204 |
* @return javax.swing.JButton
|
205 |
*/
|
206 |
public JButton getBCancel() { |
207 |
if (bCancel == null) { |
208 |
bCancel = new JButton(); |
209 |
bCancel.setPreferredSize(new java.awt.Dimension(110,20)); |
210 |
bCancel.setText("Cancelar");
|
211 |
} |
212 |
return bCancel;
|
213 |
} |
214 |
|
215 |
/**
|
216 |
* This method initializes jPanel
|
217 |
*
|
218 |
* @return javax.swing.JPanel
|
219 |
*/
|
220 |
private JPanel getPPercent() { |
221 |
if (pPercent == null) { |
222 |
lPercent = new JLabel(); |
223 |
lPercent.setText("0%");
|
224 |
lPercent.setPreferredSize(new java.awt.Dimension(35,15)); |
225 |
FlowLayout flowLayout = new FlowLayout(); |
226 |
flowLayout.setAlignment(java.awt.FlowLayout.RIGHT); |
227 |
pPercent = new JPanel(); |
228 |
pPercent.setLayout(flowLayout); |
229 |
pPercent.setPreferredSize(new java.awt.Dimension(230,25)); |
230 |
pPercent.add(lPercent, null);
|
231 |
} |
232 |
return pPercent;
|
233 |
} |
234 |
|
235 |
/**
|
236 |
* Obtiene la etiqueta del mensaje de espera
|
237 |
* @return JLabel que representa la etiqueta del mensaje de espera
|
238 |
*/
|
239 |
public JLabel getLabelWait(){ |
240 |
return lWait;
|
241 |
} |
242 |
|
243 |
/**
|
244 |
* Obtiene la etiqueta que marca el porcentaje
|
245 |
* @return JLabel que representa la etiqueta que marca el porcentaje
|
246 |
*/
|
247 |
public JLabel getLabelPercent(){ |
248 |
return lPercent;
|
249 |
} |
250 |
|
251 |
/**
|
252 |
* Obtiene la etiqueta del elemento actualmente analizado
|
253 |
* @return JLabel que representa la etiqueta del elemento actualmente analizado
|
254 |
*/
|
255 |
public JLabel getLabelCurrentElement(){ |
256 |
return lCurrentElement;
|
257 |
} |
258 |
|
259 |
} // @jve:decl-index=0:visual-constraint="10,10"
|