Statistics
| Revision:

root / trunk / extensions / extGeoreferencing / src / com / iver / cit / gvsig / gui / Panels / AdjustGeorefPanel.java @ 3019

History | View | Annotate | Download (3.26 KB)

1 3012 nacho
package com.iver.cit.gvsig.gui.Panels;
2
3 3014 nacho
import java.awt.GridBagConstraints;
4
import java.awt.GridBagLayout;
5
6 3012 nacho
import javax.swing.JPanel;
7
8 3014 nacho
import com.iver.cit.gvsig.fmap.ViewPort;
9
import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog;
10
11 3012 nacho
public class AdjustGeorefPanel extends JPanel{
12
13
14 3014 nacho
        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
20 3012 nacho
        /**
21
         * This is the default constructor
22
         */
23 3014 nacho
        public AdjustGeorefPanel(GeoreferencingDialog grd) {
24 3012 nacho
                super();
25 3014 nacho
                this.grd = grd;
26 3012 nacho
                initialize();
27
        }
28
29
        /**
30
         * This method initializes this
31
         *
32
         * @return void
33
         */
34
        private void initialize() {
35 3014 nacho
        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));
44 3012 nacho
        this.setLocation(new java.awt.Point(0,0));
45 3014 nacho
46
                this.add(getPDetailImage(), gridBagConstraints);
47
                this.add(getPOptions(), gridBagConstraints11);
48 3012 nacho
        }
49
50 3014 nacho
        /**
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
129 3012 nacho
}