Statistics
| Revision:

root / org.gvsig.legend.dotdensity.app.mainplugin / trunk / org.gvsig.legend.dotdensity.app.mainplugin / src / main / java / org / gvsig / symbology / library / DotDensityLibrary.java @ 824

History | View | Annotate | Download (3.21 KB)

1 23 jldominguez
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2013 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.symbology.library;
24
25
import org.gvsig.andami.IconThemeHelper;
26
import org.gvsig.app.project.documents.view.legend.gui.LegendManager;
27
import org.gvsig.symbology.SymbologyLibrary;
28
import org.gvsig.symbology.fmap.rendering.DotDensityLegend;
29
import org.gvsig.symbology.fmap.symbols.DotDensityFillSymbol;
30
import org.gvsig.symbology.gui.layerproperties.DotDensityPanel;
31
import org.gvsig.tools.library.AbstractLibrary;
32
import org.gvsig.tools.library.LibraryException;
33
import org.gvsig.tools.persistence.xml.XMLPersistenceLibrary;
34
import org.gvsig.tools.util.Caller;
35
import org.gvsig.tools.util.impl.DefaultCaller;
36
37
38
/**
39
 * Simple library to register dot density legend
40
 *
41
 * @author jldominguez
42
 *
43
 */
44
public class DotDensityLibrary extends AbstractLibrary {
45
46
47
    public void doRegistration() {
48
        registerAsImplementationOf(DotDensityLibrary.class);
49
        /*
50
         * This checks map context library registration
51
         */
52
        require(SymbologyLibrary.class);
53
        /*
54
         * This is because we need to use persistence manager
55
         */
56
        require(XMLPersistenceLibrary.class);
57
    }
58
59
    protected void doInitialize() throws LibraryException {
60
61
    }
62
63
64
    protected void doPostInitialize() throws LibraryException {
65
66
        IconThemeHelper.registerIcon("legend",
67
            "legend-overview-dot-density", this);
68
        IconThemeHelper.registerIcon("legend",
69
            "legend-dot-density-low-density-sample", this);
70
        IconThemeHelper.registerIcon("legend",
71
            "legend-dot-density-medium-density-sample", this);
72
        IconThemeHelper.registerIcon("legend",
73
            "legend-dot-density-high-density-sample", this);
74
75
        Caller caller = new DefaultCaller();
76
77
        caller.add(new DotDensityLegend.RegisterLegend());
78
        caller.add(new DotDensityLegend.RegisterPersistence());
79
        caller.add(new DotDensityFillSymbol.RegisterPersistence());
80
81
        /*
82
         * Do register of all
83
         */
84
        if( !caller.call() ) {
85
            throw new LibraryException(
86
                DotDensityLibrary.class,
87
                caller.getExceptions());
88
        }
89
        LegendManager.addLegendPage(DotDensityPanel.class);
90
    }
91
92
93
94
}