Statistics
| Revision:

root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.swing / org.gvsig.proj.swing.impl / src / main / java / org / gvsig / proj / swing / impl / DefaultCoordinateReferenceSystemSwingManager.java @ 854

History | View | Annotate | Download (4.57 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.proj.swing.impl;
25

    
26
import java.awt.EventQueue;
27
import java.net.URL;
28

    
29
import org.gvsig.proj.CoordinateReferenceSystem;
30
import org.gvsig.proj.CoordinateReferenceSystemLocator;
31
import org.gvsig.proj.CoordinateReferenceSystemManager;
32
import org.gvsig.proj.CoordinateTransformation;
33
import org.gvsig.proj.catalog.CRSCatalogLocator;
34
import org.gvsig.proj.catalog.CRSCatalogManager;
35
import org.gvsig.proj.swing.CoordinateReferenceSystemSelectorComponent;
36
import org.gvsig.proj.swing.CoordinateReferenceSystemSwingManager;
37
import org.gvsig.proj.swing.CoordinateTransformationSelectorComponent;
38
import org.gvsig.proj.swing.RecentHistory;
39
import org.gvsig.proj.swing.impl.history.History;
40
import org.gvsig.tools.ToolsLocator;
41
import org.gvsig.tools.i18n.I18nManager;
42
import org.gvsig.tools.swing.api.ToolsSwingLocator;
43
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
44
import org.gvsig.tools.swing.icontheme.IconTheme;
45
import org.slf4j.Logger;
46
import org.slf4j.LoggerFactory;
47

    
48
/**
49
 * Default implementation of the {@link CoordinateReferenceSystemSwingManager}.
50
 * 
51
 * @author gvSIG Team
52
 * @version $Id$
53
 */
54
public class DefaultCoordinateReferenceSystemSwingManager implements
55
    CoordinateReferenceSystemSwingManager {
56
        private static Logger logger = LoggerFactory.getLogger(DefaultCoordinateReferenceSystemSwingManager.class);
57
    private I18nManager i18nmanager = null;
58
    private RecentHistory<CoordinateReferenceSystem> crsHistory;
59
    private RecentHistory<CoordinateTransformation> transformationHistory;
60
    private RecentHistory<String> crsTextFilterHistory;
61
    private RecentHistory<String> transformationTextFilterHistory;
62
    private volatile IconTheme iconTheme = null;
63
    private volatile boolean registeredIcons = false;
64

    
65
    public DefaultCoordinateReferenceSystemSwingManager() {
66
            //this.iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent();
67
        //this.manager = CoordinateReferenceSystemLocator.getManager();
68
        //this.i18nmanager = ToolsLocator.getI18nManager();
69
        crsHistory = new History<CoordinateReferenceSystem>();
70
        transformationHistory = new History<CoordinateTransformation>();
71
        crsTextFilterHistory = new History<String>();
72
        transformationTextFilterHistory = new History<String>();
73
    }
74

    
75
    @Override
76
    public CoordinateReferenceSystemManager getCRSManager() {
77
            return CoordinateReferenceSystemLocator.getManager();
78
        //return this.manager;
79
    }
80

    
81
    public CoordinateReferenceSystemSelectorComponent createCoordinateReferenceSystemSelectionComponent() {
82
            /**
83
             * Ensures the icons have been registered. We can't do it at manager initialization because the
84
             * IconThemeManager may not be initialized at that point
85
             */
86
        return new CrsSelectorComponent(this);
87
    }
88

    
89
        @Override
90
        public CoordinateTransformationSelectorComponent createCoordinateTransformSelectionComponent() {
91
            /**
92
             * Ensures the icons have been registered. We can't do it at manager initialization because the
93
             * IconThemeManager may not be initialized at that point
94
             */
95
                return null;
96
        }
97

    
98
        @Override
99
        public CRSCatalogManager getCatalogManager() {
100
                return CRSCatalogLocator.getManager();
101
        }
102

    
103
        @Override
104
        public RecentHistory<CoordinateReferenceSystem> getCoordinateReferenceSystemHistory() {
105
                return crsHistory;
106
        }
107

    
108
        @Override
109
        public RecentHistory<CoordinateTransformation> getTransformationHistory() {
110
                return transformationHistory;
111
        }
112

    
113
        @Override
114
        public RecentHistory<String> getCoordinateReferenceSystemTextFilterHistory() {
115
                return crsTextFilterHistory;
116
        }
117

    
118
        @Override
119
        public RecentHistory<String> getTransformationTextFilterHistory() {
120
                return transformationTextFilterHistory;
121
        }
122
}