/[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

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26