Revision 230

View differences:

org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/resources/config/config.xml
5 5
	<libraries library-dir="lib" />
6 6
	<resourceBundle name="text" />
7 7
	<extensions>
8
		<extension class-name="org.gvsig.geoprocess.extensions.ToolboxExtension"
8
		<extension class-name="org.gvsig.geoprocess.extension.GeoprocessExtension"
9 9
			description="Geoprocessing Toolbox" active="true">
10
			<menu text="tools/Geoprocessing/Geoprocessing_Toolbox" tooltip="Geoprocessing_Toolbox" icon="images/sextante.gif"
11
				position="1" />
12
			<tool-bar name="Geoprocessing" position="2">
13
				<action-tool icon="images/sextante.gif" tooltip="Geoprocessing_Toolbox"
14
					position="1" />
15
			</tool-bar>
16
		</extension>
17
		<extension class-name="org.gvsig.geoprocess.extensions.ModelerExtension"
18
			description="Geoprocessing Modeler" active="true">
19
			<menu text="tools/Geoprocessing/Geoprocessing_Modeler" tooltip="Geoprocessing_Modeler" icon="images/model.png"
20
				position="2" />
21
			<!--tool-bar name="Geoprocessing" position="2">
22
				<action-tool icon="images/model.png" tooltip="Geoprocessing_Modeler"
23
					position="2" />
24
			</tool-bar-->
25
		</extension>
26 10

  
27
		<extension class-name="org.gvsig.geoprocess.extensions.HistoryExtension"
28
			description="History" active="true">
29
			<menu text="tools/Geoprocessing/Geoprocessing_History" tooltip="Geoprocessing_History" icon="images/history.gif"
30
				position="3" />
31
			<!--tool-bar name="Geoprocessing" position="2">
32
				<action-tool icon="images/history.gif" tooltip="Geoprocessing_History"
33
					position="4" />
34
			</tool-bar-->
35
		</extension>
36
		<extension class-name="org.gvsig.geoprocess.extensions.CommandLineExtension"
37
			description="Geoprocessing_command_line" active="true">
38
			<menu text="tools/Geoprocessing/Geoprocessing_command_line" tooltip="Geoprocessing_command_line" icon="images/terminal.png"
39
				position="4" />
40
			<!--tool-bar name="Geoprocessing" position="2">
41
				<action-tool icon="images/terminal.png" tooltip="Geoprocessing_command_line"
42
					position="3" />
43
			</tool-bar-->
44
		</extension>
45
		<extension
46
			class-name="org.gvsig.geoprocess.extensions.AdditionalResultsExtension"
47
			description="Geoprocessing Results" active="true">
48
			<menu text="tools/Geoprocessing/Geoprocessing_Results" tooltip="Geoprocessing_Results" icon="images/chart.gif"
49
				position="5" />
50
			<!--tool-bar name="Geoprocessing" position="2">
51
				<action-tool icon="images/chart.gif" tooltip="Geoprocessing_Results"
52
					position="5" />
53
			</tool-bar-->
54
		</extension>
55
		<extension class-name="org.gvsig.geoprocess.extensions.DataExplorerExtension"
56
			description="Geoprocessing Data Explorer" active="false">
57
			<menu text="tools/Geoprocessing/Geoprocessing_Data_Explorer" tooltip="Geoprocessing_Data_Explorer" icon="images/documenter.png"
58
				position="6" />
59
			<!--tool-bar name="Geoprocessing" position="2">
60
				<action-tool icon="images/documenter.png" tooltip="Geoprocessing_Data_Explorer"
61
					position="7" />
62
			</tool-bar-->
63
		</extension>
11
			<menu text="tools/Geoprocessing/Geoprocessing_Toolbox" 
12
			      tooltip="Geoprocessing_Toolbox"
13
				  icon="process-icon" 
14
				  position="1" 
15
				  action-command="GEOPROCESS_SELECTOR" />
16
				  
17
			<menu text="tools/Geoprocessing/Geoprocessing_Modeler" 
18
				  tooltip="Geoprocessing_Modeler"
19
				  icon="images/model.png" 
20
				  position="2"
