root / trunk / libraries / libCq_CMS_praster / src / org / cresques / ui / filter / FirstDerivativePanel.java @ 8026
History | View | Annotate | Download (5.43 KB)
1 |
/*
|
---|---|
2 |
* Created on 22-ago-2006
|
3 |
*
|
4 |
*/
|
5 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
6 |
*
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
8 |
*
|
9 |
* This program is free software; you can redistribute it and/or
|
10 |
* modify it under the terms of the GNU General Public License
|
11 |
* as published by the Free Software Foundation; either version 2
|
12 |
* of the License, or (at your option) any later version.
|
13 |
*
|
14 |
* This program is distributed in the hope that it will be useful,
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
* GNU General Public License for more details.
|
18 |
*
|
19 |
* You should have received a copy of the GNU General Public License
|
20 |
* along with this program; if not, write to the Free Software
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
22 |
*/
|
23 |
package org.cresques.ui.filter; |
24 |
|
25 |
import java.awt.FlowLayout; |
26 |
import java.awt.event.ActionEvent; |
27 |
import java.awt.event.ActionListener; |
28 |
|
29 |
import javax.swing.JCheckBox; |
30 |
import javax.swing.JComboBox; |
31 |
import javax.swing.JLabel; |
32 |
import javax.swing.JPanel; |
33 |
import javax.swing.JTextField; |
34 |
|
35 |
import org.cresques.ui.raster.BaseComponent; |
36 |
import org.gvsig.i18n.Messages; |
37 |
|
38 |
public class FirstDerivativePanel extends BaseComponent implements ActionListener { |
39 |
|
40 |
private JPanel jPanel = null; |
41 |
private JPanel jPanel1 = null; |
42 |
private JLabel jLabel = null; |
43 |
private JComboBox jComboBox = null; |
44 |
private JLabel jLabel1 = null; |
45 |
private JCheckBox jCheckBox = null; |
46 |
private JLabel jLabel2 = null; |
47 |
private JPanel jPanel2 = null; |
48 |
private JLabel jLabel3 = null; |
49 |
private JTextField jTextField = null; |
50 |
private JPanel jPanel3 = null; |
51 |
|
52 |
/**
|
53 |
* This method initializes
|
54 |
*
|
55 |
*/
|
56 |
public FirstDerivativePanel() {
|
57 |
super();
|
58 |
initialize(); |
59 |
} |
60 |
|
61 |
/**
|
62 |
* This method initializes this
|
63 |
*
|
64 |
*/
|
65 |
private void initialize() { |
66 |
this.setLayout(new FlowLayout()); |
67 |
this.setSize(new java.awt.Dimension(445,239)); |
68 |
this.setPreferredSize(new java.awt.Dimension(445,239)); |
69 |
this.add(getJPanel(), null); |
70 |
this.add(getJPanel3(), null); |
71 |
this.add(getJPanel1(), null); |
72 |
if(!this.getCbUmbralizar().isSelected()){ |
73 |
getTUmbral().setEnabled(false);
|
74 |
jLabel3.setEnabled(false);
|
75 |
} |
76 |
|
77 |
} |
78 |
|
79 |
public void actionPerformed(ActionEvent e) { |
80 |
if(e.getSource() == getCbUmbralizar()){
|
81 |
if (getCbUmbralizar().isSelected()){
|
82 |
this.getTUmbral().setEnabled(true); |
83 |
this.jLabel3.setEnabled(true); |
84 |
} |
85 |
else{
|
86 |
this.getTUmbral().setEnabled(false); |
87 |
this.jLabel3.setEnabled(false); |
88 |
} |
89 |
} |
90 |
} |
91 |
|
92 |
/**
|
93 |
* This method initializes jPanel
|
94 |
*
|
95 |
* @return javax.swing.JPanel
|
96 |
*/
|
97 |
private JPanel getJPanel() { |
98 |
if (jPanel == null) { |
99 |
jLabel1 = new JLabel(); |
100 |
jLabel1.setText(Messages.getText("tipo_calculo")+":"); |
101 |
jLabel1.setPreferredSize(new java.awt.Dimension(390,30)); |
102 |
jLabel = new JLabel(); |
103 |
jLabel.setText("");
|
104 |
jLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEADING); |
105 |
jPanel = new JPanel(); |
106 |
jPanel.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.lightGray,1));
|
107 |
jPanel.setLayout(new FlowLayout()); |
108 |
jPanel.setPreferredSize(new java.awt.Dimension(400,100)); |
109 |
jPanel.add(jLabel, null);
|
110 |
jPanel.add(jLabel1, null);
|
111 |
jPanel.add(getJComboBox(), null);
|
112 |
} |
113 |
return jPanel;
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* This method initializes jPanel1
|
118 |
*
|
119 |
* @return javax.swing.JPanel
|
120 |
*/
|
121 |
private JPanel getJPanel1() { |
122 |
if (jPanel1 == null) { |
123 |
jLabel2 = new JLabel(); |
124 |
jLabel2.setText(Messages.getText("umbralizar")+":"); |
125 |
jLabel2.setPreferredSize(new java.awt.Dimension(350,16)); |
126 |
jPanel1 = new JPanel(); |
127 |
jPanel1.setPreferredSize(new java.awt.Dimension(400,100)); |
128 |
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.lightGray,1));
|
129 |
jPanel1.add(getCbUmbralizar(), null);
|
130 |
jPanel1.add(jLabel2, null);
|
131 |
jPanel1.add(getJPanel2(), null);
|
132 |
} |
133 |
return jPanel1;
|
134 |
} |
135 |
|
136 |
/**
|
137 |
* This method initializes jComboBox
|
138 |
*
|
139 |
* @return javax.swing.JComboBox
|
140 |
*/
|
141 |
private JComboBox getJComboBox() { |
142 |
if (jComboBox == null) { |
143 |
String [] lista = {Messages.getText("cuadratico"),Messages.getText("comparativo")}; |
144 |
jComboBox = new JComboBox(lista); |
145 |
jComboBox.setPreferredSize(new java.awt.Dimension(200,25)); |
146 |
} |
147 |
return jComboBox;
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* This method initializes jCheckBox
|
152 |
*
|
153 |
* @return javax.swing.JCheckBox
|
154 |
*/
|
155 |
public JCheckBox getCbUmbralizar() { |
156 |
if (jCheckBox == null) { |
157 |
jCheckBox = new JCheckBox(); |
158 |
jCheckBox.addActionListener(this);
|
159 |
} |
160 |
return jCheckBox;
|
161 |
} |
162 |
|
163 |
/**
|
164 |
* This method initializes jPanel2
|
165 |
*
|
166 |
* @return javax.swing.JPanel
|
167 |
*/
|
168 |
private JPanel getJPanel2() { |
169 |
if (jPanel2 == null) { |
170 |
jLabel3 = new JLabel(); |
171 |
jLabel3.setText(Messages.getText("umbral")+":"); |
172 |
jPanel2 = new JPanel(); |
173 |
jPanel2.setPreferredSize(new java.awt.Dimension(280,40)); |
174 |
jPanel2.add(jLabel3, null);
|
175 |
jPanel2.add(getTUmbral(), null);
|
176 |
} |
177 |
return jPanel2;
|
178 |
} |
179 |
|
180 |
/**
|
181 |
* This method initializes jTextField
|
182 |
*
|
183 |
* @return javax.swing.JTextField
|
184 |
*/
|
185 |
public JTextField getTUmbral() { |
186 |
if (jTextField == null) { |
187 |
jTextField = new JTextField(); |
188 |
jTextField.setPreferredSize(new java.awt.Dimension(40,20)); |
189 |
} |
190 |
return jTextField;
|
191 |
} |
192 |
|
193 |
/**
|
194 |
* This method initializes jPanel3
|
195 |
*
|
196 |
* @return javax.swing.JPanel
|
197 |
*/
|
198 |
private JPanel getJPanel3() { |
199 |
if (jPanel3 == null) { |
200 |
jPanel3 = new JPanel(); |
201 |
jPanel3.setPreferredSize(new java.awt.Dimension(400,15)); |
202 |
} |
203 |
return jPanel3;
|
204 |
} |
205 |
|
206 |
} // @jve:decl-index=0:visual-constraint="10,10"
|