/[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 40 by alfonx, Mon Apr 6 19:31:02 2009 UTC trunk/src/skrueger/geotools/StyledLayerInterface.java revision 244 by alfonx, Wed Jul 29 09:33:33 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, focussing (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. Krüger - 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 description  import java.net.URL;
33   * 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.styling.Style;
38   * <li>{@link #getStyle() set/getStyle()} -> {@link Style}</li>  import org.opengis.referencing.crs.CoordinateReferenceSystem;
39   * <li>{@link #uncache()}</li>  
40   * <li>{@link #dispose()}</li>  import skrueger.AttributeMetaData;
41   * </ul>  import skrueger.RasterLegendData;
42   * </li>  import skrueger.i8n.Translation;
43   * <li><b>{@link StyledFeatureCollectionInterface} extends  
44   * {@link StyledMapInterface StyledMapInterface<FeatureCollection>}</b>  import com.vividsolutions.jts.geom.Envelope;
45   * <ul>  
46   * <li>{@link StyledFeatureCollectionInterface#getAttributeMetaDataMap()} ->  /**
47   * Map<Integer,AttributeMetaData></li>   * 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>   * following:
50   * <li><b>{@link StyledRasterInterface} extends {@link StyledMapInterface   * <ul>
51   * StyledMapInterface<GridCoverage2D>}</b>   * <li><b>{@link StyledLayerInterface StyledLayerInterface<E>}</b>
52   * <ul>   * <ul>
53   * <li>{@link StyledRasterInterface#getLegendMetaData()} ->   * <li>{@link #getId()} -> String</li>
54   * {@link RasterLegendData}</li>   * <li>{@link #getKeywords() get/setKeywords()} -> {@link Translation}</li>
55   * </ul>   * <li>{@link #getTitle() set/getTitle()} -> {@link Translation} (short
56   * </li>   * description for layer list)</li>
57   * </ul>   * <li>{@link #getDesc() set/getDesc()} -> {@link Translation} (long description
58   * <br>   * for details)</li>
59   * <b>Restrictions:</b>   * <li>{@link #getCrs()} -> {@link CoordinateReferenceSystem}</li>
60   * <ul>   * <li>{@link #getCRSString()} -> String (readable description of CRS)</li>
61   * <li>layer list only depends on {@link StyledMapInterface}</li>   * <li>{@link #getEnvelope()} -> {@link Envelope} (JTS-Envelope)</li>
62   * <li>methods returning {@link Translation} must not return {@code null}</li>   * <li>{@link #getGeoObject()} -> E (GridCoverage/FeatureCollection/...)</li>
63   * <li>methods returning {@link AttributeMetaData}-Map must not return {@code   * <li>{@link #getStyle() set/getStyle()} -> {@link Style}</li>
64   * null}</li>   * <li>{@link #uncache()}</li>
65   * <li>static helper method to get a new {@link AttributeMetaData}-map withe the   * <li>{@link #dispose()}</li>
66   * visible attributes only</li>   * </ul>
67   * <li>static helper method to create a "default" {@link AttributeMetaData}-map   * </li>
68   * for a {@link FeatureCollection} with all attributes visible and without real   * <li><b>{@link StyledFeatureCollectionInterface} extends
69   * translations, but the attribute name as description.</li>   * {@link StyledLayerInterface StyledLayerInterface<FeatureCollection>}</b>
70   * </ul>   * <ul>
71   */   * <li>{@link StyledFeatureCollectionInterface#getAttributeMetaDataMap()} ->
72  public interface StyledMapInterface<E> {   * Map<Integer,AttributeMetaData></li>
73          public String getId();   * </ul>
74     * </li>
75          public Translation getTitle();   * <li><b>{@link StyledRasterInterface} extends {@link StyledLayerInterface
76     * StyledLayerInterface<GridCoverage2D>}</b>
77          public void setTitle(Translation title);   * <ul>
78     * <li>{@link StyledRasterInterface#getLegendMetaData()} ->
79          public Translation getDesc();   * {@link RasterLegendData}</li>
80     * </ul>
81          public void setDesc(Translation dec);   * </li>
82     * </ul>
83          public Translation getKeywords();   * <br>
84     * <b>Restrictions:</b>
85          public void setKeywords(Translation keywords);   * <ul>
86     * <li>layer list only depends on {@link StyledLayerInterface}</li>
87          public CoordinateReferenceSystem getCrs();   * <li>methods returning {@link Translation} must not return {@code null}</li>
88     * <li>methods returning {@link AttributeMetaData}-Map must not return {@code
89          public String getCRSString();   * null}</li>
90     * <li>static helper method to get a new {@link AttributeMetaData}-map withe the
91          public Envelope getEnvelope();   * visible attributes only</li>
92     * <li>static helper method to create a "default" {@link AttributeMetaData}-map
93          /**   * for a {@link FeatureCollection} with all attributes visible and without real
94           * @return return an ImageIcon - <code>null</code> is valid and no icon or a   * translations, but the attribute name as description.</li>
95           *         default icon will then be shown   * </ul>
96           */   */
97          public ImageIcon getImageIcon();  public interface StyledLayerInterface<E> {
98            public String getId();
99          public void setImageIcon(ImageIcon icon);  
100            public Translation getTitle();
101          /**  
102           * Returns the underlying GeoTools Object          public void setTitle(Translation title);
103           *  
104           * @throws RuntimeException          public Translation getDesc();
105           */  
106          public E getGeoObject() throws Exception;          public void setDesc(Translation dec);
107    
108          public Style getStyle();          public Translation getKeywords();
109    
110          public void setStyle(Style style);          public void setKeywords(Translation keywords);
111    
112          /**          public CoordinateReferenceSystem getCrs();
113           * Returns the {@link URL} to a (HTML) file that provides more information  
114           * about this layer. If no HTML if associated with this          public String getCRSString();
115           * {@link StyledMapInterface}, then <code>null</code> will be returned.  
116           *          public Envelope getEnvelope();
117           * @return null or an {@link URL}  
118           */          /**
119          public URL getInfoURL();           * @return return an ImageIcon - <code>null</code> is valid and no icon or a
120             *         default icon will then be shown
121          /**           */
122           * Should be called when this Object is not needed anymore.          public ImageIcon getImageIcon();
123           */  
124          public void dispose();          public void setImageIcon(ImageIcon icon);
125    
126          /** Is the object already disposed? * */          /**
127          public boolean isDisposed();           * Returns the underlying GeoTools Object
128             *
129          /**           * @throws RuntimeException
130           * Clears any caches. For example the GeoObject could be released, and           */
131           * reread on next call of getGeoObject()          public E getGeoObject();
132           */  
133          public void uncache();          public Style getStyle();
134    
135          /**          public void setStyle(Style style);
136           * If true, this layer will not be shown in the legend. Default = false  
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           * Killed by SK: 6. April 09: Ein Layer soll nicht generell auf           * {@link StyledLayerInterface}, then <code>null</code> will be returned.
141           * verstecken/nicht verstecken gestellt werden können. Das sind           *
142           * Eigenschaften der Karte/MapContext, ebenso wie die Reihenfolge der Layer.           * @return null or an {@link URL}
143           * Im Atlas verwaltet deshalb nun die Klasse skrueger.atlas.Map welche Layer           */
144           * nicht in der Legende auftauchen sollen. Meines Wissens hat keiner bisher          public URL getInfoURL();
145           * die Funktion genutzt.  
146           *          /**
147           * public boolean isHideInLegend();           * 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.40  
changed lines
  Added in v.244

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26