Revision 43321
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardPanel.java | ||
---|---|---|
251 | 251 |
DataManager dataManager = DALLocator.getDataManager(); |
252 | 252 |
DataStore dataStore = dataManager.openStore(parameters.getDataStoreName(), parameters); |
253 | 253 |
DataStoreProviderFactory factory = dataStore.getProviderFactory(); |
254 |
if (factory.isTiledSupported() != DataStoreProviderFactory.NO) { |
|
254 |
if (factory.isTiledSupported() != DataStoreProviderFactory.NO && !factory.getClass().getSimpleName().equals("TileProviderFactory")) {
|
|
255 | 255 |
if (isTiled(parameters)) { |
256 | 256 |
DynObject tileParameters = dataManager.createStoreParameters("TileCache"); |
257 | 257 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/TiledCellRenderer.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2017 gvSIG Association |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.fmap.dal.serverexplorer.filesystem.swing; |
|
24 |
|
|
25 |
import java.awt.BorderLayout; |
|
26 |
import java.awt.Component; |
|
27 |
|
|
28 |
import javax.swing.JCheckBox; |
|
29 |
import javax.swing.JPanel; |
|
30 |
import javax.swing.JTable; |
|
31 |
import javax.swing.table.TableCellRenderer; |
|
32 |
|
|
33 |
/** |
|
34 |
* @author fdiaz |
|
35 |
* |
|
36 |
*/ |
|
37 |
public class TiledCellRenderer extends JPanel implements TableCellRenderer { |
|
38 |
|
|
39 |
/** |
|
40 |
* |
|
41 |
*/ |
|
42 |
private static final long serialVersionUID = 3875203211014535067L; |
|
43 |
|
|
44 |
private JCheckBox checkBox; |
|
45 |
|
|
46 |
/** |
|
47 |
* |
|
48 |
*/ |
|
49 |
public TiledCellRenderer() { |
|
50 |
super(new BorderLayout()); //new FlowLayout(FlowLayout.CENTER, 0, 0)); |
|
51 |
checkBox = new JCheckBox(); |
|
52 |
checkBox.setOpaque(false); |
|
53 |
checkBox.setHorizontalAlignment(JCheckBox.CENTER); |
|
54 |
add(checkBox, BorderLayout.CENTER); |
|
55 |
} |
|
56 |
|
|
57 |
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, |
|
58 |
int row, int column) { |
|
59 |
if (isSelected) { |
|
60 |
checkBox.setForeground(table.getSelectionForeground()); |
|
61 |
checkBox.setBackground(table.getSelectionBackground()); |
|
62 |
setForeground(table.getSelectionForeground()); |
|
63 |
setBackground(table.getSelectionBackground()); |
|
64 |
} else { |
|
65 |
checkBox.setForeground(table.getForeground()); |
|
66 |
checkBox.setBackground(table.getBackground()); |
|
67 |
setForeground(table.getForeground()); |
|
68 |
setBackground(table.getBackground()); |
|
69 |
} |
|
70 |
|
|
71 |
boolean booleanValue = ((Boolean) value).booleanValue(); |
|
72 |
boolean cellEditable = table.getModel().isCellEditable(row, column); |
|
73 |
if(!cellEditable && !booleanValue){ |
|
74 |
checkBox.setVisible(false); |
|
75 |
} else { |
|
76 |
checkBox.setVisible(true); |
|
77 |
} |
|
78 |
checkBox.setEnabled(cellEditable); |
|
79 |
checkBox.setSelected((value != null && booleanValue)); |
|
80 |
return this; |
|
81 |
} |
|
82 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardPanelController.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.gvsig.fmap.dal.swing.dataStoreParameters.DataStoreParametersPanelManager; |
4 | 4 |
import org.gvsig.fmap.dal.swing.dataStoreParameters.DataStoreParametersPanel; |
5 |
|
|
5 | 6 |
import java.awt.Component; |
6 | 7 |
import java.awt.Window; |
7 | 8 |
import java.awt.event.ActionEvent; |
... | ... | |
17 | 18 |
import javax.swing.ListSelectionModel; |
18 | 19 |
import javax.swing.event.ListSelectionEvent; |
19 | 20 |
import javax.swing.event.ListSelectionListener; |
21 |
import javax.swing.table.TableColumn; |
|
20 | 22 |
|
21 | 23 |
import org.cresques.cts.IProjection; |
22 | 24 |
import org.slf4j.Logger; |
... | ... | |
143 | 145 |
this.tableFiles.getColumn( |
144 | 146 |
i18nManager.getTranslation(FilesystemExplorerWizardTableModel.COLUMN_STORE_PARAMETERS_NAME)) |
145 | 147 |
.setCellRenderer(new FilesystemStoreParameteresCellRenderer(mapContext)); |
146 |
this.tableFiles.getColumn( |
|
147 |
i18nManager.getTranslation(FilesystemExplorerWizardTableModel.COLUMN_TILED_NAME)).setMaxWidth(80); |
|
148 |
TableColumn columnTiled = this.tableFiles.getColumn( |
|
149 |
i18nManager.getTranslation(FilesystemExplorerWizardTableModel.COLUMN_TILED_NAME)); |
|
150 |
columnTiled.setMaxWidth(80); |
|
151 |
columnTiled.setCellRenderer(new TiledCellRenderer()); |
|
148 | 152 |
this.tableFiles.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
149 | 153 |
this.tableFiles.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
150 | 154 |
|
... | ... | |
178 | 182 |
FilesystemExplorerWizardTableModel model = (FilesystemExplorerWizardTableModel) this.tableFiles.getModel(); |
179 | 183 |
|
180 | 184 |
for (FilesystemStoreParameters filesystemStoreParameters : list) { |
181 |
model.add(filesystemStoreParameters, false);
|
|
185 |
model.add(filesystemStoreParameters); |
|
182 | 186 |
updateTable(); |
183 | 187 |
int index = model.getRowCount()-1; |
184 | 188 |
this.tableFiles.getSelectionModel().setSelectionInterval(index, index); |
... | ... | |
406 | 410 |
return; |
407 | 411 |
} |
408 | 412 |
FilesystemExplorerWizardTableModel model = (FilesystemExplorerWizardTableModel)this.tableFiles.getModel(); |
409 |
model.add(filesParams, false);
|
|
413 |
model.add(filesParams); |
|
410 | 414 |
} |
411 | 415 |
|
412 | 416 |
/** |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardTableModel.java | ||
---|---|---|
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
public boolean isCellEditable(int row, int col) { |
98 |
if (col == COLUMN_TILED && isTiledSupported(row) ) {
|
|
98 |
if (col == COLUMN_TILED && isEditableTiled(row) ) {
|
|
99 | 99 |
return true; |
100 | 100 |
} |
101 | 101 |
return false; |
... | ... | |
120 | 120 |
if (!(value instanceof Boolean)) { |
121 | 121 |
throw new IllegalArgumentException("The object '" + value.toString() + "' must be a Boolean."); |
122 | 122 |
} |
123 |
filesystemStoreParametersToLoad.setTiled((Boolean) value);
|
|
123 |
filesystemStoreParametersToLoad.setTiled((boolean) value);
|
|
124 | 124 |
break; |
125 | 125 |
|
126 | 126 |
default: |
... | ... | |
136 | 136 |
* @param projection |
137 | 137 |
* @param tiled |
138 | 138 |
*/ |
139 |
public void add(FilesystemStoreParameters fileParams, Boolean tiled){
|
|
139 |
public void add(FilesystemStoreParameters fileParams){ |
|
140 | 140 |
DataManager dataManager = DALLocator.getDataManager(); |
141 | 141 |
DataStoreProviderFactory factory = dataManager.getStoreProviderFactory( ((DataStoreParameters)fileParams).getDataStoreName()); |
142 |
if( factory != null && factory.isTiledSupported()==DataStoreProviderFactory.NO ) { |
|
143 |
tiled = null; |
|
144 |
} |
|
145 |
FilesystemStoreParametersToLoad filesystemStoreParametersToLoad = new FilesystemStoreParametersToLoad(fileParams, tiled) ; |
|
142 |
boolean editable = false; |
|
143 |
boolean tiled = false; |
|
144 |
if( factory != null ) { |
|
145 |
if( factory.getClass().getSimpleName().equalsIgnoreCase("TileProviderFactory")){ |
|
146 |
editable = false; |
|
147 |
tiled = true; |
|
148 |
} else { |
|
149 |
switch (factory.isTiledSupported()) { |
|
150 |
case DataStoreProviderFactory.NO: |
|
151 |
editable = false; |
|
152 |
tiled = false; |
|
153 |
break; |
|
154 |
case DataStoreProviderFactory.YES: |
|
155 |
editable = true; |
|
156 |
tiled = (factory.worksBestTiled()==DataStoreProviderFactory.YES); |
|
157 |
break; |
|
158 |
case DataStoreProviderFactory.UNKNOWN: |
|
159 |
//De momento, si no sabemos si se puede tilear lo marcamos como no |
|
160 |
editable = false; |
|
161 |
tiled = false; |
|
162 |
break; |
|
163 |
default: |
|
164 |
break; |
|
165 |
} |
|
166 |
} |
|
167 |
} |
|
168 |
FilesystemStoreParametersToLoad filesystemStoreParametersToLoad = new FilesystemStoreParametersToLoad(fileParams, tiled, editable) ; |
|
146 | 169 |
data.add(filesystemStoreParametersToLoad); |
147 | 170 |
} |
148 | 171 |
|
... | ... | |
150 | 173 |
* @param listFileParams |
151 | 174 |
* @param tiled |
152 | 175 |
*/ |
153 |
public void add(List<FilesystemStoreParameters> listFileParams, Boolean tiled){
|
|
176 |
public void add(List<FilesystemStoreParameters> listFileParams){ |
|
154 | 177 |
for (FilesystemStoreParameters filesystemStoreParameters : listFileParams) { |
155 |
this.add(filesystemStoreParameters, tiled);
|
|
178 |
this.add(filesystemStoreParameters); |
|
156 | 179 |
} |
157 | 180 |
} |
158 | 181 |
|
... | ... | |
179 | 202 |
return this.data.get(row).isTiled(); |
180 | 203 |
} |
181 | 204 |
|
182 |
public boolean isTiledSupported(int row){ |
|
183 |
return this.data.get(row).isTiledSupported(); |
|
205 |
/** |
|
206 |
* @param row |
|
207 |
* @return |
|
208 |
*/ |
|
209 |
public boolean isEditableTiled(int row){ |
|
210 |
return this.data.get(row).isEditable(); |
|
184 | 211 |
} |
185 | 212 |
/** |
186 | 213 |
* @param row |
... | ... | |
235 | 262 |
public static class FilesystemStoreParametersToLoad{ |
236 | 263 |
private FilesystemStoreParameters params; |
237 | 264 |
private boolean tiled; |
238 |
private boolean tiledSupported = false;
|
|
265 |
private boolean editable = false;
|
|
239 | 266 |
|
240 | 267 |
/** |
241 | 268 |
* @param params |
... | ... | |
247 | 274 |
/** |
248 | 275 |
* @param params |
249 | 276 |
* @param tiled |
277 |
* @param editable |
|
250 | 278 |
*/ |
251 |
public FilesystemStoreParametersToLoad(FilesystemStoreParameters params, Boolean tiled) {
|
|
279 |
public FilesystemStoreParametersToLoad(FilesystemStoreParameters params, boolean tiled, boolean editable) {
|
|
252 | 280 |
this.setParameters(params); |
253 | 281 |
this.setTiled(tiled); |
282 |
this.editable = editable; |
|
254 | 283 |
} |
255 | 284 |
|
256 | 285 |
FilesystemStoreParameters getParameters(){ |
... | ... | |
271 | 300 |
return tiled; |
272 | 301 |
} |
273 | 302 |
|
274 |
|
|
275 |
public boolean isTiledSupported() { |
|
276 |
return this.tiledSupported; |
|
277 |
} |
|
278 |
|
|
279 | 303 |
/** |
280 | 304 |
* @param tiled the tiled to set |
281 | 305 |
*/ |
282 |
public void setTiled(Boolean tiled) { |
|
283 |
if( tiled == null ) { |
|
284 |
this.tiled = false; |
|
285 |
this.tiledSupported = false; |
|
286 |
} else { |
|
306 |
public void setTiled(boolean tiled) { |
|
287 | 307 |
this.tiled = tiled; |
288 |
this.tiledSupported = true; |
|
289 |
} |
|
290 | 308 |
} |
309 |
|
|
310 |
public boolean isEditable() { |
|
311 |
return this.editable; |
|
312 |
} |
|
291 | 313 |
} |
292 | 314 |
|
293 | 315 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1272 | 1272 |
_lower_left_corner=Esquina inferior izquierda |
1273 | 1273 |
_Remembered_dialogs=Dialogos recordados |
1274 | 1274 |
_Remember_responses_from_selected_dialogs=Respuestas recordadas para los siguientes dialogos |
1275 |
_It_looks_like_youre_using_percent_o_question_and_the_like_operator_is_not_being_used_I_should_probably_keep_the_equal_operator_by_like_Do_you_want_to_continue_anyway=Parece que se esta usando '%' o '?' y no se esta usando el operador like. Problablemente deberia sustiuir el operador '=' por 'like'. \u00bf Desea continuar de todas formas ? |
|
1275 |
_It_looks_like_youre_using_percent_o_question_and_the_like_operator_is_not_being_used_I_should_probably_keep_the_equal_operator_by_like_Do_you_want_to_continue_anyway=Parece que se esta usando '%' o '?' y no se esta usando el operador like. Problablemente deberia sustiuir el operador '=' por 'like'. \u00bf Desea continuar de todas formas ? |
|
1276 |
_tiled=Teselado |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1191 | 1191 |
_lower_left_corner=Lower left corner |
1192 | 1192 |
_Remembered_dialogs=Remembered dialogs |
1193 | 1193 |
_Remember_responses_from_selected_dialogs=Remember responses from selected dialogs |
1194 |
_It_looks_like_youre_using_percent_o_question_and_the_like_operator_is_not_being_used_I_should_probably_keep_the_equal_operator_by_like_Do_you_want_to_continue_anyway=It looks like you're using '%' o '?' and the 'like' operator is not being used. I should probably keep the '=' operator by 'like'. Do you want to continue anyway? |
|
1194 |
_It_looks_like_youre_using_percent_o_question_and_the_like_operator_is_not_being_used_I_should_probably_keep_the_equal_operator_by_like_Do_you_want_to_continue_anyway=It looks like you're using '%' o '?' and the 'like' operator is not being used. I should probably keep the '=' operator by 'like'. Do you want to continue anyway? |
|
1195 |
_tiled=Tiled |
Also available in: Unified diff