Revision 34814 branches/gvSIG_1.11.0_Mejoras_gvSIG-EIEL/extensions/extSeriesMapas/src/org/gvsig/eiel/print/series/EIELSeriesMapasExtension.java

View differences:

EIELSeriesMapasExtension.java
1 1
package org.gvsig.eiel.print.series;
2 2

  
3

  
4
import javax.swing.JOptionPane;
5

  
6
import org.gvsig.eiel.print.series.gui.SeriesMapasSettingsPanel;
7
import org.gvsig.eiel.print.series.model.MapSerieSettings;
8

  
3 9
import com.iver.andami.PluginServices;
10
import com.iver.andami.messages.NotificationManager;
4 11
import com.iver.andami.plugins.Extension;
5
import com.iver.andami.plugins.IExtension;
6
import com.iver.andami.plugins.status.IExtensionStatus;
7 12
import com.iver.andami.ui.mdiManager.IWindow;
8 13
import com.iver.cit.gvsig.fmap.MapContext;
9 14
import com.iver.cit.gvsig.fmap.MapControl;
10
import com.iver.cit.gvsig.fmap.layers.FLayer;
11
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
12 15
import com.iver.cit.gvsig.project.documents.view.gui.View;
13 16

  
17
// org.gvsig.eiel.print.series.EIELSeriesMapasExtension
14 18
public class EIELSeriesMapasExtension extends Extension {
15 19

  
20
	private int xx = 0;
21
	
16 22
	public EIELSeriesMapasExtension() {
17 23
		
18 24
	}
19 25
	
26
	
27
	
28
	
20 29
	 public void initialize() {
21 30
		 
22 31
	 }
......
36 45

  
37 46
	 public void execute(String actionCommand) {
38 47
		 
48
		 IWindow w = PluginServices.getMDIManager().getActiveWindow();
49
		 
50
		 if (w != null && w instanceof View) {
51
			 View v = (View) w;
52
			 SeriesMapasSettingsPanel panel = new SeriesMapasSettingsPanel();
53
			 PluginServices.getMDIManager().addCentredWindow(panel);
54
		 } else {
55
			 NotificationManager.showMessageError(
56
					 "Bad window: " + w,  
57
					 new Exception("Bad window: " + w));
58
		 }
59
		 
39 60
	 }
40 61

  
41 62

  
......
48 69
	                View v = (View) w;
49 70
	                MapControl mc = v.getMapControl();
50 71
	                MapContext mx = mc.getMapContext();
51
	                FLayer[] lyrs = mx.getLayers().getActives();
52

  
53
	                if (lyrs.length > 0) {
54
	                	return true;
55
	                }
72
	                int lyrcnt = mx.getLayers().getLayersCount();
73
	                return (lyrcnt > 0); 
56 74
	            }
57 75
	        } catch (Exception ex) {
58 76
	            return false;
......
66 84
	 public boolean isVisible() {
67 85
		 return isEnabled();
68 86
	 }
87
	 
88
	 public static void createMapSeries(MapSerieSettings mss) throws Exception {
89
		 
90
		 
91
		 throw new Exception("ERROR !!!");
92
		 
93
	 }
69 94

  
70 95
}

Also available in: Unified diff