Revision 40739
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.impl/src/main/java/org/gvsig/sldsupport/impl/DefaultSLDSupportManager.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.impl; |
|
2 |
|
|
3 |
import org.gvsig.sldsupport.SLDSupportManager; |
|
4 |
|
|
5 |
public class DefaultSLDSupportManager implements SLDSupportManager { |
|
6 |
|
|
7 |
public DefaultSLDSupportManager() { |
|
8 |
|
|
9 |
} |
|
10 |
|
|
11 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.impl/src/main/java/org/gvsig/sldsupport/impl/SLDSupportDefaultLibrary.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.impl; |
|
2 |
|
|
3 |
import org.gvsig.sldsupport.SLDSupportLibrary; |
|
4 |
import org.gvsig.sldsupport.SLDSupportLocator; |
|
5 |
import org.gvsig.tools.library.AbstractLibrary; |
|
6 |
import org.gvsig.tools.library.LibraryException; |
|
7 |
|
|
8 |
public class SLDSupportDefaultLibrary extends AbstractLibrary { |
|
9 |
|
|
10 |
public void doRegistration() { |
|
11 |
registerAsImplementationOf(SLDSupportLibrary.class); |
|
12 |
} |
|
13 |
|
|
14 |
protected void doInitialize() throws LibraryException { |
|
15 |
|
|
16 |
SLDSupportLocator.getInstance().registerSLDSupportManager( |
|
17 |
DefaultSLDSupportManager.class); |
|
18 |
|
|
19 |
} |
|
20 |
|
|
21 |
protected void doPostInitialize() throws LibraryException { |
|
22 |
} |
|
23 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.impl/pom.xml | ||
---|---|---|
11 | 11 |
</parent> |
12 | 12 |
|
13 | 13 |
<dependencies> |
14 |
|
|
15 |
<!-- |
|
16 |
<dependency> |
|
17 |
<groupId>com.vividsolutions</groupId> |
|
18 |
<artifactId>jts</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
|
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.symbology.lib.api</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.gvsig</groupId> |
|
29 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
|
|
33 |
<dependency> |
|
34 |
<groupId>org.gvsig</groupId> |
|
35 |
<artifactId>org.gvsig.fmap.mapcontext.operation</artifactId> |
|
36 |
<scope>compile</scope> |
|
37 |
</dependency> |
|
38 |
|
|
39 |
<dependency> |
|
40 |
<groupId>org.apache.xmlgraphics</groupId> |
|
41 |
<artifactId>batik-gvt</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.apache.xmlgraphics</groupId> |
|
46 |
<artifactId>batik-script</artifactId> |
|
47 |
<scope>compile</scope> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.apache.xmlgraphics</groupId> |
|
51 |
<artifactId>batik-ext</artifactId> |
|
52 |
<scope>compile</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.remoteclient</artifactId> |
|
57 |
<scope>compile</scope> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.gvsig</groupId> |
|
61 |
<artifactId>org.gvsig.utils</artifactId> |
|
62 |
<scope>compile</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
67 |
<scope>compile</scope> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
72 |
<scope>compile</scope> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
77 |
<scope>compile</scope> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.slf4j</groupId> |
|
81 |
<artifactId>slf4j-api</artifactId> |
|
82 |
<scope>compile</scope> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
87 |
<scope>compile</scope> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.compat.api</artifactId> |
|
92 |
<scope>compile</scope> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.i18n</artifactId> |
|
97 |
<scope>compile</scope> |
|
98 |
</dependency> |
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
102 |
<scope>compile</scope> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.apache.xmlgraphics</groupId> |
|
106 |
<artifactId>batik-awt-util</artifactId> |
|
107 |
<scope>compile</scope> |
|
108 |
</dependency> |
|
109 |
<dependency> |
|
110 |
<groupId>org.apache.xmlgraphics</groupId> |
|
111 |
<artifactId>batik-bridge</artifactId> |
|
112 |
<scope>compile</scope> |
|
113 |
</dependency> |
|
114 |
<dependency> |
|
115 |
<groupId>xml-apis</groupId> |
|
116 |
<artifactId>xml-apis-ext</artifactId> |
|
117 |
<scope>compile</scope> |
|
118 |
</dependency> |
|
119 |
|
|
120 |
|
|
121 |
<dependency> |
|
122 |
<groupId>org.gvsig</groupId> |
|
123 |
<artifactId>org.gvsig.symbology.lib.api</artifactId> |
|
124 |
<version>2.0.1-SNAPSHOT</version> |
|
125 |
<type>test-jar</type> |
|
126 |
<scope>test</scope> |
|
127 |
</dependency> |
|
128 |
--> |
|
14 |
<dependency> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.sldsupport.lib.api</artifactId> |
|
17 |
<scope>compile</scope> |
|
18 |
</dependency> |
|
129 | 19 |
</dependencies> |
130 | 20 |
|
131 | 21 |
|
132 | 22 |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/io/SLDLegendReader.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.io; |
|
2 |
|
|
3 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
|
4 |
import org.gvsig.sldsupport.exception.SLDReadException; |
|
5 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamReader; |
|
6 |
|
|
7 |
public interface SLDLegendReader { |
|
8 |
|
|
9 |
public ILegend read(IXmlStreamReader reader) |
|
10 |
throws SLDReadException; |
|
11 |
|
|
12 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/io/SLDSymbolWriter.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.io; |
|
2 |
|
|
3 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
4 |
import org.gvsig.sldsupport.exception.SLDWriteException; |
|
5 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamWriter; |
|
6 |
|
|
7 |
public interface SLDSymbolWriter { |
|
8 |
|
|
9 |
public void write(ISymbol sym, IXmlStreamWriter writer) |
|
10 |
throws SLDWriteException; |
|
11 |
|
|
12 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/io/SLDSymbolReader.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.io; |
|
2 |
|
|
3 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
4 |
import org.gvsig.sldsupport.exception.SLDReadException; |
|
5 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamReader; |
|
6 |
|
|
7 |
public interface SLDSymbolReader { |
|
8 |
|
|
9 |
public ISymbol read(IXmlStreamReader reader) |
|
10 |
throws SLDReadException; |
|
11 |
|
|
12 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/io/SLDLegendWriter.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.io; |
|
2 |
|
|
3 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
|
4 |
import org.gvsig.sldsupport.exception.SLDWriteException; |
|
5 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamWriter; |
|
6 |
|
|
7 |
public interface SLDLegendWriter { |
|
8 |
|
|
9 |
public void write(ILegend leg, IXmlStreamWriter writer) |
|
10 |
throws SLDWriteException; |
|
11 |
|
|
12 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/SLDSupportManager.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport; |
|
2 |
|
|
3 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
4 |
import org.gvsig.sldsupport.exception.SLDReadException; |
|
5 |
import org.gvsig.sldsupport.exception.SLDWriteException; |
|
6 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol; |
|
7 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol; |
|
8 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol; |
|
9 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamReader; |
|
10 |
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamWriter; |
|
11 |
|
|
12 |
public interface SLDSupportManager { |
|
13 |
|
|
14 |
public void writeSymbol(IXmlStreamWriter writer) |
|
15 |
throws SLDWriteException; |
|
16 |
|
|
17 |
// ========================================= |
|
18 |
|
|
19 |
public IMarkerSymbol readMarkerSymbol(IXmlStreamReader reader) |
|
20 |
throws SLDReadException; |
|
21 |
|
|
22 |
public ILineSymbol readLineSymbol(IXmlStreamReader reader) |
|
23 |
throws SLDReadException; |
|
24 |
|
|
25 |
public IFillSymbol readFillSymbol(IXmlStreamReader reader) |
|
26 |
throws SLDReadException; |
|
27 |
|
|
28 |
public ISymbol readSymbol(IXmlStreamReader reader) |
|
29 |
throws SLDReadException; |
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/exception/SLDWriteException.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.exception; |
|
2 |
|
|
3 |
import org.gvsig.tools.exception.BaseException; |
|
4 |
|
|
5 |
public class SLDWriteException extends BaseException { |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
*/ |
|
10 |
private static final long serialVersionUID = 4612344620813700878L; |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
*/ |
|
15 |
|
|
16 |
public SLDWriteException(Throwable cause) { |
|
17 |
super("Error while writing SLD file", cause, |
|
18 |
"_Error_while_writing_SLD_file", serialVersionUID); |
|
19 |
} |
|
20 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/exception/SLDReadException.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport.exception; |
|
2 |
|
|
3 |
import org.gvsig.tools.exception.BaseException; |
|
4 |
|
|
5 |
public class SLDReadException extends BaseException { |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
*/ |
|
10 |
private static final long serialVersionUID = 2873749769998353025L; |
|
11 |
|
|
12 |
public SLDReadException(Throwable cause) { |
|
13 |
super("Error while reading SLD file", cause, |
|
14 |
"_Error_while_reading_SLD_file", serialVersionUID); |
|
15 |
} |
|
16 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/SLDSupportLocator.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport; |
|
2 |
|
|
3 |
import org.gvsig.tools.locator.BaseLocator; |
|
4 |
import org.gvsig.tools.locator.LocatorException; |
|
5 |
|
|
6 |
public class SLDSupportLocator extends BaseLocator { |
|
7 |
|
|
8 |
public static final String SLD_SUPPORT_MANAGER_NAME = |
|
9 |
"SLDSupportManager"; |
|
10 |
private static final String SLD_SUPPORT_MANAGER_NAME_DESCRIPTION = |
|
11 |
"Manager to read/write symbols/legends in SLD format"; |
|
12 |
|
|
13 |
/** |
|
14 |
* Unique instance. |
|
15 |
*/ |
|
16 |
private static final SLDSupportLocator instance = new SLDSupportLocator(); |
|
17 |
|
|
18 |
/** |
|
19 |
* Return the singleton instance. |
|
20 |
* |
|
21 |
* @return the singleton instance |
|
22 |
*/ |
|
23 |
public static SLDSupportLocator getInstance() { |
|
24 |
return instance; |
|
25 |
} |
|
26 |
|
|
27 |
/** |
|
28 |
* Return a reference to the SLS support manager |
|
29 |
*/ |
|
30 |
public SLDSupportManager getSLDSupportManager() |
|
31 |
throws LocatorException { |
|
32 |
return (SLDSupportManager) getInstance().get(SLD_SUPPORT_MANAGER_NAME); |
|
33 |
} |
|
34 |
|
|
35 |
public void registerSLDSupportManager( |
|
36 |
Class<? extends SLDSupportManager> clazz) { |
|
37 |
|
|
38 |
getInstance().register( |
|
39 |
SLD_SUPPORT_MANAGER_NAME, |
|
40 |
SLD_SUPPORT_MANAGER_NAME_DESCRIPTION, |
|
41 |
clazz); |
|
42 |
} |
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/java/org/gvsig/sldsupport/SLDSupportLibrary.java | ||
---|---|---|
1 |
package org.gvsig.sldsupport; |
|
2 |
|
|
3 |
import org.gvsig.tools.library.AbstractLibrary; |
|
4 |
import org.gvsig.tools.library.LibraryException; |
|
5 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
6 |
|
|
7 |
public class SLDSupportLibrary extends AbstractLibrary { |
|
8 |
|
|
9 |
public void doRegistration() { |
|
10 |
registerAsAPI(SLDSupportLibrary.class); |
|
11 |
// require(MapContextLibrary.class); |
|
12 |
} |
|
13 |
|
|
14 |
protected void doInitialize() throws LibraryException { |
|
15 |
} |
|
16 |
|
|
17 |
protected void doPostInitialize() throws LibraryException { |
|
18 |
|
|
19 |
// Check that there is a SLD support manager |
|
20 |
SLDSupportManager mana = null; |
|
21 |
mana = SLDSupportLocator.getInstance().getSLDSupportManager(); |
|
22 |
if (mana == null) { |
|
23 |
throw new ReferenceNotRegisteredException( |
|
24 |
SLDSupportLocator.SLD_SUPPORT_MANAGER_NAME, |
|
25 |
SLDSupportLocator.getInstance()); |
|
26 |
} |
|
27 |
|
|
28 |
} |
|
29 |
|
|
30 |
} |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.symbology.SymbologyLibrary |
|
1 |
org.gvsig.sldsupport.SLDSupportLibrary |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/org.gvsig.sldsupport.lib/org.gvsig.sldsupport.lib.api/pom.xml | ||
---|---|---|
11 | 11 |
</parent> |
12 | 12 |
|
13 | 13 |
<dependencies> |
14 |
|
|
15 |
<dependency> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.symbology.lib.api</artifactId> |
|
18 |
<scope>compile</scope> |
|
19 |
</dependency> |
|
20 |
|
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.xmlpull.lib.api</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
14 | 26 |
|
15 | 27 |
<!-- |
16 | 28 |
<dependency> |
17 | 29 |
branches/v02_desarrollo/libraries/org.gvsig.sldsupport/pom.xml | ||
---|---|---|
12 | 12 |
<version>2.0.17-SNAPSHOT</version> |
13 | 13 |
</parent> |
14 | 14 |
|
15 |
|
|
16 |
<dependencyManagement> |
|
17 |
<dependencies> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.sldsupport.lib.api</artifactId> |
|
21 |
<version>2.0.17-SNAPSHOT</version> |
|
22 |
</dependency> |
|
23 |
|
|
24 |
<dependency> |
|
25 |
<groupId>org.gvsig</groupId> |
|
26 |
<artifactId>org.gvsig.xmlpull.lib.api</artifactId> |
|
27 |
<version>2.0.1-SNAPSHOT</version> |
|
28 |
</dependency> |
|
29 |
</dependencies> |
|
30 |
</dependencyManagement> |
|
31 |
|
|
32 |
|
|
15 | 33 |
<dependencies> |
16 | 34 |
|
17 |
<!-- |
|
18 | 35 |
<dependency> |
19 | 36 |
<groupId>org.gvsig</groupId> |
20 | 37 |
<artifactId>org.gvsig.tools.lib</artifactId> |
... | ... | |
25 | 42 |
<artifactId>org.gvsig.tools.lib</artifactId> |
26 | 43 |
<type>test-jar</type> |
27 | 44 |
</dependency> |
28 |
--> |
|
29 | 45 |
|
30 | 46 |
</dependencies> |
31 | 47 |
|
Also available in: Unified diff