gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.impl / src / main / java / org / gvsig / raster / georeferencing / swing / impl / launcher / GeorefLauncherPanel.java @ 1692
History | View | Annotate | Download (4.77 KB)
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.georeferencing.swing.impl.launcher; |
23 |
|
24 |
import java.awt.GridBagConstraints; |
25 |
import java.awt.GridBagLayout; |
26 |
import java.util.List; |
27 |
|
28 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
29 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
30 |
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel; |
31 |
import org.gvsig.raster.georeferencing.swing.impl.option.CellSizeOptionsPanel; |
32 |
|
33 |
/**
|
34 |
* Panel general del cuadro de lanzamiento de la funcionalidad de georreferenciaci?n.
|
35 |
* Contiene los paneles de selecci?n de algoritmo, selecci?n de fichero y selecci?n
|
36 |
* de tipo de georreferenciaci?n.
|
37 |
*
|
38 |
* 10/01/2008
|
39 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
40 |
*/
|
41 |
public class GeorefLauncherPanel extends DefaultButtonsPanel { |
42 |
private static final long serialVersionUID = 1L; |
43 |
private List<String> viewNameList = null; |
44 |
private int polynomialDegree; |
45 |
|
46 |
private AlgorithmSelectionPanel algorithmPanel = null; |
47 |
private FileSelectionPanel filePanel = null; |
48 |
private OutFileSelectionPanel outFilePanel = null; |
49 |
private TypeSelectionPanel typePanel = null; |
50 |
private CellSizeOptionsPanel cellSizePanel = null; |
51 |
|
52 |
/**
|
53 |
* Constructor
|
54 |
* @param viewList Lista de nombres de las vistas disponibles
|
55 |
* @param degreeList grado m?ximo para la georreferenciaci?n polinomial
|
56 |
*/
|
57 |
public GeorefLauncherPanel(List<String> viewList, int polynomialDegree) { |
58 |
this.viewNameList = viewList;
|
59 |
this.polynomialDegree = polynomialDegree;
|
60 |
|
61 |
//Ocultamos el bot?n de aplicar
|
62 |
getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setVisible(false);
|
63 |
init(); |
64 |
} |
65 |
|
66 |
public void setButtonsListener(ButtonsPanelListener listener) { |
67 |
getButtonsPanel().addButtonPressedListener(listener); |
68 |
} |
69 |
|
70 |
/**
|
71 |
* Acciones de inicializaci?n del panel
|
72 |
*/
|
73 |
public void init() { |
74 |
GridBagLayout gl = new GridBagLayout(); |
75 |
setLayout(gl); |
76 |
|
77 |
GridBagConstraints gbc = new GridBagConstraints(); |
78 |
gbc.weightx = 1.0;
|
79 |
gbc.weighty = 1.0;
|
80 |
gbc.fill = GridBagConstraints.BOTH;
|
81 |
|
82 |
add(getTypeSelectionPanel(), gbc); |
83 |
|
84 |
gbc.gridy = 1;
|
85 |
gbc.weighty = 0.0;
|
86 |
gbc.fill = GridBagConstraints.HORIZONTAL;
|
87 |
add(getFileSelectionPanel(), gbc); |
88 |
|
89 |
gbc.gridy = 2;
|
90 |
gbc.weighty = 0.0;
|
91 |
gbc.fill = GridBagConstraints.HORIZONTAL;
|
92 |
add(getOutFileSelectionPanel(), gbc); |
93 |
|
94 |
gbc.gridy = 3;
|
95 |
gbc.weighty = 1.0;
|
96 |
gbc.fill = GridBagConstraints.BOTH;
|
97 |
add(getAlgorithmSelectionPanel(), gbc); |
98 |
|
99 |
gbc.gridy = 4;
|
100 |
gbc.weighty = 1.0;
|
101 |
gbc.fill = GridBagConstraints.BOTH;
|
102 |
add(getCellSizePanel(), gbc); |
103 |
} |
104 |
|
105 |
/**
|
106 |
* Obtiene el panel de selecci?n de algoritmo
|
107 |
* @return AlgorithmSelectionPanel
|
108 |
*/
|
109 |
public AlgorithmSelectionPanel getAlgorithmSelectionPanel() {
|
110 |
if(algorithmPanel == null) |
111 |
algorithmPanel = new AlgorithmSelectionPanel(polynomialDegree);
|
112 |
return algorithmPanel;
|
113 |
} |
114 |
|
115 |
/**
|
116 |
* Obtiene el panel de selecci?n de fichero
|
117 |
* @return FileSelectionPanel
|
118 |
*/
|
119 |
public FileSelectionPanel getFileSelectionPanel() {
|
120 |
if(filePanel == null) |
121 |
filePanel = new FileSelectionPanel( getCellSizePanel().getXCellSizeTextField(),
|
122 |
getCellSizePanel().getYCellSizeTextField()); |
123 |
return filePanel;
|
124 |
} |
125 |
|
126 |
/**
|
127 |
* Obtiene el panel de selecci?n de fichero de salida
|
128 |
* @return FileSelectionPanel
|
129 |
*/
|
130 |
public OutFileSelectionPanel getOutFileSelectionPanel() {
|
131 |
if(outFilePanel == null) |
132 |
outFilePanel = new OutFileSelectionPanel();
|
133 |
return outFilePanel;
|
134 |
} |
135 |
|
136 |
/**
|
137 |
* Obtiene el panel de selecci?n de tipo
|
138 |
* @return TypeSelectionPanel
|
139 |
*/
|
140 |
public TypeSelectionPanel getTypeSelectionPanel() {
|
141 |
if(typePanel == null) |
142 |
typePanel = new TypeSelectionPanel(viewNameList);
|
143 |
return typePanel;
|
144 |
} |
145 |
|
146 |
/**
|
147 |
* Obtiene el panel del tama?o de celda
|
148 |
* @return CellSizeOptionsPanel
|
149 |
*/
|
150 |
public CellSizeOptionsPanel getCellSizePanel() {
|
151 |
if(cellSizePanel == null) |
152 |
cellSizePanel = new CellSizeOptionsPanel();
|
153 |
return cellSizePanel;
|
154 |
} |
155 |
} |