1 |
package skrueger.geotools; |
/******************************************************************************* |
2 |
|
* Copyright (c) 2009 Martin O. J. Schmitz. |
3 |
import org.geotools.styling.Style; |
* |
4 |
|
* This file is part of the SCHMITZM library - a collection of utility |
5 |
/** |
* classes based on Java 1.6, focussing (not only) on Java Swing |
6 |
* This class combines a Geotools visualisation {@link Style} with additional |
* and the Geotools library. |
7 |
* meta data needed for visualisation (for example legend data). |
* |
8 |
* The class {@code E} defines the type of the meta data. |
* The SCHMITZM project is hosted at: |
9 |
* @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany) |
* http://wald.intevation.org/projects/schmitzm/ |
10 |
* @version 1.0 |
* |
11 |
*/ |
* This program is free software; you can redistribute it and/or |
12 |
public class StyledLayerStyle<E> { |
* modify it under the terms of the GNU Lesser General Public License |
13 |
/** Holds the Geotools {@link Style} for the geo object visualisation. */ |
* as published by the Free Software Foundation; either version 3 |
14 |
protected Style geoObjectStyle = null; |
* of the License, or (at your option) any later version. |
15 |
/** Holds the additional meta data for object visualisation (for example |
* |
16 |
* legend information). */ |
* This program is distributed in the hope that it will be useful, |
17 |
protected E metaData = null; |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 |
/** |
* GNU General Public License for more details. |
20 |
* Creates a new style for a {@link StyledLayerInterface}. |
* |
21 |
* @param style Style |
* You should have received a copy of the GNU Lesser General Public License (license.txt) |
22 |
* @param metaData E |
* along with this program; if not, write to the Free Software |
23 |
*/ |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 |
public StyledLayerStyle(Style style, E metaData) { |
* or try this link: http://www.gnu.org/licenses/lgpl.html |
25 |
setGeoObjectStyle(style); |
* |
26 |
setMetaData(metaData); |
* Contributors: |
27 |
} |
* Martin O. J. Schmitz - initial API and implementation |
28 |
|
* Stefan A. Krüger - additional utility classes |
29 |
/** |
******************************************************************************/ |
30 |
* Returns the additional meta data needed for object visualisation. |
package skrueger.geotools; |
31 |
*/ |
|
32 |
public E getMetaData() { |
import org.geotools.styling.Style; |
33 |
return metaData; |
|
34 |
} |
/** |
35 |
|
* This class combines a Geotools visualisation {@link Style} with additional |
36 |
/** |
* meta data needed for visualisation (for example legend data). |
37 |
* Sets the additional meta data needed for object visualisation. |
* The class {@code E} defines the type of the meta data. |
38 |
* @param metaData the meta data |
* @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany) |
39 |
*/ |
* @version 1.0 |
40 |
public void setMetaData(E metaData) { |
*/ |
41 |
this.metaData = metaData; |
public class StyledLayerStyle<E> { |
42 |
} |
/** Holds the Geotools {@link Style} for the geo object visualisation. */ |
43 |
|
protected Style geoObjectStyle = null; |
44 |
/** |
/** Holds the additional meta data for object visualisation (for example |
45 |
* Returns the Geotools style for the object visualisation. |
* legend information). */ |
46 |
*/ |
protected E metaData = null; |
47 |
public Style getGeoObjectStyle() { |
|
48 |
return geoObjectStyle; |
/** |
49 |
} |
* Creates a new style for a {@link StyledLayerInterface}. |
50 |
|
* @param style Style |
51 |
/** |
* @param metaData E |
52 |
* Sets the Geotools style for the object visualisation. |
*/ |
53 |
* @param style a Geotools visualisation style |
public StyledLayerStyle(Style style, E metaData) { |
54 |
*/ |
setGeoObjectStyle(style); |
55 |
public void setGeoObjectStyle(Style style) { |
setMetaData(metaData); |
56 |
this.geoObjectStyle = style; |
} |
57 |
} |
|
58 |
} |
/** |
59 |
|
* Returns the additional meta data needed for object visualisation. |
60 |
|
*/ |
61 |
|
public E getMetaData() { |
62 |
|
return metaData; |
63 |
|
} |
64 |
|
|
65 |
|
/** |
66 |
|
* Sets the additional meta data needed for object visualisation. |
67 |
|
* @param metaData the meta data |
68 |
|
*/ |
69 |
|
public void setMetaData(E metaData) { |
70 |
|
this.metaData = metaData; |
71 |
|
} |
72 |
|
|
73 |
|
/** |
74 |
|
* Returns the Geotools style for the object visualisation. |
75 |
|
*/ |
76 |
|
public Style getGeoObjectStyle() { |
77 |
|
return geoObjectStyle; |
78 |
|
} |
79 |
|
|
80 |
|
/** |
81 |
|
* Sets the Geotools style for the object visualisation. |
82 |
|
* @param style a Geotools visualisation style |
83 |
|
*/ |
84 |
|
public void setGeoObjectStyle(Style style) { |
85 |
|
this.geoObjectStyle = style; |
86 |
|
} |
87 |
|
} |