Revision 12657 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SymbolEditor.java

View differences:

SymbolEditor.java
43 43
 *
44 44
 * $Id$
45 45
 * $Log$
46
 * Revision 1.11  2007-07-12 10:43:55  jaume
46
 * Revision 1.12  2007-07-18 06:56:03  jaume
47
 * continuing with cartographic support
48
 *
49
 * Revision 1.11  2007/07/12 10:43:55  jaume
47 50
 * *** empty log message ***
48 51
 *
49 52
 * Revision 1.10  2007/06/29 13:07:33  jaume
......
144 147
import com.iver.andami.PluginServices;
145 148
import com.iver.andami.ui.mdiManager.IWindow;
146 149
import com.iver.andami.ui.mdiManager.WindowInfo;
150
import com.iver.cit.gvsig.fmap.core.CartographicSupport;
147 151
import com.iver.cit.gvsig.fmap.core.FShape;
148 152
import com.iver.cit.gvsig.fmap.core.SymbologyFactory;
149 153
import com.iver.cit.gvsig.fmap.core.symbols.IMultiLayerSymbol;
......
217 221
					"shape_type_not_supported"));
218 222
				}
219 223

  
224
				if (symbol instanceof CartographicSupport) {
225
					CartographicSupport cs = (CartographicSupport) symbol;
226
					CartographicSupport nCs = (CartographicSupport) nSym;
227
					nCs.setReferenceSystem(cs.getReferenceSystem());
228
					nCs.setUnit(cs.getUnit());
229

  
230
					getCmbUnits().setSelectedUnitIndex(nCs.getUnit());
231
					getCmbUnitsReferenceSystem().
232
						setSelectedIndex(nCs.getReferenceSystem());
233
				}
234

  
220 235
				if (!(symbol instanceof FSymbol))
221 236
					nSym.addLayer(symbol);
237

  
222 238
				this.symbol = nSym;
223 239

  
224 240
			} else {
......
256 272
						// if the symbol is not null and is it managed by the "options" class
257 273
						// refresh the controls
258 274
						if (l != null
259
								&& l.getClass().equals(options.getSymbolClass()))
275
								&& l.getClass().equals(options.getSymbolClass())) {
276
							if (l instanceof CartographicSupport) {
277
								CartographicSupport cs = (CartographicSupport) l;
278
								getCmbUnits().setSelectedUnitIndex(cs.getUnit());
279
								getCmbUnitsReferenceSystem().setSelectedIndex(cs.getReferenceSystem());
280
							}
260 281
							options.refreshControls(l);
282
						}
261 283

  
262 284
						replaceOptions(options);
263 285
//////////			/-------------------------------------
......
487 509
		IMultiLayerSymbol s = (IMultiLayerSymbol) symbol;
488 510
		if (i >= 0 && i < s.getLayerCount()) {
489 511
			s.setLayer(s.getLayerCount() - 1 - i, layer);
512

  
490 513
		}
491 514
		refresh();
492 515
	}
......
519 542
	}
520 543

  
521 544
	public ISymbol getNewLayer() {
522
		return ((AbstractTypeSymbolEditorPanel) getCmbType().getSelectedItem())
545
		ISymbol sym = ((AbstractTypeSymbolEditorPanel) getCmbType().getSelectedItem())
523 546
				.getLayer();
547

  
548
		return sym;
524 549
	}
525 550

  
526 551
	private void replaceOptions(AbstractTypeSymbolEditorPanel options) {
......
546 571
	 */
547 572
	public void setOptionsPageFor(ISymbol symbol) {
548 573
		AbstractTypeSymbolEditorPanel options = getOptionsForSymbol(symbol);
574

  
549 575
		options.refreshControls(symbol);
550 576
		cmbType.setSelectedItem(options);
551 577
	}
......
553 579
	public int getUnitsReferenceSystem() {
554 580
		return cmbUnitsReferenceSystem.getSelectedIndex();
555 581
	}
582

  
583

  
556 584
}

Also available in: Unified diff