Revision 5170 trunk/extensions/extCAD/src/com/iver/cit/gvsig/SelectionGeometryExtension.java

View differences:

SelectionGeometryExtension.java
41 41
package com.iver.cit.gvsig;
42 42

  
43 43
import com.iver.andami.plugins.Extension;
44
import com.iver.cit.gvsig.fmap.DriverException;
44 45
import com.iver.cit.gvsig.fmap.MapControl;
46
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
45 47
import com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool;
46 48

  
47 49
/**
......
52 54
public class SelectionGeometryExtension extends Extension {
53 55

  
54 56
	private MapControl mapControl;
57
	private  SelectionCADTool selection;
55 58

  
56 59
	/**
57 60
	 * @see com.iver.andami.plugins.IExtension#initialize()
58 61
	 */
59 62
	public void initialize() {
60
		 SelectionCADTool selection=new SelectionCADTool();
63
		selection=new SelectionCADTool();
61 64
		CADExtension.addCADTool("_selection", selection);
62 65
	}
63 66

  
......
77 80
	 * @see com.iver.andami.plugins.IExtension#isEnabled()
78 81
	 */
79 82
	public boolean isEnabled() {
80
		return true;
83
		FLyrVect lv=(FLyrVect)CADExtension.getEditionManager().getActiveLayerEdited().getLayer();
84
		try {
85
			return selection.isApplicable(lv.getShapeType());
86
		} catch (DriverException e) {
87
			e.printStackTrace();
88
		}
89
		return false;
81 90
	}
82 91

  
83 92
	/**

Also available in: Unified diff