Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.symbology / org.gvsig.symbology.swing / org.gvsig.symbology.swing.impl / src / main / java / org / gvsig / symbology / swing / impl / DefaultSymbologySwingManager.java @ 40560

History | View | Annotate | Download (3.11 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.symbology.swing.impl;
25

    
26
import java.util.List;
27

    
28
import org.gvsig.app.gui.styling.SymbolEditor;
29
import org.gvsig.gui.ColorTablePainter;
30
import org.gvsig.gui.ColorTablesFactory;
31
import org.gvsig.gui.DefaultColorTablesFactory;
32
import org.gvsig.symbology.SymbologyLocator;
33
import org.gvsig.symbology.SymbologyManager;
34
import org.gvsig.symbology.swing.SymbologySwingManager;
35
import org.gvsig.symbology.swing.SymbologyWindowManager;
36

    
37
/**
38
 * Default implementation of the {@link SymbologySwingManager}.
39
 * 
40
 * @author gvSIG Team
41
 * @version $Id$
42
 */
43
public class DefaultSymbologySwingManager implements
44
    SymbologySwingManager {
45

    
46
    private SymbologyManager manager;
47
    // private I18nManager i18nmanager = null;
48
    private SymbologyWindowManager windowManager;
49
    private ColorTablesFactory colorTablesFactory;
50

    
51
    public DefaultSymbologySwingManager() {
52
        this.manager = SymbologyLocator.getSymbologyManager();
53
        // this.i18nmanager = ToolsLocator.getI18nManager();
54
        this.windowManager = new DefaultSymbologyWindowManager();
55
        colorTablesFactory = new DefaultColorTablesFactory();
56
    }
57

    
58
    public SymbologyManager getManager() {
59
        return this.manager;
60
    }
61

    
62
    public String getTranslation(String key) {
63
        // TODO: add I18nManager usage when org.gvsig.tools.lib 2.1.0 becomes
64
        // available
65
        // return this.i18nmanager.getTranslation(key);
66
        return key;
67
    }
68

    
69
    public void registerWindowManager(SymbologyWindowManager manager) {
70
        this.windowManager = manager;
71
    }
72

    
73
    public SymbologyWindowManager getWindowManager() {
74
        return this.windowManager;
75
    }
76
    
77
        @SuppressWarnings("rawtypes")
78
        public void addSymbolEditorPanel(Class abstractTypeSymbolEditorPanelClass, int shapeType) {
79
                SymbolEditor.addSymbolEditorPanel(abstractTypeSymbolEditorPanelClass, shapeType);
80
        }
81

    
82
        public void setColorTablesFactory(ColorTablesFactory factory) {
83
                colorTablesFactory = factory;
84
        }
85

    
86
        public List<ColorTablePainter> createColorTables() {
87
                if (colorTablesFactory != null){
88
                    return colorTablesFactory.createColorTables();
89
                }
90
                return null;
91
        }
92
        
93
        public ColorTablesFactory getColorTablesFactory() {
94
                return this.colorTablesFactory;
95
        }
96
}