root / trunk / libraries / libCq_CMS_praster / src / org / cresques / ui / filter / KernelFiltersPanel.java @ 8026
History | View | Annotate | Download (3.79 KB)
1 |
/*
|
---|---|
2 |
* Created on 23-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.event.ActionEvent; |
26 |
import java.awt.event.ActionListener; |
27 |
|
28 |
import javax.swing.JComboBox; |
29 |
import javax.swing.JLabel; |
30 |
import javax.swing.JPanel; |
31 |
|
32 |
import org.cresques.ui.raster.BaseComponent; |
33 |
import org.gvsig.i18n.Messages; |
34 |
|
35 |
public class KernelFiltersPanel extends BaseComponent implements ActionListener { |
36 |
|
37 |
private JPanel jPanel = null; |
38 |
private JPanel jPanel1 = null; |
39 |
private JComboBox jComboBox = null; |
40 |
private JLabel jLabel = null; |
41 |
private JPanel jPanel2 = null; |
42 |
private JPanel jPanel3 = null; |
43 |
|
44 |
private int listCount = 0; |
45 |
|
46 |
/**
|
47 |
* This method initializes
|
48 |
* @param listCount Numero de elementos que tendr? el comboBox.
|
49 |
*/
|
50 |
public KernelFiltersPanel(int lCount) { |
51 |
super();
|
52 |
this.listCount = lCount;
|
53 |
initialize(); |
54 |
} |
55 |
|
56 |
/**
|
57 |
* This method initializes
|
58 |
*
|
59 |
*/
|
60 |
public KernelFiltersPanel() {
|
61 |
super();
|
62 |
initialize(); |
63 |
} |
64 |
|
65 |
/**
|
66 |
* This method initializes this
|
67 |
*
|
68 |
*/
|
69 |
private void initialize() { |
70 |
this.setPreferredSize(new java.awt.Dimension(445,239)); |
71 |
this.add(getJPanel1(), null); |
72 |
this.add(getJPanel(), null); |
73 |
|
74 |
} |
75 |
|
76 |
public void actionPerformed(ActionEvent e) { |
77 |
// TODO Auto-generated method stub
|
78 |
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* This method initializes jPanel
|
83 |
*
|
84 |
* @return javax.swing.JPanel
|
85 |
*/
|
86 |
private JPanel getJPanel() { |
87 |
if (jPanel == null) { |
88 |
jLabel = new JLabel(); |
89 |
jLabel.setText(Messages.getText("kernel_size")+":"); |
90 |
jLabel.setPreferredSize(new java.awt.Dimension(120,16)); |
91 |
jPanel = new JPanel(); |
92 |
jPanel.setPreferredSize(new java.awt.Dimension(400,150)); |
93 |
jPanel.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.lightGray,1));
|
94 |
jPanel.add(getJPanel2(), null);
|
95 |
jPanel.add(jLabel, null);
|
96 |
jPanel.add(getCbKernel(), null);
|
97 |
jPanel.add(getJPanel3(), null);
|
98 |
} |
99 |
return jPanel;
|
100 |
} |
101 |
|
102 |
/**
|
103 |
* This method initializes jPanel1
|
104 |
*
|
105 |
* @return javax.swing.JPanel
|
106 |
*/
|
107 |
private JPanel getJPanel1() { |
108 |
if (jPanel1 == null) { |
109 |
jPanel1 = new JPanel(); |
110 |
jPanel1.setPreferredSize(new java.awt.Dimension(400,40)); |
111 |
} |
112 |
return jPanel1;
|
113 |
} |
114 |
|
115 |
/**
|
116 |
* This method initializes jComboBox
|
117 |
*
|
118 |
* @return javax.swing.JComboBox
|
119 |
*/
|
120 |
public JComboBox getCbKernel() { |
121 |
if (jComboBox == null) { |
122 |
String [] lista = new String[listCount]; |
123 |
for (int i=0; i<listCount; i++) |
124 |
lista[i] = String.valueOf((i+1)*2+1); |
125 |
jComboBox = new JComboBox(lista); |
126 |
jComboBox.setPreferredSize(new java.awt.Dimension(50,25)); |
127 |
} |
128 |
return jComboBox;
|
129 |
} |
130 |
|
131 |
/**
|
132 |
* This method initializes jPanel2
|
133 |
*
|
134 |
* @return javax.swing.JPanel
|
135 |
*/
|
136 |
private JPanel getJPanel2() { |
137 |
if (jPanel2 == null) { |
138 |
jPanel2 = new JPanel(); |
139 |
jPanel2.setPreferredSize(new java.awt.Dimension(390,30)); |
140 |
} |
141 |
return jPanel2;
|
142 |
} |
143 |
|
144 |
/**
|
145 |
* This method initializes jPanel3
|
146 |
*
|
147 |
* @return javax.swing.JPanel
|
148 |
*/
|
149 |
private JPanel getJPanel3() { |
150 |
if (jPanel3 == null) { |
151 |
jPanel3 = new JPanel(); |
152 |
jPanel3.setPreferredSize(new java.awt.Dimension(150,10)); |
153 |
} |
154 |
return jPanel3;
|
155 |
} |
156 |
|
157 |
} |