Revision 7086 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/thememanager/legendmanager/panels/FPanelLegendLabels.java

View differences:

FPanelLegendLabels.java
208 208

  
209 209
	private void updateControls() {
210 210
		getJComboBoxTextField().setEnabled(getJCheckBox().isSelected());
211
		getJComboBoxHeightField().setEnabled(getJCheckBox().isSelected());
212
        getJComboBoxRotationField().setEnabled(getJCheckBox().isSelected());
211
		if (getJComboBoxTextField().getSelectedIndex()!=-1){
212
			getJComboBoxHeightField().setEnabled(getJCheckBox().isSelected());
213
			getJComboBoxRotationField().setEnabled(getJCheckBox().isSelected());
214
		}
213 215
		getJRadioButton().setEnabled(getJCheckBox().isSelected());
214 216
		getJRadioButton1().setEnabled(getJCheckBox().isSelected());
215 217
		getJTextField().setEnabled(getJCheckBox().isSelected());
......
362 364
			jComboBoxTextField = new javax.swing.JComboBox();
363 365
			jComboBoxTextField.setBounds(175, 52, 110, 19);
364 366
			jComboBoxTextField.setEnabled(false);
367
			jComboBoxTextField.addItemListener(new java.awt.event.ItemListener() {
368
				public void itemStateChanged(java.awt.event.ItemEvent e) {
369
					if (jComboBoxTextField.getSelectedIndex()!=-1){
370
						getJComboBoxHeightField().setEnabled(true);
371
						getJComboBoxRotationField().setEnabled(true);
372
					}else{
373
						getJComboBoxHeightField().setEnabled(false);
374
						getJComboBoxRotationField().setEnabled(false);
375
					}
376
				}
377
			});
365 378
		}
366 379
		return jComboBoxTextField;
367 380
	}
......
398 411
		if (jComboBoxHeightField == null) {
399 412
			jComboBoxHeightField = new javax.swing.JComboBox();
400 413
			jComboBoxHeightField.setBounds(175, 82, 110, 18);
401
			jComboBoxHeightField.setEnabled(true);
402 414
			jComboBoxHeightField.setVisible(true);
415
			if (getJComboBoxTextField().getSelectedIndex()!=-1){
416
				jComboBoxHeightField.setEnabled(true);
417
			}else{
418
				jComboBoxHeightField.setEnabled(false);
419
			}
420

  
403 421
		}
404 422
		return jComboBoxHeightField;
405 423
	}
......
593 611
    	if (jComboBoxRotationField == null) {
594 612
    		jComboBoxRotationField = new JComboBox();
595 613
    		jComboBoxRotationField.setBounds(175, 111, 110, 19);
614
    		if (getJComboBoxTextField().getSelectedIndex()!=-1)
615
				jComboBoxRotationField.setEnabled(true);
616
			else
617
				jComboBoxRotationField.setEnabled(false);
596 618
    	}
597 619
    	return jComboBoxRotationField;
598 620
    }

Also available in: Unified diff