Revision 45056

View differences:

tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.buildtools/src/main/resources/gvsig/checkstyle.xml
1
<?xml version="1.0"?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 3
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<!DOCTYPE module PUBLIC
28
    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
29
    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
30

  
31
<!--
32

  
33
  Checkstyle configuration that checks the sun coding conventions from:
34

  
35
    - the Java Language Specification at
36
      http://java.sun.com/docs/books/jls/second_edition/html/index.html
37

  
38
    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
39

  
40
    - the Javadoc guidelines at
41
      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
42

  
43
    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
44

  
45
    - some best practices
46

  
47
  Checkstyle is very configurable. Be sure to read the documentation at
48
  http://checkstyle.sf.net (or in your downloaded distribution).
49

  
50
  Most Checks are configurable, be sure to consult the documentation.
51

  
52
  To completely disable a check, just comment it out or delete it from the file.
53

  
54
  Finally, it is worth reading the documentation.
55

  
56
-->
57

  
58
<module name="Checker">
59
    <!--
60
        If you set the basedir property below, then all reported file
61
        names will be relative to the specified directory. See
62
        http://checkstyle.sourceforge.net/5.x/config.html#Checker
63

  
64
        <property name="basedir" value="${basedir}"/>
65
    -->
66
    <!-- gvSIG: All project files have the ISO-8859-1 charset -->
67
	<property name="charset" value="ISO-8859-1" />
68

  
69
    <!-- Checks that a package-info.java file exists for each package.     -->
70
    <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
71
	<module name="JavadocPackage">
72
		<property name="allowLegacy" value="true" />
73
	</module>
74

  
75
    <!-- Checks whether files end with a new line.                        -->
76
    <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
77
    <module name="NewlineAtEndOfFile"/>
78

  
79
    <!-- Checks that property files contain the same keys.         -->
80
    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
81
    <module name="Translation"/>
82
    
83
    <!-- Checks for Size Violations.                    -->
84
    <!-- See http://checkstyle.sf.net/config_sizes.html -->
85
    <module name="FileLength"/>
86
    
87
    <!-- Checks for whitespace                               -->
88
    <!-- See http://checkstyle.sf.net/config_whitespace.html -->
89
    <module name="FileTabCharacter"/>
90

  
91

  
92
    <module name="TreeWalker">
93

  
94
	    <!-- Miscellaneous other checks.                   -->
95
	    <!-- See http://checkstyle.sf.net/config_misc.html -->
96
	    <!-- gvSIG: apply only to java files -->
97
	    <module name="RegexpSinglelineJava">
98
	       <property name="format" value="\s+$"/>
99
	       <property name="minimum" value="0"/>
100
	       <property name="maximum" value="0"/>
101
	       <property name="message" value="Line has trailing spaces."/>
102
	       <property name="ignoreComments" value="true"/>
103
	    </module>
104
	    
105
        <!-- Checks for Javadoc comments.                     -->
106
        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
107
		<!--
108
			gvSIG rule 3: All protected or public classes must have a Javadoc comments,
109
			except getters and setters
110
		-->
111
		<module name="JavadocMethod">
112
			<property name="scope" value="protected" />
113
			<property name="allowMissingPropertyJavadoc" value="true" />
114
		</module>
115
		<!--
116
			gvSIG rule 9: All classes must have a Javadoc comment
117
			with the "@author tag" and the "@version $Id$" tag included 
118
		-->
119
		<module name="JavadocType">
120
			<property name="scope" value="private" />
121
			<property name="authorFormat" value="\S" />
122
			<property name="versionFormat" value="\$Id.*\$"/>
123
		</module>
124
        <module name="JavadocVariable">
125
			<property name="scope" value="protected" />
126
		</module>
127
		<!-- gvSIG rule 3: Check correctly formatted Javadoc -->
128
		<module name="JavadocStyle">
129
			<property name="scope" value="protected" />
130
		</module>
131

  
132

  
133
        <!-- Checks for Naming Conventions.                  -->
134
        <!-- See http://checkstyle.sf.net/config_naming.html -->
135
        <module name="ConstantName"/>
136
        <module name="LocalFinalVariableName"/>
137
        <module name="LocalVariableName"/>
138
        <module name="MemberName"/>
139
        <module name="MethodName"/>
140
		<!-- gvSIG rule 15: All packages must begin with org.gvsig.  -->
141
		<module name="PackageName">
142
			<property name="format" value="^org\.gvsig(\.[a-z][a-z0-9]*)+$" />
143
		</module>
144
		<!-- gvSIG advised rule 1: Abstract class names must begin with Abstract. -->
145
		<!-- module name="AbstractClassName" /-->
146
        <module name="ParameterName"/>
147
        <module name="StaticVariableName"/>
148
        <module name="TypeName"/>
149

  
150
        <!-- Checks for imports                              -->
151
        <!-- See http://checkstyle.sf.net/config_import.html -->
152
        <module name="AvoidStarImport"/>
153
        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
154
        <module name="RedundantImport"/>
155
        <module name="UnusedImports"/>
156

  
157

  
158
        <!-- Checks for Size Violations.                    -->
159
        <!-- See http://checkstyle.sf.net/config_sizes.html -->
160
        <module name="LineLength"/>
161
        <module name="MethodLength"/>
162
        <module name="ParameterNumber"/>
163

  
164

  
165
        <!-- Checks for whitespace                               -->
