Revision 2344

View differences:

org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.raster.principalcomponents</artifactId>
5
	<packaging>pom</packaging>
6
	<version>2.0.0-SNAPSHOT</version>
7
	<name>org.gvsig.raster.principalcomponents</name>
8
	<description></description>
9
	<inceptionYear>2011</inceptionYear>
10
	<parent>
11
      <groupId>org.gvsig</groupId>
12
      <artifactId>org.gvsig.desktop</artifactId>
13
      <version>2.0.15-SNAPSHOT</version>
14
    </parent>
15
    <scm>
16
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.principalcomponents/trunk/org.gvsig.raster.principalcomponents</connection>
17
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.principalcomponents/trunk/org.gvsig.raster.principalcomponents</developerConnection>
18
        <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.principalcomponents/trunk/org.gvsig.raster.principalcomponents</url>
19
    </scm>
20
    <build>
21
        <plugins>
22
            <plugin>
23
                <groupId>org.apache.maven.plugins</groupId>
24
                <artifactId>maven-release-plugin</artifactId>
25
                <configuration>
26
                    <tagBase>https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.principalcomponents/tags/</tagBase>
27
                    <goals>deploy</goals>
28
                </configuration>
29
            </plugin>
30
        </plugins>
31
    </build>
32
    		
33
	<dependencyManagement>
34
		<dependencies>
35
			<dependency>
36
				<groupId>org.gvsig</groupId>
37
				<artifactId>org.gvsig.raster.mainplugin</artifactId>
38
				<version>2.1.0-SNAPSHOT</version>
39
			</dependency>
40
			<dependency>
41
				<groupId>org.gvsig.legacy</groupId>
42
				<artifactId>jama</artifactId>
43
				<version>1.0.3</version>
44
			</dependency>
45
			<dependency>
46
				<groupId>org.gvsig</groupId>
47
				<artifactId>org.gvsig.raster.principalcomponents.lib.api</artifactId>
48
				<version>2.0.0-SNAPSHOT</version>
49
			</dependency>
50
			<dependency>
51
				<groupId>org.gvsig</groupId>
52
				<artifactId>org.gvsig.raster.principalcomponents.lib.impl</artifactId>
53
				<version>2.0.0-SNAPSHOT</version>
54
			</dependency>
55
			<dependency>
56
				<groupId>org.gvsig</groupId>
57
				<artifactId>org.gvsig.raster.principalcomponents.swing.api</artifactId>
58
				<version>2.0.0-SNAPSHOT</version>
59
			</dependency>
60
			<dependency>
61
				<groupId>org.gvsig</groupId>
62
				<artifactId>org.gvsig.raster.principalcomponents.swing.impl</artifactId>
63
				<version>2.0.0-SNAPSHOT</version>
64
			</dependency>
65
			<dependency>
66
				<groupId>org.gvsig</groupId>
67
				<artifactId>org.gvsig.raster.principalcomponents.algorithm</artifactId>
68
				<version>2.0.0-SNAPSHOT</version>
69
			</dependency>
70
			<dependency>
71
            	<groupId>org.gvsig</groupId>
72
            	<artifactId>org.gvsig.raster.swing.api</artifactId>           
73
            	<version>2.1.0-SNAPSHOT</version>
74
        	</dependency> 
75
       		<dependency>
76
            	<groupId>org.gvsig</groupId>
77
            	<artifactId>org.gvsig.raster.swing.impl</artifactId>           
78
            	<version>2.1.0-SNAPSHOT</version>
79
        	</dependency>
80
			<dependency>
81
	            <groupId>org.gvsig</groupId>
82
	            <artifactId>org.gvsig.raster.lib.api</artifactId>
83
	            <version>2.1.0-SNAPSHOT</version>
84
	        </dependency>
85
	        <dependency>
86
	            <groupId>org.gvsig</groupId>
87
	            <artifactId>org.gvsig.raster.lib.impl</artifactId>
88
	            <version>2.1.0-SNAPSHOT</version>
89
	        </dependency>
90
			<dependency>
91
				<groupId>org.gvsig</groupId>
92
				<artifactId>org.gvsig.raster.fmap</artifactId>
93
				<version>2.1.0-SNAPSHOT</version>
94
			</dependency>
95
			<dependency>
96
				<groupId>org.gvsig</groupId>
97
				<artifactId>org.gvsig.raster.algorithm</artifactId>
98
				<version>2.1.0-SNAPSHOT</version>
99
			</dependency>
100
			<dependency>
101
		    	<groupId>org.gvsig</groupId>
102
   				<artifactId>org.gvsig.geoprocess.algorithm.base</artifactId>
103
            	<version>2.1.0-SNAPSHOT</version>
104
   			</dependency>
105
   			<dependency>
106
				<groupId>org.gvsig</groupId>
107
				<artifactId>org.gvsig.geoprocess.lib.sextante</artifactId>
108
				<version>2.1.0-SNAPSHOT</version>
109
			</dependency>
110
   			<dependency>
111
				<groupId>org.gvsig</groupId>
112
				<artifactId>org.gvsig.raster.principalcomponents.sextante</artifactId>
113
				<version>2.0.0-SNAPSHOT</version>
