gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.app.basic / src / main / java / org / gvsig / raster / tools / app / basic / tool / saveraster / ui / panel / MethodSelectorPanel.java @ 2480
History | View | Annotate | Download (4.05 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel; |
23 |
|
24 |
import java.awt.BorderLayout; |
25 |
import java.awt.GridBagConstraints; |
26 |
import java.awt.GridBagLayout; |
27 |
import java.awt.Insets; |
28 |
|
29 |
import javax.swing.ButtonGroup; |
30 |
import javax.swing.JPanel; |
31 |
import javax.swing.JRadioButton; |
32 |
|
33 |
/**
|
34 |
* Panel con el selector de m?todo de escalado. Por escala, tama?o de raster
|
35 |
* de salida o tama?o de pixel.
|
36 |
*
|
37 |
* @version 18/04/2007
|
38 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
39 |
*
|
40 |
*/
|
41 |
public class MethodSelectorPanel extends JPanel { |
42 |
private static final long serialVersionUID = 1L; |
43 |
private JPanel pMethodSelector = null; |
44 |
private JRadioButton rbScale = null; |
45 |
private JRadioButton rbMtsPixel = null; |
46 |
private JRadioButton rbSize = null; |
47 |
private ButtonGroup group = null; |
48 |
|
49 |
/**
|
50 |
* This is the default constructor
|
51 |
*/
|
52 |
public MethodSelectorPanel() {
|
53 |
super();
|
54 |
initialize(); |
55 |
} |
56 |
|
57 |
/**
|
58 |
* This method initializes this
|
59 |
*
|
60 |
* @return void
|
61 |
*/
|
62 |
private void initialize() { |
63 |
BorderLayout layout = new BorderLayout(); |
64 |
this.setLayout(layout);
|
65 |
setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
66 |
|
67 |
group = new ButtonGroup(); |
68 |
this.add(getPMethodSelector(), BorderLayout.CENTER); |
69 |
} |
70 |
|
71 |
/**
|
72 |
* This method initializes jPanel
|
73 |
*
|
74 |
* @return javax.swing.JPanel
|
75 |
*/
|
76 |
public JPanel getPMethodSelector() { |
77 |
if (pMethodSelector == null) { |
78 |
pMethodSelector = new JPanel(); |
79 |
pMethodSelector.setLayout(new GridBagLayout()); |
80 |
pMethodSelector.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
81 |
pMethodSelector.setPreferredSize(new java.awt.Dimension(105,77)); |
82 |
group.add(getRbScale()); |
83 |
group.add(getRbMtsPixel()); |
84 |
group.add(getRbSize()); |
85 |
|
86 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
87 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
88 |
gridBagConstraints.insets = new Insets(0, 5, 0, 5); |
89 |
gridBagConstraints.weightx = 1.0;
|
90 |
gridBagConstraints.weighty = 1.0;
|
91 |
|
92 |
gridBagConstraints.gridx = 0;
|
93 |
gridBagConstraints.gridy = 2;
|
94 |
pMethodSelector.add(getRbSize(), gridBagConstraints); |
95 |
|
96 |
gridBagConstraints.gridx = 0;
|
97 |
gridBagConstraints.gridy = 0;
|
98 |
pMethodSelector.add(getRbScale(), gridBagConstraints); |
99 |
|
100 |
gridBagConstraints.gridx = 0;
|
101 |
gridBagConstraints.gridy = 1;
|
102 |
pMethodSelector.add(getRbMtsPixel(), gridBagConstraints); |
103 |
} |
104 |
return pMethodSelector;
|
105 |
} |
106 |
|
107 |
/**
|
108 |
* This method initializes jRadioButton
|
109 |
*
|
110 |
* @return javax.swing.JRadioButton
|
111 |
*/
|
112 |
public JRadioButton getRbScale() { |
113 |
if (rbScale == null) { |
114 |
rbScale = new JRadioButton(); |
115 |
rbScale.setText("Escala");
|
116 |
rbScale.setSelected(true);
|
117 |
} |
118 |
return rbScale;
|
119 |
} |
120 |
|
121 |
/**
|
122 |
* This method initializes jRadioButton1
|
123 |
*
|
124 |
* @return javax.swing.JRadioButton
|
125 |
*/
|
126 |
public JRadioButton getRbMtsPixel() { |
127 |
if (rbMtsPixel == null) { |
128 |
rbMtsPixel = new JRadioButton(); |
129 |
rbMtsPixel.setText("Mts/Pixel");
|
130 |
} |
131 |
return rbMtsPixel;
|
132 |
} |
133 |
|
134 |
/**
|
135 |
* This method initializes jRadioButton2
|
136 |
*
|
137 |
* @return javax.swing.JRadioButton
|
138 |
*/
|
139 |
public JRadioButton getRbSize() { |
140 |
if (rbSize == null) { |
141 |
rbSize = new JRadioButton(); |
142 |
rbSize.setText("Tama?o");
|
143 |
} |
144 |
return rbSize;
|
145 |
} |
146 |
|
147 |
} |