Statistics
| Revision:

svn-gvsig-desktop / trunk / prototypes / mobile / desktop / extensions / extExportMobile / src / es / prodevelop / gvsig / exportMobile / ClipExtension.java @ 19124

History | View | Annotate | Download (1.82 KB)

1
package es.prodevelop.gvsig.exportMobile;
2

    
3
import java.util.ArrayList;
4

    
5
import com.iver.andami.PluginServices;
6
import com.iver.andami.plugins.Extension;
7
import com.iver.cit.gvsig.fmap.layers.FLayers;
8
import com.iver.cit.gvsig.project.ProjectExtent;
9
import com.iver.cit.gvsig.project.documents.view.gui.View;
10

    
11
import es.prodevelop.gvsig.exportMobile.ui.order.FLayerWithNewName;
12
import es.prodevelop.gvsig.exportMobile.ui.panels.ExportPanel;
13

    
14

    
15
/**
16
 * This extension will be visible if any view is execute. Get the layers are in
17
 * TOC and the exents of the view to work with them.
18
 * If are any group of layers in TOC, we work with its layers as
19
 * if this gropu doesn?t exists.
20
 * 
21
 * @author amoreno
22
 *
23
 */
24
public class ClipExtension extends Extension {
25

    
26
        public void initialize() {
27
//                //Initialiser SOAP writer with the desination SOAP file
28
                //File destFile = new File("SOAPComEventModif.xml");
29
                //CommMessageWriterManager.registerManager(new CommMessageWriterManager(new SOAPCommMessageWriter(destFile)));
30
        }
31

    
32
        public boolean isEnabled() {
33

    
34
                return true;
35
        }
36

    
37
        public boolean isVisible() {
38
                com.iver.andami.ui.mdiManager.IWindow f = (com.iver.andami.ui.mdiManager.IWindow) PluginServices
39
                                .getMDIManager().getActiveWindow();
40

    
41
                if (f == null) {
42
                        return false;
43
                }
44

    
45
                return (f instanceof View);
46
        }
47

    
48
        public void execute(String actionCommand) {
49

    
50
                View view = (View) PluginServices.getMDIManager().getActiveWindow();
51
                view.getModel().getProject().getExtents();
52
                // root
53
                FLayers rt = view.getMapControl().getMapContext().getLayers();
54
                ArrayList lyrsNewName = FLayerWithNewName.getAll(rt);
55
                ProjectExtent[] listExtent = view.getModel().getProject().getExtents();
56
                ExportPanel infPanel = new ExportPanel(lyrsNewName, listExtent);
57
                PluginServices.getMDIManager().addWindow(infPanel);
58
        }
59
}