114
			</dependency>
115
		</dependencies>
116
	</dependencyManagement>
117
	<modules>
118
		<module>org.gvsig.raster.principalcomponents.algorithm</module>
119
		<module>org.gvsig.raster.principalcomponents.sextante</module>
120
		<module>org.gvsig.raster.principalcomponents.swing</module>
121
		<module>org.gvsig.raster.principalcomponents.app.principalcomponentsclient</module>
122
	</modules>
123
</project>
0 124

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu May 16 16:37:44 CET 2013
3
buildNumber=2
0 4

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25

  
26
  <dependencySets>
27
    <dependencySet>
28
      <useProjectArtifact>false</useProjectArtifact>
29
	  <useTransitiveDependencies>false</useTransitiveDependencies>
30
      <outputDirectory>lib</outputDirectory>
31
      <includes> 
32
			<include>org.gvsig:org.gvsig.raster.principalcomponents.app.principalcomponentsclient:jar</include>
33
			<include>org.gvsig:org.gvsig.raster.principalcomponents.lib.api:jar</include>
34
			<include>org.gvsig:org.gvsig.raster.principalcomponents.lib.impl:jar</include>
35
			<include>org.gvsig:org.gvsig.raster.principalcomponents.swing.api:jar</include>
36
			<include>org.gvsig:org.gvsig.raster.principalcomponents.swing.impl:jar</include>
37
			<include>org.gvsig:org.gvsig.raster.principalcomponents.algorithm:jar</include>
38
			<include>org.gvsig:org.gvsig.raster.principalcomponents.sextante:jar</include>
39
	  </includes>
40
	</dependencySet>
41
  </dependencySets>
42
</assembly>
0 43

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/java/org/gvsig/raster/principalcomponents/app/MainWindow.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2011-2012 Prodevelop S.L
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., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 */
21
package org.gvsig.raster.principalcomponents.app;
22

  
23
import java.awt.BorderLayout;
24
import java.awt.event.ActionEvent;
25
import java.awt.event.ActionListener;
26

  
27
import javax.swing.JComponent;
28

  
29
import org.gvsig.andami.PluginServices;
30
import org.gvsig.andami.ui.mdiManager.IWindow;
31
import org.gvsig.andami.ui.mdiManager.WindowInfo;
32
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
33
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
34

  
35

  
36
/**
37
 * Basic frame for a gvSIG <code>IWindow</code> object. This frame adds buttons 
38
 * of Cancel, Accept and others.
39
 * 
40
 * @author Nacho Brodin (nachobrodin@gmail.com)
41
 */
42
public class MainWindow extends DefaultButtonsPanel implements IWindow, ActionListener {
43
    
44
    private static final long  serialVersionUID = -4401123724140025094L;
45
    private ActionListener     listener         = null;
46
    private WindowInfo         info             = null;
47

  
48
    private Object profile = WindowInfo.EDITOR_PROFILE;
49

  
50
    public MainWindow(JComponent panel, String title, int w, int h, ActionListener actionListener) {
51
    	this.listener = actionListener;
52
    	
53
    	setLayout(new BorderLayout());
54
		add(panel, BorderLayout.CENTER);
55

  
56
		getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setVisible(false);
57
        getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).addActionListener(this);
58
        getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL).addActionListener(this);
59
        
60
        info = new WindowInfo(WindowInfo.PALETTE | WindowInfo.RESIZABLE);
61
        info.setTitle(title);
62
        info.setWidth(w);
63
        info.setHeight(h);
64
    }
65
    
66
    public MainWindow(JComponent panel, String title, int w, int h, ActionListener actionListener, boolean closeButton) {
67
    	this.listener = actionListener;
68
    	
69
    	setLayout(new BorderLayout());
70
		add(panel, BorderLayout.CENTER);
71

  
72
		getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setVisible(false);
73
		
74
		if(closeButton) {
75
			getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setVisible(false);
76
			getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL).setVisible(false);
77
			getButtonsPanel().addClose();
78
			getButtonsPanel().getButton(ButtonsPanel.BUTTON_CLOSE).addActionListener(this);
79
		} else {
80
			getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).addActionListener(this);
81
			getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL).addActionListener(this);
82
		}
83
        
84
        info = new WindowInfo(WindowInfo.PALETTE | WindowInfo.RESIZABLE);
85
        info.setTitle(title);
86
        info.setWidth(w);
87
        info.setHeight(h);
88
    }
89

  
90
    public WindowInfo getWindowInfo() {
91
        return info;
92
    }
93

  
94
    public Object getWindowProfile() {
95
        return profile;
96
    }
97

  
98
    public void actionPerformed(ActionEvent e) {
99
    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT)) {
100
    		listener.actionPerformed(e);
101
    		PluginServices.getMDIManager().closeWindow(this);
102
    	}
103
    	
104
    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY)) {
105
    		listener.actionPerformed(e);
106
    	}
107
    	
108
    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL)) {
109
    		PluginServices.getMDIManager().closeWindow(this);
110
    	}
111
    	
112
    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_CLOSE)) {
113
    		PluginServices.getMDIManager().closeWindow(this);
114
    	}
115
    }
