Revision 2987 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Dialogs/GeoreferencingDialog.java
GeoreferencingDialog.java | ||
---|---|---|
19 | 19 |
import com.iver.cit.gvsig.fmap.MapControl; |
20 | 20 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
21 | 21 |
import com.iver.cit.gvsig.fmap.layers.FLyrGeoRaster; |
22 |
import com.iver.cit.gvsig.fmap.layers.FLyrPoints; |
|
22 | 23 |
import com.iver.cit.gvsig.fmap.tools.ZoomOutRightButtonListener; |
23 | 24 |
import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior; |
24 | 25 |
import com.iver.cit.gvsig.fmap.tools.Behavior.GeoMoveBehavior; |
... | ... | |
59 | 60 |
private SelectFilePanel selectFilePanel = null; |
60 | 61 |
private SelectPointsPanel selectPointsPanel = null; |
61 | 62 |
|
63 |
private JButton bAceptar = null; |
|
62 | 64 |
/** |
63 | 65 |
* Constructor. |
64 | 66 |
*/ |
... | ... | |
108 | 110 |
this.addTab(PluginServices.getText(this, "seleccionar_puntos"), selectPointsPanel); |
109 | 111 |
|
110 | 112 |
} |
113 |
|
|
111 | 114 |
|
112 | 115 |
/** |
113 | 116 |
* This method initializes tabPanel |
... | ... | |
156 | 159 |
FlowLayout flowLayout1 = new FlowLayout(); |
157 | 160 |
pBotones = new JPanel(); |
158 | 161 |
pBotones.setLayout(flowLayout1); |
159 |
flowLayout1.setHgap(30);
|
|
162 |
flowLayout1.setHgap(10);
|
|
160 | 163 |
pBotones.add(getBProcesar(), null); |
161 | 164 |
pBotones.add(getBSave(), null); |
165 |
pBotones.add(getBAceptar(), null); |
|
162 | 166 |
pBotones.add(getBCancelar(), null); |
163 | 167 |
} |
164 | 168 |
return pBotones; |
... | ... | |
174 | 178 |
bProcesar = new JButton(); |
175 | 179 |
bProcesar.setText(PluginServices.getText(this,"procesar")); |
176 | 180 |
bProcesar.setEnabled(false); |
181 |
bProcesar.setPreferredSize(new java.awt.Dimension(87,25)); |
|
177 | 182 |
bProcesar.addActionListener(new java.awt.event.ActionListener() { |
178 | 183 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
179 | 184 |
/*if (PluginServices.getMainFrame() == null) { |
... | ... | |
199 | 204 |
bCancelar.setText(PluginServices.getText(this,"cancelar")); |
200 | 205 |
bCancelar.addActionListener(new java.awt.event.ActionListener() { |
201 | 206 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
202 |
/*if (PluginServices.getMainFrame() != null) { |
|
203 |
PluginServices.getMDIManager().closeView((View) GeoreferencingDialog.this); |
|
204 |
} else { |
|
205 |
((JDialog) (getParent().getParent().getParent() |
|
206 |
.getParent())).dispose(); |
|
207 |
}*/ |
|
208 | 207 |
|
209 | 208 |
//Anulamos todos los cambios cargando el extent de origen a la capa |
210 | 209 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
211 | 210 |
|
212 | 211 |
for(int i=0;i<theView.getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
213 | 212 |
FLayer lyr = theView.getMapControl().getMapContext().getLayers().getLayer(i); |
214 |
if(lyr instanceof FLyrGeoRaster){ |
|
213 |
if(lyr instanceof FLyrGeoRaster && lyr.getName().startsWith("*")){
|
|
215 | 214 |
Extent initExtent = ((FLyrGeoRaster)lyr).getStackZoom().getInitExtent(); |
216 | 215 |
if(initExtent != null){ |
217 | 216 |
((FLyrGeoRaster)theView.getMapControl().getMapContext().getLayers().getLayer(lyr.getName())).setAssignExtent(initExtent); |
... | ... | |
344 | 343 |
public void setSelectPointsPanel(SelectPointsPanel selectPointsPanel) { |
345 | 344 |
this.selectPointsPanel = selectPointsPanel; |
346 | 345 |
} |
346 |
/** |
|
347 |
* This method initializes jButton |
|
348 |
* |
|
349 |
* @return javax.swing.JButton |
|
350 |
*/ |
|
351 |
private JButton getBAceptar() { |
|
352 |
if (bAceptar == null) { |
|
353 |
bAceptar = new JButton(); |
|
354 |
bAceptar.setText("aceptar"); |
|
355 |
bAceptar.addActionListener(new java.awt.event.ActionListener() { |
|
356 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
357 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
|
358 |
|
|
359 |
//Obtenemos la capa de puntos y la capa de georaster |
|
360 |
FLyrGeoRaster lyrGeoRaster = null; |
|
361 |
for(int i=0;i<theView.getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
|
362 |
FLayer lyr = theView.getMapControl().getMapContext().getLayers().getLayer(i); |
|
363 |
if(lyr instanceof FLyrGeoRaster && lyr.getName().startsWith("*")){ |
|
364 |
lyrGeoRaster = (FLyrGeoRaster)lyr; |
|
365 |
lyrGeoRaster.setName(lyrGeoRaster.getName().substring(1, lyrGeoRaster.getName().length())); |
|
366 |
} |
|
367 |
} |
|
368 |
|
|
369 |
//Cerramos la ventana |
|
370 |
try{ |
|
371 |
frame.setClosed(true); |
|
372 |
}catch(PropertyVetoException exc){} |
|
373 |
} |
|
374 |
}); |
|
375 |
} |
|
376 |
return bAceptar; |
|
377 |
} |
|
347 | 378 |
} // @jve:decl-index=0:visual-constraint="10,10" |
348 | 379 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
349 | 380 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
Also available in: Unified diff