root / org.gvsig.legend.vectorfilterexpression.app.mainplugin / trunk / org.gvsig.legend.vectorfilterexpression.app.mainplugin / src / main / java / org / gvsig / symbology / library / VectorFilterExpressionLibrary.java @ 107
History | View | Annotate | Download (3.39 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.SymbolTable; |
27 |
import org.gvsig.symbology.SymbologyLibrary; |
28 |
import org.gvsig.symbology.fmap.rendering.VectorFilterExpressionLegend; |
29 |
import org.gvsig.symbology.gui.layerproperties.ExpressionFieldCellEditor; |
30 |
import org.gvsig.symbology.gui.layerproperties.VectorFilterExpressionPanel; |
31 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
32 |
import org.gvsig.tools.library.AbstractLibrary; |
33 |
import org.gvsig.tools.library.LibraryException; |
34 |
import org.gvsig.tools.persistence.xml.XMLPersistenceLibrary; |
35 |
import org.gvsig.tools.util.Caller; |
36 |
import org.gvsig.tools.util.impl.DefaultCaller; |
37 |
|
38 |
|
39 |
/**
|
40 |
* Simple library to register vector filter expression legend
|
41 |
*
|
42 |
* @author jldominguez
|
43 |
*
|
44 |
*/
|
45 |
public class VectorFilterExpressionLibrary extends AbstractLibrary { |
46 |
|
47 |
|
48 |
public void doRegistration() { |
49 |
registerAsImplementationOf(VectorFilterExpressionLibrary.class); |
50 |
/*
|
51 |
* This checks map context library registration
|
52 |
*/
|
53 |
require(SymbologyLibrary.class); |
54 |
/*
|
55 |
* This is because we need to use persistence manager
|
56 |
*/
|
57 |
require(XMLPersistenceLibrary.class); |
58 |
} |
59 |
|
60 |
protected void doInitialize() throws LibraryException { |
61 |
|
62 |
} |
63 |
|
64 |
|
65 |
protected void doPostInitialize() throws LibraryException { |
66 |
|
67 |
IconThemeHelper.registerIcon("legend",
|
68 |
"legend-overview-vector-filter-expression", this); |
69 |
IconThemeHelper.registerIcon("legend",
|
70 |
"legend-overview-vectorial-unique-value", this); |
71 |
IconThemeHelper.registerIcon("symbol",
|
72 |
"symbol-layer-move-down", this); |
73 |
IconThemeHelper.registerIcon("symbol",
|
74 |
"symbol-layer-move-up", this); |
75 |
|
76 |
Caller caller = new DefaultCaller();
|
77 |
|
78 |
caller.add(new VectorFilterExpressionLegend.RegisterLegend());
|
79 |
caller.add(new VectorFilterExpressionLegend.RegisterPersistence());
|
80 |
|
81 |
/*
|
82 |
* Do register of all
|
83 |
*/
|
84 |
if( !caller.call() ) {
|
85 |
throw new LibraryException( |
86 |
VectorFilterExpressionLibrary.class, |
87 |
caller.getExceptions()); |
88 |
} |
89 |
SymbologySwingLocator.getSwingManager().registerLegendEditor(VectorFilterExpressionPanel.class); |
90 |
|
91 |
SymbolTable.addNewCellEditor("expressions",
|
92 |
new ExpressionFieldCellEditor());
|
93 |
|
94 |
} |
95 |
|
96 |
|
97 |
|
98 |
} |