116
}
0 117

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/java/org/gvsig/raster/principalcomponents/app/PrincipalComponentsExtension.java
1
package org.gvsig.raster.principalcomponents.app;
2

  
3
import java.awt.event.ActionEvent;
4
import java.awt.event.ActionListener;
5
import java.util.HashMap;
6

  
7
import javax.swing.JPanel;
8

  
9
import org.gvsig.andami.IconThemeHelper;
10
import org.gvsig.andami.PluginServices;
11
import org.gvsig.andami.plugins.Extension;
12
import org.gvsig.andami.ui.mdiManager.IWindow;
13
import org.gvsig.app.project.documents.view.gui.IView;
14
import org.gvsig.fmap.mapcontext.layers.FLayer;
15
import org.gvsig.fmap.mapcontrol.MapControl;
16
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
17
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
18
import org.gvsig.i18n.Messages;
19
import org.gvsig.raster.algorithm.BasicAPISwingPanel;
20
import org.gvsig.raster.algorithm.process.DataProcess;
21
import org.gvsig.raster.algorithm.process.IProcessActions;
22
import org.gvsig.raster.algorithm.process.ProcessParamsManagement;
23
import org.gvsig.raster.fmap.layers.FLyrRaster;
24
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure;
25
import org.gvsig.raster.principalcomponents.algorithm.PrincipalComponentsAlgorithmLibrary;
26
import org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingLibrary;
27
import org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingLocator;
28
import org.gvsig.raster.swing.RasterSwingLibrary;
29
import org.gvsig.tools.ToolsLocator;
30
import org.gvsig.tools.extensionpoint.ExtensionPoint;
31
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
32

  
33

  
34
public class PrincipalComponentsExtension extends Extension implements ActionListener, IProcessActions {
35
    private BasicAPISwingPanel   mainPanel              = null;
36
    private BasicAPISwingPanel   componentsPanel        = null;
37
    private MainWindow           windowMainPanel        = null;
38
    private MainWindow           windowComponentsPanel  = null;
39
    private MainWindow           statisticsPanel        = null;
40
    private FLyrRaster           lyr                    = null; 
41
    private PCStatsDataStructure stats                  = null; 
42
    
43
    public void initialize() {
44
    	
45
    	// Adds an entry to the TOC's floating menu to those layers defined in this extension
46
    	
47
		//ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add("My_TocActions");
48
		//exPoint.append("MyMenuEntry", "", new PrincipalComponentsTocMenuEntry());
49

  
50
        // Adds a new tab to the "add layer" dialog
51
    	
52
    	//AddLayer.addWizard(PrincipalComponentsWizard.class);
53
    	
54
    	// Adds a new button in the raster bar
55
    	// TODO: Remove for providers
56
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
57
		ExtensionPoint point = extensionPoints.add("GenericToolBarMenu");
58
		point.append("PrincipalComponents", "", PrincipalComponentsTocMenuEntry.getSingleton());
59
		PrincipalComponentsTocMenuEntry.setExtension(this);
60
    	
61
        Messages.addResourceFamily("org.gvsig.raster.principalcomponents.app.i18n.text",
62
        		PrincipalComponentsExtension.class.getClassLoader(),
63
        		PrincipalComponentsExtension.class.getClass().getName()); 
64

  
65
    	initilizeIcons();
66
    }
67
    
68
	public void postInitialize() {
69
	}
70

  
71
    public void execute(String actionCommand) {
72
    	if (actionCommand.compareTo("PrincipalComponents") == 0) {
73
    		lyr = getSelectedLayer();
74
    		if(lyr == null) {
75
    			RasterSwingLibrary.messageBoxError(Messages.getText("layer_not_found"), null);
76
    			return;
77
    		}
78
    		
79
			String defaultROIEPSG = getFirstMapCtrl().getProjection().getAbrev();
80
			
81
    		mainPanel = PrincipalComponentsSwingLocator.getSwingManager().createPCAMainPanel(
82
    				lyr.getDataStore(),
83
    				lyr.getName(),
84
    				lyr.getDataStore().getBandCount(),
85
    				defaultROIEPSG);
86
    		
87
    		windowMainPanel = new MainWindow(mainPanel.getComponent(), 
88
    				Messages.getText("principal_components"), 
89
    				400, 350, 
90
    				this);
91
    		
92
    		PluginServices.getMDIManager().addCentredWindow(windowMainPanel);
93
    		
94
    		mainPanel.initialize();
95
    	}
96
    }
97
    
98
	/**
99
	 * Gets the Mapcontrol for the first view found.
100
	 * @return
101
	 */
102
    private MapControl getFirstMapCtrl() {
103
    	IWindow[] windowList = PluginServices.getMDIManager().getAllWindows();
104
    	for (int i = 0; i < windowList.length; i++) {
105
    		if(windowList[i] instanceof IView) {
106
    			return ((IView)windowList[i]).getMapControl();
107
    		}
108
    	}		
109
    	return null;
110
    }
111

  
112
    /**
113
     * Gets the selected and valid layer
114
     * @return
115
	 */
116
	private FLyrRaster getSelectedLayer() {
117
		FLayer[] lyrList = getFirstMapCtrl().getMapContext().getLayers().getActives();
118
		for (int i = 0; i < lyrList.length; i++) {
119
			if(lyrList[i] instanceof FLyrRaster)
120
				return (FLyrRaster)lyrList[i];
121
		}
122
		return null; 
123
	}
124

  
125
    public boolean isEnabled() {
126
        return false;
127
    }
128

  
129
    public boolean isVisible() {
130
        return false;
131
    }
132

  
133
    void initilizeIcons(){
134
		IconThemeHelper.registerIcon(null, "principal-components", this);
135
    }
136

  
137
	public void actionPerformed(ActionEvent e) {
138
		//ACCEPT MAIN PANEL 
139
		if( e.getSource() == ((DefaultButtonsPanel)windowMainPanel).getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY) ||
140
			e.getSource() == ((DefaultButtonsPanel)windowMainPanel).getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT)) {
141
			DataProcess task = null;
142
			try {
143
				task = (DataProcess)mainPanel.getResult();
144
			} catch (Exception e1) {
145
				RasterSwingLibrary.messageBoxError(Messages.getText("problems_creating_process"), null);
146
				return;
147
			}
148
			task.setActions(this);
149
			task.init();
150
			task.start();
151
		}
