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