Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/AttrInTableLabeling.java
AttrInTableLabeling.java | ||
---|---|---|
55 | 55 |
import javax.swing.JRadioButton; |
56 | 56 |
import javax.swing.JTextField; |
57 | 57 |
|
58 |
import org.gvsig.fmap.data.ReadException; |
|
59 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
60 |
import org.gvsig.fmap.data.feature.FeatureType; |
|
58 |
import org.gvsig.fmap.dal.DataTypes; |
|
59 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
60 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
61 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
61 | 62 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
62 | 63 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
63 | 64 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy; |
... | ... | |
300 | 301 |
AttrInTableLabelingStrategy strategy = new AttrInTableLabelingStrategy(); |
301 | 302 |
strategy.setLayer(layer); |
302 | 303 |
|
303 |
if(getCmbHeightField().getItemCount() > 0) |
|
304 |
if(getCmbHeightField().getItemCount() > 0) {
|
|
304 | 305 |
strategy.setHeightField( |
305 | 306 |
(String) getCmbHeightField().getSelectedItem()); |
306 |
if(getCmbRotationField().getItemCount() > 0) |
|
307 |
if(!getCmbRotationField().getSelectedItem().equals(NO_FIELD_ITEM)) |
|
307 |
} |
|
308 |
if(getCmbRotationField().getItemCount() > 0) { |
|
309 |
if(!getCmbRotationField().getSelectedItem().equals(NO_FIELD_ITEM)) { |
|
308 | 310 |
strategy.setRotationField( |
309 | 311 |
(String) getCmbRotationField().getSelectedItem()); |
310 |
else
|
|
312 |
} else {
|
|
311 | 313 |
strategy.setRotationField(null); |
314 |
} |
|
315 |
} |
|
312 | 316 |
|
313 |
if(getCmbTextField().getItemCount() > 0) |
|
317 |
if(getCmbTextField().getItemCount() > 0) {
|
|
314 | 318 |
strategy.setTextField( |
315 | 319 |
(String) getCmbTextField().getSelectedItem()); |
320 |
} |
|
316 | 321 |
|
317 | 322 |
strategy.setUsesFixedSize(getRdBtnFixedHeight().isSelected()); |
318 | 323 |
strategy.setFixedSize(fixedSize); |
319 | 324 |
|
320 |
if(getCmbUnits().getItemCount() > 0) |
|
325 |
if(getCmbUnits().getItemCount() > 0) {
|
|
321 | 326 |
strategy.setUnit(getCmbUnits().getSelectedUnitIndex()); |
327 |
} |
|
322 | 328 |
|
323 | 329 |
strategy.setUsesFixedColor(getRdBtnFixedColor().isSelected()); |
324 | 330 |
strategy.setFixedColor(colorChooser.getColor()); |
325 | 331 |
|
326 |
if(getCmbColorField().getItemCount() > 0) |
|
332 |
if(getCmbColorField().getItemCount() > 0) {
|
|
327 | 333 |
strategy.setColorField((String) getCmbColorField().getSelectedItem()); |
334 |
} |
|
328 | 335 |
|
329 | 336 |
|
330 | 337 |
strategy.setFont(labelFont); |
... | ... | |
345 | 352 |
ArrayList<String> lColors = new ArrayList<String>(); |
346 | 353 |
while (iterator.hasNext()) { |
347 | 354 |
FeatureAttributeDescriptor descriptor = (FeatureAttributeDescriptor) iterator.next(); |
348 |
if (descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_DOUBLE)||
|
|
349 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_FLOAT)||
|
|
350 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_LONG)/*||
|
|
355 |
if (descriptor.getDataType() == DataTypes.DOUBLE ||
|
|
356 |
descriptor.getDataType() == DataTypes.FLOAT ||
|
|
357 |
descriptor.getDataType() == DataTypes.LONG)/*||
|
|
351 | 358 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_INT)*/){ |
352 | 359 |
l.add(descriptor.getName()); |
353 | 360 |
} |
354 |
if(descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_INT)){
|
|
361 |
if (descriptor.getDataType() == DataTypes.INT) {
|
|
355 | 362 |
l.add(descriptor.getName()); |
356 | 363 |
lColors.add(descriptor.getName()); |
357 | 364 |
} |
Also available in: Unified diff