Revision 20840 trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceOverviews.java
PreferenceOverviews.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import javax.swing.BorderFactory; |
26 | 26 |
import javax.swing.DefaultComboBoxModel; |
27 |
import javax.swing.JCheckBox; |
|
28 | 27 |
import javax.swing.JComboBox; |
29 | 28 |
import javax.swing.JLabel; |
30 | 29 |
|
... | ... | |
39 | 38 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
40 | 39 |
*/ |
41 | 40 |
public class PreferenceOverviews extends PanelBase { |
42 |
private JCheckBox jCheckBoxAsk = null; |
|
41 |
// private JCheckBox jCheckBoxAsk = null;
|
|
43 | 42 |
private JComboBox comboBoxRate = null; |
44 | 43 |
private JComboBox comboBoxNumber = null; |
45 | 44 |
private JComboBox comboBoxAlgorithm = null; |
... | ... | |
60 | 59 |
getLabelNumber().setText(getText(this, "num_overviews") + ":"); |
61 | 60 |
getLabelRate().setText(getText(this, "proporcion_overviews") + ":"); |
62 | 61 |
getLabelAlgorithm().setText(getText(this, "algorithm") + ":"); |
63 |
getCheckBoxAsk().setText(getText(this, "generacion_overviews")); |
|
64 |
getCheckBoxAsk().setToolTipText(getCheckBoxAsk().getText()); |
|
62 |
// getCheckBoxAsk().setText(getText(this, "generacion_overviews"));
|
|
63 |
// getCheckBoxAsk().setToolTipText(getCheckBoxAsk().getText());
|
|
65 | 64 |
getComboAlgorithm().setModel(new DefaultComboBoxModel(new String[] { getText(this, "vecino_cercano"), getText(this, "media"), getText(this, "media_phase") })); |
66 | 65 |
} |
67 | 66 |
|
... | ... | |
70 | 69 |
|
71 | 70 |
getPanel().setLayout(new GridBagLayout()); |
72 | 71 |
|
73 |
gridBagConstraints = new GridBagConstraints(); |
|
74 |
gridBagConstraints.gridwidth = 2; |
|
75 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
76 |
gridBagConstraints.weightx = 1.0; |
|
77 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
|
78 |
getPanel().add(getCheckBoxAsk(), gridBagConstraints); |
|
72 |
int posy = 0; |
|
73 |
|
|
74 |
// gridBagConstraints = new GridBagConstraints(); |
|
75 |
// gridBagConstraints.gridx = 0; |
|
76 |
// gridBagConstraints.gridy = posy; |
|
77 |
// gridBagConstraints.gridwidth = 2; |
|
78 |
// gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
79 |
// gridBagConstraints.weightx = 1.0; |
|
80 |
// gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
|
81 |
// getPanel().add(getCheckBoxAsk(), gridBagConstraints); |
|
79 | 82 |
|
83 |
// posy++; |
|
80 | 84 |
gridBagConstraints = new GridBagConstraints(); |
81 | 85 |
gridBagConstraints.gridx = 0; |
82 |
gridBagConstraints.gridy = 1;
|
|
86 |
gridBagConstraints.gridy = posy;
|
|
83 | 87 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
84 | 88 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
85 | 89 |
getPanel().add(getLabelNumber(), gridBagConstraints); |
86 | 90 |
|
87 | 91 |
gridBagConstraints = new GridBagConstraints(); |
88 | 92 |
gridBagConstraints.gridx = 1; |
89 |
gridBagConstraints.gridy = 1;
|
|
93 |
gridBagConstraints.gridy = posy;
|
|
90 | 94 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
91 | 95 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
92 | 96 |
gridBagConstraints.weightx = 1.0; |
93 | 97 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
94 | 98 |
getPanel().add(getComboNumber(), gridBagConstraints); |
95 | 99 |
|
100 |
posy++; |
|
96 | 101 |
gridBagConstraints = new GridBagConstraints(); |
97 | 102 |
gridBagConstraints.gridx = 0; |
98 |
gridBagConstraints.gridy = 2;
|
|
103 |
gridBagConstraints.gridy = posy;
|
|
99 | 104 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
100 | 105 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
101 | 106 |
getPanel().add(getLabelRate(), gridBagConstraints); |
102 | 107 |
|
103 | 108 |
gridBagConstraints = new GridBagConstraints(); |
104 | 109 |
gridBagConstraints.gridx = 1; |
105 |
gridBagConstraints.gridy = 2;
|
|
110 |
gridBagConstraints.gridy = posy;
|
|
106 | 111 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
107 | 112 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
108 | 113 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
109 | 114 |
getPanel().add(getComboRate(), gridBagConstraints); |
110 | 115 |
|
116 |
posy++; |
|
111 | 117 |
gridBagConstraints = new GridBagConstraints(); |
112 | 118 |
gridBagConstraints.gridx = 0; |
113 |
gridBagConstraints.gridy = 3;
|
|
119 |
gridBagConstraints.gridy = posy;
|
|
114 | 120 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
115 | 121 |
gridBagConstraints.insets = new Insets(2, 5, 5, 2); |
116 | 122 |
getPanel().add(getLabelAlgorithm(), gridBagConstraints); |
117 | 123 |
|
118 | 124 |
gridBagConstraints = new GridBagConstraints(); |
119 | 125 |
gridBagConstraints.gridx = 1; |
120 |
gridBagConstraints.gridy = 3;
|
|
126 |
gridBagConstraints.gridy = posy;
|
|
121 | 127 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
122 | 128 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
123 | 129 |
gridBagConstraints.insets = new Insets(2, 2, 5, 5); |
... | ... | |
142 | 148 |
return labelNumber; |
143 | 149 |
} |
144 | 150 |
|
145 |
private JCheckBox getCheckBoxAsk() { |
|
146 |
if (jCheckBoxAsk == null) { |
|
147 |
jCheckBoxAsk = new JCheckBox(); |
|
148 |
jCheckBoxAsk.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
149 |
jCheckBoxAsk.setMargin(new Insets(0, 0, 0, 0)); |
|
150 |
} |
|
151 |
return jCheckBoxAsk; |
|
152 |
} |
|
151 |
// private JCheckBox getCheckBoxAsk() {
|
|
152 |
// if (jCheckBoxAsk == null) {
|
|
153 |
// jCheckBoxAsk = new JCheckBox();
|
|
154 |
// jCheckBoxAsk.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
|
155 |
// jCheckBoxAsk.setMargin(new Insets(0, 0, 0, 0));
|
|
156 |
// }
|
|
157 |
// return jCheckBoxAsk;
|
|
158 |
// }
|
|
153 | 159 |
|
154 | 160 |
private JComboBox getComboRate() { |
155 | 161 |
if (comboBoxRate == null) { |
... | ... | |
178 | 184 |
*/ |
179 | 185 |
public void initializeDefaults() { |
180 | 186 |
int pos = 0; |
181 |
getCheckBoxAsk().setSelected(((Boolean) Configuration.getDefaultValue("overviews_ask_before_loading")).booleanValue()); |
|
187 |
// getCheckBoxAsk().setSelected(((Boolean) Configuration.getDefaultValue("overviews_ask_before_loading")).booleanValue());
|
|
182 | 188 |
|
183 | 189 |
pos = ((Integer) Configuration.getDefaultValue("overviews_number")).intValue() - 2; |
184 | 190 |
if ((pos < 0) || (pos >= getComboNumber().getItemCount())) |
... | ... | |
208 | 214 |
*/ |
209 | 215 |
public void initializeValues() { |
210 | 216 |
int pos = 0; |
211 |
getCheckBoxAsk().setSelected(Configuration.getValue("overviews_ask_before_loading", Boolean.FALSE).booleanValue()); |
|
217 |
// getCheckBoxAsk().setSelected(Configuration.getValue("overviews_ask_before_loading", Boolean.FALSE).booleanValue());
|
|
212 | 218 |
|
213 | 219 |
pos = Configuration.getValue("overviews_number", Integer.valueOf(4)).intValue() - 2; |
214 | 220 |
if ((pos < 0) || (pos >= getComboNumber().getItemCount())) |
... | ... | |
237 | 243 |
* Guarda los valores definidos por el usuario |
238 | 244 |
*/ |
239 | 245 |
public void storeValues() { |
240 |
Configuration.setValue("overviews_ask_before_loading", Boolean.valueOf(getCheckBoxAsk().isSelected())); |
|
246 |
// Configuration.setValue("overviews_ask_before_loading", Boolean.valueOf(getCheckBoxAsk().isSelected()));
|
|
241 | 247 |
if (getComboRate().getSelectedIndex() > -1) |
242 | 248 |
Configuration.setValue("overviews_rate", Integer.valueOf(getComboRate().getSelectedIndex() + 2)); |
243 | 249 |
if (getComboNumber().getSelectedIndex() > -1) |
Also available in: Unified diff