svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / raw / ui / main / GeometryPropertiesPanel.java @ 13957
History | View | Annotate | Download (4.89 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.rastertools.raw.ui.main; |
20 |
|
21 |
import java.awt.GridBagConstraints; |
22 |
import java.awt.GridBagLayout; |
23 |
|
24 |
import javax.swing.JPanel; |
25 |
|
26 |
import org.gvsig.rastertools.raw.tools.VRTFormatOptions; |
27 |
|
28 |
import com.iver.andami.PluginServices; |
29 |
/**
|
30 |
* This panel implements all the geometry properties panel. The "guess image
|
31 |
* geometry" button can be enabled or disabled changing the
|
32 |
* GUESS_IMAGE_BUTTON_VISIBLE attribute value.
|
33 |
*
|
34 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
35 |
*/
|
36 |
public class GeometryPropertiesPanel extends JPanel { |
37 |
private static final long serialVersionUID = -3099735931714632591L; |
38 |
private final int WIDTH = 510; |
39 |
private final int HEIGHT = 155; |
40 |
private boolean GUESS_IMAGE_BUTTON_VISIBLE = false; |
41 |
private GeometryPropertiesLeftPanel leftPanel = null; |
42 |
private GeometryPropertiesRigthPanel rigthPanel = null; |
43 |
private GuessImagePanel guessImagePanel = null; |
44 |
|
45 |
public GeometryPropertiesPanel() {
|
46 |
super();
|
47 |
initialize(); |
48 |
} |
49 |
|
50 |
/**
|
51 |
* This method initializes this
|
52 |
*/
|
53 |
private void initialize() { |
54 |
GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
55 |
gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0); |
56 |
gridBagConstraints2.gridy = 1;
|
57 |
gridBagConstraints2.gridx = 0;
|
58 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
59 |
gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0); |
60 |
gridBagConstraints1.gridy = 0;
|
61 |
gridBagConstraints1.gridx = 1;
|
62 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
63 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 0); |
64 |
gridBagConstraints.gridy = 0;
|
65 |
gridBagConstraints.gridx = 0;
|
66 |
this.setLayout(new GridBagLayout()); |
67 |
this.setSize(new java.awt.Dimension(WIDTH, HEIGHT)); |
68 |
this.setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT)); |
69 |
this.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "select_image_geometry"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
70 |
this.add(getLeftPanel(), gridBagConstraints);
|
71 |
this.add(getRigthPanel(), gridBagConstraints1);
|
72 |
if (GUESS_IMAGE_BUTTON_VISIBLE) {
|
73 |
this.add(getGuessImagePanel(), gridBagConstraints2);
|
74 |
} |
75 |
} |
76 |
|
77 |
/**
|
78 |
* This method initializes leftPanel
|
79 |
* @return javax.swing.JPanel
|
80 |
*/
|
81 |
private GeometryPropertiesLeftPanel getLeftPanel() {
|
82 |
if (leftPanel == null) { |
83 |
leftPanel = new GeometryPropertiesLeftPanel();
|
84 |
} |
85 |
return leftPanel;
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* This method initializes rigthPanel
|
90 |
* @return javax.swing.JPanel
|
91 |
*/
|
92 |
private GeometryPropertiesRigthPanel getRigthPanel() {
|
93 |
if (rigthPanel == null) { |
94 |
rigthPanel = new GeometryPropertiesRigthPanel();
|
95 |
} |
96 |
return rigthPanel;
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* This method initializes guessImagePanel
|
101 |
* @return javax.swing.JPanel
|
102 |
*/
|
103 |
private GuessImagePanel getGuessImagePanel() {
|
104 |
if (guessImagePanel == null) { |
105 |
guessImagePanel = new GuessImagePanel();
|
106 |
} |
107 |
return guessImagePanel;
|
108 |
} |
109 |
|
110 |
/**
|
111 |
* Sets the file size into the text field
|
112 |
* @param fileSize
|
113 |
*/
|
114 |
public void setFileSize(long fileSize) { |
115 |
getRigthPanel().setFileSize(fileSize); |
116 |
} |
117 |
|
118 |
/**
|
119 |
* Gets the data type
|
120 |
* @return
|
121 |
*/
|
122 |
public VRTFormatOptions.UIOption getDataType() {
|
123 |
return getRigthPanel().getDataType();
|
124 |
} |
125 |
|
126 |
/**
|
127 |
* Gets the byte order
|
128 |
* @return
|
129 |
*/
|
130 |
public String getByteOrder() { |
131 |
return getRigthPanel().getByteOrder();
|
132 |
} |
133 |
|
134 |
/**
|
135 |
* Gets the type of interleaving
|
136 |
* @return
|
137 |
*/
|
138 |
public String getInterleaving() { |
139 |
return getRigthPanel().getInterleaving();
|
140 |
} |
141 |
|
142 |
/**
|
143 |
* gets the image width
|
144 |
* @return
|
145 |
*/
|
146 |
public int getImageWidth() { |
147 |
return getLeftPanel().getImageWidth();
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* gets the image height
|
152 |
* @return
|
153 |
*/
|
154 |
public int getImageHeight() { |
155 |
return getLeftPanel().getImageHeight();
|
156 |
} |
157 |
|
158 |
/**
|
159 |
* gets the number of bands
|
160 |
* @return
|
161 |
*/
|
162 |
public int getNumberOfBands() { |
163 |
return getLeftPanel().getNumberOfBands();
|
164 |
} |
165 |
|
166 |
/**
|
167 |
* gets the header size
|
168 |
* @return
|
169 |
*/
|
170 |
public int getHeaderSize() { |
171 |
return getLeftPanel().getHeaderSize();
|
172 |
} |
173 |
} |