166
        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
167
        <module name="EmptyForIteratorPad"/>
168
        <module name="GenericWhitespace"/>
169
        <module name="MethodParamPad"/>
170
        <module name="NoWhitespaceAfter"/>
171
        <module name="NoWhitespaceBefore"/>
172
        <module name="OperatorWrap"/>
173
        <module name="ParenPad"/>
174
        <module name="TypecastParenPad"/>
175
        <module name="WhitespaceAfter"/>
176
        <module name="WhitespaceAround"/>
177

  
178

  
179
        <!-- Modifier Checks                                    -->
180
        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
181
        <module name="ModifierOrder"/>
182
        <module name="RedundantModifier"/>
183

  
184

  
185
        <!-- Checks for blocks. You know, those {}'s         -->
186
        <!-- See http://checkstyle.sf.net/config_blocks.html -->
187
        <module name="AvoidNestedBlocks"/>
188
        <module name="EmptyBlock"/>
189
        <module name="LeftCurly"/>
190
        <module name="NeedBraces"/>
191
        <module name="RightCurly"/>
192

  
193

  
194
        <!-- Checks for common coding problems               -->
195
        <!-- See http://checkstyle.sf.net/config_coding.html -->
196
        <module name="AvoidInlineConditionals"/>
197
        <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
198
        <module name="EmptyStatement"/>
199
        <module name="EqualsHashCode"/>
200
        <module name="HiddenField"/>
201
        <module name="IllegalInstantiation"/>
202
        <module name="InnerAssignment"/>
203
        <module name="MagicNumber"/>
204
        <module name="MissingSwitchDefault"/>
205
        <module name="RedundantThrows"/>
206
        <module name="SimplifyBooleanExpression"/>
207
        <module name="SimplifyBooleanReturn"/>
208

  
209
		<!-- gvSIG: Check for some common programming errors -->
210
		<module name="CovariantEquals" />
211
		<module name="StringLiteralEquality" />
212

  
213
        <!-- Checks for class design                         -->
214
        <!-- See http://checkstyle.sf.net/config_design.html -->
215
        <module name="DesignForExtension"/>
216
        <module name="FinalClass"/>
217
        <module name="HideUtilityClassConstructor"/>
218
        <module name="InterfaceIsType"/>
219
        <module name="VisibilityModifier"/>
220

  
221

  
222
        <!-- Miscellaneous other checks.                   -->
223
        <!-- See http://checkstyle.sf.net/config_misc.html -->
224
        <module name="ArrayTypeStyle"/>
225
        <!-- gvSIG: removed -->
226
        <!-- module name="FinalParameters"/-->
227
        <module name="TodoComment"/>
228
        <module name="UpperEll"/>
229
				
230
	    <!-- gvSIG rule 2: Sun style with 4 spaces -->
231
	    <module name="Indentation">
232
	    	<property name="basicOffset" value="4"/>
233
		    <property name="caseIndent" value="0"/>
234
		</module>
235
        
236
        <!-- gvSIG rule 10: Do not use System.out/err to log -->
237
		<module name="Regexp">
238
		    <!-- . matches any character, so we need to escape it and use \. 
239
		    to match dots.-->
240
		    <property name="format" value="System\.[out|err]\.println"/>
241
		    <property name="illegalPattern" value="true"/>
242
		</module>
243
		
244
		<!-- gvSIG rule 11: Try to avoid catching Throwable or 
245
		Exception and catch specific exceptions instead. -->
246
		<module name="IllegalCatch"/>
247
		
248
		<!-- gvSIG rule 13: Use interfaces in the declaration of 
249
		methods and variables.
250
        By default only avoids usage of Classes:
251
			"java.util.GregorianCalendar, java.util.Hashtable, 
252
		  	java.util.HashSet, java.util.HashMap, java.util.ArrayList, 
253
		  	java.util.LinkedList, java.util.LinkedHashMap, 
254
		  	java.util.LinkedHashSet, java.util.TreeSet, 
255
		  	java.util.TreeMap, java.util.Vector" -->
256
		<module name="IllegalType">
257
		    <property name="ignoredMethodNames" value="getInstance"/>
258
		</module>
259
		
260
    </module>
261

  
262
	<!--  gvSIG rule 1: check for the gvSIG header -->
263
    <!-- Uneeded, use the maven-license-plugin instead
264
	<module name="RegexpHeader"> -->
265
		<!-- The follow property value demonstrates the ability     -->
266
		<!-- to have access to ANT properties. In this case it uses -->
267
		<!-- the ${basedir} property to allow Checkstyle to be run  -->
268
		<!-- from any directory within a project. See property      -->
269
		<!-- expansion,                                             -->
270
		<!-- http://checkstyle.sf.net/config.html#properties        -->
271
    <!--
272
		<property name="headerFile" value="${checkstyle.header.file}" />
273
	</module>
274
    -->
275

  
276
</module>
0 277

  
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.buildtools/src/main/resources/header.txt
1
gvSIG. Desktop Geographic Information System.
2

  
3
Copyright (C) 2007-2013 gvSIG Association.
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 3
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
For any additional information, do not hesitate to contact us 
21
at info AT gvsig.com, or visit our website www.gvsig.com.
0 22

  
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.buildtools/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
  <groupId>org.gvsig</groupId>
5
  <artifactId>org.gvsig.desktop.buildtools</artifactId>
