/[schmitzm]/trunk/src/skrueger/geotools/StyledLayerInterface.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/StyledLayerInterface.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/skrueger/geotools/StyledMapInterface.java revision 2 by mojays, Tue Feb 24 22:43:52 2009 UTC trunk/src/skrueger/geotools/StyledLayerInterface.java revision 1203 by alfonx, Tue Nov 2 22:53:55 2010 UTC
# Line 1  Line 1 
1  package skrueger.geotools;  /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3  import java.net.URL;   *
4     * This file is part of the SCHMITZM library - a collection of utility
5  import javax.swing.ImageIcon;   * classes based on Java 1.6, focusing (not only) on Java Swing
6     * and the Geotools library.
7  import org.geotools.styling.Style;   *
8  import org.opengis.referencing.crs.CoordinateReferenceSystem;   * The SCHMITZM project is hosted at:
9     * http://wald.intevation.org/projects/schmitzm/
10  import skrueger.i8n.Translation;   *
11     * This program is free software; you can redistribute it and/or
12  import com.vividsolutions.jts.geom.Envelope;   * modify it under the terms of the GNU Lesser General Public License
13     * as published by the Free Software Foundation; either version 3
14  // fuer Doku   * of the License, or (at your option) any later version.
15  import org.geotools.feature.FeatureCollection;   *
16  import org.geotools.coverage.grid.GridCoverage2D;   * This program is distributed in the hope that it will be useful,
17  import skrueger.geotools.MapContextManagerInterface;   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  import skrueger.AttributeMetaData;   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  import skrueger.RasterLegendData;   * GNU General Public License for more details.
20     *
21  /**   * You should have received a copy of the GNU Lesser General Public License (license.txt)
22   * This class is the top interface for styled objects to be managed in   * along with this program; if not, write to the Free Software
23   * {@link MapContextManagerInterface}. The (rough) classe structure is the   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24   * following:   * or try this link: http://www.gnu.org/licenses/lgpl.html
25   * <ul>   *
26   * <li><b>{@link StyledMapInterface StyledMapInterface<E>}</b>   * Contributors:
27   * <ul>   *     Martin O. J. Schmitz - initial API and implementation
28   * <li>{@link #getId()} -> String</li>   *     Stefan A. Tzeggai - additional utility classes
29   * <li>{@link #getKeywords() get/setKeywords()} -> {@link Translation}</li>   ******************************************************************************/
30   * <li>{@link #getTitle() set/getTitle()} -> {@link Translation} (short  package skrueger.geotools;
31   * description for layer list)</li>  
32   * <li>{@link #getDesc() set/getDesc()} -> {@link Translation} (long  import java.net.URL;
33   * description for details)</li>  
34   * <li>{@link #getCrs()} -> {@link CoordinateReferenceSystem}</li>  import javax.swing.ImageIcon;
35   * <li>{@link #getCRSString()} -> String (readable description of CRS)</li>  
36   * <li>{@link #getEnvelope()} -> {@link Envelope} (JTS-Envelope)</li>  import org.geotools.feature.FeatureCollection;
37   * <li>{@link #getGeoObject()} -> E (GridCoverage/FeatureCollection/...)</li>  import org.geotools.geometry.jts.ReferencedEnvelope;
38   * <li>{@link #getStyle() set/getStyle()} -> {@link Style}</li>  import org.geotools.styling.Style;
39   * <li>{@link #isHideInLegend()} -> Boolean</li> *  import org.opengis.referencing.crs.CoordinateReferenceSystem;
40   * <li>{@link #uncache()}</li>  
41   * <li>{@link #dispose()}</li>  import skrueger.AttributeMetadataImpl;
42   * </ul>  import skrueger.RasterLegendData;
43   * </li>  import skrueger.i8n.Translation;
44   * <li><b>{@link StyledFeatureCollectionInterface} extends  
45   * {@link StyledMapInterface StyledMapInterface<FeatureCollection>}</b>  import com.vividsolutions.jts.geom.Envelope;
46   * <ul>  
47   * <li>{@link StyledFeatureCollectionInterface#getAttributeMetaDataMap()} ->  /**
48   * Map<Integer,AttributeMetaData></li>   * This class is the top interface for styled objects to be managed in
49   * </ul>   * {@link MapContextManagerInterface}. The (rough) classe structure is the
50   * </li>   * following:
51   * <li><b>{@link StyledRasterInterface} extends   * <ul>
52   * {@link StyledMapInterface StyledMapInterface<GridCoverage2D>}</b>   * <li><b>{@link StyledLayerInterface StyledLayerInterface<E>}</b>
53   * <ul>   * <ul>
54   * <li>{@link StyledRasterInterface#getLegendMetaData()} ->   * <li>{@link #getId()} -> String</li>
55   * {@link RasterLegendData}</li>   * <li>{@link #getKeywords() get/setKeywords()} -> {@link Translation}</li>
56   * </ul>   * <li>{@link #getTitle() set/getTitle()} -> {@link Translation} (short
57   * </li>   * description for layer list)</li>
58   * </ul>   * <li>{@link #getDesc() set/getDesc()} -> {@link Translation} (long description
59   * <br>   * for details)</li>
60   * <b>Restrictions:</b>   * <li>{@link #getCrs()} -> {@link CoordinateReferenceSystem}</li>
61   * <ul>   * <li>{@link #getCRSString()} -> String (readable description of CRS)</li>
62   * <li>layer list only depends on {@link StyledMapInterface}</li>   * <li>{@link #getEnvelope()} -> {@link Envelope} (JTS-Envelope)</li>
63   * <li>methods returning {@link Translation} must not return {@code null}</li>   * <li>{@link #getGeoObject()} -> E (GridCoverage/FeatureCollection/...)</li>
64   * <li>methods returning {@link AttributeMetaData}-Map must not return   * <li>{@link #getStyle() set/getStyle()} -> {@link Style}</li>
65   * {@code null}</li>   * <li>{@link #uncache()}</li>
66   * <li>static helper method to get a new {@link AttributeMetaData}-map withe   * <li>{@link #dispose()}</li>
67   * the visible attributes only</li>   * </ul>
68   * <li>static helper method to create a "default" {@link AttributeMetaData}-map   * </li>
69   * for a {@link FeatureCollection} with all attributes visible and without real   * <li><b>{@link StyledFeatureCollectionInterface} extends
70   * translations, but the attribute name as description.</li>   * {@link StyledLayerInterface StyledLayerInterface<FeatureCollection>}</b>
71   * </ul>   * <ul>
72   */   * <li>{@link StyledFeatureCollectionInterface#getAttributeMetaDataMap()} ->
73  public interface StyledMapInterface<E> {   * Map<Integer,AttributeMetaData></li>
74          public String getId();   * </ul>
75     * </li>
76          public Translation getTitle();   * <li><b>{@link StyledRasterInterface} extends {@link StyledLayerInterface
77     * StyledLayerInterface<GridCoverage2D>}</b>
78          public void setTitle(Translation title);   * <ul>
79     * <li>{@link StyledRasterInterface#getLegendMetaData()} ->
80          public Translation getDesc();   * {@link RasterLegendData}</li>
81     * </ul>
82          public void setDesc(Translation dec);   * </li>
83     * </ul>
84          public Translation getKeywords();   * <br>
85     * <b>Restrictions:</b>
86          public void setKeywords(Translation keywords);   * <ul>
87     * <li>layer list only depends on {@link StyledLayerInterface}</li>
88          public CoordinateReferenceSystem getCrs();   * <li>methods returning {@link Translation} must not return {@code null}</li>
89     * <li>methods returning {@link AttributeMetadataImpl}-Map must not return {@code
90          public String getCRSString();   * null}</li>
91     * <li>static helper method to get a new {@link AttributeMetadataImpl}-map withe the
92          public Envelope getEnvelope();   * visible attributes only</li>
93     * <li>static helper method to create a "default" {@link AttributeMetadataImpl}-map
94          /**   * for a {@link FeatureCollection} with all attributes visible and without real
95           * @return return an ImageIcon - <code>null</code> is valid and no icon or   * translations, but the attribute name as description.</li>
96           *         a default icon will then be shown   * </ul>
97           */   */
98          public ImageIcon getImageIcon();  public interface StyledLayerInterface<E> {
99            public String getId();
100          public void setImageIcon(ImageIcon icon);  
101            public Translation getTitle();
102          /**  
103           * Returns the underlying GeoTools Object          public void setTitle(Translation title);
104           *  
105           * @throws RuntimeException          public Translation getDesc();
106           */  
107          public E getGeoObject() throws Exception;          public void setDesc(Translation dec);
108    
109          public Style getStyle();          public Translation getKeywords();
110    
111          public void setStyle(Style style);          public void setKeywords(Translation keywords);
112    
113          /**          public CoordinateReferenceSystem getCrs();
114           * Returns the {@link URL} to a (HTML) file that provides more information  
115           * about this layer. If no HTML if associated with this          public String getCRSString();
116           * {@link StyledMapInterface}, then <code>null</code> will be returned.  
117           *          public Envelope getEnvelope();
118           * @return null or an {@link URL}  
119           */          /**
120          public URL getInfoURL();           * @return <code>null</code> is no CRS is available
121             */
122          /**          public ReferencedEnvelope getReferencedEnvelope();
123           * Should be called when this Object is not needed anymore.  
124           */  
125          public void dispose();          /**
126             * @return return an ImageIcon - <code>null</code> is valid and no icon or a
127          /** Is the object already disposed? * */           *         default icon will then be shown
128          public boolean isDisposed();           */
129            public ImageIcon getImageIcon();
130          /**  
131           * Clears any caches. For example the GeoObject could be released, and          public void setImageIcon(ImageIcon icon);
132           * reread on next call of getGeoObject()  
133           */          /**
134          public void uncache();           * Returns the underlying GeoTools Object
135             *
136          /**           * @throws RuntimeException
137           * If true, this layer will not be shown in the legend. Default = false           */
138           */          public E getGeoObject();
139          public boolean isHideInLegend();  
140  }          public Style getStyle();
141    
142            public void setStyle(Style style);
143    
144            /**
145             * Returns the {@link URL} to a (HTML) file that provides more information
146             * about this layer. If no HTML if associated with this
147             * {@link StyledLayerInterface}, then <code>null</code> will be returned.
148             *
149             * @return null or an {@link URL}
150             */
151            public URL getInfoURL();
152            
153            /**
154             * Should be called when this Object is not needed anymore.
155             */
156            public void dispose();
157    
158            /** Is the object already disposed? * */
159            public boolean isDisposed();
160    
161            /**
162             * Clears any caches. For example the GeoObject could be released, and
163             * reread on next call of getGeoObject()
164             */
165            public void uncache();
166    //      public String getLegendHtml();
167    }

Legend:
Removed from v.2  
changed lines
  Added in v.1203

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26