21
				  action-command="GEOPROCESS_MODELER" />
22
				  
23
			<menu text="tools/Geoprocessing/Geoprocessing_History" 
24
				  tooltip="Geoprocessing_History"
25
				  icon="images/history.gif" 
26
				  position="3"
27
				  action-command="GEOPROCESS_HISTORY" />
64 28

  
65
		<extension class-name="org.gvsig.geoprocess.extensions.HelpExtension"
66
			description="Geoprocessing Help" active="true">
67
			<menu text="tools/Geoprocessing/Geoprocessing_Help" tooltip="Geoprocessing_Help" icon="images/help.png"
68
				position="7" />
69
			<!--tool-bar name="Geoprocessing" position="2">
70
				<action-tool icon="images/help.png" tooltip="Geoprocessing_Help"
71
					position="8" />
72
			</tool-bar-->
29
			<menu text="tools/Geoprocessing/Geoprocessing_command_line"
30
				  tooltip="Geoprocessing_command_line" 
31
				  icon="images/terminal.png"
32
				  position="4"
33
				  action-command="GEOPROCESS_COMMAND_LINE" />
34

  
35
			<menu text="tools/Geoprocessing/Geoprocessing_Results" 
36
			      tooltip="Geoprocessing_Results"
37
				  icon="images/chart.gif" 
38
				  position="5"
39
				  action-command="GEOPROCESS_RESULTS" />
40

  
41
			<menu text="tools/Geoprocessing/Geoprocessing_Data_Explorer"
42
				  tooltip="Geoprocessing_Data_Explorer" 
43
				  icon="images/documenter.png"
44
				  position="6"
45
				  action-command="GEOPROCESS_DATAEXPLORER" />
46

  
47
			<menu text="tools/Geoprocessing/Geoprocessing_Help" 
48
			      tooltip="Geoprocessing_Help"
49
				  icon="images/help.png" 
50
				  position="7"
51
				  action-command="GEOPROCESS_HELP" />
52

  
53
			<tool-bar name="Geoprocessing" position="10">
54
				<action-tool icon="process-icon" 
55
				             tooltip="Geoprocessing_Toolbox"
56
					         position="1" 
57
					         action-command="GEOPROCESS_SELECTOR" />
58
			</tool-bar>
59
			
60
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/model.png" 
61
					tooltip="Geoprocessing_Modeler" position="2" /> </tool-bar -->
62
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/history.gif" 
63
				tooltip="Geoprocessing_History" position="4" /> </tool-bar -->
64
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/terminal.png" 
65
				tooltip="Geoprocessing_command_line" position="3" /> </tool-bar -->
66
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/chart.gif" 
67
				tooltip="Geoprocessing_Results" position="5" /> </tool-bar -->
68
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/documenter.png" 
69
				tooltip="Geoprocessing_Data_Explorer" position="7" /> </tool-bar -->
70
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/help.png" 
71
				tooltip="Geoprocessing_Help" position="8" /> </tool-bar -->
73 72
		</extension>
74 73

  
75
		<extension class-name="org.gvsig.geoprocess.extensions.PointCollectorExtension"
74
		<extension class-name="org.gvsig.geoprocess.extension.GeoprocessPointSelectionExtension"
76 75
			description="Catch coordinates" active="true">
77
			<menu text="tools/Geoprocessing/Geoprocessing_PointCollector" tooltip="Geoprocessing_PointCollector" icon="images/bullseye.gif"
76
			<menu text="tools/Geoprocessing/Geoprocessing_PointCollector"
77
				tooltip="Geoprocessing_PointCollector" icon="images/bullseye.gif"
78 78
				position="8" />
79
			<!--tool-bar name="Geoprocessing" position="2">
80
				<action-tool icon="images/bullseye.gif" tooltip="Catch coordinates"
81
					position="8" />
82
			</tool-bar-->
79
			<!--tool-bar name="Geoprocessing" position="2"> <action-tool icon="images/bullseye.gif" 
80
				tooltip="Catch coordinates" position="8" /> </tool-bar -->
83 81
		</extension>
84 82
	</extensions>
