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