Revision 3012 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Dialogs/GeoreferencingDialog.java
GeoreferencingDialog.java | ||
---|---|---|
9 | 9 |
import javax.swing.JFileChooser; |
10 | 10 |
import javax.swing.JInternalFrame; |
11 | 11 |
import javax.swing.JPanel; |
12 |
import javax.swing.JTabbedPane; |
|
13 |
import javax.swing.event.ChangeEvent; |
|
14 |
import javax.swing.event.ChangeListener; |
|
15 | 12 |
|
16 | 13 |
import org.cresques.cts.IProjection; |
17 | 14 |
|
... | ... | |
27 | 24 |
import com.iver.cit.gvsig.fmap.tools.Behavior.MouseMovementBehavior; |
28 | 25 |
import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior; |
29 | 26 |
import com.iver.cit.gvsig.gui.View; |
27 |
import com.iver.cit.gvsig.gui.Panels.DataPointsTabPanel; |
|
30 | 28 |
import com.iver.cit.gvsig.gui.Panels.SelectFilePanel; |
31 | 29 |
import com.iver.cit.gvsig.gui.Panels.SelectPointsPanel; |
30 |
import com.iver.cit.gvsig.gui.Panels.TablePointsPanel; |
|
32 | 31 |
import com.iver.cit.gvsig.gui.toolListeners.GeorefPanListener; |
33 | 32 |
import com.iver.cit.gvsig.gui.toolListeners.GeorefPointerListener; |
34 | 33 |
import com.iver.cit.gvsig.gui.toolListeners.StatusBarListener; |
... | ... | |
46 | 45 |
|
47 | 46 |
|
48 | 47 |
static private IProjection proj = Project.getProjection(); |
49 |
private javax.swing.JTabbedPane tabPanel = null;; |
|
50 | 48 |
private JFileChooser fileChooser; |
51 | 49 |
private JPanel pBotones = null; // @jve:decl-index=0: |
52 | 50 |
private JButton bProcesar = null; // @jve:decl-index=0: |
... | ... | |
57 | 55 |
private GeoMoveBehavior mb = null; |
58 | 56 |
private static boolean loadTools = false; |
59 | 57 |
private JInternalFrame frame = null; |
58 |
|
|
60 | 59 |
private SelectFilePanel selectFilePanel = null; |
61 | 60 |
private SelectPointsPanel selectPointsPanel = null; |
61 |
private TablePointsPanel tablePointsPanel = null; |
|
62 |
private DataPointsTabPanel dataPointsTabPanel = null; |
|
62 | 63 |
|
63 | 64 |
private JButton bAceptar = null; |
65 |
|
|
64 | 66 |
/** |
65 | 67 |
* Constructor. |
66 | 68 |
*/ |
... | ... | |
110 | 112 |
this.setPreferredSize(new java.awt.Dimension(400,315)); |
111 | 113 |
this.setSize(new java.awt.Dimension(400,315)); |
112 | 114 |
this.setLocation(new java.awt.Point(0,0)); |
113 |
this.add(getTabPanel(), BorderLayout.CENTER); |
|
114 | 115 |
this.add(getPBotones(), java.awt.BorderLayout.SOUTH); |
115 |
selectFilePanel = new SelectFilePanel(this);
|
|
116 |
tablePointsPanel = new TablePointsPanel();
|
|
116 | 117 |
selectPointsPanel = new SelectPointsPanel(); |
117 |
//this.addTab(PluginServices.getText(this, "cargar_fichero"), selectFilePanel);
|
|
118 |
this.addTab(PluginServices.getText(this, "seleccionar_puntos"), selectPointsPanel); |
|
118 |
this.add(this.getDataPointsPanel(), null);
|
|
119 |
|
|
119 | 120 |
|
120 | 121 |
} |
121 | 122 |
|
122 |
|
|
123 | 123 |
/** |
124 |
* This method initializes tabPanel |
|
125 |
* |
|
126 |
* @return javax.swing.JTabbedPane |
|
124 |
* Obtiene el panel que contiene los tabs de selecci?n de puntos y tabla de puntos. |
|
125 |
* @return |
|
127 | 126 |
*/ |
128 |
public javax.swing.JTabbedPane getTabPanel() { |
|
129 |
if (tabPanel == null) { |
|
130 |
tabPanel = new javax.swing.JTabbedPane(); |
|
131 |
tabPanel.setBounds(0, 0, 519, 352); |
|
132 |
tabPanel.addChangeListener(new ChangeListener() { |
|
133 |
public void stateChanged(ChangeEvent e) { |
|
134 |
JTabbedPane tabs = (JTabbedPane) e.getSource(); |
|
135 |
//getBProcesar().setEnabled(!(tabs.getSelectedComponent() instanceof WizardPanel)); |
|
136 |
} |
|
137 |
}); |
|
138 |
} |
|
139 |
|
|
140 |
return tabPanel; |
|
127 |
public DataPointsTabPanel getDataPointsPanel() { |
|
128 |
if (dataPointsTabPanel == null) { |
|
129 |
dataPointsTabPanel = new DataPointsTabPanel(this.selectPointsPanel, this.tablePointsPanel); |
|
130 |
dataPointsTabPanel.setBounds(0, 0, 519, 352); |
|
131 |
} |
|
132 |
|
|
133 |
return dataPointsTabPanel; |
|
141 | 134 |
} |
142 | 135 |
|
143 |
/** |
|
144 |
* A?ade pesta?as al panel |
|
145 |
* @param title Nombre del tab |
|
146 |
* @param panel Panel que ir? en la pesta?a |
|
147 |
*/ |
|
148 |
public void addTab(String title, JPanel panel){ |
|
149 |
getTabPanel().addTab(title, panel); |
|
150 |
} |
|
151 |
|
|
152 |
/** |
|
153 |
* Obtiene el panel que contiene la pesta?a seleccionada |
|
154 |
* @return Panel seleccionado |
|
155 |
*/ |
|
156 |
public JPanel getSelectedTab(){ |
|
157 |
return (JPanel) getTabPanel().getSelectedComponent(); |
|
158 |
} |
|
159 |
|
|
160 | 136 |
/** |
161 | 137 |
* This method initializes jPanel |
162 | 138 |
* |
... | ... | |
280 | 256 |
public void setSelectPointsPanel(SelectPointsPanel selectPointsPanel) { |
281 | 257 |
this.selectPointsPanel = selectPointsPanel; |
282 | 258 |
} |
259 |
|
|
283 | 260 |
/** |
284 | 261 |
* This method initializes jButton |
285 | 262 |
* |
... | ... | |
294 | 271 |
return bAceptar; |
295 | 272 |
} |
296 | 273 |
|
274 |
/** |
|
275 |
* Acci?n cuando se pulsa el bot?n de aceptar en el dialogo. |
|
276 |
* <UL> |
|
277 |
* <LI>Cambiamos el nombre a la capa georraster</LI> |
|
278 |
* <LI>A la capa Georraster le asignamos la capa de puntos para poder recuperarla</LI> |
|
279 |
* <LI>Cerramos la ventana</LI> |
|
280 |
* </UL> |
|
281 |
*/ |
|
297 | 282 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
298 | 283 |
if(e.getSource() == bAceptar){ |
299 | 284 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
... | ... | |
305 | 290 |
if( lyr instanceof FLyrGeoRaster && |
306 | 291 |
lyr.getName().startsWith("*") && |
307 | 292 |
lyr.isActive()){ |
308 |
//A la capa Georraster le asignamos la capa de puntos para poder recuperarla |
|
309 |
|
|
293 |
|
|
294 |
//Campbiamos el nombre a la capa GeoRaster |
|
310 | 295 |
lyr.setName(lyr.getName().substring(1, lyr.getName().length())); |
311 | 296 |
lyr.setActive(false); |
312 | 297 |
lyrGeoRaster = (FLyrGeoRaster)lyr; |
... | ... | |
316 | 301 |
lyrPoints = (FLyrPoints)lyr; |
317 | 302 |
} |
318 | 303 |
|
319 |
if(lyrGeoRaster != null){ |
|
304 |
//A la capa Georraster le asignamos la capa de puntos para poder recuperarla |
|
305 |
if(lyrGeoRaster != null) |
|
320 | 306 |
lyrGeoRaster.setFLyrPoints(lyrPoints); |
321 |
//lyrGeoRaster.setGeoDialog(this); |
|
322 |
} |
|
307 |
|
|
323 | 308 |
|
324 | 309 |
theView.getMapControl().setTool("zoomIn"); |
325 | 310 |
|
Also available in: Unified diff