root / trunk / extensions / extGeoreferencing / src / com / iver / cit / gvsig / gui / Panels / ConectorPanel.java @ 3014
History | View | Annotate | Download (3.81 KB)
1 | 3014 | nacho | package com.iver.cit.gvsig.gui.Panels; |
---|---|---|---|
2 | |||
3 | import javax.swing.JPanel; |
||
4 | |||
5 | import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog; |
||
6 | |||
7 | import java.awt.Dimension; |
||
8 | import java.awt.GridBagConstraints; |
||
9 | import java.awt.GridBagLayout; |
||
10 | import javax.swing.JButton; |
||
11 | import java.awt.FlowLayout; |
||
12 | |||
13 | /**
|
||
14 | * Panel que contiene opciones de georreferenciaci?n a elegir por
|
||
15 | * el usuario. Esta clase no maneja eventos.
|
||
16 | *
|
||
17 | * @author Nacho Brodin (brodin_ign@gva.es)
|
||
18 | *
|
||
19 | */
|
||
20 | public class ConectorPanel extends JPanel{ |
||
21 | |||
22 | private AdjustGeorefPanel adjustGeorefPanel = null; |
||
23 | private DataPointsTabPanel dataPointsTabPanel = null; |
||
24 | private GeoreferencingDialog grd = null; |
||
25 | private JPanel pNorth = null; |
||
26 | private JPanel pSouth = null; |
||
27 | /**
|
||
28 | * This is the default constructor
|
||
29 | */
|
||
30 | public ConectorPanel(GeoreferencingDialog grd) {
|
||
31 | super();
|
||
32 | this.grd = grd;
|
||
33 | initialize(); |
||
34 | } |
||
35 | |||
36 | /**
|
||
37 | * This method initializes this
|
||
38 | *
|
||
39 | * @return void
|
||
40 | */
|
||
41 | private void initialize() { |
||
42 | GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
||
43 | gridBagConstraints1.gridx = 0;
|
||
44 | gridBagConstraints1.fill = java.awt.GridBagConstraints.NONE; |
||
45 | gridBagConstraints1.anchor = java.awt.GridBagConstraints.CENTER; |
||
46 | gridBagConstraints1.gridy = 1;
|
||
47 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
||
48 | gridBagConstraints.gridx = 0;
|
||
49 | gridBagConstraints.gridy = 0;
|
||
50 | this.setLayout(new GridBagLayout()); |
||
51 | this.setPreferredSize(new java.awt.Dimension(400,545)); |
||
52 | this.setSize(new java.awt.Dimension(400,545)); |
||
53 | this.setLocation(new java.awt.Point(0,0)); |
||
54 | this.add(getPNorth(), gridBagConstraints);
|
||
55 | this.add(getPSouth(), gridBagConstraints1);
|
||
56 | } |
||
57 | |||
58 | |||
59 | public AdjustGeorefPanel getAdjustGeorefPanel() {
|
||
60 | if (adjustGeorefPanel == null) { |
||
61 | adjustGeorefPanel = new AdjustGeorefPanel(grd);
|
||
62 | adjustGeorefPanel.setSize(400, 275); |
||
63 | adjustGeorefPanel.setPreferredSize(new Dimension(400, 275)); |
||
64 | adjustGeorefPanel.setVisible(true);
|
||
65 | } |
||
66 | return adjustGeorefPanel;
|
||
67 | } |
||
68 | |||
69 | public DataPointsTabPanel getDataPointsTabPanel() {
|
||
70 | if (dataPointsTabPanel == null) { |
||
71 | dataPointsTabPanel = new DataPointsTabPanel(grd);
|
||
72 | dataPointsTabPanel.setVisible(true);
|
||
73 | } |
||
74 | return dataPointsTabPanel;
|
||
75 | } |
||
76 | |||
77 | /**
|
||
78 | * This method initializes jPanel
|
||
79 | *
|
||
80 | * @return javax.swing.JPanel
|
||
81 | */
|
||
82 | private JPanel getPNorth() { |
||
83 | if (pNorth == null) { |
||
84 | FlowLayout flowLayout = new FlowLayout(); |
||
85 | flowLayout.setHgap(0);
|
||
86 | flowLayout.setAlignment(java.awt.FlowLayout.LEFT); |
||
87 | flowLayout.setVgap(0);
|
||
88 | pNorth = new JPanel(); |
||
89 | pNorth.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
||
90 | pNorth.setBackground(new java.awt.Color(204,204,204)); |
||
91 | pNorth.setLayout(flowLayout); |
||
92 | pNorth.setPreferredSize(new java.awt.Dimension(400,270)); |
||
93 | pNorth.add(getDataPointsTabPanel(), null);
|
||
94 | } |
||
95 | return pNorth;
|
||
96 | } |
||
97 | |||
98 | /**
|
||
99 | * This method initializes jPanel1
|
||
100 | *
|
||
101 | * @return javax.swing.JPanel
|
||
102 | */
|
||
103 | private JPanel getPSouth() { |
||
104 | if (pSouth == null) { |
||
105 | FlowLayout flowLayout1 = new FlowLayout(); |
||
106 | flowLayout1.setHgap(0);
|
||
107 | flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
||
108 | flowLayout1.setVgap(0);
|
||
109 | pSouth = new JPanel(); |
||
110 | pSouth.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
||
111 | pSouth.setComponentOrientation(java.awt.ComponentOrientation.UNKNOWN); |
||
112 | pSouth.setLayout(flowLayout1); |
||
113 | pSouth.setPreferredSize(new java.awt.Dimension(400,275)); |
||
114 | pSouth.add(getAdjustGeorefPanel(), null);
|
||
115 | } |
||
116 | return pSouth;
|
||
117 | } |
||
118 | |||
119 | /**
|
||
120 | * Asigna al canvas de los controles de zoom la propiedad de visibilidad a
|
||
121 | * verdadero o falso.
|
||
122 | * @param visible true para mostrar los canvas y false para ocultarlos
|
||
123 | */
|
||
124 | public void setCanvasVisible(boolean visible){ |
||
125 | this.getAdjustGeorefPanel().getZoomLeft().setVisible(visible);
|
||
126 | this.getAdjustGeorefPanel().getZoomRight().setVisible(visible);
|
||
127 | } |
||
128 | } |