Revision 19037

View differences:

tags/tmp_build/extensions/extPublishMapserver/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry combineaccessrules="false" kind="src" path="/extPublish"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/>
7
	<classpathentry combineaccessrules="false" kind="src" path="/libIverUtiles"/>
8
	<classpathentry kind="lib" path="/_fwAndami/lib/beans.jar" sourcepath="/libUI/src"/>
9
	<classpathentry kind="lib" path="/_fwAndami/lib/log4j-1.2.8.jar"/>
10
	<classpathentry kind="output" path="bin"/>
11
</classpath>
tags/tmp_build/extensions/extPublishMapserver/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>publishMapserver</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
	</buildSpec>
14
	<natures>
15
		<nature>org.eclipse.jdt.core.javanature</nature>
16
	</natures>
17
</projectDescription>
tags/tmp_build/extensions/extPublishMapserver/config/text.properties
1
nothing_to_publish=Nada que publicar. A?ada recursos a la publicaci?n.
2
the_mapfile_is_not_defined=Seleccione un fichero para escribir la configuraci?n.
3
debug=Depuraci?n
4
mapserver_layer_properties=Propiedades capa Mapserver
5
mapserver_properties=Propiedades Servidor Mapserver
6
mapserver_mapname=Nombre del mapa
7
mapserver_url=URL
8
mapserver_mapfile=Fichero de configuraci?n
9
name=Nombre
10
mapserver_imagepath=Directorio temporal
11
mapserver_shapepath=Directorio datos
tags/tmp_build/extensions/extPublishMapserver/config/text_en.properties
1
nothing_to_publish=Nothing to publish. Add a new resource.
2
the_mapfile_is_not_defined=Select a file to write the configuration.
3
debug=Debug
4
mapserver_layer_properties=Mapserver layer properties
5
mapserver_properties=Mapserver properties
6
mapserver_mapname=Map name
7
mapserver_url=URL
8
mapserver_mapfile=Configuration file
9
name=Name
10
mapserver_imagepath=Temp directory
11
mapserver_shapepath=ShapePath
tags/tmp_build/extensions/extPublishMapserver/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<depends plugin-name="org.gvsig.publish" />
5
	<libraries library-dir="."/>
6
	<resourceBundle name="text"/>
7
	<extensions>
8
		<extension class-name="org.gvsig.publish.mapserver.MapserverExtension"
9
			description="MapserverPublish Extension"
10
			active="true"
11
			priority="1">
12
		</extension>		
13
	</extensions>
14
</plugin-config>
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/MapserverExtension.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver;
42

  
43
import org.gvsig.publish.PublishRegister;
44
import org.gvsig.publish.mapserver.gui.MapserverController;
45
import org.gvsig.publish.mapserver.model.Mapserver;
46
import org.gvsig.publish.mapserver.model.wcs.MapserverWCS;
47
import org.gvsig.publish.mapserver.model.wcs.MapserverWCSLayer;
48
import org.gvsig.publish.mapserver.model.wfs.MapserverWFS;
49
import org.gvsig.publish.mapserver.model.wfs.MapserverWFSLayer;
50
import org.gvsig.publish.mapserver.model.wms.MapserverWMS;
51
import org.gvsig.publish.mapserver.model.wms.MapserverWMSLayer;
52

  
53
import com.iver.andami.plugins.Extension;
54
/**
55
 * Extension for publish into mapserver 
56
 * 
57
 * @author Jos? Vicente Hig?n (josevicente.higon@iver.es)
58
 *
59
 */
