Statistics
| Revision:

root / org.gvsig.legend.vectorfilterexpression.app.mainplugin / trunk / org.gvsig.legend.vectorfilterexpression.app.mainplugin / src / main / java / org / gvsig / symbology / library / VectorFilterExpressionLibrary.java @ 39

History | View | Annotate | Download (3.17 KB)

1
/* 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.VectorFilterExpressionLegend;
29
import org.gvsig.symbology.gui.layerproperties.VectorFilterExpressionPanel;
30
import org.gvsig.tools.library.AbstractLibrary;
31
import org.gvsig.tools.library.LibraryException;
32
import org.gvsig.tools.persistence.xml.XMLPersistenceLibrary;
33
import org.gvsig.tools.util.Caller;
34
import org.gvsig.tools.util.impl.DefaultCaller;
35

    
36

    
37
/**
38
 * Simple library to register vector filter expression legend
39
 * 
40
 * @author jldominguez
41
 *
42
 */
43
public class VectorFilterExpressionLibrary extends AbstractLibrary {
44

    
45

    
46
    public void doRegistration() {
47
        registerAsImplementationOf(VectorFilterExpressionLibrary.class);
48
        /*
49
         * This checks map context library registration
50
         */
51
        require(SymbologyLibrary.class);
52
        /*
53
         * This is because we need to use persistence manager
54
         */
55
        require(XMLPersistenceLibrary.class);
56
    }
57

    
58
    protected void doInitialize() throws LibraryException {
59
        
60
    }
61

    
62

    
63
    protected void doPostInitialize() throws LibraryException {
64
        
65
        IconThemeHelper.registerIcon("legend",
66
            "legend-overview-vector-filter-expression", this);
67
        IconThemeHelper.registerIcon("legend",
68
            "legend-overview-vectorial-unique-value", this);
69
        IconThemeHelper.registerIcon("symbol",
70
            "symbol-layer-move-down", this);
71
        IconThemeHelper.registerIcon("symbol",
72
            "symbol-layer-move-up", this);
73

    
74
        Caller caller = new DefaultCaller();
75
        
76
        caller.add(new VectorFilterExpressionLegend.RegisterLegend());
77
        caller.add(new VectorFilterExpressionLegend.RegisterPersistence());
78
        
79
        /*
80
         * Do register of all
81
         */
82
        if( !caller.call() ) {
83
            throw new LibraryException(
84
                VectorFilterExpressionLibrary.class,
85
                caller.getExceptions());
86
        }
87
        LegendManager.addLegendPage(VectorFilterExpressionPanel.class);
88
    }
89
    
90

    
91

    
92
}