152
		
153
		//GENERATE STATISTICS BUTTON
154
		if( componentsPanel != null && 
155
			PrincipalComponentsSwingLibrary.GENERATE_STATIST == componentsPanel.getComponentIDByObject(e.getSource())) {
156
			try {
157
				Object[] result = (Object[])componentsPanel.getResult();
158
				JPanel statsPanel = PrincipalComponentsSwingLocator.getSwingManager().createStatisticsPanel(
159
						stats, 
160
						(Boolean)result[1], 
161
						(Boolean)result[2], 
162
						(Boolean)result[3]);
163
				statisticsPanel = new MainWindow(statsPanel, 
164
	    				Messages.getText("stats"), 
165
	    				800, 500, 
166
	    				this,
167
	    				true);
168
	    		
169
	    		PluginServices.getMDIManager().addWindow(statisticsPanel);
170
			} catch (Exception e1) {
171
				RasterSwingLibrary.messageBoxError(Messages.getText("problems_creating_process"), null);
172
				return;
173
			}
174
		}
175
		
176
		//ACCEPT COMPONENTS PANEL
177
		if( windowComponentsPanel != null &&
178
			(e.getSource() == ((DefaultButtonsPanel)windowComponentsPanel).getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY) ||
179
			e.getSource() == ((DefaultButtonsPanel)windowComponentsPanel).getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT))) {
180
			DataProcess task = null;
181
			try {
182
				Object[] result = (Object[])componentsPanel.getResult();
183
				task = (DataProcess)result[0];
184
				task.setActions(new ProcessEndActions(windowComponentsPanel, lyr));
185
				task.init();
186
				task.start();
187
			} catch (Exception e1) {
188
				RasterSwingLibrary.messageBoxError(Messages.getText("problems_creating_process"), null);
189
				return;
190
			}
191
		}
192
	}
193

  
194
	@SuppressWarnings("unchecked")
195
	public void end(Object param) {
196
		HashMap<String, Object> params = (HashMap<String, Object>)param;
197
		String processName = (String)params.get(ProcessParamsManagement.PROCESS_NAME);
198
		
199
		//END STATISTICS PROCESS (after accept main dialog)
200
		if (processName.equals(PrincipalComponentsAlgorithmLibrary.PC_STATS_PROCESS_LABEL)) {
201
			PluginServices.getMDIManager().closeWindow(windowMainPanel);
202
			stats = (PCStatsDataStructure)params.get("STATS_RESULT");
203
			String fileName = (String)params.get("PATH");
204
			boolean[] bands = (boolean[])params.get("BANDS");
205
			String rois = (String)params.get("ROI_EPSG");
206
			
207
			componentsPanel = PrincipalComponentsSwingLocator.getSwingManager().createPCAComponentsListPanel(
208
					lyr.getDataStore(), 
209
					stats, 
210
					fileName, 
211
					bands,
212
					rois);
213
			componentsPanel.addListener(this);
214
			windowComponentsPanel = new MainWindow(componentsPanel.getComponent(), 
215
    				Messages.getText("principal_components"), 
216
    				400, 350, 
217
    				this);
218
    		PluginServices.getMDIManager().addCentredWindow(windowComponentsPanel);
219
    		componentsPanel.initialize();
220
		}
221
	}
222
	
223
	public void interrupted() {
224
		
225
	}
226
	
227
	public void updateProgress(int current, int total) {
228
		
229
	}
230
}
0 231

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/java/org/gvsig/raster/principalcomponents/app/PrincipalComponentsTocMenuEntry.java
1
package org.gvsig.raster.principalcomponents.app;
2

  
3
import javax.swing.Icon;
4

  
5
import org.gvsig.andami.IconThemeHelper;
6
import org.gvsig.andami.plugins.Extension;
7
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
8
import org.gvsig.app.project.documents.view.toc.ITocItem;
9
import org.gvsig.fmap.mapcontext.layers.FLayer;
10
import org.gvsig.i18n.Messages;
11
import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
12

  
13
public class PrincipalComponentsTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
14
	static private PrincipalComponentsTocMenuEntry singleton  = null;