60
public class MapserverExtension extends Extension{
61

  
62
	public void execute(String actionCommand) {		
63
		
64
	}
65
	/**
66
	 * Register Mapserver in the Publish register
67
	 */
68
	public void initialize() {
69
		//Register the server		
70
		PublishRegister.register().addServer(Mapserver.SERVER_MAPSERVER, Mapserver.class);		
71
		//Register the services
72
		PublishRegister.register().addService(Mapserver.SERVER_MAPSERVER, MapserverWMS.MAPSERVER_WMS, MapserverWMS.class);
73
		PublishRegister.register().addService(Mapserver.SERVER_MAPSERVER, MapserverWFS.MAPSERVER_WFS, MapserverWFS.class);
74
		PublishRegister.register().addService(Mapserver.SERVER_MAPSERVER, MapserverWCS.MAPSERVER_WCS, MapserverWCS.class);
75
		//Register the remote resources
76
		//One remote resource type for each service
77
		PublishRegister.register().addRemoteResource(MapserverWMS.MAPSERVER_WMS, MapserverWMSLayer.MAPSERVER_WMS_LAYER, MapserverWMSLayer.class);
78
		PublishRegister.register().addRemoteResource(MapserverWFS.MAPSERVER_WFS, MapserverWFSLayer.MAPSERVER_WFS_LAYER, MapserverWFSLayer.class);
79
		PublishRegister.register().addRemoteResource(MapserverWCS.MAPSERVER_WCS, MapserverWCSLayer.MAPSERVER_WCS_LAYER, MapserverWCSLayer.class);
80
		//Register the controller		
81
		PublishRegister.register().addController(Mapserver.SERVER_MAPSERVER, MapserverController.class);
82
	}
83

  
84
	public boolean isEnabled() {
85
		// TODO Auto-generated method stub
86
		return true;
87
	}
88

  
89
	public boolean isVisible() {
90
		// TODO Auto-generated method stub
91
		return false;
92
	}
93

  
94
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wms/MapserverLayerWMSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wms;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.ogcMetadata.LayerWMS111Panel;
49
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
50
import org.gvsig.publish.mapserver.gui.common.MapserverLayerPanel;
51
import org.gvsig.publish.mapserver.model.wms.MapserverWMSLayer;
52

  
53
public class MapserverLayerWMSPanel extends JPanel implements IPublishPluginPanel{
54
    
55
	/*
56
	 * components
57
	 */
58
	private CommonOGCMetadataPanel ogcMetadataPanel = null;
59
	private LayerWMS111Panel wms111layerpanel = null;
60
	private MapserverLayerPanel mapserverlayerPanel = null;
61
	/*
62
	 * model
63
	 */
64
	private MapserverWMSLayer model_layerwms;
65
    
66
	public MapserverLayerWMSPanel() {
67
        initComponents();
68
        //TODO: In the first release this panels are not visibles.
69
        wms111layerpanel.setVisible(false);
70
        mapserverlayerPanel.setVisible(false);
71
        //initLabels();
72
    }
73

  
74
    private void initComponents() {
75
        java.awt.GridBagConstraints gridBagConstraints;
76

  
77
        ogcMetadataPanel = new CommonOGCMetadataPanel();
78
        wms111layerpanel = new LayerWMS111Panel();
79
        mapserverlayerPanel = new MapserverLayerPanel();
80

  
81
        setLayout(new java.awt.GridBagLayout());
82

  
83
     //   ogcMetadataPanel.setLayout(null);
84

  
85
        gridBagConstraints = new java.awt.GridBagConstraints();
86
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
87
        gridBagConstraints.weightx = 1.0;
88
        gridBagConstraints.weighty = 1.0;
89
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
90
        add(ogcMetadataPanel, gridBagConstraints);
91

  
92
      //  wms111layerpanel.setLayout(null);
93

  
94
        gridBagConstraints = new java.awt.GridBagConstraints();
95
        gridBagConstraints.gridx = 0;
96
        gridBagConstraints.gridy = 1;
97
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
98
        gridBagConstraints.weightx = 1.0;
99
        gridBagConstraints.weighty = 1.0;
100
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
101
        add(wms111layerpanel, gridBagConstraints);
102

  
103
        gridBagConstraints = new java.awt.GridBagConstraints();
104
        gridBagConstraints.gridx = 0;
105
        gridBagConstraints.gridy = 2;
106
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
107
        gridBagConstraints.weightx = 1.0;
108
        gridBagConstraints.weighty = 1.0;
109
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
110
        add(mapserverlayerPanel, gridBagConstraints);
111

  
112
    }// </editor-fold>                        
113
    
114
                       
115
	public Object getModel() {
116
		//forces the update of the model 
117
		ogcMetadataPanel.getModel();
118
		wms111layerpanel.getModel();
119
		mapserverlayerPanel.getModel();
120
		return model_layerwms;
121
	}
122

  
123
	public void setListener(EventListener listener) {
124
		// TODO Auto-generated method stub
125
		
126
	}
127

  
128
	public void setModel(Object entityModel) {
129
		// cast to MapservrLayerWMS
130
		model_layerwms = (MapserverWMSLayer)entityModel;
131
		//set objects into panels		
132
		ogcMetadataPanel.setModel(model_layerwms.getOgcMetadata());
133
		wms111layerpanel.setModel(model_layerwms.getLayerWmsMetadata());
134
		mapserverlayerPanel.setModel(model_layerwms.getLayerMapserver());
135
	}
136

  
137
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wms/MapserverServiceWMSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wms;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.ogcMetadata.ServiceWMS111Panel;
49
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
50
import org.gvsig.publish.mapserver.model.wms.MapserverWMS;
51
import org.gvsig.publish.ogcmetadata.CommonOGCMetadata;
52
import org.gvsig.publish.ogcmetadata.ServiceWMS111Metadata;
53

  
54

  
55

  
56
public class MapserverServiceWMSPanel extends JPanel implements IPublishPluginPanel{
57
	/*
58
	 * components
59
	 */
60
	CommonOGCMetadataPanel ogcMetadataPanel = null;
61
	ServiceWMS111Panel  wms111servicepanel = null;	
62
	
63
	/*
64
	 * model
65
	 */
66
	MapserverWMS model_mapserverwms = null;
67
	/**
68
	 * Constructor
69
	 */
70
	public MapserverServiceWMSPanel(){
71
		super();
72
		initComponents();
73
		wms111servicepanel.setVisible(false);
74
		//initLabels();
75
	}
76

  
77
    private void initComponents() {
78
        java.awt.GridBagConstraints gridBagConstraints;
79

  
80
        ogcMetadataPanel = new CommonOGCMetadataPanel();
81
        wms111servicepanel = new ServiceWMS111Panel();
82

  
83
        setLayout(new java.awt.GridBagLayout());
84
       
85
        gridBagConstraints = new java.awt.GridBagConstraints();
86
        gridBagConstraints.gridx = 0;
87
        gridBagConstraints.gridy = 0;
88
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
89
        gridBagConstraints.weightx = 1.0;
90
        gridBagConstraints.weighty = 1.0;
91
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
92
        add(ogcMetadataPanel, gridBagConstraints);      
93

  
94
        gridBagConstraints = new java.awt.GridBagConstraints();
95
        gridBagConstraints.gridx = 0;
96
        gridBagConstraints.gridy = 1;
97
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
98
        gridBagConstraints.weightx = 1.0;
99
        gridBagConstraints.weighty = 1.0;
100
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
101
        add(wms111servicepanel, gridBagConstraints);
102

  
103

  
104
    }// </editor-fold>                        
105

  
106
        
107
	public Object getModel() {
108
		model_mapserverwms.setOgcMetadata((CommonOGCMetadata)ogcMetadataPanel.getModel());
109
		model_mapserverwms.setWmsMetadata((ServiceWMS111Metadata)wms111servicepanel.getModel());
110
		return model_mapserverwms;
111
	}
112

  
113
	public void setListener(EventListener listener) {
114
		// TODO Auto-generated method stub
115

  
116
	}
117

  
118
	public void setModel(Object entityModel) {
119
		// Cast to MapserverWMS
120
		model_mapserverwms = (MapserverWMS) entityModel;
121
		//set ogcmetadata into ogcmetadata panel
122
		ogcMetadataPanel.setModel(model_mapserverwms.getOgcMetadata());
123
		//set service
124
		wms111servicepanel.setModel(model_mapserverwms.getWmsMetadata());
125

  
126
	}
127

  
128
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/MapserverController.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui;
42

  
43

  
44
import java.awt.event.ActionEvent;
45
import java.awt.event.ActionListener;
46
import java.io.File;
47

  
48
import javax.swing.JFileChooser;
49

  
50
import org.gvsig.publish.gui.browser.BrowserController;
51
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
52
import org.gvsig.publish.mapserver.gui.wcs.MapserverLayerWCSPanel;
53
import org.gvsig.publish.mapserver.gui.wcs.MapserverServiceWCSPanel;
54
import org.gvsig.publish.mapserver.gui.wfs.MapserverLayerWFSPanel;
55
import org.gvsig.publish.mapserver.gui.wfs.MapserverServiceWFSPanel;
56
import org.gvsig.publish.mapserver.gui.wms.MapserverLayerWMSPanel;
57
import org.gvsig.publish.mapserver.gui.wms.MapserverServiceWMSPanel;
58
import org.gvsig.publish.mapserver.model.Mapserver;
59
import org.gvsig.publish.mapserver.model.wcs.MapserverWCS;
60
import org.gvsig.publish.mapserver.model.wcs.MapserverWCSLayer;
61
import org.gvsig.publish.mapserver.model.wfs.MapserverWFS;
62
import org.gvsig.publish.mapserver.model.wfs.MapserverWFSLayer;
63
import org.gvsig.publish.mapserver.model.wms.MapserverWMS;
64
import org.gvsig.publish.mapserver.model.wms.MapserverWMSLayer;
65
import org.gvsig.publish.serversmodel.RemoteResource;
66
import org.gvsig.publish.serversmodel.Server;
67
import org.gvsig.publish.serversmodel.Service;
68

  
69
import com.iver.utiles.FileUtils;
70

  
71
/**
72
 * This class represents the controller which shows the user the publication in Mapserver.
73
 * 
74
 * At first, the publish extension call the method setModel(Mapserver) in order to fill all the panels
75
 * When the user has finished to modify the model (Mapserver, its services a remote resources), the
76
 * publish extension call the method getModel():Mapserver in order to publish (calling the publish() method
77
 * of Mapserver)   
78
 * 
79
 * 
80
 * @author jvhigon
81
 *
82
 */
83

  
84
public class MapserverController extends BrowserController implements ActionListener{
85

  
86
	/*
87
	 * Event from the JFileChooser
88
	 */
89
	public final static String MAPFILE_CHOOSE_PATH_EVENT="mapfile_path_event";
90
	public final static String IMAGEPATH_CHOOSE_PATH_EVENT="imagepath_path_event";
91

  
92
	Mapserver active_server = null;
93
	/*
94
	 * Panels
95
	 */
96
	private MapserverPanel serverPanel= null;
97
	private MapserverServiceWMSPanel wmsPanel = null;
98
	private MapserverServiceWFSPanel wfsPanel = null;
99
	private MapserverServiceWCSPanel wcsPanel = null;
100
	private MapserverLayerWMSPanel wmsLayerPanel = null;
101
	private MapserverLayerWFSPanel wfsLayerPanel = null;
102
	private MapserverLayerWCSPanel wcsLayerPanel = null;
103
	private MapFileChooser mapfileChooser = null;
104
	private ImagePathChooser imagepathChooser = null;
105
	/**
106
	 * Constructor
107
	 * 
108
	 */
109
	public MapserverController(){
110
		super();
111
		//creates the panels and set itself like a listener from user events
112
		serverPanel = new MapserverPanel();
113
		serverPanel.setListener(this);
114
		wmsPanel = new MapserverServiceWMSPanel();
115
		wmsLayerPanel = new MapserverLayerWMSPanel();
116
		wfsPanel = new MapserverServiceWFSPanel();
117
		wfsLayerPanel = new MapserverLayerWFSPanel();
118
		wcsPanel = new MapserverServiceWCSPanel();
119
		wcsLayerPanel = new MapserverLayerWCSPanel();		
120
		//creates the filechooser		
121
		//mapfileChooser = new MapFileChooser(new File(System.getProperty("user.home")));
122
		mapfileChooser = new MapFileChooser(new File(System.getProperty("user.home")));
123
		imagepathChooser = new ImagePathChooser(null);
124
		imagepathChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
125
	}
126

  
127
	
128

  
129
	/**
130
	 * @see BrowserController#getServerPanel(Server)
131
	 */
132
	public IPublishPluginPanel getServerPanel(Server server) {		
133
		if (server.getType() == Mapserver.SERVER_MAPSERVER){			
134
			serverPanel.setModel(server);
135
			//set the server as active
136
			active_server =(Mapserver) server;
137
			return (IPublishPluginPanel) serverPanel;
138
		}
139
		return null;	
140
	}
141

  
142
	/**
143
	 * @see BrowserController#getServicePanel(Service)
144
	 */
145
	public IPublishPluginPanel getServicePanel(Service service) {
146
		if (service.getType() == MapserverWMS.MAPSERVER_WMS){
147
			wmsPanel.setModel(service);
148
			return (IPublishPluginPanel) wmsPanel;
149
		}
150
		if (service.getType() == MapserverWFS.MAPSERVER_WFS){
151
			wfsPanel.setModel(service);
152
			return (IPublishPluginPanel) wfsPanel;
153
		}
154
		if (service.getType() == MapserverWCS.MAPSERVER_WCS){
155
			wcsPanel.setModel(service);
156
			return (IPublishPluginPanel) wcsPanel;
157
		}
158
		return null;
159
	} 
160
	/**
161
	 * @see BrowserController#getRemoteResourcePanel(RemoteResource)
162
	 */
163
	public IPublishPluginPanel getRemoteResourcePanel(RemoteResource remoteResource) {
164
		if (remoteResource.getType() == MapserverWMSLayer.MAPSERVER_WMS_LAYER){
165
			wmsLayerPanel.setModel(remoteResource);
166
			return wmsLayerPanel;
167
		}
168
		if (remoteResource.getType() == MapserverWFSLayer.MAPSERVER_WFS_LAYER){
169
			wfsLayerPanel.setModel(remoteResource);
170
			return wfsLayerPanel;
171
		}
172
		if (remoteResource.getType() == MapserverWCSLayer.MAPSERVER_WCS_LAYER){
173
			wcsLayerPanel.setModel(remoteResource);
174
			return wcsLayerPanel;
175
		}
176
		return null;
177
	}
178
	/**
179
	 * This method gets the action from the MapfileChooser and ImagepathChooser.
180
	 * I must call the super.actionCommand() in order to execute the BrowserController actions
181
	 */
182
	public void actionPerformed(ActionEvent e) {
183
		super.actionPerformed(e);
184
		if (e.getActionCommand().equals(MapserverController.MAPFILE_CHOOSE_PATH_EVENT)){
185
			//first of all I must update the model
186
			
187
			Mapserver m = (Mapserver) serverPanel.getModel();
188
			//check if the mapfile is defined			
189
			int returnVal = mapfileChooser.showSaveDialog(serverPanel);
190
			if (returnVal == JFileChooser.APPROVE_OPTION){
191
				File mapfile = mapfileChooser.getSelectedFile();
192
				String aux = FileUtils.getFileWithoutExtension(mapfile);
193
				aux = aux + ".map";				
194
				active_server.setMapfileFile(new File(aux));		
195
				serverPanel.setModel(active_server);
196
			}
197
			return;
198
		}
199
		if (e.getActionCommand().equals(MapserverController.IMAGEPATH_CHOOSE_PATH_EVENT)){
200
			//first of all I must update the model
201
			serverPanel.getModel();
202
			int returnVal = imagepathChooser.showSaveDialog(serverPanel);
203
			if (returnVal == JFileChooser.APPROVE_OPTION){
204
				File imagepath = imagepathChooser.getSelectedFile();
205
				active_server.setImagePath(imagepath);		
206
				serverPanel.setModel(active_server);
207
			}
208
			return;
209
		}
210
	}
211
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/common/MapserverLayerPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.common;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
48
import org.gvsig.publish.mapserver.model.MapserverLayer;
49

  
50
import com.iver.andami.PluginServices;
51

  
52
public class MapserverLayerPanel extends JPanel implements IPublishPluginPanel {
53
	/*
54
	 * model
55
	 */
56
	private MapserverLayer model_mapserverlayer = null;
57
	
58
	public MapserverLayerPanel() {
59
		super();
60
		initComponents();
61
		initLabels();
62
	}
63
	private void initLabels(){
64
	    setBorder(javax.swing.BorderFactory.createTitledBorder(PluginServices.getText(this,"mapserver_layer_properties")));
65
	    debugCheck.setText(PluginServices.getText(this,"debug"));
66
	}
67
	 private void initComponents() {
68
	        java.awt.GridBagConstraints gridBagConstraints;
69

  
70
	        debugCheck = new javax.swing.JCheckBox();
71

  
72
	        setLayout(new java.awt.GridBagLayout());
73

  
74
	        
75
	        debugCheck.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
76
	        debugCheck.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
77
	        debugCheck.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
78
	        debugCheck.setMargin(new java.awt.Insets(0, 0, 0, 0));
79
	        gridBagConstraints = new java.awt.GridBagConstraints();
80
	        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
81
	        gridBagConstraints.weightx = 1.0;
82
	        add(debugCheck, gridBagConstraints);
83

  
84
	    }// </editor-fold>                        
85
	    
86
	    
87
	    // Variables declaration - do not modify                     
88
	    private javax.swing.JCheckBox debugCheck;
89
	    // End of variables declaration                
90

  
91

  
92
		public Object getModel() {
93
			model_mapserverlayer.setDebug(debugCheck.isSelected());
94
			return model_mapserverlayer;
95
		}
96
		public void setListener(EventListener listener) {
97
			// TODO Auto-generated method stub
98
			
99
		}
100
		public void setModel(Object entityModel) {
101
			// cast to MapserverLayer
102
			model_mapserverlayer = (MapserverLayer)entityModel;
103
			debugCheck.setSelected(model_mapserverlayer.isDebug());
104
		}
105

  
106
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wcs/MapserverLayerWCSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wcs;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
49
import org.gvsig.publish.mapserver.model.wcs.MapserverWCSLayer;
50

  
51
public class MapserverLayerWCSPanel extends JPanel implements
52
		IPublishPluginPanel {
53
	/**
54
	 * Components
55
	 */
56
	private CommonOGCMetadataPanel ogcMetadataPanel = null;
57
	/**
58
	 * model
59
	 */
60
	private MapserverWCSLayer model_layerwcs;
61
	/**
62
	 * Constructor
63
	 */
64
	public MapserverLayerWCSPanel() {
65
		initComponents();
66
		//initLabels();
67
	}
68
//	private void initLabels(){
69
//		
70
//	}
71
    private void initComponents() {
72
        ogcMetadataPanel = new CommonOGCMetadataPanel();
73

  
74
        setLayout(new java.awt.GridBagLayout());
75

  
76
        //ogcMetadataPanel.setLayout(null);
77
        java.awt.GridBagConstraints gridBagConstraints;
78
        gridBagConstraints = new java.awt.GridBagConstraints();
79
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
80
        gridBagConstraints.weightx = 1.0;
81
        gridBagConstraints.weighty = 1.0;
82
        add(ogcMetadataPanel, gridBagConstraints);
83
    }// </editor-fold>                        
84

  
85
	public Object getModel() {
86
		ogcMetadataPanel.getModel();
87
		return model_layerwcs;
88
	}
89

  
90
	public void setListener(EventListener listener) {
91
		// TODO Auto-generated method stub
92

  
93
	}
94

  
95
	public void setModel(Object entityModel) {
96
		// cast to MapservrLayerWFS
97
		model_layerwcs = (MapserverWCSLayer)entityModel;
98
		//set objects into panels		
99
		ogcMetadataPanel.setModel(model_layerwcs.getOgcMetadata());
100

  
101
	}
102

  
103
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wcs/MapserverServiceWCSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wcs;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
49
import org.gvsig.publish.mapserver.model.wcs.MapserverWCS;
50

  
51
public class MapserverServiceWCSPanel extends JPanel implements
52
IPublishPluginPanel {
53
	/**
54
	 * Components
55
	 */
56
	private CommonOGCMetadataPanel ogcMetadataPanel = null;
57
	/**
58
	 * model
59
	 */
60
	private MapserverWCS model_servicewcs;
61
	
62
	/**
63
	 * Constructor
64
	 */
65
	public MapserverServiceWCSPanel() {
66
		initComponents();
67
		// initLabels();
68
	}
69
    private void initComponents() {
70
        ogcMetadataPanel = new CommonOGCMetadataPanel();
71
        
72
        setLayout(new java.awt.GridBagLayout());
73

  
74
        //ogcMetadataPanel.setLayout(null);
75
        java.awt.GridBagConstraints gridBagConstraints;
76
        gridBagConstraints = new java.awt.GridBagConstraints();
77
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
78
        gridBagConstraints.weightx = 1.0;
79
        gridBagConstraints.weighty = 1.0;
80
        add(ogcMetadataPanel, gridBagConstraints);
81

  
82
    }// </editor-fold>                        
83

  
84
	public Object getModel() {
85
		ogcMetadataPanel.getModel();
86
		return model_servicewcs;
87
	}
88

  
89
	public void setListener(EventListener listener) {
90
		// TODO Auto-generated method stub
91

  
92
	}
93

  
94
	public void setModel(Object entityModel) {
95
		// cast to MapservrLayerWFS
96
		model_servicewcs = (MapserverWCS)entityModel;
97
		//set objects into panels		
98
		ogcMetadataPanel.setModel(model_servicewcs.getOgcMetadata());
99
	}
100

  
101

  
102
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wfs/MapserverLayerWFSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wfs;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
49
import org.gvsig.publish.mapserver.model.wfs.MapserverWFSLayer;
50

  
51
public class MapserverLayerWFSPanel extends JPanel implements
52
		IPublishPluginPanel {
53
	/**
54
	 * Components
55
	 */
56
	private CommonOGCMetadataPanel ogcMetadataPanel = null;
57
	/**
58
	 * model
59
	 */
60
	private MapserverWFSLayer model_layerwfs;
61
	/**
62
	 * Constructor
63
	 */
64
	public MapserverLayerWFSPanel() {
65
		initComponents();
66
		// initLabels();
67
	}
68
    private void initComponents() {
69
        ogcMetadataPanel = new CommonOGCMetadataPanel();
70

  
71
        setLayout(new java.awt.GridBagLayout());
72

  
73
        //ogcMetadataPanel.setLayout(null);
74
        java.awt.GridBagConstraints gridBagConstraints;
75
        gridBagConstraints = new java.awt.GridBagConstraints();
76
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
77
        gridBagConstraints.weightx = 1.0;
78
        gridBagConstraints.weighty = 1.0;
79
        add(ogcMetadataPanel, gridBagConstraints);
80
    }// </editor-fold>                        
81

  
82
	public Object getModel() {
83
		ogcMetadataPanel.getModel();
84
		return model_layerwfs;
85
	}
86

  
87
	public void setListener(EventListener listener) {
88
		// TODO Auto-generated method stub
89

  
90
	}
91

  
92
	public void setModel(Object entityModel) {
93
		// cast to MapservrLayerWFS
94
		model_layerwfs = (MapserverWFSLayer)entityModel;
95
		//set objects into panels		
96
		ogcMetadataPanel.setModel(model_layerwfs.getOgcMetadata());
97

  
98
	}
99

  
100
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/wfs/MapserverServiceWFSPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui.wfs;
42

  
43
import java.util.EventListener;
44

  
45
import javax.swing.JPanel;
46

  
47
import org.gvsig.publish.gui.ogcMetadata.CommonOGCMetadataPanel;
48
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
49
import org.gvsig.publish.mapserver.model.wfs.MapserverWFS;
50

  
51
public class MapserverServiceWFSPanel extends JPanel implements
52
		IPublishPluginPanel {
53
	/**
54
	 * Components
55
	 */
56
	private CommonOGCMetadataPanel ogcMetadataPanel = null;
57
	/**
58
	 * model
59
	 */
60
	private MapserverWFS model_servicewfs;
61
	
62
	/**
63
	 * Constructor
64
	 */
65
	public MapserverServiceWFSPanel() {
66
		initComponents();
67
		// initLabels();
68
	}
69
    private void initComponents() {
70
        ogcMetadataPanel = new CommonOGCMetadataPanel();
71
        
72
        setLayout(new java.awt.GridBagLayout());
73

  
74
        //ogcMetadataPanel.setLayout(null);
75
        java.awt.GridBagConstraints gridBagConstraints;
76
        gridBagConstraints = new java.awt.GridBagConstraints();
77
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
78
        gridBagConstraints.weightx = 1.0;
79
        gridBagConstraints.weighty = 1.0;
80
        add(ogcMetadataPanel, gridBagConstraints);
81

  
82
    }// </editor-fold>                        
83

  
84
	public Object getModel() {
85
		ogcMetadataPanel.getModel();
86
		return model_servicewfs;
87
	}
88

  
89
	public void setListener(EventListener listener) {
90
		// TODO Auto-generated method stub
91

  
92
	}
93

  
94
	public void setModel(Object entityModel) {
95
		// cast to MapservrLayerWFS
96
		model_servicewfs = (MapserverWFS)entityModel;
97
		//set objects into panels		
98
		ogcMetadataPanel.setModel(model_servicewfs.getOgcMetadata());
99
	}
100

  
101
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/MapFileChooser.java
1
package org.gvsig.publish.mapserver.gui;
2

  
3
import java.io.File;
4

  
5
import javax.swing.JFileChooser;
6

  
7
import com.iver.andami.PluginServices;
8
import com.iver.andami.ui.mdiManager.IWindow;
9
import com.iver.andami.ui.mdiManager.WindowInfo;
10
import com.iver.utiles.GenericFileFilter;
11
/**
12
 * Mapfile chooser.
13
 * 
14
 * @author jvhigon
15
 *
16
 */
17
public class MapFileChooser extends JFileChooser implements IWindow {
18
	WindowInfo mWindowInfo = null;
19
	/*
20
	 * Dependences
21
	 */
22
	GenericFileFilter filter = null;
23
	/**
24
	 * Constructor
25
	 * @param initialDirectory
26
	 */
27
	public MapFileChooser(File initialDirectory){
28
		super(initialDirectory);
29
		initialize();
30
	}
31
	/**
32
	 * Initializes the JFileChooser with a filter (*.map) 
33
	 */
34
	public void initialize(){
35
		String format = "map";
36
		String description = "Mapserver mapfiles";
37
		filter = new GenericFileFilter(format, description);
38
		this.setFileFilter(filter);
39
	}
40
	public WindowInfo getWindowInfo() {
41
		if (mWindowInfo == null){
42
			//mWindowInfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
43
			mWindowInfo=new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
44
			mWindowInfo.setTitle(PluginServices.getText(this,"mapfile_chooser_window"));
45
			mWindowInfo.setHeight(100);
46
			mWindowInfo.setWidth(200);
47
        }
48
        return mWindowInfo;
49
	}
50

  
51
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/ImagePathChooser.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui;
42

  
43
import java.io.File;
44

  
45
import javax.swing.JFileChooser;
46

  
47
import com.iver.andami.PluginServices;
48
import com.iver.andami.ui.mdiManager.IWindow;
49
import com.iver.andami.ui.mdiManager.WindowInfo;
50
/**
51
 * Mapfile chooser.
52
 * 
53
 * @author jvhigon
54
 *
55
 */
56
public class ImagePathChooser extends JFileChooser implements IWindow {
57
	WindowInfo mWindowInfo = null;
58
	/**
59
	 * Constructor
60
	 * @param initialDirectory
61
	 */
62
	public ImagePathChooser(File initialDirectory){
63
		super(initialDirectory);
64
	}
65
	public WindowInfo getWindowInfo() {
66
		if (mWindowInfo == null){
67
			//mWindowInfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
68
			mWindowInfo=new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
69
			mWindowInfo.setTitle(PluginServices.getText(this,"imagepath_chooser_window"));
70
			mWindowInfo.setHeight(100);
71
			mWindowInfo.setWidth(200);
72
        }
73
        return mWindowInfo;
74
	}
75

  
76
}
tags/tmp_build/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/gui/MapserverPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.publish.mapserver.gui;
42

  
43

  
44
import java.awt.event.ActionListener;
45
import java.io.File;
46
import java.net.MalformedURLException;
47
import java.net.URL;
48
import java.util.EventListener;
49

  
50
import javax.swing.JOptionPane;
51
import javax.swing.JPanel;
52

  
53
import org.gvsig.gui.beans.swing.JButton;
54
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
55
import org.gvsig.publish.mapserver.model.Mapserver;
56

  
57
import com.iver.andami.PluginServices;
58

  
59
public class MapserverPanel extends JPanel implements IPublishPluginPanel {
60

  
61
	/*
62
	 * model
63
	 */
64
	private Mapserver model_server = null;
65
	/**
66
	 * Constructor
67
	 */
68
	public MapserverPanel(){
69
		super();		
70
		initComponents();
71
		urlField.setEditable(false);
72
		initLabels();
73
		initIcons();
74
	}
75
	private void initIcons(){
76
		imagepathButton.setIcon(new javax.swing.ImageIcon(this.getClass().getClassLoader().getResource("images/publishmapserver-fileopen.gif")));
77
		fileButton.setIcon(new javax.swing.ImageIcon(this.getClass().getClassLoader().getResource("images/publishmapserver-fileopen.gif")));
78
	}
79

  
80
	private void initLabels(){
81
		setBorder(javax.swing.BorderFactory.createTitledBorder(PluginServices.getText(this,"mapserver_properties")));
82
		nameLabel.setText(PluginServices.getText(this,"mapserver_mapname"));
83
		urlLabel.setText(PluginServices.getText(this,"mapserver_url"));
84
		mapfileLabel.setText(PluginServices.getText(this,"mapserver_mapfile"));
85
		nameField.setText(PluginServices.getText(this,"name"));
86
		imagepathLabel.setText(PluginServices.getText(this,"mapserver_imagepath"));
87
		shapepathLabel.setText(PluginServices.getText(this,"mapserver_shapepath"));
88

  
89
	}
90
	private void initComponents() {
91
		java.awt.GridBagConstraints gridBagConstraints;
92

  
93
		nameLabel = new javax.swing.JLabel();
94
		urlLabel = new javax.swing.JLabel();
95
		mapfileLabel = new javax.swing.JLabel();
96
		nameField = new javax.swing.JTextField();
97
		urlField = new javax.swing.JTextField();
98
		mapfileField = new javax.swing.JTextField();
99
		imagepathLabel = new javax.swing.JLabel();
100
		imagepathField = new javax.swing.JTextField();
101
		shapepathLabel = new javax.swing.JLabel();
102
		shapepathField = new javax.swing.JTextField();
103
		fileButton = new org.gvsig.gui.beans.swing.JButton();
104
		imagepathButton = new org.gvsig.gui.beans.swing.JButton();
105

  
106
		setLayout(new java.awt.GridBagLayout());
107

  
108
		setBorder(javax.swing.BorderFactory.createTitledBorder("mapserver_properties"));
109
		nameLabel.setText("mapserver_mapname");
110
		gridBagConstraints = new java.awt.GridBagConstraints();
111
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
112
		add(nameLabel, gridBagConstraints);
113

  
114
		urlLabel.setText("mapserver_url");
115
		gridBagConstraints = new java.awt.GridBagConstraints();
116
		gridBagConstraints.gridx = 0;
117
		gridBagConstraints.gridy = 1;
118
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
119
		add(urlLabel, gridBagConstraints);
120

  
121
		mapfileLabel.setText("mapserver_mapfile");
122
		gridBagConstraints = new java.awt.GridBagConstraints();
123
		gridBagConstraints.gridx = 0;
124
		gridBagConstraints.gridy = 2;
125
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
126
		add(mapfileLabel, gridBagConstraints);
127

  
128
		nameField.setText("name");
129
		gridBagConstraints = new java.awt.GridBagConstraints();
130
		gridBagConstraints.gridx = 1;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff