Revision 3014 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/AdjustGeorefPanel.java
AdjustGeorefPanel.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.gui.Panels; |
2 | 2 |
|
3 |
import java.awt.GridBagConstraints; |
|
4 |
import java.awt.GridBagLayout; |
|
5 |
|
|
3 | 6 |
import javax.swing.JPanel; |
4 | 7 |
|
8 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
9 |
import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog; |
|
10 |
|
|
5 | 11 |
public class AdjustGeorefPanel extends JPanel{ |
6 | 12 |
|
7 | 13 |
|
14 |
private JPanel pDetailImage = null; |
|
15 |
private ZoomControlPanel pixelZoom = null; |
|
16 |
private ZoomControlPanel mapZoom = null; |
|
17 |
private JPanel pOptions = null; |
|
18 |
private GeoreferencingDialog grd = null; |
|
19 |
|
|
8 | 20 |
/** |
9 | 21 |
* This is the default constructor |
10 | 22 |
*/ |
11 |
public AdjustGeorefPanel() { |
|
23 |
public AdjustGeorefPanel(GeoreferencingDialog grd) {
|
|
12 | 24 |
super(); |
25 |
this.grd = grd; |
|
13 | 26 |
initialize(); |
14 | 27 |
} |
15 | 28 |
|
... | ... | |
19 | 32 |
* @return void |
20 | 33 |
*/ |
21 | 34 |
private void initialize() { |
22 |
this.setPreferredSize(new java.awt.Dimension(400,240)); |
|
23 |
this.setSize(new java.awt.Dimension(400,240)); |
|
35 |
GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); |
|
36 |
gridBagConstraints11.gridx = 0; |
|
37 |
gridBagConstraints11.gridy = 1; |
|
38 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
|
39 |
gridBagConstraints.gridx = 0; |
|
40 |
gridBagConstraints.gridy = 0; |
|
41 |
this.setLayout(new GridBagLayout()); |
|
42 |
this.setPreferredSize(new java.awt.Dimension(400,275)); |
|
43 |
this.setSize(new java.awt.Dimension(400,275)); |
|
24 | 44 |
this.setLocation(new java.awt.Point(0,0)); |
45 |
|
|
46 |
this.add(getPDetailImage(), gridBagConstraints); |
|
47 |
this.add(getPOptions(), gridBagConstraints11); |
|
25 | 48 |
} |
26 | 49 |
|
50 |
/** |
|
51 |
* This method initializes jPanel |
|
52 |
* |
|
53 |
* @return javax.swing.JPanel |
|
54 |
*/ |
|
55 |
private JPanel getPDetailImage() { |
|
56 |
if (pDetailImage == null) { |
|
57 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
58 |
gridBagConstraints1.insets = new java.awt.Insets(0,0,0,0); |
|
59 |
gridBagConstraints1.gridy = 0; |
|
60 |
gridBagConstraints1.gridx = 0; |
|
61 |
GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
|
62 |
gridBagConstraints2.insets = new java.awt.Insets(0,0,0,0); |
|
63 |
gridBagConstraints2.gridy = 0; |
|
64 |
gridBagConstraints2.gridx = 1; |
|
65 |
pDetailImage = new JPanel(); |
|
66 |
pDetailImage.setLayout(new GridBagLayout()); |
|
67 |
pDetailImage.setPreferredSize(new java.awt.Dimension(400,175)); |
|
68 |
pDetailImage.add(getZoomLeft(), gridBagConstraints1); |
|
69 |
pDetailImage.add(getZoomRight(), gridBagConstraints2); |
|
70 |
} |
|
71 |
return pDetailImage; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* This method initializes ZoomControlPanel |
|
76 |
* |
|
77 |
* @return javax.swing.JButton |
|
78 |
*/ |
|
79 |
public ZoomControlPanel getZoomLeft() { |
|
80 |
if (pixelZoom == null) { |
|
81 |
pixelZoom = new ZoomControlPanel(true); |
|
82 |
} |
|
83 |
return pixelZoom; |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* This method initializes jButton |
|
88 |
* |
|
89 |
* @return javax.swing.JButton |
|
90 |
*/ |
|
91 |
public ZoomControlPanel getZoomRight() { |
|
92 |
if (mapZoom == null) { |
|
93 |
mapZoom = new ZoomControlPanel(false); |
|
94 |
} |
|
95 |
return mapZoom; |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* This method initializes jPanel |
|
100 |
* |
|
101 |
* @return javax.swing.JPanel |
|
102 |
*/ |
|
103 |
private JPanel getPOptions() { |
|
104 |
if (pOptions == null) { |
|
105 |
pOptions = new JPanel(); |
|
106 |
pOptions.setPreferredSize(new java.awt.Dimension(400,75)); |
|
107 |
} |
|
108 |
return pOptions; |
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* Asigna los viewPort a los canvas para el dibujado de la minimagen |
|
113 |
* @param vp ViewPort asignado. |
|
114 |
*/ |
|
115 |
public void setViewPort(ViewPort vp){ |
|
116 |
this.getZoomLeft().setViewPort(vp); |
|
117 |
this.getZoomRight().setViewPort(vp); |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* Realiza el dibujado de la minimagen de los cavas con el viewport actual |
|
122 |
*/ |
|
123 |
public void draw(){ |
|
124 |
this.getZoomLeft().draw(); |
|
125 |
this.getZoomRight().draw(); |
|
126 |
} |
|
127 |
|
|
128 |
|
|
27 | 129 |
} |
Also available in: Unified diff