85 83
</plugin-config>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/resources/i18n/text.properties
54 54

  
55 55
Classification=Clasificaci?n
56 56

  
57
Geoprocessing=Geoprocesamiento
57
Geoprocessing=Geoprocesamiento
58

  
59
Point_name=Nombre del punto
60

  
61
New_point=Nuevo punto
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/resources/i18n/text_en.properties
55 55
Classification=Classification
56 56

  
57 57
Geoprocessing=Geoprocessing
58

  
59
Point_name=Point name
60

  
61
New_point=New point
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extension/GeoprocessExtension.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2012 gvSIG Association
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 */
21
package org.gvsig.geoprocess.extension;
22

  
23
import es.unex.sextante.gui.additionalResults.AdditionalResults;
24
import es.unex.sextante.gui.core.IGUIFactory;
25
import es.unex.sextante.gui.core.SextanteGUI;
26
import es.unex.sextante.gui.history.History;
27

  
28
import org.gvsig.andami.plugins.Extension;
29
import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
30

  
31
/**
32
 * Extension to show Geoprocess GUI utilities.
33
 * 
34
 * @author gvSIG Team
35
 * @version $Id$
36
 */
37
public class GeoprocessExtension extends Extension {
38

  
39
    private static final String GEOPROCESS_SELECTOR = "GEOPROCESS_SELECTOR";
40

  
41
    private static final String GEOPROCESS_MODELER = "GEOPROCESS_MODELER";
42

  
43
    private static final String GEOPROCESS_HISTORY = "GEOPROCESS_HISTORY";
44

  
45
    private static final String GEOPROCESS_COMMAND_LINE =
46
        "GEOPROCESS_COMMAND_LINE";
47

  
48
    private static final String GEOPROCESS_RESULTS = "GEOPROCESS_RESULTS";
49

  
50
    private static final String GEOPROCESS_DATAEXPLORER =
51
        "GEOPROCESS_DATAEXPLORER";
52

  
53
    private static final String GEOPROCESS_HELP = "GEOPROCESS_HELP";
54

  
55
    public void initialize() {
56
        SextanteGUI.setGUIFactory(new GUIFactory());
57
        History.startSession();
58
    }
59

  
60
    public void execute(String actionCommand) {
61

  
62
        IGUIFactory guiFactory = SextanteGUI.getGUIFactory();
63

  
64
        if (GEOPROCESS_SELECTOR.equals(actionCommand)) {
65
            guiFactory.showToolBoxDialog();
66
            return;
67
        }
68

  
69
        if (GEOPROCESS_MODELER.equals(actionCommand)) {
70
            guiFactory.showModelerDialog();
71
            return;
72
        }
73

  
74
        if (GEOPROCESS_HISTORY.equals(actionCommand)) {
75
            guiFactory.showHistoryDialog();
76
            return;
77
        }
78

  
79
        if (GEOPROCESS_COMMAND_LINE.equals(actionCommand)) {
80
            guiFactory.showCommandLineDialog();
81
            return;
82
        }
83

  
84
        if (GEOPROCESS_RESULTS.equals(actionCommand)) {
85
            guiFactory.showAdditionalResultsDialog(AdditionalResults
86
                .getComponents());
87
            return;
88
        }
89

  
90
        if (GEOPROCESS_DATAEXPLORER.equals(actionCommand)) {
91
            guiFactory.showDataExplorer();
92
            return;
93
        }
94

  
95
        if (GEOPROCESS_HELP.equals(actionCommand)) {
96
            guiFactory.showHelpWindow();
97
            return;
98
        }
99
    }
100

  
101
    public boolean isEnabled() {
102
        return true;
103
    }
104

  
105
    public boolean isVisible() {
106
        return true;
107
    }
108

  
109
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extension/GeoprocessPointSelectionExtension.java
1
package org.gvsig.geoprocess.extension;
2

  
3
import org.gvsig.andami.plugins.Extension;
4
import org.gvsig.app.ApplicationLocator;
5
import org.gvsig.app.ApplicationManager;
6
import org.gvsig.app.project.documents.view.gui.IView;
7
import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
8
import org.gvsig.fmap.mapcontrol.MapControl;
9
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
10
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
11
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
12

  
13
/**
14
 * Collector of points over the gvSIG view document window, to be used
15
 * in the geoprocess parameters extension definition.
16
 * 
17
 * @author gvSIG Team
18
 * @version $Id$
19
 */
20
public class GeoprocessPointSelectionExtension extends Extension {
21

  
22
    private final static String TOOL_NAME = "GeoprocessingPointSelector";
23
    private ApplicationManager manager;
24

  
25
    public void initialize() {
26
        manager = ApplicationLocator.getManager();
27
    }
28

  
29
    public void execute(final String s) {
30
        MapControl mapControl =
31
            ((IView) manager.getActiveWindow()).getMapControl();
32
        GeoprocessPointSelectionListener pointSelectorListener =
33
            new GeoprocessPointSelectionListener(mapControl);
34
        StatusBarListener listener = new StatusBarListener(mapControl);
35
        mapControl.addBehavior(TOOL_NAME, new Behavior[] {
36
            new PointBehavior(pointSelectorListener),
37
            new MouseMovementBehavior(listener) });
38
        mapControl.setTool(TOOL_NAME);
39
    }
40

  
41
    public boolean isEnabled() {
42
        return manager.getActiveWindow() instanceof IView;
43
    }
44

  
45
    public boolean isVisible() {
46
        return manager.getActiveWindow() instanceof IView;
47
    }
48
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extension/GeoprocessPointSelectionListener.java
1
package org.gvsig.geoprocess.extension;
2

  
3
import java.awt.geom.Point2D;
4

  
5
import javax.swing.JOptionPane;
6

  
7
import es.unex.sextante.gui.core.NamedPoint;
8
import es.unex.sextante.gui.core.SextanteGUI;
9

  
10
import org.gvsig.fmap.mapcontrol.MapControl;
11
import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
12
import org.gvsig.fmap.mapcontrol.tools.PointSelectionListener;
13
import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
14
import org.gvsig.i18n.Messages;
15

  
16
/**
17
 * Tool to collect points over the gvSIG view document window, to be used
18
 * in the geoprocess parameters extension definition.
19
 * 
20
 * @author gvSIG Team
21
 * @version $Id$
22
 */
23
public class GeoprocessPointSelectionListener extends PointSelectionListener {
24

  
25
    /**
26
     * Listener constructor with a given {@link MapControl}.
27
     * 
28
     * @param mapControl
29
     *            to use to get the points from
30
     */
31
    public GeoprocessPointSelectionListener(MapControl mapControl) {
32
        super(mapControl);
33
    }
34

  
35
    public void point(final PointEvent event) throws BehaviorException {
36
        Point2D point = event.getPoint();
37
        Point2D mapPoint = mapCtrl.getViewPort().toMapPoint(point);
38

  
39
        String pointName =
40
            JOptionPane.showInputDialog(
41
                null,
42
                "X: " + Double.toString(mapPoint.getX()) + "\n" + "Y: "
43
                    + Double.toString(mapPoint.getY()) + "\n"
44
                    + Messages.getText("Point_name") + ":",
45
                Messages.getText("New_point"));
46

  
47
        if (pointName != null) {
48
            NamedPoint namedPoint = new NamedPoint(pointName, mapPoint);
49
            SextanteGUI.getGUIFactory().getCoordinatesList().add(namedPoint);
50
        }
51
    }
52
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/AdditionalResultsExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.additionalResults.AdditionalResults;
4
import es.unex.sextante.gui.core.SextanteGUI;
5

  
6
import org.gvsig.andami.plugins.Extension;
7

  
8
public class AdditionalResultsExtension extends Extension {
9

  
10
    public void initialize() {
11
    }
12

  
13
   public void execute(final String actionCommand) {
14

  
15
        SextanteGUI.getGUIFactory().showAdditionalResultsDialog(
16
            AdditionalResults.getComponents());
17

  
18
    }
19

  
20

  
21
    public boolean isEnabled() {
22

  
23
        return true;
24

  
25
    }
26

  
27

  
28
    public boolean isVisible() {
29

  
30
        return true;
31

  
32
    }
33

  
34
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/DataExplorerExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4

  
5
import org.gvsig.andami.plugins.Extension;
6

  
7
public class DataExplorerExtension extends Extension {
8

  
9
    public void initialize() {
10
    }
11

  
12
   public void execute(final String actionCommand) {
13

  
14
        SextanteGUI.getGUIFactory().showDataExplorer();
15

  
16
    }
17

  
18

  
19
    public boolean isEnabled() {
20

  
21
        return true;
22

  
23
    }
24

  
25

  
26
    public boolean isVisible() {
27

  
28
        return true;
29

  
30
    }
31

  
32
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/PointCollectorExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import org.gvsig.andami.PluginServices;
4
import org.gvsig.andami.plugins.Extension;
5
import org.gvsig.andami.ui.mdiManager.IWindow;
6
import org.gvsig.app.project.documents.view.gui.IView;
7
import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
8
import org.gvsig.fmap.mapcontrol.MapControl;
9
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
10
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
11
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
12

  
13
public class PointCollectorExtension extends Extension {
14

  
15
    private final static String TOOL_NAME = "sextantePointCollector";
16

  
17
    public void execute(final String s) {
18
        final IView vista =
19
            (IView) PluginServices.getMDIManager().getActiveWindow();
20
        final MapControl mapCtrl = vista.getMapControl();
21

  
22
        final PointSelectorListener psl = new PointSelectorListener();
23
        final StatusBarListener sbl = new StatusBarListener(mapCtrl);
24
        mapCtrl.addBehavior(TOOL_NAME, new Behavior[] { new PointBehavior(psl),
25
            new MouseMovementBehavior(sbl) });
26
        mapCtrl.setTool(TOOL_NAME);
27

  
28
    }
29

  
30

  
31
    /**
32
     * @see com.iver.mdiApp.plugins.IExtension#isVisible()
33
     */
34
    public boolean isEnabled() {
35
        final IWindow f = PluginServices.getMDIManager().getActiveWindow();
36

  
37
        if (f == null) {
38
            return false;
39
        }
40

  
41
        return (f instanceof IView);
42

  
43
    }
44

  
45

  
46
    /**
47
     * @see com.iver.andami.plugins.IExtension#initialize()
48
     */
49
    public void initialize() {
50

  
51

  
52
    }
53

  
54

  
55
    /**
56
     * @see com.iver.andami.plugins.IExtension#isEnabled()
57
     */
58
    public boolean isVisible() {
59

  
60
        final IWindow f = PluginServices.getMDIManager().getActiveWindow();
61

  
62
        if (f == null) {
63
            return false;
64
        }
65

  
66
        return (f instanceof IView);
67

  
68
    }
69
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/HistoryExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4
import es.unex.sextante.gui.history.History;
5

  
6
import org.gvsig.andami.plugins.Extension;
7

  
8

  
9
public class HistoryExtension extends Extension {
10

  
11
    public void initialize() {
12

  
13
        History.startSession();
14

  
15
    }
16

  
17
   public void execute(final String actionCommand) {
18

  
19
        SextanteGUI.getGUIFactory().showHistoryDialog();
20

  
21
    }
22

  
23

  
24
    public boolean isEnabled() {
25

  
26
        return true;
27

  
28
    }
29

  
30

  
31
    public boolean isVisible() {
32

  
33
        return true;
34

  
35
    }
36

  
37

  
38
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/PointSelectorListener.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import java.awt.Image;
4
import java.awt.geom.Point2D;
5

  
6
import javax.swing.ImageIcon;
7
import javax.swing.JOptionPane;
8

  
9
import es.unex.sextante.core.Sextante;
10
import es.unex.sextante.gui.core.NamedPoint;
11
import es.unex.sextante.gui.core.SextanteGUI;
12

  
13
import org.gvsig.andami.PluginServices;
14
import org.gvsig.app.project.documents.view.gui.IView;
15
import org.gvsig.fmap.mapcontext.ViewPort;
16
import org.gvsig.fmap.mapcontrol.MapControl;
17
import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
18
import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
19
import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
20

  
21
public class PointSelectorListener implements PointListener {
22

  
23
    private final Image img = new ImageIcon(
24
        MapControl.class.getResource("images/PointSelectCursor.gif"))
25
        .getImage();
26

  
27
    public PointSelectorListener() {
28
        super();
29
    }
30

  
31
    public void point(final PointEvent event) throws BehaviorException {
32

  
33
        IView view;
34

  
35
        try {
36
            view = (IView) PluginServices.getMDIManager().getActiveWindow();
37
        } catch (final ClassCastException exc) {
38
            return;
39
        }
40

  
41
        final ViewPort viewPort =
42
            view.getMapControl().getMapContext().getViewPort();
43
        final Point2D wcPoint = viewPort.toMapPoint(event.getPoint());
44
        final String sPointName =
45
            JOptionPane.showInputDialog(
46
                null,
47
                "X: " + Double.toString(wcPoint.getX()) + "\n" + "Y: "
48
                    + Double.toString(wcPoint.getY()),
49
                Sextante.getText("New point"));
50
        if (sPointName != null) {
51
            final NamedPoint namedPoint = new NamedPoint(sPointName, wcPoint);
52
            SextanteGUI.getGUIFactory().getCoordinatesList().add(namedPoint);
53
        }
54

  
55
    }
56

  
57

  
58
    public boolean cancelDrawing() {
59
        return false;
60
    }
61

  
62

  
63
    public void pointDoubleClick(final PointEvent event)
64
        throws BehaviorException {
65

  
66
    }
67

  
68
    public Image getImageCursor() {
69
        return img;
70
    }
71
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/CommandLineExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4

  
5
import org.gvsig.andami.plugins.Extension;
6

  
7
public class CommandLineExtension extends Extension {
8

  
9
    public void initialize() {
10
    }
11

  
12
   public void execute(final String actionCommand) {
13

  
14
        SextanteGUI.getGUIFactory().showCommandLineDialog();
15

  
16
    }
17

  
18

  
19
    public boolean isEnabled() {
20

  
21
        return true;
22

  
23
    }
24

  
25

  
26
    public boolean isVisible() {
27

  
28
        return true;
29

  
30
    }
31

  
32
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/ToolboxExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4

  
5
import org.gvsig.andami.plugins.Extension;
6
import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
7

  
8
public class ToolboxExtension extends Extension {
9

  
10
    public void initialize() {
11
        SextanteGUI.setGUIFactory(new GUIFactory());
12
    }
13

  
14
    public void execute(final String actionCommand) {
15
        SextanteGUI.getGUIFactory().showToolBoxDialog();
16
    }
17

  
18
    public boolean isEnabled() {
19
        return true;
20
    }
21

  
22
    public boolean isVisible() {
23
        return true;
24
    }
25

  
26
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/ModelerExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4

  
5
import org.gvsig.andami.plugins.Extension;
6

  
7
public class ModelerExtension extends Extension {
8

  
9
    public void initialize() {
10
    }
11

  
12
   public void execute(final String actionCommand) {
13

  
14
        SextanteGUI.getGUIFactory().showModelerDialog();
15

  
16
    }
17

  
18

  
19
    public boolean isEnabled() {
20

  
21
        return true;
22

  
23
    }
24

  
25

  
26
    public boolean isVisible() {
27

  
28
        return true;
29

  
30
    }
31

  
32
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/extensions/HelpExtension.java
1
package org.gvsig.geoprocess.extensions;
2

  
3
import es.unex.sextante.gui.core.SextanteGUI;
4

  
5
import org.gvsig.andami.plugins.Extension;
6

  
7
public class HelpExtension extends Extension {
8

  
9
    public void initialize() {
10
    }
11

  
12
    public void execute(final String actionCommand) {
13

  
14
        SextanteGUI.getGUIFactory().showHelpWindow();
15

  
16
    }
17

  
18
    public boolean isEnabled() {
19

  
20
        return true;
21

  
22
    }
23

  
24
    public boolean isVisible() {
25

  
26
        return true;
27

  
28
    }
29

  
30
}

Also available in: Unified diff