Revision 15673 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/LabelingManager.java

View differences:

LabelingManager.java
151 151
	private JTextField txtHeightField;
152 152
	private boolean noEvent;
153 153

  
154

  
155

  
156 154
	private class MethodItem {
157 155
		private String name;
158 156
		private ILabelingMethod method;
......
210 208
							ExprEditorPanel.this);
211 209
				}
212 210
			}
213

  
214

  
215 211
		};
216 212
		private JTextField txtExpression;
217 213
		private String lastExtression;
......
275 271
		content.setBorder(BorderFactory.createEtchedBorder());
276 272
		add(getPnlNorth(), BorderLayout.NORTH);
277 273
		add(content, BorderLayout.SOUTH);
278
//		if (!strategies.keySet().isEmpty())  {
279
//			getCmbStrategy().setSelectedIndex(0);
280
//			actionPerformed(new ActionEvent(getCmbStrategy(),321, null));
281
//		}
282 274

  
283 275
	}
284 276

  
......
326 318
			final LabelingStrategyItem items[] = aux.toArray(new LabelingStrategyItem[aux.size()]);
327 319

  
328 320
			cmbStrategy = new JComboBox(items) {
321
				private static final long serialVersionUID = -5800497614956189066L;
329 322

  
330 323
				@Override
331 324
				public void setSelectedItem(Object anObject) {
......
711 704
			}
712 705
		}
713 706
		c.setEnabled(b);
707
		quitaEsteMetodo();
714 708
	}
709
	
710
	private void quitaEsteMetodo() {
711
		getBtnAddClass().setEnabled(false);
712
		getBtnDelClass().setEnabled(false);
713
		getBtnEditExpression().setEnabled(false);
714
		getBtnFont().setEnabled(false);
715
		getBtnLabelStyles().setEnabled(false);
716
		getBtnSQLQuery().setEnabled(false);
717
		getBtnAddClass().setEnabled(false);
718
		getBtnVisualization().setEnabled(false);
719
		getBtnSymbol().setEnabled(false);
720
	}
715 721

  
716 722

  
717 723
	public void setModel(FLayer layer) throws IllegalArgumentException {
......
765 771
			setComponentEnabled(this, true);
766 772
			refreshControls();
767 773

  
768
//			String mode = (this.layer.getLabelingStrategy() instanceof AttrInTableLabeling)
769
//				? ATTRS_IN_TABLE_ITEM : USER_DEFINED_ITEM;
770
//			getCmbStrategy().setSelectedItem(mode);
771

  
772 774
			if (strategy!=null)
773 775
				getCmbStrategy().setSelectedItem(new LabelingStrategyItem("", strategy));
774 776
			ActionEvent evt = new ActionEvent(chkApplyLabels, 0, null);
......
1133 1135
				strategy.setFixedSize(fixedSize);
1134 1136
				// add more attributes for AttrInTableLabeling (if you need) here
1135 1137

  
1136

  
1137
				double unitFactor;
1138
				/*try {
1139
					unitFactor = getCmbUnits().getUnitConversionFactor();
1140
				} catch (ArrayIndexOutOfBoundsException aioobEx) { //jijiji
1141
					unitFactor = 0; // which represents size in pixel
1142
				}
1143
				strategy.setUnitFactor(unitFactor);
1144
				*/
1145 1138
				strategy.setUnit(getCmbUnits().getSelectedUnitIndex());
1146 1139
				layer.setLabelingStrategy(strategy);
1147 1140
			}

Also available in: Unified diff