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 @ 1711

History | View | Annotate | Download (4.96 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.control.GeorefControlPanel;
32
import org.gvsig.raster.georeferencing.swing.impl.control.GeorefControlPanelImpl;
33
import org.gvsig.raster.georeferencing.swing.impl.launcher.GeorefLauncherDialog;
34
import org.gvsig.raster.georeferencing.swing.impl.option.GeorefOptionsDataModelImpl;
35
import org.gvsig.raster.georeferencing.swing.impl.option.GeorefOptionsDialog;
36
import org.gvsig.raster.georeferencing.swing.impl.view.ViewPanelImpl;
37
import org.gvsig.raster.georeferencing.swing.impl.view.ZoomPanelImpl;
38
import org.gvsig.raster.georeferencing.swing.impl.view.synchronize.SynchronizedViewsImpl;
39
import org.gvsig.raster.georeferencing.swing.view.GeoreferencingView;
40
import org.gvsig.raster.georeferencing.swing.view.SynchronizedViews;
41
import org.gvsig.raster.georeferencing.swing.view.ToolListener;
42
import org.gvsig.raster.swing.pagedtable.PagedTable;
43
import org.gvsig.tools.ToolsLocator;
44
import org.gvsig.tools.i18n.I18nManager;
45
import org.slf4j.Logger;
46
import org.slf4j.LoggerFactory;
47

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

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

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

    
91
        public SynchronizedViews createSyncViews(
92
                        GeoreferencingView viewMap,
93
                        GeoreferencingView viewRaster, 
94
                        GeoreferencingView zoomMap,
95
                        GeoreferencingView zoomRaster, 
96
                        PagedTable table, 
97
                        ToolListener listener) {
98
                SynchronizedViewsImpl lpm = new SynchronizedViewsImpl(listener);
99
                lpm.setViews(viewMap, viewRaster, zoomMap, zoomRaster, table);
100
                return lpm;
101
        }
102

    
103
        public GeorefControlPanel createGeorefControlPanel() {
104
                return new GeorefControlPanelImpl();
105
        }
106

    
107
        public GeoreferencingView createView(
108
                        boolean showInfo, 
109
                        boolean minMaxUL,
110
                        boolean rightSideButtons,
111
                        ToolListener toolListener) {
112
                ViewPanelImpl v = new ViewPanelImpl(toolListener, rightSideButtons);
113
                //v.setMinxMaxyUL(minMaxUL);
114
                v.setShowInfo(showInfo);
115
                return v;
116
        }
117

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

    
141
}