Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.swing / org.gvsig.raster.swing.impl / src / main / java / org / gvsig / raster / swing / impl / RasterSwingImplLibrary.java @ 2443

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

    
24
import java.util.Locale;
25

    
26
import org.gvsig.andami.IconThemeHelper;
27
import org.gvsig.i18n.Messages;
28
import org.gvsig.raster.swing.RasterSwingLibrary;
29
import org.gvsig.raster.swing.RasterSwingLocator;
30
import org.gvsig.tools.library.AbstractLibrary;
31
import org.gvsig.tools.library.Library;
32
import org.gvsig.tools.library.LibraryException;
33

    
34
/**
35
 * Library for default swing implementation initialization and configuration.
36
 * 
37
 * @author gvSIG team
38
 * @version $Id$
39
 */
40
public class RasterSwingImplLibrary extends AbstractLibrary {
41

    
42
        public RasterSwingImplLibrary() {
43
                super();
44
        }
45
        
46
        @Override
47
        public void doRegistration() {
48
            this.registerAs(RasterSwingLibrary.class, Library.TYPE.IMPL);
49
        }
50
        
51
    @Override
52
    protected void doInitialize() throws LibraryException {
53
            RasterSwingLocator
54
            .registerSwingManager(DefaultRasterSwingManager.class);
55
        
56
        
57
        if (!Messages.hasLocales()) {
58
            Messages.addLocale(Locale.getDefault());
59
        }
60
        
61
        Messages.addResourceFamily("org.gvsig.raster.swing.impl.i18n.text",
62
            RasterSwingImplLibrary.class.getClassLoader(),
63
            RasterSwingImplLibrary.class.getClass().getName()); 
64
        
65
        registerIcons();
66
    }
67

    
68
    @Override
69
    protected void doPostInitialize() throws LibraryException {
70
    }
71
    
72
    private void registerIcons() {
73
                IconThemeHelper.registerIcon(null, "icon-folder-open", this);
74
                IconThemeHelper.registerIcon(null, "backward-icon", this);
75
                IconThemeHelper.registerIcon(null, "delall", this);
76
                IconThemeHelper.registerIcon(null, "delone", this);
77
                IconThemeHelper.registerIcon(null, "down-16x16", this);
78
                IconThemeHelper.registerIcon(null, "first", this);
79
                IconThemeHelper.registerIcon(null, "forward-icon", this);
80
                IconThemeHelper.registerIcon(null, "icon-folder-open", this);
81
                IconThemeHelper.registerIcon(null, "last", this);
82
                IconThemeHelper.registerIcon(null, "layer-saveas", this);
83
                IconThemeHelper.registerIcon(null, "line-icon", this);
84
                IconThemeHelper.registerIcon(null, "newpoint", this);
85
                IconThemeHelper.registerIcon(null, "next", this);
86
                IconThemeHelper.registerIcon(null, "point-icon", this);
87
                IconThemeHelper.registerIcon(null, "polygon-icon", this);
88
                IconThemeHelper.registerIcon(null, "prev", this);
89
                IconThemeHelper.registerIcon(null, "tfwload-icon", this);
90
                IconThemeHelper.registerIcon(null, "up-16x16", this);
91
    }
92
}