root / trunk / extensions / extgvSIGPiloto-Raster / src / org / gvsig / rasterTools / raw / ui / main / OutputHeaderFormatPanel.java @ 9045
History | View | Annotate | Download (5.85 KB)
1 |
package org.gvsig.rasterTools.raw.ui.main; |
---|---|
2 |
|
3 |
import java.awt.Dimension; |
4 |
import java.awt.FlowLayout; |
5 |
import java.awt.GridBagConstraints; |
6 |
import java.awt.GridBagLayout; |
7 |
|
8 |
import javax.swing.JLabel; |
9 |
import javax.swing.JPanel; |
10 |
import javax.swing.JTextField; |
11 |
|
12 |
import org.gvsig.rasterTools.raw.tools.VRTFormatOptions; |
13 |
|
14 |
import com.iver.andami.PluginServices; |
15 |
import com.iver.utiles.swing.JComboBox; |
16 |
|
17 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
18 |
*
|
19 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
20 |
*
|
21 |
* This program is free software; you can redistribute it and/or
|
22 |
* modify it under the terms of the GNU General Public License
|
23 |
* as published by the Free Software Foundation; either version 2
|
24 |
* of the License, or (at your option) any later version.
|
25 |
*
|
26 |
* This program is distributed in the hope that it will be useful,
|
27 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
28 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
29 |
* GNU General Public License for more details.
|
30 |
*
|
31 |
* You should have received a copy of the GNU General Public License
|
32 |
* along with this program; if not, write to the Free Software
|
33 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
34 |
*
|
35 |
* For more information, contact:
|
36 |
*
|
37 |
* Generalitat Valenciana
|
38 |
* Conselleria d'Infraestructures i Transport
|
39 |
* Av. Blasco Ib??ez, 50
|
40 |
* 46010 VALENCIA
|
41 |
* SPAIN
|
42 |
*
|
43 |
* +34 963862235
|
44 |
* gvsig@gva.es
|
45 |
* www.gvsig.gva.es
|
46 |
*
|
47 |
* or
|
48 |
*
|
49 |
* IVER T.I. S.A
|
50 |
* Salamanca 50
|
51 |
* 46005 Valencia
|
52 |
* Spain
|
53 |
*
|
54 |
* +34 963163400
|
55 |
* dac@iver.es
|
56 |
*/
|
57 |
/* CVS MESSAGES:
|
58 |
*
|
59 |
* $Id: OutputHeaderFormatPanel.java 9045 2006-11-28 11:49:25Z nacho $
|
60 |
* $Log$
|
61 |
* Revision 1.1 2006-11-28 11:49:24 nacho
|
62 |
* *** empty log message ***
|
63 |
*
|
64 |
* Revision 1.1 2006/10/10 16:11:22 nacho
|
65 |
* *** empty log message ***
|
66 |
*
|
67 |
* Revision 1.3 2006/08/01 11:19:04 jorpiell
|
68 |
* Ajustado el tama?o de las ventanas
|
69 |
*
|
70 |
* Revision 1.2 2006/07/31 10:44:28 jorpiell
|
71 |
* Se ha a?adido el tama?o del fichero con un thread.
|
72 |
*
|
73 |
* Revision 1.1 2006/07/28 12:51:40 jorpiell
|
74 |
* Primer commit de las clases empleadas para abrir raw
|
75 |
*
|
76 |
*
|
77 |
*/
|
78 |
/**
|
79 |
* This class implements one part of the open raw file panel.
|
80 |
* It contains the combobox to select the "output header format".
|
81 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
82 |
*/
|
83 |
public class OutputHeaderFormatPanel extends JPanel{ |
84 |
private JPanel labelsPanel = null; |
85 |
private JPanel fieldsPanel = null; |
86 |
private JPanel OutputFormatTextPanel = null; |
87 |
private JPanel outputFormatLabelPanel = null; |
88 |
private JLabel outputFormatLabel = null; |
89 |
private JComboBox outputFormatText = null; |
90 |
private final int WIDTH = 510; |
91 |
private final int HEIGHT = 25; |
92 |
private final int LABELS_PANEL_WIDTH = 250; |
93 |
private final int TEXTS_PANEL_WIDTH = 250; |
94 |
private final int LABELS_WIDTH = 245; |
95 |
private final int LABELS_HEIGHT = 19; |
96 |
private final int TEXTS_WIDTH = 245; |
97 |
private final int TEXTS_HEIGHT = 19; |
98 |
|
99 |
/**
|
100 |
* This is the default constructor
|
101 |
*/
|
102 |
public OutputHeaderFormatPanel() {
|
103 |
super();
|
104 |
initialize(); |
105 |
} |
106 |
|
107 |
/**
|
108 |
* This method initializes this
|
109 |
*
|
110 |
* @return void
|
111 |
*/
|
112 |
private void initialize() { |
113 |
|
114 |
this.setLayout(new GridBagLayout()); |
115 |
this.setPreferredSize(new java.awt.Dimension(WIDTH,HEIGHT)); |
116 |
this.add(getLabelsPanel(), new GridBagConstraints()); |
117 |
this.add(getFieldsPanel(), new GridBagConstraints()); |
118 |
} |
119 |
|
120 |
/**
|
121 |
* This method initializes jPanel3
|
122 |
*
|
123 |
* @return javax.swing.JPanel
|
124 |
*/
|
125 |
private JPanel getOutputFormatLabelPanel() { |
126 |
if (outputFormatLabelPanel == null) { |
127 |
outputFormatLabel = new JLabel(); |
128 |
outputFormatLabel.setText(PluginServices.getText(this, "output_header_format")); |
129 |
FlowLayout flowLayout4 = new FlowLayout(); |
130 |
flowLayout4.setHgap(0);
|
131 |
flowLayout4.setAlignment(java.awt.FlowLayout.LEFT); |
132 |
flowLayout4.setVgap(1);
|
133 |
outputFormatLabelPanel = new JPanel(); |
134 |
outputFormatLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH,LABELS_HEIGHT));
|
135 |
outputFormatLabelPanel.setLayout(flowLayout4); |
136 |
outputFormatLabelPanel.add(outputFormatLabel, null);
|
137 |
} |
138 |
return outputFormatLabelPanel;
|
139 |
} |
140 |
|
141 |
|
142 |
|
143 |
|
144 |
/**
|
145 |
* This method initializes jPanel
|
146 |
*
|
147 |
* @return javax.swing.JPanel
|
148 |
*/
|
149 |
private JPanel getLabelsPanel() { |
150 |
if (labelsPanel == null) { |
151 |
labelsPanel = new JPanel(); |
152 |
labelsPanel.setPreferredSize(new java.awt.Dimension(LABELS_PANEL_WIDTH,HEIGHT));
|
153 |
labelsPanel.add(getOutputFormatLabelPanel(), null);
|
154 |
} |
155 |
return labelsPanel;
|
156 |
} |
157 |
|
158 |
/**
|
159 |
* This method initializes jPanel
|
160 |
*
|
161 |
* @return javax.swing.JPanel
|
162 |
*/
|
163 |
private JPanel getFieldsPanel() { |
164 |
if (fieldsPanel == null) { |
165 |
fieldsPanel = new JPanel(); |
166 |
fieldsPanel.setPreferredSize(new java.awt.Dimension(TEXTS_PANEL_WIDTH,HEIGHT));
|
167 |
fieldsPanel.add(getOutputFormatTextPanel(), null);
|
168 |
} |
169 |
return fieldsPanel;
|
170 |
} |
171 |
|
172 |
/**
|
173 |
* This method initializes jPanel
|
174 |
*
|
175 |
* @return javax.swing.JPanel
|
176 |
*/
|
177 |
private JPanel getOutputFormatTextPanel() { |
178 |
if (OutputFormatTextPanel == null) { |
179 |
FlowLayout flowLayout = new FlowLayout(); |
180 |
flowLayout.setHgap(0);
|
181 |
flowLayout.setAlignment(java.awt.FlowLayout.LEFT); |
182 |
flowLayout.setVgap(1);
|
183 |
OutputFormatTextPanel = new JPanel(); |
184 |
OutputFormatTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH,TEXTS_HEIGHT));
|
185 |
OutputFormatTextPanel.setLayout(flowLayout); |
186 |
OutputFormatTextPanel.add(getOutputFormatText(), null);
|
187 |
} |
188 |
return OutputFormatTextPanel;
|
189 |
} |
190 |
|
191 |
/**
|
192 |
* This method initializes pronunciacionText
|
193 |
*
|
194 |
* @return javax.swing.JTextField
|
195 |
*/
|
196 |
private JComboBox getOutputFormatText() { |
197 |
if (outputFormatText == null) { |
198 |
outputFormatText = new JComboBox(VRTFormatOptions.getOutputHeaderFormats()); |
199 |
outputFormatText.setPreferredSize(new Dimension(TEXTS_WIDTH,TEXTS_HEIGHT)); |
200 |
} |
201 |
return outputFormatText;
|
202 |
} |
203 |
|
204 |
/**
|
205 |
* gets the selected outputformat
|
206 |
* @return
|
207 |
*/
|
208 |
public String getOutputHeaderFormat(){ |
209 |
return ((VRTFormatOptions.UIOption)getOutputFormatText().getSelectedItem()).getVrtOptionName();
|
210 |
} |
211 |
} // @jve:decl-index=0:visual-constraint="10,10"
|