15
	private static Extension                     extension  = null;
16
	
17
	
18
	public static void setExtension(Extension ext) {
19
		extension = ext;
20
	}
21

  
22
	private PrincipalComponentsTocMenuEntry() {}
23

  
24
	static public PrincipalComponentsTocMenuEntry getSingleton() {
25
		if (singleton == null)
26
			singleton = new PrincipalComponentsTocMenuEntry();
27
		return singleton;
28
	}
29
	
30
	public String getGroup() {
31
		return "Multispectral";
32
	}
33

  
34
	public int getGroupOrder() {
35
		return 55;
36
	}
37

  
38
	public int getOrder() {
39
		return 0;
40
	}
41

  
42
	public String getText() {
43
		return Messages.getText("principalcomponents");
44
	}
45

  
46
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
47
		return true;
48
	}
49

  
50
	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
51
		return true;
52
	}
53

  
54
	public void execute(ITocItem item, FLayer[] selectedItems) {
55
		extension.execute("PrincipalComponents");
56
	}
57
	
58
	public Icon getIcon() {
59
		return IconThemeHelper.getImageIcon("principal-components");
60
	}
61
	
62
}
0 63

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/java/org/gvsig/raster/principalcomponents/app/ProcessEndActions.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2011-2012 Prodevelop S.L
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., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 */
21
package org.gvsig.raster.principalcomponents.app;
22

  
23
import java.io.File;
24
import java.util.HashMap;
25

  
26
import org.gvsig.andami.PluginServices;
27
import org.gvsig.andami.ui.mdiManager.IWindow;
28
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
29
import org.gvsig.fmap.dal.DALLocator;
30
import org.gvsig.fmap.dal.DataManager;
31
import org.gvsig.fmap.dal.DataStore;
32
import org.gvsig.fmap.dal.coverage.RasterLocator;
33
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
34
import org.gvsig.fmap.dal.coverage.util.ProviderServices;
35
import org.gvsig.fmap.dal.exception.InitializeException;
36
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
37
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
38
import org.gvsig.fmap.mapcontext.MapContextLocator;
39
import org.gvsig.fmap.mapcontext.MapContextManager;
40
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
41
import org.gvsig.fmap.mapcontext.layers.FLayer;
42
import org.gvsig.fmap.mapcontext.layers.FLayers;
43
import org.gvsig.raster.algorithm.process.IProcessActions;
44
import org.gvsig.raster.algorithm.process.ProcessParamsManagement;
45
import org.gvsig.raster.principalcomponents.algorithm.PrincipalComponentsAlgorithmLibrary;
46
import org.gvsig.raster.swing.RasterSwingLibrary;
47
import org.gvsig.raster.swing.RasterSwingLocator;
48
import org.gvsig.raster.util.RasterNotLoadException;
49

  
50
/**
51
 * Actions when the process finalizes or is interrupted
52
 * 
53
 * Nacho Brodin (nachobrodin@gmail.com)
54
 */
55
public class ProcessEndActions implements IProcessActions {
56
	private IWindow     window        = null;
57
	private FLayer      inputLyr      = null;
58

  
59
	/**
60
	 * Constructor
61
	 * @param window
62
	 * @param lyr
63
	 *        The input layer is only used to select the view where the new layer be loaded
64
	 */
65
	public ProcessEndActions(IWindow window, FLayer lyr) {
66
		this.window = window;
67
		this.inputLyr = lyr;
68
	}
69
	
70
	@SuppressWarnings("unchecked")
71
	public void end(Object param) {
72
		if(window != null) {
73
			PluginServices.getMDIManager().closeWindow(window);
74
			window = null;
75
		}
76
		
77
		HashMap<String, Object> params = (HashMap<String, Object>)param;
78
		String processName = (String)params.get(ProcessParamsManagement.PROCESS_NAME);
79
		
80
		//End the process to get statistics (accept main dialog)
81
		if (processName.equals(PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL)) {
82
			String fileName = (String)params.get("FILENAME");
83
			long milis = (Long)params.get("TIME");
84
			processFinalize(fileName, milis);
85
			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fileName, milis);
86
		}
87
	}
88
	
89
	/**
90
	 * Acciones que se realizan al finalizar de crear los recortes de imagen.
91
	 * Este m?todo es llamado por el thread TailRasterProcess al finalizar.
92
	 */
93
	private void processFinalize(String fileName, long milis) {
94
		if (!new File(fileName).exists())
95
			return;
96

  
97
		if (RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", null)) {
98
			try {
99
				loadLayer(fileName, fileName.substring(fileName.lastIndexOf(File.separator) + 1));
100
			} catch (RasterNotLoadException e) {
101
				RasterSwingLibrary.messageBoxError("error_load_layer", e);
102
			}
103
		}
104
	}
105
	
106
	/**
107
	 * Gets the view 
108
	 * @return
109
	 */
