Statistics
| Revision:

root / trunk / extensions / extGeoreferencing / src / com / iver / cit / gvsig / gui / Panels / ErrorPointPanel.java @ 3142

History | View | Annotate | Download (6.94 KB)

1
package com.iver.cit.gvsig.gui.Panels;
2

    
3
import java.awt.FlowLayout;
4
import java.awt.GridBagConstraints;
5
import java.awt.GridBagLayout;
6

    
7
import javax.swing.JLabel;
8
import javax.swing.JPanel;
9
import javax.swing.JTextField;
10

    
11
import com.iver.andami.PluginServices;
12

    
13
import java.awt.Insets;
14
/**
15
 * Panel que contiene la informaci?n de cada punto. 
16
 * No contiene eventos, estos deben ser manejados desde la 
17
 * clase que lo llame.
18
 * 
19
 * @author Nacho Brodin (brodin_ign@gva.es)
20
 *
21
 */
22
public class ErrorPointPanel extends JPanel{
23

    
24
        private JPanel pInfoPoint = null;
25
        private JPanel pX = null;
26
        private JPanel pY = null;
27
        private JPanel pRms = null;
28
        private JPanel pTotal = null;
29
        private JTextField tResX = null;
30
        private JLabel lX = null;
31
        private JLabel lY = null;
32
        private JTextField tResY = null;
33
        private JLabel lRms = null;
34
        private JLabel lTotal = null;
35
        private JTextField tTotal = null;
36
        private JTextField tRms = null;
37

    
38
        
39
        
40
        private JPanel pError = null;
41
        /**
42
         * This is the default constructor
43
         */
44
        public ErrorPointPanel() {
45
                super();
46
                initialize();
47
        }
48

    
49
        /**
50
         * This method initializes this
51
         * 
52
         * @return void
53
         */
54
        private void initialize() {                
55
                GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
56
                GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
57
                gridBagConstraints6.insets = new java.awt.Insets(0,0,0,0);
58
                gridBagConstraints6.gridy = 1;
59
                gridBagConstraints6.gridx = 0;
60
                
61
                this.setLayout(new GridBagLayout());
62
                this.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0));
63
                this.setSize(new java.awt.Dimension(180,113));
64
                this.setPreferredSize(new java.awt.Dimension(180,120));
65
                gridBagConstraints4.gridx = 0;
66
                gridBagConstraints4.gridy = 0;
67
                this.add(getPTotal(), gridBagConstraints6);
68
                this.add(getPError(), gridBagConstraints4);
69
        }
70
        
71
        /**
72
         * This method initializes pX        
73
         *         
74
         * @return javax.swing.JPanel        
75
         */
76
        private JPanel getPX() {
77
                if (pX == null) {
78
                        lX = new JLabel();
79
                        lX.setText("Res X: ");
80
                        FlowLayout flowLayout2 = new FlowLayout();
81
                        flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
82
                        pX = new JPanel();
83
                        pX.setLayout(flowLayout2);
84
                        pX.setPreferredSize(new java.awt.Dimension(165,22));
85
                        flowLayout2.setHgap(0);
86
                        flowLayout2.setVgap(1);
87
                        pX.add(lX, null);
88
                        pX.add(getTResX(), null);
89
                }
90
                return pX;
91
        }
92

    
93
        /**
94
         * This method initializes pY        
95
         *         
96
         * @return javax.swing.JPanel        
97
         */
98
        private JPanel getPY() {
99
                if (pY == null) {
100
                        lY = new JLabel();
101
                        lY.setText("Res Y:");
102
                        FlowLayout flowLayout1 = new FlowLayout();
103
                        flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT);
104
                        pY = new JPanel();
105
                        pY.setLayout(flowLayout1);
106
                        pY.setPreferredSize(new java.awt.Dimension(165,22));
107
                        flowLayout1.setHgap(0);
108
                        flowLayout1.setVgap(1);
109
                        pY.add(lY, null);
110
                        pY.add(getTResY(), null);
111
                }
112
                return pY;
113
        }
114

    
115
        /**
116
         * This method initializes pLatitud        
117
         *         
118
         * @return javax.swing.JPanel        
119
         */
120
        private JPanel getPRms() {
121
                if (pRms == null) {
122
                        lRms = new JLabel();
123
                        lRms.setText("RMS:");
124
                        FlowLayout flowLayout3 = new FlowLayout();
125
                        flowLayout3.setAlignment(java.awt.FlowLayout.RIGHT);
126
                        pRms = new JPanel();
127
                        pRms.setLayout(flowLayout3);
128
                        pRms.setPreferredSize(new java.awt.Dimension(165,22));
129
                        flowLayout3.setHgap(0);
130
                        flowLayout3.setVgap(1);
131
                        pRms.add(lRms, null);
132
                        pRms.add(getTRMS(), null);
133
                }
134
                return pRms;
135
        }
