Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / org.gvsig.symbology / org.gvsig.symbology.lib / org.gvsig.symbology.lib.impl / src / main / java / org / gvsig / symbology / impl / DefaultSymbologyManager.java @ 34294

History | View | Annotate | Download (5.79 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

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {}  {{Task}}
26
*/
27
package org.gvsig.symbology.impl;
28

    
29
import java.io.IOException;
30
import java.net.URL;
31

    
32
import org.gvsig.fmap.mapcontext.rendering.legend.IInterval;
33
import org.gvsig.symbology.SymbologyLocator;
34
import org.gvsig.symbology.SymbologyManager;
35
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.FInterval;
36
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy;
37
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.IAttrInTableLabelingStrategy;
38
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.IMultiShapeSymbol;
39
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IMarkerFillSymbol;
40
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol;
41
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.ISimpleFillSymbol;
42
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.MarkerFillSymbol;
43
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.PictureFillSymbol;
44
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.SimpleFillSymbol;
45
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.MultiShapeSymbol;
46
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.IPictureLineSymbol;
47
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ISimpleLineSymbol;
48
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.PictureLineSymbol;
49
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.SimpleLineSymbol;
50
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IPictureMarkerSymbol;
51
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.ISimpleMarkerSymbol;
52
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.PictureMarkerSymbol;
53
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.SimpleMarkerSymbol;
54
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.ArrowDecoratorStyle;
55
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.DefaultMask;
56
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IArrowDecoratorStyle;
57
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyle;
58
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMask;
59
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.ISimpleLineStyle;
60
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SimpleLineStyle;
61
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SimpleMarkerFillPropertiesStyle;
62
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
63
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol;
64
import org.gvsig.tools.util.Callable;
65

    
66
/**
67
 * Default {@link SymbologyManager} implementation.
68
 * 
69
 * @author 2009- <a href="cordinyana@gvsig.org">C?sar Ordi?ana</a> - gvSIG team
70
 */
71
public class DefaultSymbologyManager implements SymbologyManager {
72

    
73
        public IInterval createInterval(double min, double max) {
74
                return new FInterval(min, max);
75
        }
76

    
77
        public static class RegisterSymbologyManager implements Callable {
78

    
79
                public Object call() throws Exception {
80

    
81
                        SymbologyLocator.registerSymbologyManager(DefaultSymbologyManager.class);
82
                
83
                        return Boolean.TRUE;
84
                }
85
                
86
        }
87

    
88
        public IArrowDecoratorStyle createArrowDecoratorStyle() {
89
                return new ArrowDecoratorStyle();
90
        }
91
        
92
//        public IMarkerSymbol createMarkerSymbol(){
93
//                return new SimpleMarkerSymbol();
94
//        }
95

    
96
        public ISimpleMarkerSymbol createSimpleMarkerSymbol() {
97
                return new SimpleMarkerSymbol();
98
        }
99

    
100
        public IMask createMask() {
101
                return new DefaultMask();
102
        }
103

    
104
        public IMultiShapeSymbol createMultiShapeSymbol() {
105
                return new MultiShapeSymbol();
106
        }
107

    
108
        public ISimpleFillSymbol createSimpleFillSymbol() {
109
                return new SimpleFillSymbol();
110
        }
111

    
112
        public ISimpleLineSymbol createSimpleLineSymbol() {
113
                return new SimpleLineSymbol();
114
        }
115

    
116
        public ISimpleLineStyle createSimpleLineStyle() {
117
                return new SimpleLineStyle();
118
        }
119

    
120
        public ISimpleTextSymbol createSimpleTextSymbol() {
121
                return new SimpleTextSymbol();
122
        }
123

    
124
        public IMarkerFillPropertiesStyle createSimpleMarkerFillPropertiesStyle() {
125
                return new SimpleMarkerFillPropertiesStyle();
126
        }
127

    
128
        public IPictureFillSymbol createPictureFillSymbol(URL imageURL,
129
                        URL selImageURL) throws IOException {
130
                return new PictureFillSymbol(imageURL, selImageURL);
131
        }
132

    
133
        public IPictureLineSymbol createPictureLineSymbol(URL imageURL,
134
                        URL selImageURL) throws IOException {
135
                return new PictureLineSymbol(imageURL, selImageURL);
136
        }
137

    
138
        public IPictureMarkerSymbol createPictureMarkerSymbol(URL imageURL,
139
                        URL selImageURL) throws IOException {
140
                return new PictureMarkerSymbol(imageURL, selImageURL);
141

    
142
        }
143

    
144
        public IMarkerFillSymbol createMarkerFillSymbol() {
145
                return new MarkerFillSymbol();
146
        }
147

    
148
        public IAttrInTableLabelingStrategy createAttrInTableLabelingStrategy() {
149
                return new AttrInTableLabelingStrategy();
150
        }
151

    
152

    
153
}