root / trunk / extensions / extCAD / src / com / iver / cit / gvsig / GridExtension.java @ 6474
History | View | Annotate | Download (1.99 KB)
1 |
package com.iver.cit.gvsig; |
---|---|
2 |
|
3 |
import java.io.IOException; |
4 |
|
5 |
import com.iver.andami.PluginServices; |
6 |
import com.iver.andami.messages.NotificationManager; |
7 |
import com.iver.andami.plugins.Extension; |
8 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
9 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
10 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
11 |
import com.iver.cit.gvsig.gui.Table; |
12 |
import com.iver.cit.gvsig.gui.View; |
13 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
14 |
|
15 |
/**
|
16 |
* DOCUMENT ME!
|
17 |
*
|
18 |
* @author Vicente Caballero Navarro
|
19 |
*/
|
20 |
public class GridExtension extends Extension { |
21 |
/**
|
22 |
* @see com.iver.andami.plugins.IExtension#initialize()
|
23 |
*/
|
24 |
public void initialize() { |
25 |
} |
26 |
|
27 |
/**
|
28 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
|
29 |
*/
|
30 |
public void execute(String s) { |
31 |
com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager() |
32 |
.getActiveView(); |
33 |
|
34 |
View vista = (View) f; |
35 |
if (s.equals("SHOWGRID")) { |
36 |
CADExtension.getCADToolAdapter().setMapControl( |
37 |
vista.getMapControl()); |
38 |
CADExtension.getCADToolAdapter().setGridVisibility(true);
|
39 |
} else if (s.equals("HIDEGRID")) { |
40 |
CADExtension.getCADToolAdapter().setMapControl(vista.getMapControl()); |
41 |
CADExtension.getCADToolAdapter().setGridVisibility(false);
|
42 |
} else if (s.equals("SETADJUSTGRID")) { |
43 |
CADExtension.getCADToolAdapter().setMapControl(vista.getMapControl()); |
44 |
CADExtension.getCADToolAdapter().setAdjustGrid(true);
|
45 |
} else if (s.equals("NOTADJUSTGRID")) { |
46 |
CADExtension.getCADToolAdapter().setMapControl(vista.getMapControl()); |
47 |
CADExtension.getCADToolAdapter().setAdjustGrid(false);
|
48 |
} |
49 |
|
50 |
PluginServices.getMainFrame().enableControls(); |
51 |
|
52 |
} |
53 |
|
54 |
/**
|
55 |
* @see com.iver.andami.plugins.IExtension#isEnabled()
|
56 |
*/
|
57 |
public boolean isEnabled() { |
58 |
return true; |
59 |
} |
60 |
|
61 |
/**
|
62 |
* @see com.iver.andami.plugins.IExtension#isVisible()
|
63 |
*/
|
64 |
public boolean isVisible() { |
65 |
if (EditionUtilities.getEditionStatus() == EditionUtilities.EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE_AND_EDITABLE)
|
66 |
return true; |
67 |
else
|
68 |
return false; |
69 |
|
70 |
} |
71 |
} |