110
	private AbstractViewPanel getView() {
111
		IWindow[] w = PluginServices.getMDIManager().getAllWindows();
112
		for (int i = 0; i < w.length; i++) {
113
			if(w[i] instanceof AbstractViewPanel) {
114
				FLayers lyrs = ((AbstractViewPanel)w[i]).getMapControl().getMapContext().getLayers();
115
				for (int j = 0; j < lyrs.getLayersCount(); j++) {
116
					FLayer lyr = lyrs.getLayer(j);
117
					if(inputLyr == lyr) {
118
						return ((AbstractViewPanel) w[i]);
119
					}
120
				}
121
			}
122
		}
123
		return null;
124
	}
125
	
126
	@SuppressWarnings("deprecation")
127
	private void loadLayer(String fileName, String layerName) throws RasterNotLoadException {
128
		if(fileName ==  null)
129
			return;
130

  
131
		//Seleccionamos la vista de gvSIG
132
		AbstractViewPanel theView = getView();
133

  
134
		theView.getMapControl().getMapContext().beginAtomicEvent();
135

  
136
		try {
137
			DataManager dataManager = DALLocator.getDataManager();
138
			
139
			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
140
			RasterDataParameters storeParameters = provServ.createParameters(fileName);
141
			storeParameters.setURI(fileName);
142
			
143
			MapContextManager mcm = MapContextLocator.getMapContextManager();
144
			
145
			DataStore dataStore = null;
146
			try {
147
				dataStore = dataManager.createStore(storeParameters);
148
			} catch (ValidateDataParametersException e) {
149
				throw new RasterNotLoadException("Error al cargar la capa.");
150
			} catch (InitializeException e) {
151
				throw new RasterNotLoadException("Error al cargar la capa.");
152
			} catch (ProviderNotRegisteredException e) {
153
				throw new RasterNotLoadException("Error al cargar la capa.");
154
			}
155
			
156
			if(layerName == null) {
157
				int endIndex = fileName.lastIndexOf(".");
158
				if (endIndex < 0)
159
					endIndex = fileName.length();
160
				
161
				layerName = fileName.substring(fileName.lastIndexOf(File.separator) + 1, endIndex);
162
			}
163
			
164
			FLayer lyr = mcm.createLayer(layerName, dataStore);
165
			theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
166

  
167
		} catch (LoadLayerException e) {
168
			throw new RasterNotLoadException("Error al cargar la capa.");
169
		} 
170
		theView.getMapControl().getMapContext().invalidate();
171
		theView.getMapControl().getMapContext().endAtomicEvent();
172
	}
173
	
174
	public void interrupted() {
175

  
176
    }
177
	
178
	public void updateProgress(int current, int total) {
179
		
180
	}
181
}
0 182

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.raster.mainplugin" />
4
	<!--Only for sextante algorithms-->
5
	<depends plugin-name="org.gvsig.geoprocess.app.algorithm" />
6
	<resourceBundle name="text"/>
7
	<libraries library-dir="lib"/>
8
	<extensions>
9
		<extension class-name="org.gvsig.raster.principalcomponents.app.PrincipalComponentsExtension"
10
			description="" 
11
			active="true" 
12
			priority="1">
13
		</extension>	
14
	</extensions>
15
</plugin-config>
0 16

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/resources-plugin/org/gvsig/raster/principalcomponents/app/i18n/text.properties
1
principalcomponents=Componentes principales
2
layer_not_found=No hay seleccionada una capa v?lida
3
problems_creating_process=No se ha podido crear el proceso
0 4

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/src/main/resources-plugin/org/gvsig/raster/principalcomponents/app/i18n/text_en.properties
1
principalcomponents=Principal components
2
layer_not_found=There is not selected a valid layer
3
problems_creating_process=The process has not be created
0 4

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.app.principalcomponentsclient/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.raster.principalcomponents.app.principalcomponentsclient</artifactId>
6
	<packaging>jar</packaging>
7
	<name>Principal components</name>
8
	<description>Principal components for remote sensing images</description>
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.raster.principalcomponents</artifactId>
12
		<version>2.0.0-SNAPSHOT</version>
13
	</parent>
14
	<dependencies>
15
		<dependency>
16
			<groupId>org.gvsig</groupId>
17
			<artifactId>org.gvsig.raster.mainplugin</artifactId>
18
			<scope>compile</scope>
19
		</dependency>
20
		<dependency>
21
			<groupId>org.gvsig</groupId>
22
			<artifactId>org.gvsig.raster.principalcomponents.swing.api</artifactId>
23
			<scope>compile</scope>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.raster.principalcomponents.swing.impl</artifactId>
28
			<scope>runtime</scope>
29
		</dependency>
30
		<dependency>
31
			<groupId>org.gvsig</groupId>
32
			<artifactId>org.gvsig.raster.principalcomponents.algorithm</artifactId>
33
			<scope>compile</scope>
34
		</dependency>
35
		<dependency>
36
			<groupId>org.gvsig</groupId>
37
			<artifactId>org.gvsig.app.mainplugin</artifactId>
38
			<scope>compile</scope>
39
		</dependency>
40
		<dependency>
41
			<groupId>org.gvsig</groupId>
42
			<artifactId>org.gvsig.raster.lib.api</artifactId>
43
			<scope>compile</scope>
44
		</dependency>
45
		<dependency>
46
			<groupId>org.gvsig</groupId>
47
			<artifactId>org.gvsig.raster.lib.impl</artifactId>
