root / tags / v2_0_0_Build_2031 / libraries / org.gvsig.symbology / org.gvsig.symbology.swing / org.gvsig.symbology.swing.impl / src / main / java / org / gvsig / symbology / swing / impl / DefaultSymbologySwingManager.java @ 36104
History | View | Annotate | Download (2.98 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.symbology.swing.impl; |
23 |
|
24 |
import org.gvsig.app.gui.styling.SymbolEditor; |
25 |
import org.gvsig.gui.DefaultColorTables; |
26 |
import org.gvsig.gui.IColorTables; |
27 |
import org.gvsig.gui.IColorTablesFactory; |
28 |
import org.gvsig.symbology.SymbologyLocator; |
29 |
import org.gvsig.symbology.SymbologyManager; |
30 |
import org.gvsig.symbology.swing.SymbologySwingManager; |
31 |
import org.gvsig.symbology.swing.SymbologyWindowManager; |
32 |
|
33 |
/**
|
34 |
* Default implementation of the {@link SymbologySwingManager}.
|
35 |
*
|
36 |
* @author gvSIG Team
|
37 |
* @version $Id$
|
38 |
*/
|
39 |
public class DefaultSymbologySwingManager implements |
40 |
SymbologySwingManager { |
41 |
|
42 |
private SymbologyManager manager;
|
43 |
// private I18nManager i18nmanager = null;
|
44 |
private SymbologyWindowManager windowManager;
|
45 |
private IColorTablesFactory colorTablesFactory;
|
46 |
|
47 |
public DefaultSymbologySwingManager() {
|
48 |
this.manager = SymbologyLocator.getSymbologyManager();
|
49 |
// this.i18nmanager = ToolsLocator.getI18nManager();
|
50 |
this.windowManager = new DefaultSymbologyWindowManager(); |
51 |
} |
52 |
|
53 |
public SymbologyManager getManager() {
|
54 |
return this.manager; |
55 |
} |
56 |
|
57 |
public String getTranslation(String key) { |
58 |
// TODO: add I18nManager usage when org.gvsig.tools.lib 2.1.0 becomes
|
59 |
// available
|
60 |
// return this.i18nmanager.getTranslation(key);
|
61 |
return key;
|
62 |
} |
63 |
|
64 |
public void registerWindowManager(SymbologyWindowManager manager) { |
65 |
this.windowManager = manager;
|
66 |
} |
67 |
|
68 |
public SymbologyWindowManager getWindowManager() {
|
69 |
return this.windowManager; |
70 |
} |
71 |
|
72 |
@SuppressWarnings("rawtypes") |
73 |
public void addSymbolEditorPanel(Class abstractTypeSymbolEditorPanelClass, int shapeType) { |
74 |
SymbolEditor.addSymbolEditorPanel(abstractTypeSymbolEditorPanelClass, shapeType); |
75 |
} |
76 |
|
77 |
public void setColorTablesFactory(IColorTablesFactory factory) { |
78 |
colorTablesFactory = factory; |
79 |
} |
80 |
|
81 |
public IColorTables createColorTables() {
|
82 |
if (colorTablesFactory != null){ |
83 |
return colorTablesFactory.createColorTables();
|
84 |
} |
85 |
return new DefaultColorTables(); |
86 |
} |
87 |
|
88 |
public IColorTablesFactory getColorTablesFactory() {
|
89 |
return this.colorTablesFactory; |
90 |
} |
91 |
} |