Revision 42264 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/gui/layerproperties/LabelClassProperties.java
LabelClassProperties.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package org.gvsig.labeling.gui.layerproperties; |
42 | 42 |
|
43 |
import java.awt.BorderLayout; |
|
44 |
import java.awt.Component; |
|
45 |
import java.awt.Dimension; |
|
46 |
import java.awt.FlowLayout; |
|
47 |
import java.awt.GridBagConstraints; |
|
48 |
import java.awt.GridBagLayout; |
|
49 |
import java.awt.GridLayout; |
|
43 |
import java.awt.*; |
|
50 | 44 |
import java.awt.event.ActionEvent; |
51 | 45 |
import java.awt.event.ActionListener; |
52 | 46 |
import java.util.logging.Level; |
... | ... | |
64 | 58 |
import javax.swing.JScrollPane; |
65 | 59 |
import javax.swing.JTable; |
66 | 60 |
import javax.swing.JTextField; |
61 |
import javax.swing.border.EmptyBorder; |
|
67 | 62 |
import javax.swing.table.DefaultTableModel; |
68 | 63 |
import javax.swing.table.TableCellEditor; |
69 | 64 |
import javax.swing.table.TableColumnModel; |
... | ... | |
88 | 83 |
import org.gvsig.gui.beans.swing.JBlank; |
89 | 84 |
import org.gvsig.i18n.Messages; |
90 | 85 |
import org.gvsig.labeling.lang.LabelClassUtils; |
86 |
import org.gvsig.tools.ToolsLocator; |
|
87 |
import org.gvsig.tools.i18n.I18nManager; |
|
88 |
|
|
89 |
import org.jfree.chart.block.EmptyBlock; |
|
91 | 90 |
import org.slf4j.Logger; |
92 | 91 |
import org.slf4j.LoggerFactory; |
93 | 92 |
|
... | ... | |
128 | 127 |
private LabelTextStylePanel textStyle; |
129 | 128 |
private JPanel sqlPnl; |
130 | 129 |
private LabelClassPreview labelPreview; |
131 |
|
|
132 |
/* |
|
133 |
private String[] fieldNames; |
|
134 |
private int[] fieldTypes; |
|
135 |
*/ |
|
136 | 130 |
private FeatureStore featureStore = null; |
137 | 131 |
private JButton btnDontUseStyle; |
138 | 132 |
private boolean accepted = true; |
139 | 133 |
private AcceptCancelPanel acceptCancelPanel; |
140 | 134 |
|
141 |
|
|
142 |
|
|
143 | 135 |
/** |
144 | 136 |
* <p> |
145 | 137 |
* Creates a new instance of the dialog that configures all the properties |
... | ... | |
155 | 147 |
} |
156 | 148 |
|
157 | 149 |
private void initialize() { |
158 |
setPreferredSize(new Dimension(810, 580)); |
|
159 |
setLayout(new BorderLayout(1, 1)); |
|
150 |
|
|
151 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
152 |
|
|
153 |
this.setPreferredSize(new Dimension(850, 580)); |
|
154 |
this.setLayout(new BorderLayout()); |
|
155 |
this.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
160 | 156 |
|
157 |
|
|
158 |
JPanel northPanel = new JPanel(); |
|
159 |
northPanel.setLayout(new FlowLayout(FlowLayout.LEFT,5,5)); |
|
160 |
|
|
161 |
JLabel lbl_name = new JLabel(); |
|
162 |
lbl_name.setText(i18nManager.getTranslation("name").concat(":")); |
|
163 |
northPanel.add(lbl_name); |
|
164 |
|
|
161 | 165 |
txtName = new JTextField(40); |
162 |
JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 2)); |
|
163 |
northPanel.add(new JLabel(Messages.getText("name") + ":")); |
|
164 | 166 |
northPanel.add(txtName); |
167 |
|
|
165 | 168 |
add(northPanel, BorderLayout.NORTH); |
166 | 169 |
|
167 |
JPanel centerPanel = new JPanel(new BorderLayout(10, 10)); |
|
170 |
|
|
171 |
JPanel centerPanel = new JPanel(new BorderLayout()); |
|
172 |
|
|
168 | 173 |
textStyle = new LabelTextStylePanel(); |
169 | 174 |
textStyle.addActionListener(this); |
170 | 175 |
centerPanel.add(textStyle, BorderLayout.NORTH); |
171 | 176 |
|
172 |
JPanel labelExpressionsPanel = new JPanel(new BorderLayout(1, 1)); |
|
173 |
|
|
174 |
labelExpressionsPanel.add(new JBlank(10, 30), BorderLayout.WEST); |
|
177 |
JPanel labelExpressionsPanel = new JPanel(new BorderLayout()); |
|
178 |
labelExpressionsPanel.setBorder(new EmptyBorder(5, 7, 5, 5)); |
|
175 | 179 |
labelExpressionsPanel.add(new JScrollPane(getTableFields()), |
176 | 180 |
BorderLayout.CENTER); |
177 | 181 |
|
178 |
JPanel a = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
|
|
182 |
JPanel a = new JPanel(new FlowLayout(FlowLayout.LEFT, 7, 0));
|
|
179 | 183 |
a.add(new JLabel("<html><b>"+Messages.getText("text_fields")+"</b></html>")); |
180 | 184 |
centerPanel.add(labelExpressionsPanel, BorderLayout.CENTER); |
181 | 185 |
|
182 |
|
|
183 |
GridLayout gbl = new GridLayout(3, 1, 0, 6); |
|
186 |
GridLayout gbl = new GridLayout(3, 1, 0, 5); |
|
184 | 187 |
JPanel auxp = new JPanel(gbl); |
185 | 188 |
auxp.add(getBtnVerify()); |
186 | 189 |
auxp.add(getBtnAddField()); |
187 | 190 |
auxp.add(getBtnRemoveField()); |
188 |
auxp.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
|
|
191 |
auxp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
|
|
189 | 192 |
JPanel auxpp = new JPanel(); |
190 | 193 |
auxpp.add(auxp); |
191 | 194 |
|
... | ... | |
196 | 199 |
// aux.setBorder(BorderFactory.createTitledBorder(PluginServices.getText( |
197 | 200 |
// this, "features"))); |
198 | 201 |
rdBtnAllFeatures = new JRadioButton(Messages.getText("all_features")); |
199 |
rdBtnFilteredFeatures = new JRadioButton(Messages.getText("filtered_features") |
|
200 |
+" (SQL GDBMS)"); |
|
202 |
rdBtnFilteredFeatures = new JRadioButton(Messages.getText("filtered_features").concat(" (SQL GDBMS)")); |
|
201 | 203 |
|
202 |
rdBtnAllFeatures.addActionListener(this); |
|
203 |
rdBtnFilteredFeatures.addActionListener(this); |
|
204 | 204 |
|
205 | 205 |
ButtonGroup g = new ButtonGroup(); |
206 | 206 |
g.add(rdBtnAllFeatures); |
207 | 207 |
g.add(rdBtnFilteredFeatures); |
208 |
|
|
209 |
rdBtnAllFeatures.addActionListener(this); |
|
210 |
rdBtnFilteredFeatures.addActionListener(this); |
|
211 |
|
|
208 | 212 |
aux.addComponent(chkLabelFeatures = new JCheckBox( |
209 | 213 |
Messages.getText("label_features_in_this_class"))); |
210 | 214 |
aux.addComponent("", rdBtnAllFeatures); |
211 | 215 |
aux.addComponent("", rdBtnFilteredFeatures); |
216 |
|
|
212 | 217 |
sqlPnl = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
213 | 218 |
sqlPnl.add(new JLabel(" SQL: SELECT * FROM ")); |
214 | 219 |
sqlPnl.add(new JLabel("<" + Messages.getText("layer_name") |
215 | 220 |
+ ">")); |
216 | 221 |
sqlPnl.add(new JLabel(" WHERE ")); |
217 |
sqlPnl.add(txtSQL = new JTextField(40));
|
|
222 |
sqlPnl.add(txtSQL = new JTextField(30));
|
|
218 | 223 |
sqlPnl.add(new JLabel(";")); |
219 | 224 |
aux.addComponent("", sqlPnl); |
220 | 225 |
|
221 |
|
|
222 |
JPanel auxPanel = new JPanel(new BorderLayout(1,1)); |
|
223 |
|
|
226 |
JPanel auxPanel = new JPanel(new BorderLayout()); |
|
227 |
|
|
224 | 228 |
JPanel aux2 = new JPanel(); |
225 | 229 |
auxPanel.setBorder(BorderFactory.createTitledBorder( |
226 | 230 |
Messages.getText("background_style"))); |
227 | 231 |
|
228 | 232 |
aux2.add(getStylePreviewer()); |
229 | 233 |
|
230 |
gbl = new GridLayout(2, 1, 0, 6);
|
|
234 |
gbl = new GridLayout(2, 1, 0, 5);
|
|
231 | 235 |
JPanel aux3 = new JPanel(gbl); |
232 | 236 |
aux3.add(getBtnSelectStyle()); |
233 | 237 |
aux3.add(getBtnDontUseStyle()); |
234 |
aux3.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
|
|
238 |
aux3.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
|
|
235 | 239 |
auxpp = new JPanel(); |
236 | 240 |
auxpp.add(aux3); |
237 | 241 |
|
238 |
auxPanel.add(aux2,BorderLayout.CENTER);
|
|
242 |
auxPanel.add(aux2,BorderLayout.WEST);
|
|
239 | 243 |
auxPanel.add(auxpp,BorderLayout.EAST); |
240 | 244 |
|
241 | 245 |
JPanel aux4 = new JPanel(new GridLayout(1,2)); |
242 | 246 |
aux4.add(auxPanel); |
243 | 247 |
aux2 = new JPanel(new BorderLayout()); |
244 | 248 |
aux2.setBorder(BorderFactory.createTitledBorder(Messages.getText("preview"))); |
249 |
aux2.add(new JBlank(5, 5), BorderLayout.NORTH); |
|
245 | 250 |
aux2.add(labelPreview = new LabelClassPreview(), BorderLayout.CENTER); |
251 |
aux2.add(new JBlank(5, 5), BorderLayout.WEST); |
|
252 |
aux2.add(new JBlank(5, 5), BorderLayout.EAST); |
|
253 |
aux2.add(new JBlank(5, 5), BorderLayout.SOUTH); |
|
246 | 254 |
aux4.add(aux2); |
247 | 255 |
|
248 | 256 |
GridBagLayoutPanel aux5 = new GridBagLayoutPanel(); |
249 | 257 |
aux5.addComponent("", aux); |
250 |
aux5.addComponent(new JBlank(3, 5)); |
|
251 | 258 |
aux5.addComponent("", aux4); |
252 | 259 |
centerPanel.add(aux5, BorderLayout.SOUTH); |
253 | 260 |
add(centerPanel, BorderLayout.CENTER); |
Also available in: Unified diff