gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.algorithm / org.gvsig.raster.tools.algorithm.swing / org.gvsig.raster.tools.algorithm.swing.impl / src / main / java / org / gvsig / raster / tools / algorithm / swing / impl / DefaultAlgorithmSwingManager.java @ 2101
History | View | Annotate | Download (3.81 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.algorithm.swing.impl; |
23 |
|
24 |
import org.gvsig.raster.algorithm.BasicAPISwingPanel; |
25 |
import org.gvsig.raster.swing.newlayer.FileNameManagement; |
26 |
import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingManager; |
27 |
import org.gvsig.raster.tools.algorithm.swing.impl.layerdatatype.LayerDatatypePanelImpl; |
28 |
import org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold.MaskThresholdPanelImpl; |
29 |
import org.gvsig.raster.tools.algorithm.swing.impl.reproject.RasterReprojectPanelImpl; |
30 |
import org.gvsig.raster.tools.algorithm.swing.impl.saveraster.SaveRasterMainPanel; |
31 |
import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdPanel; |
32 |
import org.gvsig.raster.tools.algorithm.swing.reproject.RasterReprojectPanel; |
33 |
import org.gvsig.raster.tools.algorithm.swing.reproject.ReprojectPanelDataModel; |
34 |
import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel; |
35 |
import org.gvsig.tools.ToolsLocator; |
36 |
import org.gvsig.tools.i18n.I18nManager; |
37 |
import org.slf4j.Logger; |
38 |
import org.slf4j.LoggerFactory; |
39 |
|
40 |
/**
|
41 |
* Default implementation of the {@link CartociudadSwingManager}.
|
42 |
*
|
43 |
* @author gvSIG Team
|
44 |
* @version $Id$
|
45 |
*/
|
46 |
public class DefaultAlgorithmSwingManager implements AlgorithmSwingManager { |
47 |
private static final Logger logger = LoggerFactory.getLogger(DefaultAlgorithmSwingManager.class); |
48 |
private I18nManager i18nmanager = null; |
49 |
|
50 |
public DefaultAlgorithmSwingManager() {
|
51 |
this.i18nmanager = ToolsLocator.getI18nManager();
|
52 |
} |
53 |
|
54 |
public String getTranslation(String key) { |
55 |
return this.i18nmanager.getTranslation(key); |
56 |
} |
57 |
|
58 |
/**
|
59 |
* Obtiene la traducci?n de la cadena de texto
|
60 |
* @param parent Ventana padre
|
61 |
* @param text Cadena a traducir
|
62 |
* @return Cadena de texto traducida
|
63 |
*/
|
64 |
public static String getText(Object parent, String key) { |
65 |
if (key == null) |
66 |
return null; |
67 |
String translation = org.gvsig.i18n.Messages.getText(key, false); |
68 |
if (translation != null) |
69 |
return translation;
|
70 |
else {
|
71 |
logger.debug("Can't find translation for ''{1}''.", key);
|
72 |
return key;
|
73 |
} |
74 |
} |
75 |
|
76 |
/**
|
77 |
* Creates a new panel to reproject a raster layer
|
78 |
* @param fileNameManagement
|
79 |
* @param dataModel
|
80 |
* @return
|
81 |
*/
|
82 |
public RasterReprojectPanel createRasterReprojectPanel(
|
83 |
FileNameManagement fileNameManagement, |
84 |
ReprojectPanelDataModel dataModel) { |
85 |
return new RasterReprojectPanelImpl(fileNameManagement, dataModel); |
86 |
} |
87 |
|
88 |
/*
|
89 |
* (non-Javadoc)
|
90 |
* @see org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingManager#createMaskThresholdPanel()
|
91 |
*/
|
92 |
public MaskThresholdPanel createMaskThresholdPanel() {
|
93 |
return new MaskThresholdPanelImpl(); |
94 |
} |
95 |
|
96 |
public BasicAPISwingPanel createLayerDatatypePanel(Object inputStore, String inputDatatype, String layerName) { |
97 |
return new LayerDatatypePanelImpl(inputStore, inputDatatype, layerName); |
98 |
} |
99 |
|
100 |
public SaveRasterPanel createSaveRasterPanel() {
|
101 |
return new SaveRasterMainPanel(); |
102 |
} |
103 |
|
104 |
} |