/[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 1228 by alfonx, Wed Nov 3 20:44:16 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.AttributeMetadataInterface;
43   * Map<Integer,AttributeMetaData></li>  import skrueger.RasterLegendData;
44   * </ul>  import skrueger.i8n.Translation;
45   * </li>  
46   * <li><b>{@link StyledRasterInterface} extends {@link StyledLayerInterface  import com.vividsolutions.jts.geom.Envelope;
47   * StyledLayerInterface<GridCoverage2D>}</b>  
48   * <ul>  /**
49   * <li>{@link StyledRasterInterface#getLegendMetaData()} ->   * This class is the top interface for styled objects to be managed in
50   * {@link RasterLegendData}</li>   * {@link MapContextManagerInterface}. The (rough) classe structure is the
51   * </ul>   * following:
52   * </li>   * <ul>
53   * </ul>   * <li><b>{@link StyledLayerInterface StyledLayerInterface<E>}</b>
54   * <br>   * <ul>
55   * <b>Restrictions:</b>   * <li>{@link #getId()} -> String</li>
56   * <ul>   * <li>{@link #getKeywords() get/setKeywords()} -> {@link Translation}</li>
57   * <li>layer list only depends on {@link StyledLayerInterface}</li>   * <li>{@link #getTitle() set/getTitle()} -> {@link Translation} (short
58   * <li>methods returning {@link Translation} must not return {@code null}</li>   * description for layer list)</li>
59   * <li>methods returning {@link AttributeMetaData}-Map must not return {@code   * <li>{@link #getDesc() set/getDesc()} -> {@link Translation} (long description
60   * null}</li>   * for details)</li>
61   * <li>static helper method to get a new {@link AttributeMetaData}-map withe the   * <li>{@link #getCrs()} -> {@link CoordinateReferenceSystem}</li>
62   * visible attributes only</li>   * <li>{@link #getCRSString()} -> String (readable description of CRS)</li>
63   * <li>static helper method to create a "default" {@link AttributeMetaData}-map   * <li>{@link #getEnvelope()} -> {@link Envelope} (JTS-Envelope)</li>
64   * for a {@link FeatureCollection} with all attributes visible and without real   * <li>{@link #getGeoObject()} -> E (GridCoverage/FeatureCollection/...)</li>
65   * translations, but the attribute name as description.</li>   * <li>{@link #getStyle() set/getStyle()} -> {@link Style}</li>
66   * </ul>   * <li>{@link #uncache()}</li>
67   */   * <li>{@link #dispose()}</li>
68  public interface StyledLayerInterface<E> {   * </ul>
69          public String getId();   * </li>
70     * <li><b>{@link StyledFeatureCollectionInterface} extends
71          public Translation getTitle();   * {@link StyledLayerInterface StyledLayerInterface<FeatureCollection>}</b>
72     * <ul>
73          public void setTitle(Translation title);   * <li>{@link StyledFeatureCollectionInterface#getAttributeMetaDataMap()} ->
74     * Map<Integer,AttributeMetaData></li>
75          public Translation getDesc();   * </ul>
76     * </li>
77          public void setDesc(Translation dec);   * <li><b>{@link StyledRasterInterface} extends {@link StyledLayerInterface
78     * StyledLayerInterface<GridCoverage2D>}</b>
79          public Translation getKeywords();   * <ul>
80     * <li>{@link StyledRasterInterface#getLegendMetaData()} ->
81          public void setKeywords(Translation keywords);   * {@link RasterLegendData}</li>
82     * </ul>
83          public CoordinateReferenceSystem getCrs();   * </li>
84     * </ul>
85          public String getCRSString();   * <br>
86     * <b>Restrictions:</b>
87          public Envelope getEnvelope();   * <ul>
88     * <li>layer list only depends on {@link StyledLayerInterface}</li>
89          /**   * <li>methods returning {@link Translation} must not return {@code null}</li>
90           * @return return an ImageIcon - <code>null</code> is valid and no icon or a   * <li>methods returning {@link AttributeMetadataInterface}-Map must not return {@code
91           *         default icon will then be shown   * null}</li>
92           */   * <li>static helper method to get a new {@link AttributeMetadataImpl}-map with the
93          public ImageIcon getImageIcon();   * visible attributes only</li>
94     * <li>static helper method to create a "default" {@link AttributeMetadataImpl}-map
95          public void setImageIcon(ImageIcon icon);   * for a {@link FeatureCollection} with all attributes visible and without real
96     * translations, but the attribute name as description.</li>
97          /**   * </ul>
98           * Returns the underlying GeoTools Object   */
99           *  public interface StyledLayerInterface<E> {
100           * @throws RuntimeException          public String getId();
101           */  
102          public E getGeoObject();          public Translation getTitle();
103    
104          public Style getStyle();          public void setTitle(Translation title);
105    
106          public void setStyle(Style style);          public Translation getDesc();
107    
108          /**          public void setDesc(Translation dec);
109           * Returns the {@link URL} to a (HTML) file that provides more information  
110           * about this layer. If no HTML if associated with this          public Translation getKeywords();
111           * {@link StyledLayerInterface}, then <code>null</code> will be returned.  
112           *          public void setKeywords(Translation keywords);
113           * @return null or an {@link URL}  
114           */          public CoordinateReferenceSystem getCrs();
115          public URL getInfoURL();  
116            public String getCRSString();
117          /**  
118           * Should be called when this Object is not needed anymore.          public Envelope getEnvelope();
119           */  
120          public void dispose();          /**
121             * @return <code>null</code> is no CRS is available
122          /** Is the object already disposed? * */           */
123          public boolean isDisposed();          public ReferencedEnvelope getReferencedEnvelope();
124    
125          /**  
126           * Clears any caches. For example the GeoObject could be released, and          /**
127           * reread on next call of getGeoObject()           * @return return an ImageIcon - <code>null</code> is valid and no icon or a
128           */           *         default icon will then be shown
129          public void uncache();           */
130            public ImageIcon getImageIcon();
131    
132  }          public void setImageIcon(ImageIcon icon);
133    
134            /**
135             * Returns the underlying GeoTools Object
136             *
137             * @throws RuntimeException
138             */
139            public E getGeoObject();
140    
141            public Style getStyle();
142    
143            public void setStyle(Style style);
144    
145            /**
146             * Returns the {@link URL} to a (HTML) file that provides more information
147             * about this layer. If no HTML if associated with this
148             * {@link StyledLayerInterface}, then <code>null</code> will be returned.
149             *
150             * @return null or an {@link URL}
151             */
152            public URL getInfoURL();
153            
154            /**
155             * Should be called when this Object is not needed anymore.
156             */
157            public void dispose();
158    
159            /** Is the object already disposed? * */
160            public boolean isDisposed();
161    
162            /**
163             * Clears any caches. For example the GeoObject could be released, and
164             * reread on next call of getGeoObject()
165             */
166            public void uncache();
167    //      public String getLegendHtml();
168    }

Legend:
Removed from v.224  
changed lines
  Added in v.1228

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26