Revision 20043 trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceGeneral.java
PreferenceGeneral.java | ||
---|---|---|
41 | 41 |
private JCheckBox checkBoxCoordinates = null; |
42 | 42 |
private JLabel labelNumClases = null; |
43 | 43 |
private JComboBox comboBoxNumClases = null; |
44 |
private JCheckBox checkBoxProjection = null; |
|
44 | 45 |
|
45 | 46 |
public PreferenceGeneral() { |
46 | 47 |
initialize(); |
... | ... | |
53 | 54 |
getCheckBoxPreview().setToolTipText(getCheckBoxPreview().getText()); |
54 | 55 |
getLabelNumClases().setText(getText(this, "num_clases") + ":"); |
55 | 56 |
getCheckBoxCoordinates().setText(getText(this, "pedir_coordenadas_georreferenciacion")); |
57 |
getCheckBoxProjection().setText(getText(this, "ask_for_projection")); |
|
56 | 58 |
} |
57 | 59 |
|
58 | 60 |
private void initialize() { |
... | ... | |
94 | 96 |
gridBagConstraints.weighty = 1.0; |
95 | 97 |
gridBagConstraints.insets = new Insets(2, 5, 5, 5); |
96 | 98 |
getPanel().add(getCheckBoxCoordinates(), gridBagConstraints); |
99 |
|
|
100 |
gridBagConstraints = new GridBagConstraints(); |
|
101 |
gridBagConstraints.gridx = 0; |
|
102 |
gridBagConstraints.gridy = 3; |
|
103 |
gridBagConstraints.gridwidth = 2; |
|
104 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
105 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
106 |
gridBagConstraints.insets = new Insets(2, 5, 5, 5); |
|
107 |
getPanel().add(getCheckBoxProjection(), gridBagConstraints); |
|
97 | 108 |
} |
98 | 109 |
|
99 | 110 |
private JCheckBox getCheckBoxPreview() { |
100 | 111 |
if (checkBoxPreview == null) { |
101 | 112 |
checkBoxPreview = new JCheckBox(); |
102 |
checkBoxPreview.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
103 | 113 |
checkBoxPreview.setMargin(new Insets(0, 0, 0, 0)); |
104 | 114 |
} |
105 | 115 |
return checkBoxPreview; |
... | ... | |
123 | 133 |
private JCheckBox getCheckBoxCoordinates() { |
124 | 134 |
if (checkBoxCoordinates == null) { |
125 | 135 |
checkBoxCoordinates = new JCheckBox(); |
126 |
checkBoxCoordinates.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
127 | 136 |
checkBoxCoordinates.setMargin(new Insets(0, 0, 0, 0)); |
128 | 137 |
} |
129 | 138 |
return checkBoxCoordinates; |
130 | 139 |
} |
140 |
|
|
141 |
/** |
|
142 |
* Obtiene el checkbox que indica si se se muestran las opciones de proyecci?n |
|
143 |
* en la carga de un raster o no. Si se marca no, se aplicar?n siempre las opciones |
|
144 |
* por defecto. |
|
145 |
* @return JCheckBox |
|
146 |
*/ |
|
147 |
private JCheckBox getCheckBoxProjection() { |
|
148 |
if (checkBoxProjection == null) { |
|
149 |
checkBoxProjection = new JCheckBox(); |
|
150 |
checkBoxProjection.setMargin(new Insets(0, 0, 0, 0)); |
|
151 |
} |
|
152 |
return checkBoxProjection; |
|
153 |
} |
|
131 | 154 |
|
132 | 155 |
public void initializeDefaults() { |
133 | 156 |
getCheckBoxCoordinates().setSelected(((Boolean) Configuration.getDefaultValue("general_ask_coordinates")).booleanValue()); |
157 |
getCheckBoxProjection().setSelected(((Boolean) Configuration.getDefaultValue("general_ask_projection")).booleanValue()); |
|
134 | 158 |
getCheckBoxPreview().setSelected(((Boolean)Configuration.getDefaultValue("general_auto_preview")).booleanValue()); |
135 | 159 |
Integer defaultNumberOfClasses = (Integer) Configuration.getDefaultValue("general_defaultNumberOfClasses"); |
136 | 160 |
for (int i = 0; i < getComboBoxNumClases().getItemCount(); i++) { |
... | ... | |
143 | 167 |
|
144 | 168 |
public void initializeValues() { |
145 | 169 |
getCheckBoxCoordinates().setSelected(Configuration.getValue("general_ask_coordinates", Boolean.valueOf(false)).booleanValue()); |
170 |
getCheckBoxProjection().setSelected(Configuration.getValue("general_ask_projection", Boolean.valueOf(true)).booleanValue()); |
|
146 | 171 |
getCheckBoxPreview().setSelected(Configuration.getValue("general_auto_preview", Boolean.valueOf(true)).booleanValue()); |
147 | 172 |
Integer defaultNumberOfClasses = Configuration.getValue("general_defaultNumberOfClasses", Integer.valueOf(RasterLibrary.defaultNumberOfClasses)); |
148 | 173 |
for (int i = 0; i < getComboBoxNumClases().getItemCount(); i++) { |
... | ... | |
157 | 182 |
Configuration.setValue("general_ask_coordinates", Boolean.valueOf(getCheckBoxCoordinates().isSelected())); |
158 | 183 |
Configuration.setValue("general_auto_preview", Boolean.valueOf(getCheckBoxPreview().isSelected())); |
159 | 184 |
Configuration.setValue("general_defaultNumberOfClasses", Integer.valueOf(getComboBoxNumClases().getSelectedItem().toString())); |
185 |
Configuration.setValue("general_ask_projection", Boolean.valueOf(getCheckBoxProjection().isSelected())); |
|
160 | 186 |
} |
161 | 187 |
} |
Also available in: Unified diff