svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / ui / raster / RasterPropsDialogPanel.java @ 4578
History | View | Annotate | Download (3 KB)
1 |
/*
|
---|---|
2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 |
*
|
4 |
* Copyright (C) 2004-5.
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* cresques@gmail.com
|
23 |
*/
|
24 |
package org.cresques.ui.raster; |
25 |
|
26 |
import org.cresques.io.GeoRasterFile; |
27 |
|
28 |
import org.cresques.ui.DefaultDialogPanel; |
29 |
|
30 |
import javax.swing.JPanel; |
31 |
|
32 |
|
33 |
/**
|
34 |
* Dialogo para configurar las propiedades del raster.
|
35 |
* @author Luis W. Sevilla (sevilla_lui@gva.es)
|
36 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
37 |
*/
|
38 |
public class RasterPropsDialogPanel extends DefaultDialogPanel { |
39 |
final private static long serialVersionUID = -3370601314380922368L; |
40 |
|
41 |
/**
|
42 |
* Constructor
|
43 |
*/
|
44 |
public RasterPropsDialogPanel() {
|
45 |
super();
|
46 |
initialize(); |
47 |
} |
48 |
|
49 |
/**
|
50 |
* This method initializes this
|
51 |
*
|
52 |
* @return void
|
53 |
*/
|
54 |
public void initialize() { |
55 |
this.setBounds(0, 0, 355, 230); |
56 |
} |
57 |
|
58 |
/**
|
59 |
* Obtiene el panel BandSetupPanel con los controles
|
60 |
* @return BandSetupPanel
|
61 |
*/
|
62 |
protected BandSetupPanel getBandSetupPanel() {
|
63 |
return (BandSetupPanel) getContentPanel();
|
64 |
} |
65 |
|
66 |
/**
|
67 |
* Obtiene el contentPane
|
68 |
*/
|
69 |
protected JPanel getContentPanel() { |
70 |
if (contentPane == null) { |
71 |
contentPane = new BandSetupPanel();
|
72 |
contentPane.setBounds(14, 12, 345, 174); |
73 |
} |
74 |
|
75 |
return contentPane;
|
76 |
} |
77 |
|
78 |
/**
|
79 |
* A?ade una lista de GeoRasterFile al panel de bandas
|
80 |
* @param files Array de GeoRasterFile
|
81 |
*/
|
82 |
public void addFiles(GeoRasterFile[] files) { |
83 |
getBandSetupPanel().addFiles(files); |
84 |
getBandSetupPanel().repaint(); |
85 |
this.repaint();
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* Mantiene la asignaci?n entre R, G o B y la banda de la imagen que le corresponde
|
90 |
* @param nBand Banda de la imagen que corresponde
|
91 |
* @param flag R, G o B se selecciona por medio de un flag que los identifica
|
92 |
*/
|
93 |
public void assignBand(int nBand, int flag) { |
94 |
getBandSetupPanel().assignBand(nBand, flag); |
95 |
} |
96 |
|
97 |
/**
|
98 |
* Obtiene la correspondencia entre el R, G o B y la banda asignada
|
99 |
* @param flag R, G o B se selecciona por medio de un flag que los identifica
|
100 |
* @return Banda de la imagen asignada al flag pasado por par?metro
|
101 |
*/
|
102 |
public int getAssignedBand(int flag) { |
103 |
return getBandSetupPanel().getAssignedBand(flag);
|
104 |
} |
105 |
} |