Revision 9738
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.api/src/main/java/org/gvsig/raster/principalcomponents/swing/PrincipalComponentsSwingLibrary.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing; |
|
2 |
|
|
3 |
import org.gvsig.tools.library.AbstractLibrary; |
|
4 |
import org.gvsig.tools.library.LibraryException; |
|
5 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
6 |
|
|
7 |
/** |
|
8 |
* Library for API initialization and configuration. |
|
9 |
* |
|
10 |
* @author gvSIG team |
|
11 |
* @version $Id$ |
|
12 |
*/ |
|
13 |
public class PrincipalComponentsSwingLibrary extends AbstractLibrary { |
|
14 |
public static int GENERATE_STATIST = 1026; |
|
15 |
|
|
16 |
@Override |
|
17 |
protected void doInitialize() throws LibraryException { |
|
18 |
} |
|
19 |
|
|
20 |
@Override |
|
21 |
protected void doPostInitialize() throws LibraryException { |
|
22 |
// Validate there is any implementation registered. |
|
23 |
PrincipalComponentsSwingManager manager = PrincipalComponentsSwingLocator.getSwingManager(); |
|
24 |
if (manager == null) { |
|
25 |
throw new ReferenceNotRegisteredException( |
|
26 |
PrincipalComponentsSwingLocator.SWING_MANAGER_NAME, |
|
27 |
PrincipalComponentsSwingLocator.getInstance()); |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
} |
|
0 | 32 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.api/src/main/java/org/gvsig/raster/principalcomponents/swing/PrincipalComponentsSwingManager.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing; |
|
2 |
|
|
3 |
import javax.swing.JPanel; |
|
4 |
|
|
5 |
import org.gvsig.raster.algorithm.BasicAPISwingPanel; |
|
6 |
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure; |
|
7 |
|
|
8 |
/** |
|
9 |
* This class is responsible of the management of the library's business logic. |
|
10 |
* It is the library's main entry point, and provides all the services to manage |
|
11 |
* {@link PrincipalComponentsService}s. |
|
12 |
* |
|
13 |
* @see PrincipalComponentsService |
|
14 |
* @author gvSIG team |
|
15 |
* @version $Id$ |
|
16 |
*/ |
|
17 |
public interface PrincipalComponentsSwingManager { |
|
18 |
public BasicAPISwingPanel createPCAMainPanel( |
|
19 |
Object inputStore, |
|
20 |
String layerName, |
|
21 |
int bandList, |
|
22 |
String roisEPSG); |
|
23 |
|
|
24 |
public BasicAPISwingPanel createPCAComponentsListPanel( |
|
25 |
Object inputStore, |
|
26 |
PCStatsDataStructure stats, |
|
27 |
String fileName, |
|
28 |
boolean[] bands, |
|
29 |
String roisEPSG); |
|
30 |
|
|
31 |
public JPanel createStatisticsPanel( |
|
32 |
PCStatsDataStructure pcStatistics, |
|
33 |
boolean bandStatistics, |
|
34 |
boolean covar, |
|
35 |
boolean autovect); |
|
36 |
} |
|
0 | 37 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.api/src/main/java/org/gvsig/raster/principalcomponents/swing/PrincipalComponentsSwingLocator.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing; |
|
2 |
|
|
3 |
import org.gvsig.tools.locator.BaseLocator; |
|
4 |
|
|
5 |
/** |
|
6 |
* This locator is the entry point for the Raster library, providing |
|
7 |
* access to all Raster services through the {@link PrincipalComponentsManager} |
|
8 |
* . |
|
9 |
* |
|
10 |
* @author gvSIG team |
|
11 |
* @version $Id$ |
|
12 |
*/ |
|
13 |
public class PrincipalComponentsSwingLocator extends BaseLocator { |
|
14 |
/** |
|
15 |
* Validation swing manager name. |
|
16 |
*/ |
|
17 |
public static final String SWING_MANAGER_NAME = |
|
18 |
"PrincipalComponents.swing.manager"; |
|
19 |
|
|
20 |
/** |
|
21 |
* Validation swing manager description. |
|
22 |
*/ |
|
23 |
public static final String SWING_MANAGER_DESCRIPTION = |
|
24 |
"PrincipalComponents UIManager"; |
|
25 |
|
|
26 |
private static final String LOCATOR_NAME = "PrincipalComponents.swing.locator"; |
|
27 |
|
|
28 |
/** |
|
29 |
* Unique instance. |
|
30 |
*/ |
|
31 |
private static final PrincipalComponentsSwingLocator INSTANCE = |
|
32 |
new PrincipalComponentsSwingLocator(); |
|
33 |
|
|
34 |
/** |
|
35 |
* Return the singleton instance. |
|
36 |
* |
|
37 |
* @return the singleton instance |
|
38 |
*/ |
|
39 |
public static PrincipalComponentsSwingLocator getInstance() { |
|
40 |
return INSTANCE; |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* Return the Locator's name |
|
45 |
* |
|
46 |
* @return a String with the Locator's name |
|
47 |
*/ |
|
48 |
public final String getLocatorName() { |
|
49 |
return LOCATOR_NAME; |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* Registers the Class implementing the PersistenceManager interface. |
|
54 |
* |
|
55 |
* @param clazz |
|
56 |
* implementing the PersistenceManager interface |
|
57 |
*/ |
|
58 |
public static void registerSwingManager( |
|
59 |
Class<? extends PrincipalComponentsSwingManager> clazz) { |
|
60 |
getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION, clazz); |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* Gets the instance of the {@link ScriptingUIManager} registered. |
|
65 |
* |
|
66 |
* @return {@link ScriptingUIManager} |
|
67 |
*/ |
|
68 |
public static PrincipalComponentsSwingManager getSwingManager() { |
|
69 |
return (PrincipalComponentsSwingManager) getInstance().get(SWING_MANAGER_NAME); |
|
70 |
} |
|
71 |
} |
|
0 | 72 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingLibrary |
|
0 | 2 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.api/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
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/maven-v4_0_0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.raster.principalcomponents.swing.api</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>org.gvsig.raster.principalcomponents.swing.api</name> |
|
7 |
<parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.raster.principalcomponents.swing</artifactId> |
|
10 |
<version>2.2.81</version> |
|
11 |
</parent> |
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
16 |
<scope>compile</scope> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
21 |
<scope>compile</scope> |
|
22 |
</dependency> |
|
23 |
<dependency> |
|
24 |
<groupId>org.gvsig</groupId> |
|
25 |
<artifactId>org.gvsig.fmap.mapcontext.impl</artifactId> |
|
26 |
<scope>runtime</scope> |
|
27 |
</dependency> |
|
28 |
<dependency> |
|
29 |
<groupId>org.gvsig</groupId> |
|
30 |
<artifactId>org.gvsig.i18n</artifactId> |
|
31 |
<scope>compile</scope> |
|
32 |
</dependency> |
|
33 |
</dependencies> |
|
34 |
</project> |
|
0 | 35 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
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 |
|
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.raster.principalcomponents.swing</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>org.gvsig.raster.principalcomponents.swing</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.raster.principalcomponents</artifactId> |
|
11 |
<version>2.2.81</version> |
|
12 |
</parent> |
|
13 |
<dependencies> |
|
14 |
<dependency> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.andami</artifactId> |
|
17 |
<scope>compile</scope> |
|
18 |
</dependency> |
|
19 |
<dependency> |
|
20 |
<groupId>org.gvsig</groupId> |
|
21 |
<artifactId>org.gvsig.ui</artifactId> |
|
22 |
<scope>compile</scope> |
|
23 |
</dependency> |
|
24 |
<dependency> |
|
25 |
<groupId>org.gvsig</groupId> |
|
26 |
<artifactId>org.gvsig.raster.algorithm</artifactId> |
|
27 |
<scope>compile</scope> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.raster.swing.api</artifactId> |
|
32 |
<scope>compile</scope> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.raster.swing.impl</artifactId> |
|
37 |
<scope>runtime</scope> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.raster.principalcomponents.algorithm</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
</dependencies> |
|
45 |
<modules> |
|
46 |
<module>org.gvsig.raster.principalcomponents.swing.api</module> |
|
47 |
<module>org.gvsig.raster.principalcomponents.swing.impl</module> |
|
48 |
</modules> |
|
49 |
</project> |
|
50 |
|
|
0 | 51 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.principalcomponents.swing.impl.PrincipalComponentsDefaultSwingImplLibrary |
|
0 | 2 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/resources/org/gvsig/raster/principalcomponents/swing/impl/i18n/text_en.properties | ||
---|---|---|
1 |
components_selection=Component selection |
|
2 |
autovalor=Eigenvalue |
|
3 |
by_band=By band |
|
4 |
var_covar=Matrix variance-covariance |
|
5 |
autovector=Eigenvector |
|
6 |
generate=Generate |
|
7 |
stats=Statistics |
|
8 |
use_rois=Use regions of interest of the layer |
|
9 |
band=Band |
|
10 |
max=Maximum |
|
11 |
min=Minimum |
|
12 |
mean=Mean |
|
13 |
variance=Variance |
|
14 |
standard_deviation=Standard deviation |
|
0 | 15 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/resources/org/gvsig/raster/principalcomponents/swing/impl/i18n/text.properties | ||
---|---|---|
1 |
components_selection=Selecci?n de componentes |
|
2 |
autovalor=Autovalor |
|
3 |
by_band=Por banda |
|
4 |
var_covar=Matriz varianza-covarianza |
|
5 |
autovector=Autovector |
|
6 |
generate=Generar |
|
7 |
stats=Estadisticas |
|
8 |
use_rois=Usar regiones de inter?s de la capa |
|
9 |
band=Banda |
|
10 |
max=M?ximo |
|
11 |
min=M?nimo |
|
12 |
mean=Media |
|
13 |
variance=Varianza |
|
14 |
standard_deviation=Desviaci?n est?ndar |
|
0 | 15 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/PrincipalComponentsDefaultSwingImplLibrary.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing.impl; |
|
2 |
|
|
3 |
import java.util.Locale; |
|
4 |
|
|
5 |
import org.gvsig.i18n.Messages; |
|
6 |
import org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingLocator; |
|
7 |
import org.gvsig.tools.library.AbstractLibrary; |
|
8 |
import org.gvsig.tools.library.LibraryException; |
|
9 |
|
|
10 |
/** |
|
11 |
* Library for default implementation initialization and configuration. |
|
12 |
* |
|
13 |
* @author gvSIG team |
|
14 |
* @version $Id$ |
|
15 |
*/ |
|
16 |
public class PrincipalComponentsDefaultSwingImplLibrary extends AbstractLibrary { |
|
17 |
|
|
18 |
public PrincipalComponentsDefaultSwingImplLibrary() { |
|
19 |
registerAsImplementationOf(PrincipalComponentsDefaultSwingImplLibrary.class); |
|
20 |
} |
|
21 |
|
|
22 |
protected void doInitialize() throws LibraryException { |
|
23 |
//Register the default GeometryManager |
|
24 |
PrincipalComponentsSwingLocator.registerSwingManager(DefaultPrincipalComponentsSwingManager.class); |
|
25 |
|
|
26 |
if (!Messages.hasLocales()) { |
|
27 |
Messages.addLocale(Locale.getDefault()); |
|
28 |
} |
|
29 |
|
|
30 |
Messages.addResourceFamily("org.gvsig.raster.principalcomponents.swing.impl.i18n.text", |
|
31 |
PrincipalComponentsDefaultSwingImplLibrary.class.getClassLoader(), |
|
32 |
PrincipalComponentsDefaultSwingImplLibrary.class.getClass().getName()); |
|
33 |
|
|
34 |
registerIcons(); |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
protected void doPostInitialize() throws LibraryException { |
|
39 |
|
|
40 |
} |
|
41 |
|
|
42 |
private void registerIcons() { |
|
43 |
//IconThemeHelper.registerIcon(null, "...", this); |
|
44 |
} |
|
45 |
|
|
46 |
} |
|
0 | 47 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/stats/ReportStatisticsProcessPCA.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing.impl.stats; |
|
2 |
|
|
3 |
import java.text.DecimalFormat; |
|
4 |
|
|
5 |
import org.cresques.Messages; |
|
6 |
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure; |
|
7 |
|
|
8 |
import Jama.Matrix; |
|
9 |
|
|
10 |
//* Clase encargada de crear un String html con los datos estad?sticos resultantes del |
|
11 |
//* PCAStatisticsTask (stadisticas por banda, matriz varianza-covarianza y autovalores) |
|
12 |
/** |
|
13 |
* |
|
14 |
* This class create a String with result statistics data of PCAStatisticsTask |
|
15 |
* @author seriznue |
|
16 |
*/ |
|
17 |
public class ReportStatisticsProcessPCA { |
|
18 |
private boolean rowColor = true; |
|
19 |
private final String bgColor0 = "\"#FEEDD6\""; // light salmon |
|
20 |
private final String bgColor1 = "\"#EAEAEA\""; // light grey |
|
21 |
// private final String bgColor3 = "\"#FBFFE1\""; // light yellow |
|
22 |
private final String bgColor4 = "\"#D6D6D6\""; // Gris |
|
23 |
private final String bgColorBody = "\"#FFFFFF\""; // white |
|
24 |
|
|
25 |
public DecimalFormat df = null; |
|
26 |
public String html = ""; |
|
27 |
|
|
28 |
private PCStatsDataStructure pcStatistics = null; |
|
29 |
private boolean bandStatistics = false; |
|
30 |
private boolean covar = false; |
|
31 |
private boolean autovect = false; |
|
32 |
|
|
33 |
public ReportStatisticsProcessPCA(PCStatsDataStructure pcStatistics, boolean bandStatistics, boolean covar, boolean autovect) { |
|
34 |
super(); |
|
35 |
this.pcStatistics = pcStatistics; |
|
36 |
this.bandStatistics = bandStatistics; |
|
37 |
this.covar = covar; |
|
38 |
this.autovect = autovect; |
|
39 |
init(); |
|
40 |
} |
|
41 |
|
|
42 |
public String getHtml() { |
|
43 |
return html; |
|
44 |
} |
|
45 |
|
|
46 |
public void init() { |
|
47 |
df = new DecimalFormat("0.00000"); |
|
48 |
|
|
49 |
html ="<blockquote>" + |
|
50 |
"<blockquote>" + |
|
51 |
"<html><body>" + |
|
52 |
" <body bgcolor=" + bgColorBody + " topmargin=\"0\" marginheight=\"0\">" + |
|
53 |
"<font size=3><h1><center>Informe estad?stico de Componentes Principales</center></h1>"; |
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
if(bandStatistics) { |
|
58 |
html += " <font face=\"Arial\" size=\"2\"><B>Estad?sticas de bandas : </B><br>"; |
|
59 |
CreateBandStatistic(pcStatistics.getMaxMinMean()); |
|
60 |
} |
|
61 |
if(covar) { |
|
62 |
html += " <font face=\"Arial\" size=\"2\"><B>Matriz varianza-covarianza : </B><br>"; |
|
63 |
ExportarMatriz(pcStatistics.getCoVarMatrix(), "Band"); |
|
64 |
} |
|
65 |
|
|
66 |
if (autovect) { |
|
67 |
//Hay que modificar el orden (Traspuesta y cambio de orden de columnas) |
|
68 |
//Colocamos la matriz en el orden correcto: |
|
69 |
/* |
|
70 |
* b3 b2 b1 |
|
71 |
* c1 |
|
72 |
* c2 |
|
73 |
* c3 |
|
74 |
* | | |
|
75 |
* | | Cambio de orden de columnas de la matriz transpuesta |
|
76 |
* ___ |
|
77 |
* \ / |
|
78 |
* V |
|
79 |
* c1 c2 c3 |
|
80 |
* b1 |
|
81 |
* b2 |
|
82 |
* b3 |
|
83 |
* */ |
|
84 |
html += " <font face=\"Arial\" size=\"2\"><B>Matriz de autovectores : </B><br>"; |
|
85 |
ExportarMatriz(ChangeColumns((pcStatistics.getAutoVectorsMatrix().transpose())), "Component"); |
|
86 |
|
|
87 |
} |
|
88 |
|
|
89 |
this.close(); |
|
90 |
} |
|
91 |
|
|
92 |
private Matrix ChangeColumns(Matrix m) { |
|
93 |
Matrix result = new Matrix(m.getRowDimension(), m.getColumnDimension()); |
|
94 |
int k = m.getColumnDimension() - 1; |
|
95 |
for(int i = 0; i < m.getRowDimension(); i++) { |
|
96 |
for(int j=0; j<m.getColumnDimension(); j++) { |
|
97 |
result.set(i, j, m.get(k - i, j)); |
|
98 |
} |
|
99 |
} |
|
100 |
return result; |
|
101 |
} |
|
102 |
|
|
103 |
private void ExportarMatriz(Matrix Matrix, String nameColumns) { |
|
104 |
//Creamos tabla |
|
105 |
html = html + "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"\">"+ |
|
106 |
"<TR bgcolor=" + bgColor4 +" ALIGN=center>"; |
|
107 |
html += "<TH > <font face=\"Arial\" size=\"3\"><N></TH>"; |
|
108 |
//Crear primera fila: cabecera de tabla |
|
109 |
for(int i = 0; i < Matrix.getColumnDimension(); i++) { |
|
110 |
html += "<TH > <font face=\"Arial\" size=\"3\" b> "+ nameColumns + " " + (i + 1) + "</b></TH>"; |
|
111 |
} |
|
112 |
html += "</TR>"; |
|
113 |
//Rellenamos tabla |
|
114 |
for(int i = 0; i < Matrix.getRowDimension(); i++) { |
|
115 |
html = html + "<TR ><TD bgcolor=" + bgColor4 +"><center><font face=\"Arial\" size=\"3\">" +"<b>Band "+(i+1)+" </b></TD>"; |
|
116 |
String color = getColor(); |
|
117 |
for(int j = 0; j < Matrix.getColumnDimension(); j++){ |
|
118 |
html += "<TD bgcolor=" + color +"><center><font face=\"Arial\" size=\"3\">"+df.format(Matrix.get(i, j))+" </TD>"; |
|
119 |
} |
|
120 |
html += "</TR>"; |
|
121 |
} |
|
122 |
|
|
123 |
//Cerrar tabla |
|
124 |
html = html + "</TABLE><br><br>"; |
|
125 |
} |
|
126 |
|
|
127 |
private void CreateBandStatistic(double[][] maxminmean) { |
|
128 |
//Creamos tabla |
|
129 |
html = html + "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"\">" + |
|
130 |
"<TR bgcolor=" + bgColor4 +" ALIGN=center>"; |
|
131 |
//Crear primera fila: cabecera de tabla |
|
132 |
html += "<TH><font face=\"Arial\" size=\"3\">" + Messages.getText("band") + "</TH>" + |
|
133 |
"<TH> <font face=\"Arial\" size=\"3\"><N>" + Messages.getText("max") + "</TH>" + |
|
134 |
"<TH><font face=\"Arial\" size=\"3\">" + Messages.getText("min") + "</TH>" + |
|
135 |
"<TH><font face=\"Arial\" size=\"3\">" + Messages.getText("mean") + "</TH>" + |
|
136 |
"<TH><font face=\"Arial\" size=\"3\">" + Messages.getText("variance") + "</TH>" + |
|
137 |
"<TH><font face=\"Arial\" size=\"3\">" + Messages.getText("standard_deviation") + "</N></TH></TR>"; |
|
138 |
|
|
139 |
//Recorremos filas de datos |
|
140 |
for (int i = 0; i < maxminmean.length; i++) { |
|
141 |
html = html + "<TR bgcolor=" + getColor() + "><TD><center><font face=\"Arial\" size=\"3\">" +"band " + (i + 1) + " </TD>" + |
|
142 |
"<TD><center><font face=\"Arial\" size=\"3\">" + df.format(maxminmean[i][0]) + " </TD>" + |
|
143 |
"<TD><center><font face=\"Arial\" size=\"3\">" + df.format(maxminmean[i][1]) + " </TD>" + |
|
144 |
"<TD><center><font face=\"Arial\" size=\"3\">" + df.format(maxminmean[i][2]) + " </TD>" + |
|
145 |
"<TD><center><font face=\"Arial\" size=\"3\">" + df.format(maxminmean[i][3]) + " </TD>" + |
|
146 |
"<TD><center><font face=\"Arial\" size=\"3\">" + df.format(Math.sqrt(maxminmean[i][3])) + " </TD></TR>"; |
|
147 |
} |
|
148 |
//Cerrar tabla |
|
149 |
html = html + "</TABLE><br><br>"; |
|
150 |
} |
|
151 |
|
|
152 |
public void close() { |
|
153 |
html = html + "</BODY></HTML>"; |
|
154 |
} |
|
155 |
|
|
156 |
private String getColor() { |
|
157 |
String color = (rowColor ? bgColor0 : bgColor1); |
|
158 |
rowColor = !rowColor; |
|
159 |
return color; |
|
160 |
} |
|
161 |
} |
|
0 | 162 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/stats/StatsPanelImpl.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing.impl.stats; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.event.ActionEvent; |
|
5 |
import java.awt.event.ActionListener; |
|
6 |
import java.io.File; |
|
7 |
import java.io.FileWriter; |
|
8 |
import java.io.IOException; |
|
9 |
import java.io.PrintWriter; |
|
10 |
|
|
11 |
import javax.swing.BorderFactory; |
|
12 |
import javax.swing.Box; |
|
13 |
import javax.swing.BoxLayout; |
|
14 |
import javax.swing.JButton; |
|
15 |
import javax.swing.JFileChooser; |
|
16 |
import javax.swing.JOptionPane; |
|
17 |
import javax.swing.JPanel; |
|
18 |
import javax.swing.JScrollPane; |
|
19 |
import javax.swing.JTextPane; |
|
20 |
|
|
21 |
import org.cresques.Messages; |
|
22 |
|
|
23 |
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure; |
|
24 |
import org.gvsig.tools.ToolsLocator; |
|
25 |
import org.gvsig.tools.i18n.I18nManager; |
|
26 |
|
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
public class StatsPanelImpl extends JPanel { |
|
31 |
private static final long serialVersionUID = 1L; |
|
32 |
private JButton save = null; |
|
33 |
//private JButton accept = null; |
|
34 |
private JTextPane text = null; |
|
35 |
private String html = null; |
|
36 |
private Logger log = LoggerFactory.getLogger(StatsPanelImpl.class); |
|
37 |
|
|
38 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
39 |
|
|
40 |
public StatsPanelImpl(PCStatsDataStructure pcStatistics, boolean bandStatistics, boolean covar, boolean autovect) { |
|
41 |
ReportStatisticsProcessPCA process = new ReportStatisticsProcessPCA(pcStatistics, bandStatistics, covar, autovect); |
|
42 |
html = process.getHtml(); |
|
43 |
this.setLayout(new BorderLayout()); |
|
44 |
//this.setPreferredSize(new Dimension(650, 400)); |
|
45 |
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); |
|
46 |
|
|
47 |
text = new JTextPane(); |
|
48 |
text.setContentType("text/html"); |
|
49 |
text.setEditable(false); |
|
50 |
text.setText(html); |
|
51 |
text.setCaretPosition(0); |
|
52 |
|
|
53 |
JScrollPane scrollPane = new JScrollPane(text); |
|
54 |
//scrollPane.setPreferredSize(new Dimension(500, 220)); |
|
55 |
|
|
56 |
/*accept = new JButton("Accept"); |
|
57 |
accept.addActionListener(new ActionListener() { |
|
58 |
public void actionPerformed(ActionEvent arg0) { |
|
59 |
setVisible(false); // Provoca el cierre de la ventana |
|
60 |
} |
|
61 |
});*/ |
|
62 |
|
|
63 |
save = new JButton(i18n.getTranslation("save")); |
|
64 |
save.addActionListener(new ActionListener() { |
|
65 |
public void actionPerformed(ActionEvent evt) { |
|
66 |
saveActionPerformed(evt); |
|
67 |
} |
|
68 |
}); |
|
69 |
|
|
70 |
JPanel buttonsPanel = new JPanel(); |
|
71 |
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, |
|
72 |
BoxLayout.LINE_AXIS)); |
|
73 |
buttonsPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); |
|
74 |
|
|
75 |
buttonsPanel.add(Box.createHorizontalGlue()); |
|
76 |
buttonsPanel.add(save); |
|
77 |
//buttonsPanel.add(accept); |
|
78 |
|
|
79 |
this.add(scrollPane, BorderLayout.CENTER); |
|
80 |
this.add(buttonsPanel, BorderLayout.SOUTH); |
|
81 |
this.setVisible(true); |
|
82 |
} |
|
83 |
|
|
84 |
private void saveActionPerformed(ActionEvent evt) { |
|
85 |
FileWriter reporte = null; |
|
86 |
PrintWriter escritura = null; |
|
87 |
JFileChooser chooser = new JFileChooser(); |
|
88 |
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); |
|
89 |
int returnVal = chooser.showSaveDialog(getParent()); |
|
90 |
if(returnVal == JFileChooser.APPROVE_OPTION) { |
|
91 |
if(chooser.getSelectedFile() != null){ |
|
92 |
try { |
|
93 |
File file = chooser.getSelectedFile(); |
|
94 |
if(file.isDirectory()) { |
|
95 |
if(file.canWrite()) |
|
96 |
file = new File(file.getAbsolutePath() + File.separator + "Report.html"); |
|
97 |
else |
|
98 |
JOptionPane.showMessageDialog(getParent(), Messages.getText("folder_not_writable")); |
|
99 |
} else { |
|
100 |
if(!file.getAbsolutePath().endsWith("html") && !file.getAbsolutePath().endsWith("htm")) |
|
101 |
file = new File(file.getAbsolutePath() + ".html"); |
|
102 |
} |
|
103 |
|
|
104 |
reporte = new FileWriter(file); |
|
105 |
} catch (IOException e1) { |
|
106 |
log.error("Error writing the statistics", e1); |
|
107 |
} |
|
108 |
|
|
109 |
escritura = new PrintWriter(reporte); |
|
110 |
escritura.println(html); |
|
111 |
escritura.close(); |
|
112 |
} |
|
113 |
|
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
} |
|
118 |
|
|
0 | 119 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/DefaultPrincipalComponentsSwingManager.java | ||
---|---|---|
1 |
package org.gvsig.raster.principalcomponents.swing.impl; |
|
2 |
|
|
3 |
import javax.swing.JPanel; |
|
4 |
|
|
5 |
import org.gvsig.raster.algorithm.BasicAPISwingPanel; |
|
6 |
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure; |
|
7 |
import org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingManager; |
|
8 |
import org.gvsig.raster.principalcomponents.swing.impl.main.PCAComponentsListPanelImpl; |
|
9 |
import org.gvsig.raster.principalcomponents.swing.impl.main.PCAMainPanelImpl; |
|
10 |
import org.gvsig.raster.principalcomponents.swing.impl.stats.StatsPanelImpl; |
|
11 |
|
|
12 |
/** |
|
13 |
* Default {@link PrincipalComponentsManager} implementation. |
|
14 |
* |
|
15 |
* @author gvSIG Team |
|
16 |
* @version $Id$ |
|
17 |
*/ |
|
18 |
public class DefaultPrincipalComponentsSwingManager implements PrincipalComponentsSwingManager { |
|
19 |
private static DefaultPrincipalComponentsSwingManager internalInstance = new DefaultPrincipalComponentsSwingManager(); |
|
20 |
//private static final Logger logger = LoggerFactory.getLogger(DefaultPrincipalComponentsSwingManager.class); |
|
21 |
|
|
22 |
/** |
|
23 |
* Gets an instance of this object for internal use. |
|
24 |
* @return DefaultPrincipalComponentsManager |
|
25 |
*/ |
|
26 |
public static DefaultPrincipalComponentsSwingManager getInstance() { |
|
27 |
return internalInstance; |
|
28 |
} |
|
29 |
|
|
30 |
public BasicAPISwingPanel createPCAMainPanel( |
|
31 |
Object inputStore, |
|
32 |
String layerName, |
|
33 |
int bandList, |
|
34 |
String roisEPSG) { |
|
35 |
return new PCAMainPanelImpl(inputStore, layerName, bandList, roisEPSG); |
|
36 |
} |
|
37 |
|
|
38 |
public BasicAPISwingPanel createPCAComponentsListPanel( |
|
39 |
Object inputStore, |
|
40 |
PCStatsDataStructure stats, |
|
41 |
String fileName, |
|
42 |
boolean[] bands, |
|
43 |
String roisEPSG) { |
|
44 |
return new PCAComponentsListPanelImpl(inputStore, stats, fileName, bands, roisEPSG); |
|
45 |
} |
|
46 |
|
|
47 |
public JPanel createStatisticsPanel( |
|
48 |
PCStatsDataStructure pcStatistics, |
|
49 |
boolean bandStatistics, |
|
50 |
boolean covar, |
|
51 |
boolean autovect) { |
|
52 |
return new StatsPanelImpl(pcStatistics, bandStatistics, covar, autovect); |
|
53 |
} |
|
54 |
} |
|
0 | 55 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/main/BandTableModel.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.raster.principalcomponents.swing.impl.main; |
|
25 |
|
|
26 |
import javax.swing.table.DefaultTableModel; |
|
27 |
|
|
28 |
import org.gvsig.raster.swing.pagedtable.TableModel; |
|
29 |
/** |
|
30 |
* Model for the band table |
|
31 |
* |
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
33 |
*/ |
|
34 |
public class BandTableModel extends DefaultTableModel implements TableModel { |
|
35 |
final private static long serialVersionUID = -3370601314380922368L; |
|
36 |
private int nColumns = 0; |
|
37 |
|
|
38 |
public BandTableModel(String[] columnNames) { |
|
39 |
super(new Object[0][columnNames.length], columnNames); |
|
40 |
this.nColumns = columnNames.length; |
|
41 |
} |
|
42 |
|
|
43 |
public Class<?> getColumnClass(int c) { |
|
44 |
return String.class; |
|
45 |
} |
|
46 |
|
|
47 |
public void setValueAt(Object value, int row, int col) { |
|
48 |
super.setValueAt(value, row, col); |
|
49 |
} |
|
50 |
|
|
51 |
public void addNew() { |
|
52 |
Object[] line = new Object[nColumns]; |
|
53 |
line[0] = new Boolean(true); |
|
54 |
for (int i = 0; i < nColumns; i++) |
|
55 |
line[i] = new String(""); |
|
56 |
super.addRow(line); |
|
57 |
} |
|
58 |
|
|
59 |
public Object[] getNewLine() { |
|
60 |
Object[] o = new Object[nColumns]; |
|
61 |
o[0] = new Boolean(true); |
|
62 |
for (int i = 1; i < nColumns; i++) |
|
63 |
o[i] = ""; |
|
64 |
return o; |
|
65 |
} |
|
66 |
|
|
67 |
public void addNewLine() { |
|
68 |
// TODO Auto-generated method stub |
|
69 |
|
|
70 |
} |
|
71 |
} |
|
0 | 72 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/main/ComponentsTableModel.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.raster.principalcomponents.swing.impl.main; |
|
25 |
|
|
26 |
import javax.swing.table.DefaultTableModel; |
|
27 |
|
|
28 |
import org.gvsig.raster.swing.pagedtable.TableModel; |
|
29 |
/** |
|
30 |
* Model for the list of components |
|
31 |
* |
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
33 |
*/ |
|
34 |
public class ComponentsTableModel extends DefaultTableModel implements TableModel { |
|
35 |
final private static long serialVersionUID = -3370601314380922368L; |
|
36 |
private int nColumns = 0; |
|
37 |
|
|
38 |
public ComponentsTableModel(String[] columnNames) { |
|
39 |
super(new Object[0][columnNames.length], columnNames); |
|
40 |
this.nColumns = columnNames.length; |
|
41 |
} |
|
42 |
|
|
43 |
public Class<?> getColumnClass(int c) { |
|
44 |
return String.class; |
|
45 |
} |
|
46 |
|
|
47 |
public void setValueAt(Object value, int row, int col) { |
|
48 |
super.setValueAt(value, row, col); |
|
49 |
} |
|
50 |
|
|
51 |
public void addNew() { |
|
52 |
Object[] line = new Object[nColumns]; |
|
53 |
line[0] = new Boolean(true); |
|
54 |
for (int i = 0; i < nColumns; i++) |
|
55 |
line[i] = new String(""); |
|
56 |
super.addRow(line); |
|
57 |
} |
|
58 |
|
|
59 |
public Object[] getNewLine() { |
|
60 |
Object[] o = new Object[nColumns]; |
|
61 |
o[0] = new Boolean(true); |
|
62 |
for (int i = 1; i < nColumns; i++) |
|
63 |
o[i] = ""; |
|
64 |
return o; |
|
65 |
} |
|
66 |
|
|
67 |
public void addNewLine() { |
|
68 |
// TODO Auto-generated method stub |
|
69 |
|
|
70 |
} |
|
71 |
} |
|
0 | 72 |
org.gvsig.raster.principalcomponents/tags/org.gvsig.raster.principalcomponents-2.2.81/org.gvsig.raster.principalcomponents.swing/org.gvsig.raster.principalcomponents.swing.impl/src/main/java/org/gvsig/raster/principalcomponents/swing/impl/main/PCAComponentsListPanelImpl.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.raster.principalcomponents.swing.impl.main; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.GridBagConstraints; |
|
26 |
import java.awt.GridBagLayout; |
|
27 |
import java.awt.event.ActionListener; |
|
28 |
import java.util.EventListener; |
|
29 |
import java.util.List; |
|
30 |
|
|
31 |
import javax.swing.BorderFactory; |
|
32 |
import javax.swing.JButton; |
|
33 |
import javax.swing.JComponent; |
|
34 |
import javax.swing.JPanel; |
|
35 |
import javax.swing.JRadioButton; |
|
36 |
|
|
37 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
|
38 |
import org.gvsig.i18n.Messages; |
|
39 |
import org.gvsig.raster.algorithm.BasicAPISwingPanel; |
|
40 |
import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary; |
|
41 |
import org.gvsig.raster.algorithm.process.DataProcess; |
|
42 |
import org.gvsig.raster.algorithm.process.ProcessException; |
|
43 |
import org.gvsig.raster.principalcomponents.algorithm.PCStatsDataStructure; |
|
44 |
import org.gvsig.raster.principalcomponents.algorithm.PrincipalComponentsAlgorithmLibrary; |
|
45 |
import org.gvsig.raster.principalcomponents.swing.PrincipalComponentsSwingLibrary; |
|
46 |
import org.gvsig.raster.swing.RasterSwingLocator; |
|
47 |
import org.gvsig.raster.swing.RasterSwingManager; |
|
48 |
import org.gvsig.raster.swing.pagedtable.ModelLoader; |
|
49 |
import org.gvsig.raster.swing.pagedtable.PagedTable; |
|
50 |
|
|
51 |
/** |
|
52 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
53 |
*/ |
|
54 |
public class PCAComponentsListPanelImpl extends JPanel implements BasicAPISwingPanel { |
|
55 |
private static final long serialVersionUID = 1L; |
|
56 |
private Object inputStore = null; |
|
57 |
private PagedTable table = null; |
|
58 |
private JRadioButton byBandRadioButton = null; |
|
59 |
private JRadioButton varCovarRadioButton = null; |
|
60 |
private JRadioButton autovectorRadioButton = null; |
|
61 |
private JButton generateButton = null; |
|
62 |
private PCStatsDataStructure stats = null; |
|
63 |
private String fileName = null; |
|
64 |
private boolean[] bands = null; |
|
65 |
private String roisEPSG = null; |
|
66 |
|
|
67 |
public PCAComponentsListPanelImpl( |
|
68 |
Object inputStore, |
|
69 |
PCStatsDataStructure stats, |
|
70 |
String fileName, |
|
71 |
boolean[] bands, |
|
72 |
String roisEPSG) { |
|
73 |
this.inputStore = inputStore; |
|
74 |
this.stats = stats; |
|
75 |
this.fileName = fileName; |
|
76 |
this.bands = bands; |
|
77 |
this.roisEPSG = roisEPSG; |
|
78 |
init(); |
|
79 |
} |
|
80 |
|
|
81 |
private void init() { |
|
82 |
setLayout(new GridBagLayout()); |
|
83 |
|
|
84 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
85 |
gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH; |
|
86 |
gridBagConstraints1.weightx = 1; |
|
87 |
gridBagConstraints1.weighty = 1; |
|
88 |
gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 0); |
|
89 |
gridBagConstraints1.gridx = 0; |
|
90 |
gridBagConstraints1.gridy = 0; |
|
91 |
add(getInputsPanel(), gridBagConstraints1); |
|
92 |
|
|
93 |
gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
94 |
gridBagConstraints1.weighty = 0; |
|
95 |
gridBagConstraints1.gridy = 1; |
|
96 |
add(getPanelStatistics(), gridBagConstraints1); |
|
97 |
} |
|
98 |
|
|
99 |
public JPanel getPanelStatistics() { |
|
100 |
JPanel p = new JPanel(); |
|
101 |
p.setBorder(BorderFactory.createTitledBorder(Messages.getText("statistics"))); |
|
102 |
p.setLayout(new GridBagLayout()); |
|
103 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
104 |
gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
105 |
gridBagConstraints1.weightx = 1; |
|
106 |
gridBagConstraints1.insets = new java.awt.Insets(0, 0, 2, 0); |
|
107 |
gridBagConstraints1.gridwidth = 2; |
|
108 |
|
|
109 |
gridBagConstraints1.gridx = 0; |
|
110 |
gridBagConstraints1.gridy = 0; |
|
111 |
p.add(getByBandRadioButton(), gridBagConstraints1); |
|
112 |
|
|
113 |
gridBagConstraints1.gridwidth = 1; |
|
114 |
gridBagConstraints1.gridy = 1; |
|
115 |
p.add(getVarCovarRadioButton(), gridBagConstraints1); |
|
116 |
|
|
117 |
gridBagConstraints1.gridwidth = 2; |
|
118 |
gridBagConstraints1.gridy = 2; |
|
119 |
p.add(getAutovectorRadioButton(), gridBagConstraints1); |
|
120 |
|
|
121 |
gridBagConstraints1.gridwidth = 1; |
|
122 |
gridBagConstraints1.gridx = 1; |
|
123 |
gridBagConstraints1.gridy = 1; |
|
124 |
p.add(getGenerateButton(), gridBagConstraints1); |
|
125 |
|
|
126 |
return p; |
|
127 |
} |
|
128 |
|
|
129 |
public JRadioButton getByBandRadioButton() { |
|
130 |
if(byBandRadioButton == null) { |
|
131 |
byBandRadioButton = new JRadioButton(Messages.getText("by_band")); |
|
132 |
byBandRadioButton.setSelected(true); |
|
133 |
} |
|
134 |
return byBandRadioButton; |
|
135 |
} |
|
136 |
|
|
137 |
public JRadioButton getVarCovarRadioButton() { |
|
138 |
if(varCovarRadioButton == null) |
|
139 |
varCovarRadioButton = new JRadioButton(Messages.getText("var_covar")); |
|
140 |
return varCovarRadioButton; |
|
141 |
} |
|
142 |
|
|
143 |
public JRadioButton getAutovectorRadioButton() { |
|
144 |
if(autovectorRadioButton == null) |
|
145 |
autovectorRadioButton = new JRadioButton(Messages.getText("autovector")); |
|
146 |
return autovectorRadioButton; |
|
147 |
} |
|
148 |
|
|
149 |
public JButton getGenerateButton() { |
Also available in: Unified diff