Revision 3040 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Dialogs/GeoreferencingDialog.java
GeoreferencingDialog.java | ||
---|---|---|
4 | 4 |
import java.awt.Dimension; |
5 | 5 |
import java.awt.FlowLayout; |
6 | 6 |
import java.awt.event.ActionListener; |
7 |
import java.awt.event.ComponentEvent; |
|
8 |
import java.awt.event.ComponentListener; |
|
7 | 9 |
import java.beans.PropertyVetoException; |
8 | 10 |
|
9 | 11 |
import javax.swing.JButton; |
... | ... | |
40 | 42 |
* |
41 | 43 |
* @author Nacho Brodin (brodin_ign@gva.es) |
42 | 44 |
*/ |
43 |
public class GeoreferencingDialog extends JPanel implements ActionListener { |
|
44 |
|
|
45 |
|
|
45 |
public class GeoreferencingDialog extends JPanel implements ActionListener, ComponentListener { |
|
46 | 46 |
static private IProjection proj = Project.getProjection(); |
47 | 47 |
private JFileChooser fileChooser; |
48 | 48 |
private JPanel pBotones = null; // @jve:decl-index=0: |
... | ... | |
70 | 70 |
*/ |
71 | 71 |
public GeoreferencingDialog(JInternalFrame f) { |
72 | 72 |
frame = f; |
73 |
frame.addComponentListener(this); |
|
73 | 74 |
initialize(); |
74 | 75 |
} |
75 | 76 |
|
... | ... | |
79 | 80 |
*/ |
80 | 81 |
public void setFrame(JInternalFrame f){ |
81 | 82 |
frame = f; |
83 |
frame.addComponentListener(this); |
|
82 | 84 |
} |
83 | 85 |
|
84 | 86 |
/** |
87 |
* Obtiene el frame |
|
88 |
* @return frame |
|
89 |
*/ |
|
90 |
public JInternalFrame getFrame(){ |
|
91 |
return frame; |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
85 | 95 |
* En la inicializaci?n de la ventana a?adimos los tags de est? y cargamos |
86 | 96 |
* ls herramientas para manejar las imagenes a georeferenciar. |
87 | 97 |
*/ |
... | ... | |
390 | 400 |
public SelectPointsPanel getSelectPointsPanel(){ |
391 | 401 |
return this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel(); |
392 | 402 |
} |
403 |
|
|
393 | 404 |
|
394 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
405 |
/* (non-Javadoc) |
|
406 |
* @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent) |
|
407 |
*/ |
|
408 |
public void componentHidden(ComponentEvent arg0) { |
|
409 |
// TODO Auto-generated method stub |
|
410 |
|
|
411 |
} |
|
412 |
/* (non-Javadoc) |
|
413 |
* @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent) |
|
414 |
*/ |
|
415 |
public void componentMoved(ComponentEvent arg0) { |
|
416 |
// TODO Auto-generated method stub |
|
417 |
|
|
418 |
} |
|
419 |
/* (non-Javadoc) |
|
420 |
* @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent) |
|
421 |
*/ |
|
422 |
public void componentResized(ComponentEvent ev) { |
|
423 |
//this.newFrameSize(frame.getWidth(), frame.getHeight()); |
|
424 |
|
|
425 |
} |
|
426 |
/* (non-Javadoc) |
|
427 |
* @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent) |
|
428 |
*/ |
|
429 |
public void componentShown(ComponentEvent arg0) { |
|
430 |
// TODO Auto-generated method stub |
|
431 |
|
|
432 |
} |
|
433 |
|
|
434 |
/** |
|
435 |
* Calculo del nuevo tama?o a partir de un frame redimensionado |
|
436 |
* @param w Ancho del frame |
|
437 |
* @param h Alto del frame |
|
438 |
*/ |
|
439 |
public void newFrameSize(int w, int h){ |
|
440 |
int initWFrame = 385; |
|
441 |
int initW = 395; |
|
442 |
|
|
443 |
normalWidth = (int)((initW * w)/initWFrame); |
|
444 |
//System.out.println(normalWidth+" "+normalHeight); |
|
445 |
|
|
446 |
this.resize(new java.awt.Dimension(normalWidth, normalHeight)); |
|
447 |
|
|
448 |
this.getConectorPanel().newFrameSize(w, h); |
|
449 |
|
|
450 |
} |
|
451 |
|
|
452 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
395 | 453 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
396 | 454 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
Also available in: Unified diff