136

    
137
        /**
138
         * This method initializes pLongitud        
139
         *         
140
         * @return javax.swing.JPanel        
141
         */
142
        private JPanel getPTotal() {
143
                if (pTotal == null) {
144
                        lTotal = new JLabel();
145
                        lTotal.setText(PluginServices.getText(this, "total")+":");
146
                        FlowLayout flowLayout4 = new FlowLayout();
147
                        flowLayout4.setAlignment(java.awt.FlowLayout.RIGHT);
148
                        pTotal = new JPanel();
149
                        pTotal.setLayout(flowLayout4);
150
                        pTotal.setPreferredSize(new java.awt.Dimension(180,22));
151
                        flowLayout4.setHgap(7);
152
                        flowLayout4.setVgap(1);
153
                        pTotal.add(lTotal, null);
154
                        pTotal.add(getTTotal(), null);
155
                }
156
                return pTotal;
157
        }
158
        
159
        /**
160
         * Este m?todo inicializa el campo de texto que tiene la coordenada en X 
161
         * de la vista. Controla que le sean introducidos valores numericos y
162
         * salva el valor que contiene en la capa.        
163
         *         
164
         * @return javax.swing.JTextField        
165
         */
166
        public JTextField getTResX() {
167
                if (tResX == null) {
168
                        tResX = new JTextField();
169
                        tResX.setPreferredSize(new java.awt.Dimension(110,19));
170
                }
171
                return tResX;
172
        }
173

    
174
        /**
175
         * Este m?todo inicializa el campo de texto que tiene la coordenada en Y 
176
         * de la vista. Controla que le sean introducidos valores numericos y
177
         * salva el valor que contiene en la capa.        
178
         *         
179
         * @return javax.swing.JTextField        
180
         */
181
        public JTextField getTResY() {
182
                if (tResY == null) {
183
                        tResY = new JTextField();
184
                        tResY.setPreferredSize(new java.awt.Dimension(110,19));
185
                }
186
                return tResY;
187
        }
188

    
189
        /**
190
         * Este m?todo inicializa el campo de texto que tiene la coordenada en Y 
191
         * del mundo real. Controla que le sean introducidos valores numericos y
192
         * salva el valor que contiene en la capa.        
193
         *         
194
         * @return javax.swing.JTextField        
195
         */
196
        public JTextField getTTotal() {
197
                if (tTotal == null) {
198
                        tTotal = new JTextField();
199
                        tTotal.setPreferredSize(new java.awt.Dimension(110,19));
200
                        tTotal.setHorizontalAlignment(javax.swing.JTextField.LEFT);
201
                }
202
                return tTotal;
203
        }
204

    
205
        /**
206
         * Este m?todo inicializa el campo de texto que tiene la coordenada en X 
207
         * del mundo real. Controla que le sean introducidos valores numericos y
208
         * salva el valor que contiene en la capa.
209
         *         
210
         * @return javax.swing.JTextField        
211
         */
212
        public JTextField getTRMS() {
213
                if (tRms == null) {
214
                        tRms = new JTextField();
215
                        tRms.setPreferredSize(new java.awt.Dimension(110,19));
216
                        tRms.setHorizontalAlignment(javax.swing.JTextField.LEFT);
217
                }
218
                return tRms;
219
        }
220
        
221
        
222
        /**
223
         * This method initializes jPanel        
224
         *         
225
         * @return javax.swing.JPanel        
226
         */    
227
        private JPanel getPError() {
228
                if (pError == null) {
229
                        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
230
                        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
231
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
232
                        pError = new JPanel();
233
                        pError.setLayout(new GridBagLayout());
234
                        gridBagConstraints1.gridx = 0;
235
                        gridBagConstraints1.gridy = 0;
236
                        gridBagConstraints1.ipadx = 0;
237
                        gridBagConstraints1.insets = new Insets(0, 0, 0, 0);
238
                        gridBagConstraints1.gridwidth = 2;
239
                        gridBagConstraints2.gridx = 0;
240
                        gridBagConstraints2.gridy = 1;
241
                        gridBagConstraints2.weighty = 0.0D;
242
                        gridBagConstraints2.insets = new Insets(0, 0, 0, 0);
243
                        gridBagConstraints3.gridx = 0;
244
                        gridBagConstraints3.gridy = 2;
245
                        gridBagConstraints3.weighty = 0.0D;
246
                        gridBagConstraints3.insets = new Insets(0, 0, 0, 0);
247
                        pError.setPreferredSize(new java.awt.Dimension(175,91));
248
                        pError.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Error", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
249
                        pError.add(getPX(), gridBagConstraints1);
250
                        pError.add(getPY(), gridBagConstraints2);
251
                        pError.add(getPRms(), gridBagConstraints3);
252
                }
253
                return pError;
254
        }
255
 }