6
  <version>1.0.0</version>
7
  <packaging>jar</packaging>
8
  <name>${project.artifactId}</name>
9
  <description>Resources used for build gvsig desktop</description>
10

  
11

  
12
<!-- No puede ser hijo de org.gvsig.desktop para evitar referencas circulares -->
13
<!--
14
  <parent>
15
    <groupId>org.gvsig</groupId>
16
    <artifactId>org.gvsig.desktop</artifactId>
17
    <version>2.0.10-SNAPSHOT</version>
18
  </parent>  
19
-->
20

  
21

  
22
    <licenses>
23
        <license>
24
            <name>GPLv3</name>
25
            <url>http://www.gnu.org/licenses/gpl.html</url>
26
            <distribution>repo</distribution>
27
            <comments>
28
			"GPL" stands for "General Public License". The most widespread such
29
			license is the GNU General Public License, or GNU GPL for short.
30
			This can be further shortened to "GPL", when it is understood that
31
			the GNU GPL is the one intended.
32
	      	</comments>
33
        </license>
34
    </licenses>
35

  
36
    <organization>
37
        <name>gvSIG Association</name>
38
        <url>http://www.gvsig.com/</url>
39
    </organization>
40

  
41
    <scm>
42
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</connection>
43
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</developerConnection>
44
        <url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/trunk</url>
45
    </scm>
46
    
47
    <repositories>
48
      <repository>
49
        <id>gvsig-public-http-repository</id>
50
        <name>gvSIG maven public HTTP repository</name>
51
        <url>http://devel.gvsig.org/m2repo/j2se</url>
52
        <releases>
53
          <enabled>true</enabled>
54
          <updatePolicy>daily</updatePolicy>
55
          <checksumPolicy>warn</checksumPolicy>
56
        </releases>
57
        <snapshots>
58
          <enabled>true</enabled>
59
          <updatePolicy>daily</updatePolicy>
60
          <checksumPolicy>warn</checksumPolicy>
61
        </snapshots>
62
      </repository>
63
    </repositories>
64

  
65
    <distributionManagement>
66
      <site>
67
        <id>gvsig-repository</id>
68
        <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
69
      </site>
70
      <repository>
71
          <id>gvsig-repository</id>
72
          <name>gvSIG maven repository</name>
73
          <url>dav:https://devel.gvsig.org/m2repo/j2se</url>
74
          <uniqueVersion>false</uniqueVersion>
75
      </repository>
76
      <snapshotRepository>
77
          <id>gvsig-repository</id>
78
          <name>gvSIG maven repository</name>
79
          <url>dav:https://devel.gvsig.org/m2repo/j2se</url>
80
          <uniqueVersion>false</uniqueVersion>
81
      </snapshotRepository>
82
    </distributionManagement>
83
    
84
    <issueManagement>
85
      <system>redmine</system>
86
      <url>https://devel.gvsig.org/redmine/projects/gvsig-desktop</url>
87
    </issueManagement>
88

  
89
    <mailingLists>
90
      <mailingList>
91
        <name>User List</name>
92
        <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</subscribe>
93
        <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</unsubscribe>
94
        <post>gvsig_usuarios@listserv.gva.es</post>
95
        <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
96
        <otherArchives>
97
          <otherArchive>http://www.mail-archive.com/gvsig_usuarios@runas.cap.gva.es</otherArchive>
98
          <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
99
        </otherArchives>
100
      </mailingList>
101
      <mailingList>
102
        <name>Developer List</name>
103
        <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</subscribe>
104
        <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</unsubscribe>
105
        <post>gvsig_desarrolladores@listserv.gva.es</post>
106
        <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
107
        <otherArchives>
108
          <otherArchive>http://www.mail-archive.com/gvsig_desarrolladores@runas.cap.gva.es</otherArchive>
109
          <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
110
        </otherArchives>
111
      </mailingList>
112
      <mailingList>
113
        <name>International List</name>
114
        <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</subscribe>
115
        <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</unsubscribe>
116
        <post>gvsig_internacional@listserv.gva.es</post>
117
        <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
118
        <otherArchives>
119
          <otherArchive>http://www.mail-archive.com/gvsig_internacional@runas.cap.gva.es</otherArchive>
120
          <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
121
        </otherArchives>
122
      </mailingList>
123
    </mailingLists>
124
    
125
    <build>
126
        <extensions>
127
            <extension>
128
                <groupId>org.apache.maven.wagon</groupId>
129
                <artifactId>wagon-webdav-jackrabbit</artifactId>
130
                <version>1.0-beta-7</version>
131
            </extension>
132
        </extensions>
133
    </build>
134

  
135
</project>
0 136

  
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/MapContextRasterSwingManager.java
1
package org.gvsig.fmap.mapcontext.raster.swing;
2
/* gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2017 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

  
25

  
26
import java.util.List;
27

  
28
import org.gvsig.fmap.dal.raster.BandDescriptor;
29
import org.gvsig.fmap.mapcontext.raster.swing.bands.BandsPanel;
30
import org.gvsig.fmap.mapcontext.raster.swing.export.ExportRasterPanel;
31
import org.gvsig.fmap.mapcontext.raster.swing.operations.OperationListPanel;
32
import org.gvsig.fmap.mapcontext.raster.swing.operations.OperationSelectorPanel;
33
import org.gvsig.fmap.mapcontext.raster.swing.previewer.OneLayerPreviewer;
34
import org.gvsig.fmap.mapcontext.raster.swing.transparency.TransparencyPanel;
35
import org.gvsig.tools.service.Manager;
36

  
37

  
38
/**
39
 *
40
 * @see MapContextRasterSwingManager
41
 * @author gvSIG team
42
 * @version $Id$
43
 */
