Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / saveraster / ui / info / EndInfoPanel.java @ 11307

History | View | Annotate | Download (8.16 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2007 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
package org.gvsig.rastertools.saveraster.ui.info;
20

    
21
import java.awt.FlowLayout;
22
import java.awt.GridBagConstraints;
23
import java.awt.GridBagLayout;
24

    
25
import javax.swing.JButton;
26
import javax.swing.JLabel;
27
import javax.swing.JPanel;
28

    
29
/**
30
 * Panel principal del dialogo de finalizaci?n del salvado a raster. En el se muestra 
31
 * la informaci?n de nombre de fichero, tama?o de este, tiempo de la operaci?n, etc...
32
 * 
33
 * @version 18/04/2007
34
 * @author Nacho Brodin (nachobrodin@gmail.com)
35
 *
36
 */
37
public class EndInfoPanel extends JPanel {
38

    
39
        private JPanel pFile = null;
40
        private JPanel pTime = null;
41
        private JPanel pButtons = null;
42
        private JLabel lTimeTag = null;
43
        private JButton jButton = null;
44
        private JPanel pCompression = null;
45
        private JLabel lFileNameTag = null;
46
        private JLabel lSize = null;
47
        private JLabel lSizeTag = null;
48
        private JLabel lTime = null;
49
        private JLabel lCompressTag = null;
50
        private JLabel lCompress = null;
51
        private JPanel jPanel = null;
52
        private JPanel pMain = null;
53
        private JLabel lFile = null;
54
        /**
55
         * This is the default constructor
56
         */
57
        public EndInfoPanel() {
58
                super();
59
                initialize();
60
        }
61

    
62
        /**
63
         * This method initializes this
64
         * 
65
         * @return void
66
         */
67
        private void initialize() {
68
                GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
69
                gridBagConstraints4.gridx = 0;
70
                gridBagConstraints4.gridy = 0;
71
                GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
72
                gridBagConstraints2.gridx = 0;
73
                gridBagConstraints2.gridy = 1;
74
                this.setLayout(new GridBagLayout());
75
                this.setSize(482, 130);
76
                this.setPreferredSize(new java.awt.Dimension(472,75));
77
                this.add(getJPanel12(), gridBagConstraints4);
78
                this.add(getJPanel2(), gridBagConstraints2);
79
        }
80

    
81
        /**
82
         * This method initializes jPanel        
83
         *         
84
         * @return javax.swing.JPanel        
85
         */
86
        private JPanel getJPanel() {
87
                if (pFile == null) {
88
                        lFile = new JLabel();
89
                        lFile.setText("");
90
                        lFile.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
91
                        lFile.setPreferredSize(new java.awt.Dimension(410,15));
92
                        FlowLayout flowLayout = new FlowLayout();
93
                        flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
94
                        flowLayout.setHgap(5);
95
                        pFile = new JPanel();
96
                        pFile.setLayout(flowLayout);
97
                        pFile.setPreferredSize(new java.awt.Dimension(472,25));
98
                        lFileNameTag = new JLabel();
99
                        lFileNameTag.setText("File:");
100
                        pFile.add(lFileNameTag, null);
101
                        pFile.add(lFile, null);
102
                }
103
                return pFile;
104
        }
105

    
106
        /**
107
         * This method initializes jPanel1        
108
         *         
109
         * @return javax.swing.JPanel        
110
         */
111
        private JPanel getJPanel1() {
112
                if (pTime == null) {
113
                        lTime = new JLabel();
114
                        lTime.setText("");
115
                        lTime.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
116
                        lTime.setPreferredSize(new java.awt.Dimension(170,15));
117
                        lSizeTag = new JLabel();
118
                        lSizeTag.setText("Size: ");
119
                        FlowLayout flowLayout1 = new FlowLayout();
120
                        flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
121
                        flowLayout1.setHgap(5);
122
                        lSize = new JLabel();
123
                        lSize.setText("");
124
                        lSize.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
125
                        lSize.setPreferredSize(new java.awt.Dimension(170,15));
126
                        lTimeTag = new JLabel();
127
                        lTimeTag.setText("Time:");
128
                        pTime = new JPanel();
129
                        pTime.setLayout(flowLayout1);
130
                        pTime.setPreferredSize(new java.awt.Dimension(472,25));
131
                        pTime.add(lTimeTag, null);
132
                        pTime.add(lTime, null);
133
                        pTime.add(lSizeTag, null);
134
                        pTime.add(lSize, null);
135
                }
136
                return pTime;
137
        }
138

    
139
        /**
140
         * This method initializes jPanel2        
141
         *         
142
         * @return javax.swing.JPanel        
143
         */
144
        private JPanel getJPanel2() {
145
                if (pButtons == null) {
146
                        FlowLayout flowLayout2 = new FlowLayout();
147
                        flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
148
                        flowLayout2.setHgap(15);
149
                        pButtons = new JPanel();
150
                        pButtons.setLayout(flowLayout2);
151
                        pButtons.setPreferredSize(new java.awt.Dimension(472,30));
152
                        pButtons.add(getBAccept(), null);
153
                }
154
                return pButtons;
155
        }
156

    
157
        /**
158
         * This method initializes jButton        
159
         *         
160
         * @return javax.swing.JButton        
161
         */
162
        public JButton getBAccept() {
163
                if (jButton == null) {
164
                        jButton = new JButton();
165
                        jButton.setText("Aceptar");
166
                }
167
                return jButton;
168
        }
169

    
170
        /**
171
         * This method initializes jPanel        
172
         *         
173
         * @return javax.swing.JPanel        
174
         */
175
        private JPanel getJPanel3() {
176
                if (pCompression == null) {
177
                        FlowLayout flowLayout3 = new FlowLayout();
178
                        flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
179
                        flowLayout3.setHgap(5);
180
                        lCompress = new JLabel();
181
                        lCompress.setText("");
182
                        lCompress.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
183
                        lCompress.setPreferredSize(new java.awt.Dimension(50,15));
184
                        lCompressTag = new JLabel();
185
                        lCompressTag.setText("Compression:");
186
                        pCompression = new JPanel();
187
                        pCompression.setLayout(flowLayout3);
188
                        pCompression.setPreferredSize(new java.awt.Dimension(472,25));
189
                        pCompression.add(lCompressTag, null);
190
                        pCompression.add(lCompress, null);
191
                }
192
                return pCompression;
193
        }
194

    
195
        /**
196
         * This method initializes jPanel        
197
         *         
198
         * @return javax.swing.JPanel        
199
         */
200
        private JPanel getJPanel4() {
201
                if (jPanel == null) {
202
                        jPanel = new JPanel();
203
                        jPanel.setPreferredSize(new java.awt.Dimension(472,0));
204
                }
205
                return jPanel;
206
        }
207
        
208
        /**
209
         * This method initializes jPanel1        
210
         *         
211
         * @return javax.swing.JPanel        
212
         */
213
        private JPanel getJPanel12() {
214
                if (pMain == null) {
215
                        GridBagConstraints gridBagConstraints = new GridBagConstraints();
216
                        gridBagConstraints.gridx = 0;
217
                        gridBagConstraints.gridy = 0;
218
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
219
                        gridBagConstraints1.gridx = 0;
220
                        gridBagConstraints1.gridy = 1;
221
                        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
222
                        gridBagConstraints3.gridx = 0;
223
                        gridBagConstraints3.gridy = 3;
224
                        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
225
                        gridBagConstraints11.gridx = 0;
226
                        gridBagConstraints11.gridy = 2;
227
                        pMain = new JPanel();
228
                        pMain.setLayout(new GridBagLayout());
229
                        pMain.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1), "Estadisticas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
230
                        pMain.setPreferredSize(new java.awt.Dimension(482,100));
231
                        pMain.add(getJPanel4(), gridBagConstraints3);
232
                        pMain.add(getJPanel3(), gridBagConstraints11);
233
                        pMain.add(getJPanel1(), gridBagConstraints1);
234
                        pMain.add(getJPanel(), gridBagConstraints);
235
                }
236
                return pMain;
237
        }
238
        
239
        //---------------------------
240

    
241
        protected JLabel getLCompressTag() {
242
                return lCompressTag;
243
        }
244

    
245
        protected JLabel getLFileNameTag() {
246
                return lFileNameTag;
247
        }
248

    
249
        protected JLabel getLSizeTag() {
250
                return lSizeTag;
251
        }
252

    
253
        protected JLabel getLTimeTag() {
254
                return lTimeTag;
255
        }
256

    
257
        public JLabel getLCompress() {
258
                return lCompress;
259
        }
260

    
261
        public void setFileName(String fileName) {
262
                lFile.setText(fileName);
263
        }
264

    
265
        /**
266
         * Asigna el tama?o del fichero que ha sido salvado. Se pasa como par?metro el
267
         * String que ser? mostrado en el panel
268
         * @param size Longitud en bytes.
269
         */
270
        public void setSize(String size) {
271
                lSize.setText(size);        
272
        }
273

    
274
        /**
275
         * Asigna el tiempo que ha tardado para la compresi?n en milisegundos.
276
         * Se asignar? directamente el par?metro pasado.
277
         * @param time Tiempo en milisegundos
278
         */
279
        public void setTime(String time){
280
                lTime.setText(time);
281
        }
282
                
283
        /**
284
         *
285
         * @param comp
286
         */
287
        public void setCompression(boolean comp){
288
                if(comp)
289
                        lCompress.setText("Yes");
290
                else
291
                        lCompress.setText("No");
292
        }
293

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