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

Legend:
Removed from v.208  
changed lines
  Added in v.256

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26