48
			<scope>runtime</scope>
49
		</dependency>
50
		<dependency>
51
			<groupId>org.gvsig</groupId>
52
			<artifactId>org.gvsig.raster.fmap</artifactId>
53
			<scope>compile</scope>
54
		</dependency>
55
		<dependency>
56
			<groupId>org.gvsig</groupId>
57
			<artifactId>org.gvsig.fmap.control</artifactId>
58
			<scope>compile</scope>
59
		</dependency>
60
		<dependency>
61
			<groupId>org.gvsig</groupId>
62
			<artifactId>org.gvsig.utils</artifactId>
63
			<scope>compile</scope>
64
		</dependency>
65
		<dependency>
66
			<groupId>org.gvsig</groupId>
67
			<artifactId>org.gvsig.ui</artifactId>
68
			<scope>compile</scope>
69
		</dependency>
70
		<!--<dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.symbology.lib.api</artifactId> 
71
			<scope>compile</scope> </dependency> -->
72
		<dependency>
73
			<groupId>org.gvsig</groupId>
74
			<artifactId>org.gvsig.symbology.lib.impl</artifactId>
75
			<scope>compile</scope>
76
		</dependency>
77
		<dependency>
78
			<groupId>org.gvsig</groupId>
79
			<artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
80
			<scope>compile</scope>
81
		</dependency>
82
		<dependency>
83
			<groupId>org.gvsig</groupId>
84
			<artifactId>org.gvsig.raster.principalcomponents.sextante</artifactId>
85
			<scope>runtime</scope>
86
		</dependency>
87
		
88
		<dependency>
89
            <groupId>org.gvsig</groupId>
90
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
91
            <scope>compile</scope>
92
        </dependency>
93
        <dependency>
94
            <groupId>org.gvsig</groupId>
95
            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
96
            <scope>runtime</scope>
97
        </dependency>
98
        <dependency>
99
            <groupId>org.gvsig</groupId>
100
            <artifactId>org.gvsig.fmap.mapcontext.operation</artifactId>
101
            <scope>runtime</scope>
102
        </dependency>
103
		<dependency>
104
            <groupId>org.gvsig</groupId>
105
            <artifactId>org.gvsig.projection.api</artifactId>
106
            <scope>compile</scope>
107
        </dependency>
108
        <dependency>
109
            <groupId>org.gvsig</groupId>
110
            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
111
            <scope>runtime</scope>
112
        </dependency>
113
        <dependency>
114
            <groupId>org.gvsig</groupId>
115
            <artifactId>org.gvsig.compat.api</artifactId>
116
            <scope>compile</scope>
117
        </dependency>
118
        <dependency>
119
            <groupId>org.gvsig</groupId>
120
            <artifactId>org.gvsig.compat.se</artifactId>
121
            <scope>compile</scope>
122
        </dependency>
123
        <dependency>
124
            <groupId>org.gvsig</groupId>
125
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
126
            <scope>compile</scope>
127
        </dependency>
128
        <dependency>
129
            <groupId>org.gvsig</groupId>
130
            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
131
            <scope>compile</scope>
132
        </dependency>
133
        <dependency>
134
            <groupId>org.gvsig</groupId>
135
            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
136
            <scope>compile</scope>
137
        </dependency>
138
        <dependency>
139
            <groupId>org.gvsig</groupId>
140
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
141
            <scope>compile</scope>
142
        </dependency>
143
        <dependency>
144
            <groupId>org.gvsig</groupId>
145
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
146
            <scope>compile</scope>
147
        </dependency>
148
        <dependency>
149
            <groupId>org.gvsig</groupId>
150
            <artifactId>org.gvsig.fmap.geometry.impl</artifactId>
151
            <scope>runtime</scope>
152
        </dependency>
153
        <dependency>
154
            <groupId>org.gvsig</groupId>
155
            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
156
            <scope>runtime</scope>
157
        </dependency>
158
	</dependencies>
159
	<properties>
160
		<gvsig.package.info.state>testing</gvsig.package.info.state>
161
		<gvsig.package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2, required: org.gvsig.raster.mainplugin -ge 2</gvsig.package.info.dependencies>
162
		<gvsig.package.info.poolURL>http://devel.gvsig.org/download/projects/Raster/pool</gvsig.package.info.poolURL>
163
		<gvsig.package.info.categories>OGC,Remote Services,Raster</gvsig.package.info.categories>
164
		<gvsig.package.info.official>true</gvsig.package.info.official>
165
	</properties>