44
public interface MapContextRasterSwingManager extends Manager{
45

  
46
    /**
47
     * @return
48
     */
49
    public SelectableBandDescriptorsTableModel createSelectableBandDescriptorsTableModel(List<BandDescriptor> descriptors) ;
50

  
51
    /**
52
     * @return
53
     */
54
    public TransparencyPanel createTransparencyPanel();
55

  
56
    /**
57
     * @return
58
     */
59
    public BandsPanel createBandsPanel();
60

  
61

  
62
    /**
63
     * @return
64
     */
65
    public ExportRasterPanel createExportRaster();
66

  
67
    /**
68
     * @return
69
     */
70
    public OneLayerPreviewer createOneLayerPreviewer();
71

  
72
    /**
73
     * @return
74
     */
75
    public OperationListPanel createOperationListPanel();
76

  
77
    /**
78
     * @return
79
     */
80
    OperationSelectorPanel createOperationSelectorPanel();
81

  
82
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/bands/BandsPanel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.bands;
2

  
3
import org.gvsig.tools.dispose.Disposable;
4
import org.gvsig.tools.swing.api.Component;
5
import org.gvsig.fmap.mapcontext.layers.FLayer;
6

  
7

  
8

  
9
/**
10
 * @author fdiaz
11
 *
12
 */
13
public interface BandsPanel extends Component, Disposable {
14

  
15
    /**
16
     * @param layer
17
     * @return
18
     */
19
    public boolean fetch(FLayer layer);
20

  
21
    /**
22
     * @param layer
23
     */
24
    public void set(FLayer layer);
25

  
26
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/previewer/OneLayerPreviewer.java
1
package org.gvsig.fmap.mapcontext.raster.swing.previewer;
2

  
3
import org.cresques.cts.IProjection;
4

  
5
import org.gvsig.fmap.mapcontext.layers.FLayer;
6
import org.gvsig.tools.dispose.Disposable;
7
import org.gvsig.tools.swing.api.Component;
8

  
9

  
10
/**
11
 * @author fdiaz
12
 *
13
 */
14
public interface OneLayerPreviewer extends Component, Disposable {
15

  
16
    /**
17
     * @param projection
18
     */
19
    public void setProjection(IProjection projection);
20

  
21
    /**
22
     * @param layer
23
     */
24
    public void setLayer(FLayer layer);
25

  
26
    /**
27
     * @return
28
     */
29
    public FLayer getLayer();
30

  
31
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/transparency/TransparencyPanel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.transparency;
2

  
3
import java.awt.Color;
4

  
5
import org.gvsig.fmap.mapcontext.layers.FLayer;
6
import org.gvsig.tools.swing.api.Component;
7

  
8

  
9

  
10
/**
11
 * @author fdiaz
12
 *
13
 */
14
public interface TransparencyPanel extends Component {
15

  
16
    /**
17
     * Fetch the layer with the panel's values.
18
     *
19
     * @param layer
20
     * @return
21
     */
22
    public boolean fetch(FLayer layer);
23

  
24
    /**
25
     * Sets the layer
26
     *
27
     * @param layer
28
     */
29
    public void set(FLayer layer);
30

  
31
    /**
32
     * Sets the color.
33
     * @param color
34
     */
35
    public void setColor(Color color);
36

  
37
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/MapContextRasterSwingLocator.java
1
package org.gvsig.fmap.mapcontext.raster.swing;
2
/* gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2017 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

  
25

  
26
import org.gvsig.tools.locator.BaseLocator;
27

  
28
/**
29
 * This locator is the entry point for the raster buffer swing library,
30
 *
31
 * @author gvSIG team
32
 * @version $Id$
33
 */
34
public class MapContextRasterSwingLocator extends BaseLocator {
35

  
36
    /**
37
     * Chart swing manager name.
38
     */
39
    public static final String SWING_MANAGER_NAME =
40
        "Mapcontext.raster.swing.manager";
41

  
42
    /**
43
     * Chart swing manager description.
44
     */
45
    public static final String SWING_MANAGER_DESCRIPTION =
46
        "UIManager of MapContext Raster library";
47

  
48
    private static final String LOCATOR_NAME = "Mapcontext.raster.swing.locator";
49

  
50
    /**
51
     * Unique instance.
52
     */
53
    private static final MapContextRasterSwingLocator INSTANCE =
54
        new MapContextRasterSwingLocator();
55

  
56
    /**
57
     * Return the singleton instance.
58
     *
59
     * @return the singleton instance
60
     */
61
    public static MapContextRasterSwingLocator getInstance() {
62
        return INSTANCE;
63
    }
64

  
65
    /**
66
     * Return the Locator's name
67
     *
68
     * @return a String with the Locator's name
69
     */
70
    public final String getLocatorName() {
71
        return LOCATOR_NAME;
72
    }
73

  
74
    /**
75
     * Registers the Class implementing the PersistenceManager interface.
76
     *
77
     * @param clazz
78
     *            implementing the PersistenceManager interface
79
     */
80
    public static void registerSwingManager(
81
        Class<? extends MapContextRasterSwingManager> clazz) {
82
        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
83
            clazz);
84
    }
85

  
86
    /**
87
     * Gets the instance of the {@link ScriptingUIManager} registered.
88
     *
89
     * @return {@link ScriptingUIManager}
90
     */
91
    public static MapContextRasterSwingManager getSwingManager() {
92
        return (MapContextRasterSwingManager) getInstance()
93
            .get(SWING_MANAGER_NAME);
94
    }
95

  
96
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/MapContextRasterSwingLibrary.java
1
package org.gvsig.fmap.mapcontext.raster.swing;
2

  
3
/* gvSIG. Desktop Geographic Information System.
4
 *
5
 * Copyright ? 2007-2017 gvSIG Association
6
 *
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
 * MA  02110-1301, USA.
21
 *
22
 * For any additional information, do not hesitate to contact us
23
 * at info AT gvsig.com, or visit our website www.gvsig.com.
24
 */
25
import org.gvsig.tools.library.AbstractLibrary;
26
import org.gvsig.tools.library.LibraryException;
27
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
28

  
29

  
30

  
31

  
32
/**
33
 * @author fdiaz
34
 *
35
 */
36
public class MapContextRasterSwingLibrary extends AbstractLibrary{
37

  
38
    @Override
39
    public void doRegistration() {
40
        registerAsAPI(MapContextRasterSwingLibrary.class);
41
//        this.require(RasterLibrary.class);
42
//        this.require(BufferLibrary.class);
43
    }
44

  
45
    @Override
46
    protected void doInitialize() throws LibraryException {
47
    }
48

  
49
    @Override
50
    protected void doPostInitialize() throws LibraryException {
51
        // Validate there is any implementation registered.
52
        MapContextRasterSwingManager manager =
53
            MapContextRasterSwingLocator.getSwingManager();
54
        if (manager == null) {
55
            throw new ReferenceNotRegisteredException(
56
                MapContextRasterSwingLocator.SWING_MANAGER_NAME,
57
                MapContextRasterSwingLocator.getInstance());
58
        }
59
    }
60

  
61

  
62
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/export/ExportRasterPanel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.export;
2

  
3
import java.nio.Buffer;
4

  
5
import org.gvsig.tools.swing.api.Component;
6

  
7

  
8
public interface ExportRasterPanel extends Component {
9

  
10
//    /**
11
//     * @param layer
12
//     */
13
//    public boolean fetch(FLayer layer);
14

  
15
    /**
16
     * @param buffer
17
     */
18
    public void set(Buffer buffer);
19

  
20
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/SelectableBandDescriptorsTableModel.java
1
package org.gvsig.fmap.mapcontext.raster.swing;
2

  
3
import org.gvsig.raster.swing.buffer.SelectableBandsTableModel;
4

  
5

  
6
/**
7
 * @author fdiaz
8
 *
9
 */
10
public interface SelectableBandDescriptorsTableModel extends SelectableBandsTableModel {
11

  
12
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/operations/OperationSelectorPanel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.operations;
2

  
3
import javax.swing.event.ListSelectionListener;
4

  
5
import org.gvsig.raster.lib.buffer.api.operations.OperationFactory;
6
import org.gvsig.tools.swing.api.Component;
7

  
8

  
9

  
10
/**
11
 * @author fdiaz
12
 *
13
 */
14
public interface OperationSelectorPanel extends Component {
15

  
16
    /**
17
     * @param layer
18
     * @return
19
     */
20
    public OperationFactory getSelected();
21

  
22
    /**
23
     * @param layer
24
     * @return
25
     */
26
    public void clearSelection();
27

  
28
    /**
29
     * @param listener
30
     */
31
    public void addListSelectionListener(ListSelectionListener listener);
32

  
33
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/operations/OperationListPanel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.operations;
2

  
3
import java.awt.event.ActionListener;
4

  
5
import javax.swing.event.ListSelectionListener;
6
import javax.swing.event.TableModelListener;
7

  
8
import org.gvsig.raster.lib.buffer.api.operations.OperationFactory;
9
import org.gvsig.raster.lib.buffer.api.operations.OperationList;
10
import org.gvsig.raster.lib.buffer.api.operations.OperationListEntry;
11
import org.gvsig.tools.swing.api.Component;
12

  
13
/**
14
 * @author fdiaz
15
 *
16
 */
17
public interface OperationListPanel extends Component {
18

  
19
    public static String ADD_ACTION_COMMAND = "add_operation_entry";
20
    public static String UPDATE_ACTION_COMMAND = "update_operation_entry";
21
    public static String UP_ACTION_COMMAND = "up_operation_entry";
22
    public static String DOWN_ACTION_COMMAND = "down_operation_entry";
23
    public static String REMOVE_ACTION_COMMAND = "remove_operation_entry";
24

  
25
    /**
26
     * @param operationList
27
     * @return
28
     */
29
    public boolean fetch(OperationList operationList);
30

  
31
    /**
32
     * @param operationList
33
     */
34
    public void set(OperationList operationList);
35

  
36
    /**
37
     * @param layer
38
     * @return
39
     */
40
    public OperationListEntry getSelected();
41

  
42
    /**
43
     * @param listener
44
     */
45
    public void addListSelectionListener(ListSelectionListener listener);
46

  
47
    /**
48
     * @param listener
49
     */
50
    public void addTableModelListener(TableModelListener listener);
51

  
52
    /**
53
     * @param enable
54
     */
55
    public void enableAdd(boolean enable);
56

  
57
    /**
58
     * @param enable
59
     */
60
    public void enableUpdate(boolean enable);
61

  
62
    /**
63
     * @param operationListEntry
64
     */
65
    public void add(OperationListEntry operationListEntry);
66

  
67
    /**
68
     * @param listener
69
     */
70
    void addActionListener(ActionListener listener);
71

  
72
    /**
73
    *
74
    */
75
    public void clearSelection();
76

  
77
    /**
78
     * @param row
79
     */
80
    public void select(int row);
81

  
82
    /**
83
     * @return
84
     */
85
    public int getSelectedRow();
86

  
87
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.fmap.mapcontext.raster.swing.MapContextRasterSwingLibrary
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/pom.xml
1
<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">
2
    <modelVersion>4.0.0</modelVersion>
3
    <parent>
4
        <groupId>org.gvsig</groupId>
5
        <artifactId>org.gvsig.fmap.mapcontext.swing</artifactId>
6
        <version>2.0.283</version>
7
      </parent>
8
    <artifactId>org.gvsig.fmap.mapcontext.swing.api</artifactId>
9
    <name>${project.artifactId}</name>
10
    <dependencies>
11
        <dependency>
12
            <groupId>org.gvsig</groupId>
13
            <artifactId>org.gvsig.tools.swing.api</artifactId>
14
            <scope>compile</scope>
15
        </dependency>
16
        <dependency>
17
            <groupId>org.gvsig</groupId>
18
            <artifactId>org.gvsig.raster.lib.buffer.api</artifactId>
19
            <scope>compile</scope>
20
        </dependency>
21
        <dependency>
22
            <groupId>org.gvsig</groupId>
23
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
24
            <scope>compile</scope>
25
        </dependency>
26
        <dependency>
27
            <groupId>org.gvsig</groupId>
28
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
29
            <scope>compile</scope>
30
        </dependency>
31
        <dependency>
32
            <groupId>org.gvsig</groupId>
33
            <artifactId>org.gvsig.raster.swing.buffer.api</artifactId>
34
            <scope>compile</scope>
35
        </dependency>
36
    </dependencies>
37
</project>
0 38

  
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/pom.xml
1
<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">
2
    <modelVersion>4.0.0</modelVersion>
3
    <parent>
4
        <groupId>org.gvsig</groupId>
5
        <artifactId>org.gvsig.desktop.library</artifactId>
6
        <version>2.0.283</version>
7
      </parent>
8
    <groupId>org.gvsig</groupId>
9
    <artifactId>org.gvsig.fmap.mapcontext.swing</artifactId>
10
    <packaging>pom</packaging>
11
    <name>${project.artifactId}</name>
12
    <modules>
13
        <module>org.gvsig.fmap.mapcontext.swing.api</module>
14
        <module>org.gvsig.fmap.mapcontext.swing.impl</module>
15
    </modules>
16
</project>
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/pom.xml
1
<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">
2
    <modelVersion>4.0.0</modelVersion>
3
    <parent>
4
        <groupId>org.gvsig</groupId>
5
        <artifactId>org.gvsig.fmap.mapcontext.swing</artifactId>
6
        <version>2.0.283</version>
7
      </parent>
8
    <artifactId>org.gvsig.fmap.mapcontext.swing.impl</artifactId>
9
    <name>${project.artifactId}</name>
10
    <dependencies>
11
        <dependency>
12
            <groupId>org.gvsig</groupId>
13
            <artifactId>org.gvsig.fmap.mapcontext.swing.api</artifactId>
14
            <scope>compile</scope>
15
        </dependency>
16
        <dependency>
17
            <groupId>org.gvsig</groupId>
18
            <artifactId>org.gvsig.tools.swing.api</artifactId>
19
            <scope>compile</scope>
20
        </dependency>
21
        <dependency>
22
            <groupId>org.gvsig</groupId>
23
            <artifactId>org.gvsig.raster.swing.buffer.api</artifactId>
24
            <scope>compile</scope>
25
        </dependency>
26
        <dependency>
27
            <groupId>org.gvsig</groupId>
28
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
29
            <scope>compile</scope>
30
        </dependency>
31
        <dependency>
32
            <groupId>com.jgoodies</groupId>
33
            <artifactId>jgoodies-forms</artifactId>
34
            <scope>compile</scope>
35
        </dependency>
36
        <dependency>
37
            <groupId>com.jeta</groupId>
38
            <artifactId>formsrt</artifactId>
39
            <scope>compile</scope>
40
        </dependency>
41
        <dependency>
42
            <groupId>org.gvsig</groupId>
43
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
44
            <scope>compile</scope>
45
        </dependency>
46
        <dependency>
47
            <groupId>org.gvsig</groupId>
48
            <artifactId>org.gvsig.fmap.control</artifactId>
49
            <scope>compile</scope>
50
        </dependency>
51
        <dependency>
52
            <groupId>org.gvsig</groupId>
53
            <artifactId>org.gvsig.raster.swing.buffer.api</artifactId>
54
            <scope>compile</scope>
55
        </dependency>
56
    </dependencies>
57
</project>
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/DefaultSelectableBandDescriptorsTableModel.java
1
package org.gvsig.fmap.mapcontext.raster.swing.impl;
2
/* gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2017 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

  
25

  
26
import java.util.ArrayList;
27
import java.util.Collections;
28
import java.util.List;
29

  
30
import javax.swing.table.AbstractTableModel;
31

  
32
import org.gvsig.fmap.dal.raster.BandDescriptor;
33
import org.gvsig.fmap.mapcontext.raster.swing.SelectableBandDescriptorsTableModel;
34
import org.gvsig.raster.swing.buffer.SelectableBandsTableModel;
35
import org.gvsig.tools.ToolsLocator;
36
import org.gvsig.tools.i18n.I18nManager;
37

  
38

  
39
/**
40
 * @author fdiaz
41
 *
42
 */
43
public class DefaultSelectableBandDescriptorsTableModel extends AbstractTableModel implements SelectableBandDescriptorsTableModel {
44

  
45
    /**
46
     *
47
     */
48
    private static final long serialVersionUID = -3653794540611142562L;
49

  
50
    private List<SelectableBand> bands;
51

  
52
    private static final int COLUMNS = 5;
53

  
54
    private static final int COLUMN_SELECTED = 0;
55
    private static final int COLUMN_NUMBER = 1;
56
    private static final int COLUMN_BAND_STORE_NAME = 2;
57
    private static final int COLUMN_BAND_NUMBER_IN_STORE = 3;
58
    private static final int COLUMN_BAND_NAME = 4;
59

  
60
    /**
61
     * @param bandDescriptors
62
     */
63
    public DefaultSelectableBandDescriptorsTableModel(List<BandDescriptor> bandDescriptors) {
64
        bands = new ArrayList<DefaultSelectableBandDescriptorsTableModel.SelectableBand>();
65
        for (int i=0; i<bandDescriptors.size(); i++) {
66
            SelectableBand selectableBand = new SelectableBand(i, bandDescriptors.get(i), true);
67
            bands.add(selectableBand);
68
        }
69
    }
70

  
71
    /* (non-Javadoc)
72
     * @see javax.swing.table.TableModel#getRowCount()
73
     */
74
    @Override
75
    public int getRowCount() {
76
        return bands.size();
77
    }
78

  
79
    /* (non-Javadoc)
80
     * @see javax.swing.table.TableModel#getColumnCount()
81
     */
82
    @Override
83
    public int getColumnCount() {
84
        return COLUMNS;
85
    }
86

  
87
    /* (non-Javadoc)
88
     * @see javax.swing.table.TableModel#getValueAt(int, int)
89
     */
90
    @Override
91
    public Object getValueAt(int rowIndex, int columnIndex) {
92
        switch (columnIndex) {
93
        case COLUMN_SELECTED:
94
            return bands.get(rowIndex).isSelected();
95
        case COLUMN_NUMBER:
96
            return bands.get(rowIndex).getNumber();
97
        case COLUMN_BAND_STORE_NAME:
98
            return bands.get(rowIndex).getBandDescriptor().getStore().getName();
99
        case COLUMN_BAND_NUMBER_IN_STORE:
100
            return bands.get(rowIndex).getBandDescriptor().getBand();
101
        case COLUMN_BAND_NAME:
102
            return bands.get(rowIndex).getBandDescriptor().getName();
103
        }
104
        return null;
105
    }
106

  
107
    @Override
108
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
109

  
110
        if (rowIndex < bands.size()) {
111
            if (columnIndex < COLUMNS) {
112
                switch (columnIndex) {
113
                case COLUMN_SELECTED:
114
                    if (aValue == null) {
115
                        bands.get(rowIndex).setSelected(false);
116
                        break;
117
                    }
118
                    if (!(aValue instanceof Boolean)) {
119
                        throw new IllegalArgumentException("The object '" + aValue.toString() + "' must be a Boolean.");
120
                    }
121
                    bands.get(rowIndex).setSelected((Boolean) aValue);
122
                    this.fireTableDataChanged();
123
                    break;
124
                default:
125
                    break;
126
                }
127

  
128
            }
129
        }
130
    }
131

  
132
    @Override
133
    public String getColumnName(int column) {
134
        I18nManager i18nManager = ToolsLocator.getI18nManager();
135
        switch (column) {
136
        case COLUMN_SELECTED:
137
            return i18nManager.getTranslation("_selected");
138
        case COLUMN_NUMBER:
139
            return i18nManager.getTranslation("_number");
140
        case COLUMN_BAND_STORE_NAME:
141
            return i18nManager.getTranslation("_store_name");
142
        case COLUMN_BAND_NUMBER_IN_STORE:
143
            return i18nManager.getTranslation("_band_number");
144
        case COLUMN_BAND_NAME:
145
            return i18nManager.getTranslation("_band_name");
146
        }
147
        return null;
148
    }
149

  
150
    public boolean isCellEditable(int row, int col) {
151
        if (col == COLUMN_SELECTED) {
152
            return true;
153
        }
154
        return false;
155
    }
156

  
157
    @Override
158
    public Class<?> getColumnClass(int col) {
159
        if (col == COLUMN_SELECTED) {
160
            return Boolean.class;
161
        }
162
        return super.getColumnClass(col);
163
    }
164

  
165

  
166
    /**
167
     * @param rowIndex
168
     */
169
    public void up(int rowIndex){
170
        if(rowIndex>0){
171
            SelectableBand aux = bands.get(rowIndex);
172
            bands.set(rowIndex, bands.get(rowIndex-1));
173
            bands.set(rowIndex-1, aux);
174
            this.fireTableDataChanged();
175
        }
176
    }
177

  
178
    /**
179
     * @param rowIndex
180
     */
181
    public void down(int rowIndex){
182
        if(rowIndex<(bands.size()-1)){
183
            SelectableBand aux = bands.get(rowIndex);
184
            bands.set(rowIndex, bands.get(rowIndex+1));
185
            bands.set(rowIndex+1, aux);
186
            this.fireTableDataChanged();
187
        }
188
    }
189

  
190
    /**
191
     * @return a list of selected bands.
192
     */
193
    public List<Integer> getSelectedBands() {
194
        List<Integer> selectedBands = new ArrayList<Integer>();
195
        for (SelectableBand selBand : this.bands) {
196
            if(selBand.isSelected()){
197
                selectedBands.add(selBand.getNumber());
198
            }
199
        }
200
        return Collections.unmodifiableList(selectedBands);
201
    }
202

  
203
    public void selectBand(int band) {
204
        this.bands.get(band).setSelected(true);
205
        this.fireTableDataChanged();
206
    }
207

  
208
    public void unselectBand(int band) {
209
        this.bands.get(band).setSelected(false);
210
        this.fireTableDataChanged();
211
    }
212

  
213
    public void selectAllBands() {
214
        for (SelectableBand selBand : this.bands) {
215
            selBand.setSelected(true);
216
            this.fireTableDataChanged();
217
        }
218
    }
219

  
220
    public void unselectAllBands() {
221
        for (SelectableBand selBand : this.bands) {
222
            selBand.setSelected(false);
223
            this.fireTableDataChanged();
224
        }
225
    }
226

  
227
    /**
228
     * @author fdiaz
229
     *
230
     */
231
    public static class SelectableBand {
232

  
233
        private boolean selected;
234
        private int number;
235
        private BandDescriptor bandDescriptor;
236

  
237
        /**
238
         * @param bandDescriptor
239
         * @param selected
240
         */
241
        public SelectableBand(int number, BandDescriptor bandDescriptor, boolean selected) {
242

  
243
            this.setNumber(number);
244
            this.setBandDescriptor(bandDescriptor);
245
            this.setSelected(selected);
246
        }
247

  
248
        /**
249
         * @return the number
250
         */
251
        public int getNumber() {
252
            return number;
253
        }
254

  
255
        /**
256
         * @param number the number to set
257
         */
258
        public void setNumber(int number) {
259
            this.number = number;
260
        }
261

  
262
        /**
263
         * @return the selected
264
         */
265
        public boolean isSelected() {
266
            return selected;
267
        }
268

  
269
        /**
270
         * @param selected the selected to set
271
         */
272
        public void setSelected(boolean selected) {
273
            this.selected = selected;
274
        }
275

  
276
        /**
277
         * @return the bandDescriptor
278
         */
279
        public BandDescriptor getBandDescriptor() {
280
            return bandDescriptor;
281
        }
282

  
283
        /**
284
         * @param bandDescriptor the bandDescriptor to set
285
         */
286
        public void setBandDescriptor(BandDescriptor bandDescriptor) {
287
            this.bandDescriptor = bandDescriptor;
288
        }
289
    }
290

  
291
}
tags/org.gvsig.desktop-2.0.283/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/previewer/DefaultOneLayerPreviewer.java
1
package org.gvsig.fmap.mapcontext.raster.swing.impl.previewer;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.Dimension;
5
import java.awt.Rectangle;
6

  
7
import javax.swing.JComponent;
8
import javax.swing.JPanel;
9

  
10
import org.cresques.cts.IProjection;
11
import org.slf4j.Logger;
12
import org.slf4j.LoggerFactory;
13

  
14
import org.gvsig.fmap.dal.exception.ReadException;
15
import org.gvsig.fmap.mapcontext.MapContext;
16
import org.gvsig.fmap.mapcontext.MapContextLocator;
17
import org.gvsig.fmap.mapcontext.layers.FLayer;
18
import org.gvsig.fmap.mapcontext.layers.FLayers;
19
import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
20
import org.gvsig.fmap.mapcontext.raster.swing.previewer.OneLayerPreviewer;
21
import org.gvsig.fmap.mapcontext.rendering.legend.events.LegendChangedEvent;
22
import org.gvsig.fmap.mapcontext.rendering.legend.events.listeners.LegendListener;
23
import org.gvsig.fmap.mapcontrol.MapControl;
24
import org.gvsig.fmap.mapcontrol.MapControlCreationException;
25
import org.gvsig.fmap.mapcontrol.MapControlLocator;
26
import org.gvsig.fmap.mapcontrol.tools.PanListenerImpl;
27
import org.gvsig.fmap.mapcontrol.tools.ZoomInListenerImpl;
28
import org.gvsig.fmap.mapcontrol.tools.ZoomOutListenerImpl;
29
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
30
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseWheelBehavior;
31
import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior;
32
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
33
import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
34
import org.gvsig.fmap.mapcontrol.tools.Listeners.PanListener;
35
import org.gvsig.tools.dispose.Disposable;
36
import org.gvsig.tools.dispose.DisposeUtils;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff