Statistics
| Revision:

gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.impl / src / main / java / org / gvsig / raster / georeferencing / swing / impl / DefaultGeoreferencingSwingManager.java @ 1692

History | View | Annotate | Download (4.66 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.georeferencing.swing.impl;
23

    
24
import java.util.List;
25

    
26
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
27
import org.gvsig.raster.georeferencing.swing.GeoreferencingLauncher;
28
import org.gvsig.raster.georeferencing.swing.GeoreferencingOptions;
29
import org.gvsig.raster.georeferencing.swing.GeoreferencingOptionsDataModel;
30
import org.gvsig.raster.georeferencing.swing.GeoreferencingSwingManager;
31
import org.gvsig.raster.georeferencing.swing.LayoutEnvironment;
32
import org.gvsig.raster.georeferencing.swing.control.GeorefControlPanel;
33
import org.gvsig.raster.georeferencing.swing.impl.control.GeorefControlPanelImpl;
34
import org.gvsig.raster.georeferencing.swing.impl.launcher.GeorefLauncherDialog;
35
import org.gvsig.raster.georeferencing.swing.impl.option.GeorefOptionsDataModelImpl;
36
import org.gvsig.raster.georeferencing.swing.impl.option.GeorefOptionsDialog;
37
import org.gvsig.raster.georeferencing.swing.impl.view.ViewPanelImpl;
38
import org.gvsig.raster.georeferencing.swing.impl.view.ZoomPanelImpl;
39
import org.gvsig.raster.georeferencing.swing.view.GeoreferencingView;
40
import org.gvsig.raster.georeferencing.swing.view.ToolListener;
41
import org.gvsig.tools.ToolsLocator;
42
import org.gvsig.tools.i18n.I18nManager;
43
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
45

    
46
/**
47
 * Default implementation of the {@link CartociudadSwingManager}.
48
 * 
49
 * @author gvSIG Team
50
 * @version $Id$
51
 */
52
public class DefaultGeoreferencingSwingManager implements GeoreferencingSwingManager {
53
        private static final Logger            logger        = LoggerFactory.getLogger(DefaultGeoreferencingSwingManager.class);
54
    private I18nManager                    i18nmanager   = null;
55
        private GeoreferencingOptionsDataModel dataModel     = null;
56

    
57
    public DefaultGeoreferencingSwingManager() {
58
        this.i18nmanager = ToolsLocator.getI18nManager();       
59
    }
60
    
61
    public GeoreferencingOptionsDataModel getDataModel() {
62
            if(dataModel == null)
63
                    dataModel = new GeorefOptionsDataModelImpl();
64
            return dataModel;
65
    }
66

    
67
    public String getTranslation(String key) {
68
        return this.i18nmanager.getTranslation(key);
69
    }
70
    
71
        /**
72
         * Obtiene la traducci?n de la cadena de texto
73
         * @param parent Ventana padre
74
         * @param text Cadena a traducir
75
         * @return Cadena de texto traducida
76
         */
77
        public static String getText(Object parent, String key) {
78
                 if (key == null)
79
                    return null;
80
                String translation = org.gvsig.i18n.Messages.getText(key, false);
81
                if (translation != null)
82
                    return translation;
83
                else {
84
                    logger.debug("Can't find translation for ''{1}''.", key);
85
                    return key;
86
                }
87
        }
88

    
89
        public LayoutEnvironment createLayout(
90
                        GeoreferencingView viewMap,
91
                        GeoreferencingView viewRaster, 
92
                        GeoreferencingView zoomMap,
93
                        GeoreferencingView zoomRaster, 
94
                        GeorefControlPanel table) {
95
                return null;
96
        }
97

    
98
        public GeorefControlPanel createGeorefControlPanel() {
99
                return new GeorefControlPanelImpl();
100
        }
101

    
102
        public GeoreferencingView createView(
103
                        boolean showInfo, 
104
                        boolean minMaxUL,
105
                        boolean rightSideButtons,
106
                        ToolListener toolListener) {
107
                ViewPanelImpl v = new ViewPanelImpl(toolListener, rightSideButtons);
108
                v.setMinxMaxyUL(minMaxUL);
109
                v.setShowInfo(showInfo);
110
                return v;
111
        }
112

    
113
        public GeoreferencingView createZoom(
114
                        boolean showInfo, 
115
                        boolean minMaxUL) {
116
                ZoomPanelImpl v = new ZoomPanelImpl();
117
                v.setMinxMaxyUL(minMaxUL);
118
                v.setShowInfo(showInfo);
119
                return v;
120
        }
121
        
122
        public GeoreferencingLauncher createWindowLauncher(
123
                        List<String> viewList, 
124
                        int polynomialDegree) {
125
                return new GeorefLauncherDialog(viewList, polynomialDegree); 
126
        }
127
        
128
        public GeoreferencingOptions createWindowOptions(
129
                        int polynomialDegree, 
130
                        ButtonsPanelListener listener) {
131
                return new GeorefOptionsDialog(polynomialDegree, listener); 
132
        }
133
        
134
        
135

    
136
}