166
</project>
0 167

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/resources-plugin/org/gvsig/raster/principalcomponents/algorithm/i18n/text.properties
1
layers_dont_intersect=Las capas no intersectan
2
roi_not_inside=La zona de estudio no esta contenida en la extensi?n de las capas
3
calc_stats="Calculando estad?sticas para PCA"
4
error_covarianza_optimize="Error en el covarianceOptimize() : C?lculo de la matriz varianza covarianza de las bandas de un Grid."
5
preparing_buffers=Preparando buffers
0 6

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/resources-plugin/org/gvsig/raster/principalcomponents/algorithm/i18n/text_en.properties
1
layers_dont_intersect=Layers do not intersect
2
roi_not_inside=The region of interest are not inside the extension of the layers
3
calc_stats="Calculating statistics to PCA"
4
error_covarianza_optimize="Error in covarianceOptimize."
5
preparing_buffers=Preparing buffers
0 6

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/resources/org/gvsig/raster/principalcomponents/algorithm/i18n/text.properties
1
layers_dont_intersect=Las capas no intersectan
2
roi_not_inside=La zona de estudio no esta contenida en la extensi?n de las capas
3
calc_stats="Calculando estad?sticas para PCA"
4
error_covarianza_optimize="Error en el covarianceOptimize() : C?lculo de la matriz varianza covarianza de las bandas de un Grid."
5
preparing_buffers=Preparando buffers
0 6

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/resources/org/gvsig/raster/principalcomponents/algorithm/i18n/text_en.properties
1
layers_dont_intersect=Layers do not intersect
2
roi_not_inside=The region of interest are not inside the extension of the layers
3
calc_stats="Calculating statistics to PCA"
4
error_covarianza_optimize="Error in covarianceOptimize."
5
preparing_buffers=Preparing buffers
0 6

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.raster.principalcomponents.algorithm.PrincipalComponentsAlgorithmLibrary
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/java/org/gvsig/raster/principalcomponents/algorithm/PrincipalComponentsAlgorithmLibrary.java
1
package org.gvsig.raster.principalcomponents.algorithm;
2

  
3
import org.gvsig.i18n.Messages;
4
import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
5
import org.gvsig.tools.library.AbstractLibrary;
6
import org.gvsig.tools.library.LibraryException;
7

  
8
/**
9
 * Initialization of PrincipalComponentsAlgorithmLibrary library.
10
 */
11
public class PrincipalComponentsAlgorithmLibrary extends AbstractLibrary {
12
	public static final String         PC_PROCESS_LABEL         = "PrincipalComponentsProcess";
13
	public static final String         PC_STATS_PROCESS_LABEL   = "StatsPrincipalComponentsProcess";
14
	
15
    @Override
16
    protected void doInitialize() throws LibraryException {
17
        // Nothing to do
18
    }
19

  
20
    @Override
21
    protected void doPostInitialize() throws LibraryException {
22
    	//Registers the process and its parameters
23
    	RasterBaseAlgorithmLibrary.register(PC_STATS_PROCESS_LABEL, PCAStatisticsProcess.class);
24
    	PCAStatisticsProcess.registerParameters();
25
    	RasterBaseAlgorithmLibrary.register(PC_PROCESS_LABEL, PrincipalComponentsProcess.class);
26
    	PrincipalComponentsProcess.registerParameters();
27
    	
28
        Messages.addResourceFamily(
29
            "org.gvsig.raster.principalcomponents.algorithm", 
30
            PrincipalComponentsAlgorithmLibrary.class.getClassLoader(), 
31
            PrincipalComponentsAlgorithmLibrary.class.getClass().getName());
32
        //registerGeoProcess(new RasterReprojectAlgorithmLibrary());
33
        
34
        Messages.addResourceFamily("org.gvsig.raster.principalcomponents.algorithm.i18n.text",
35
        		PrincipalComponentsAlgorithmLibrary.class.getClassLoader(),
36
        		PrincipalComponentsAlgorithmLibrary.class.getClass().getName()); 
37
    }
38
}
0 39

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/java/org/gvsig/raster/principalcomponents/algorithm/PrincipalComponentsException.java
1
package org.gvsig.raster.principalcomponents.algorithm;
2

  
3
import org.gvsig.raster.algorithm.process.ProcessException;
4

  
5

  
6
/**
7
 * This exception is thrown if happen problems processing data with this algorithm.
8
 */
9
public class PrincipalComponentsException extends ProcessException {
10
	private static final long serialVersionUID = -3022090543908771484L;
11
	
12
	public PrincipalComponentsException(String msg){
13
		super(msg);
14
	}
15
	
16
	public PrincipalComponentsException(String msg, Throwable e){
17
		super(msg, e);
18
	}
19
}
0 20

  
org.gvsig.raster.principalcomponents/branches/org.gvsig.raster.principalcomponents_dataaccess_refactoring/org.gvsig.raster.principalcomponents.algorithm/src/main/java/org/gvsig/raster/principalcomponents/algorithm/PrincipalComponentsProcess.java
1
package org.gvsig.raster.principalcomponents.algorithm;
2

  
3
import java.awt.geom.Rectangle2D;
4
import java.util.List;
5

  
6
import org.gvsig.fmap.dal.coverage.RasterLocator;
7
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
8
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
9
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
10
import org.gvsig.fmap.dal.coverage.exception.CloneException;
11
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
12
import org.gvsig.fmap.dal.coverage.exception.ROIException;
13
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
14
import org.gvsig.i18n.Messages;
15
import org.gvsig.raster.algorithm.process.DataProcess;
16
import org.gvsig.raster.algorithm.process.ProcessException;
17
import org.gvsig.raster.roi.ROI;
18

  
19
import Jama.Matrix;
20

  
21
/**
22
 * PCA Process 
23
 * @author Nacho Brodin (nachobrodin@gmail.com)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff