root / trunk / extensions / extGeoreferencing / src / com / iver / cit / gvsig / gui / Panels / AdjustGeorefPanel.java @ 3039
History | View | Annotate | Download (3.77 KB)
1 | 3012 | nacho | package com.iver.cit.gvsig.gui.Panels; |
---|---|---|---|
2 | |||
3 | 3037 | nacho | import java.awt.BorderLayout; |
4 | 3014 | nacho | import java.awt.GridBagConstraints; |
5 | import java.awt.GridBagLayout; |
||
6 | |||
7 | 3012 | nacho | import javax.swing.JPanel; |
8 | |||
9 | 3014 | nacho | import com.iver.cit.gvsig.fmap.ViewPort; |
10 | import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog; |
||
11 | |||
12 | 3012 | nacho | public class AdjustGeorefPanel extends JPanel{ |
13 | |||
14 | |||
15 | 3014 | nacho | 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 | 3037 | nacho | private OptionsPanel optionsPanel = null; |
21 | 3014 | nacho | |
22 | 3012 | nacho | /**
|
23 | * This is the default constructor
|
||
24 | */
|
||
25 | 3014 | nacho | public AdjustGeorefPanel(GeoreferencingDialog grd) {
|
26 | 3012 | nacho | super();
|
27 | 3014 | nacho | this.grd = grd;
|
28 | 3012 | nacho | initialize(); |
29 | } |
||
30 | |||
31 | /**
|
||
32 | * This method initializes this
|
||
33 | *
|
||
34 | * @return void
|
||
35 | */
|
||
36 | private void initialize() { |
||
37 | 3014 | nacho | 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 | 3039 | nacho | this.setPreferredSize(new java.awt.Dimension(380,162)); |
45 | this.setSize(new java.awt.Dimension(380,162)); |
||
46 | 3012 | nacho | this.setLocation(new java.awt.Point(0,0)); |
47 | 3014 | nacho | |
48 | this.add(getPDetailImage(), gridBagConstraints);
|
||
49 | this.add(getPOptions(), gridBagConstraints11);
|
||
50 | 3012 | nacho | } |
51 | |||
52 | 3014 | nacho | /**
|
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 | 3039 | nacho | pDetailImage.setPreferredSize(new java.awt.Dimension(380,142)); |
70 | 3014 | nacho | 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 | 3037 | nacho | BorderLayout bl = new BorderLayout(); |
109 | pOptions.setLayout(bl); |
||
110 | 3039 | nacho | pOptions.setPreferredSize(new java.awt.Dimension(380,20)); |
111 | 3037 | nacho | if(optionsPanel == null) |
112 | optionsPanel = new OptionsPanel();
|
||
113 | 3039 | nacho | optionsPanel.setPreferredSize(new java.awt.Dimension(380,20)); |
114 | 3037 | nacho | pOptions.add(optionsPanel, BorderLayout.CENTER);
|
115 | 3014 | nacho | } |
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 | 3037 | nacho | /**
|
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 | 3014 | nacho | |
146 | 3012 | nacho | } |