Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / rendering / legend / IVectorLegend.java @ 35329

History | View | Annotate | Download (6.19 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.mapcontext.rendering.legend;
42

    
43
import java.awt.Graphics2D;
44
import java.awt.image.BufferedImage;
45
import java.util.Map;
46

    
47
import org.cresques.cts.ICoordTrans;
48

    
49
import org.gvsig.compat.print.PrintAttributes;
50
import org.gvsig.fmap.dal.feature.Feature;
51
import org.gvsig.fmap.dal.feature.FeatureQuery;
52
import org.gvsig.fmap.dal.feature.FeatureStore;
53
import org.gvsig.fmap.mapcontext.MapContextException;
54
import org.gvsig.fmap.mapcontext.ViewPort;
55
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
56
import org.gvsig.tools.task.Cancellable;
57

    
58

    
59

    
60
/**
61
 * Interface of a vectorial legend.
62
 *
63
 * @author Vicente Caballero Navarro
64
 */
65
public interface IVectorLegend extends ILegend, DrawingObservable {
66
        /**
67
         * Inserts the DataSource.
68
         *
69
         * @param ds DataSource.
70
         * @throws DataException TODO
71
         * @throws FieldNotFoundException when the field is not found.
72
         */
73
//        void setFeatureStore(FeatureStore fs)
74
//                throws DataException;
75

    
76
        /**
77
         * Returns the symbol to be used to represent the feature in the i-th
78
         * record in the DataSource
79
         * @param i, the record index
80
         *
81
         * @return ISymbol.
82
         */
83
//        ISymbol getSymbol(int i) throws ReadException;
84
        /**
85
     * Returns a symbol starting from an IFeature.
86
         *
87
         * TAKE CARE!! When we are using a feature iterator as a database
88
         * the only field that will be filled is the fieldID.
89
         * The rest of fields will be null to reduce the time of creation
90
         *
91
         * @param feat IFeature.
92
         *
93
         * @return S?mbolo.
94
         * @throws MapContextException 
95
         */
96
    ISymbol getSymbolByFeature(Feature feat) throws MapContextException;
97

    
98
        /**
99
         * Returns the type of the shape.
100
         *
101
         * @return Returns the type of the shapes that the legend is ready to use.
102
         *
103
         */
104
        int getShapeType();
105

    
106
        /**
107
         * Defines the type of the shape.
108
         *
109
         * @param shapeType type of the shape.
110
         */
111
        void setShapeType(int shapeType);
112

    
113
        /**
114
         * Establishes the default symbol of a legend. In a SingleSymbolLegend the symbol
115
         * is established by calling this method.
116
         *
117
         * @param s default symbol.
118
         */
119
        void setDefaultSymbol(ISymbol s);
120

    
121
        /**
122
     * Returns true or false depending on if the rest of values are used.
123
         *
124
         * @return  True if the rest of values are used.
125
         */
126
    public boolean isUseDefaultSymbol();
127

    
128
    void useDefaultSymbol(boolean b);
129

    
130
//   jjdc los eliminamos, y debe quedar dependiente de la implementacion y n de api
131
//   public ZSort getZSort();
132
//
133
//        public void setZSort(ZSort zSort);
134
//
135
        public boolean isSuitableForShapeType(int shapeType);
136

    
137
        /**
138
         * Draws the {@link FeatureStore} data using this legend simbology.
139
         * 
140
         * @param image
141
         *            the base image to draw over
142
         * @param graphics2D
143
         *            the {@link Graphics2D} to draw to
144
         * @param viewPort
145
         *            the ViewPort to use
146
         * @param cancel
147
         *            the {@link Cancellable} delegate object
148
         * @param scale
149
         *            the scale of the view
150
         * @param queryParameters
151
         *            the query parameters
152
         * @param coordTrans
153
         *            the transformation coordinates to use for reprojection
154
         * @param featureStore
155
         *                           {@link FeatureStore} to load the data to draw from
156
         * @throws LegendException
157
         */
158
        void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort,
159
                        Cancellable cancel, double scale, Map queryParameters,
160
                        ICoordTrans coordTrans, FeatureStore featureStore)
161
                        throws LegendException;
162
        
163
         /**
164
     * Draws the {@link FeatureStore} data using this legend simbology.
165
     * 
166
     * @param image
167
     *            the base image to draw over
168
     * @param graphics2D
169
     *            the {@link Graphics2D} to draw to
170
     * @param viewPort
171
     *            the ViewPort to use
172
     * @param cancel
173
     *            the {@link Cancellable} delegate object
174
     * @param scale
175
     *            the scale of the view
176
     * @param queryParameters
177
     *            the query parameters
178
     * @param coordTrans
179
     *            the transformation coordinates to use for reprojection
180
     * @param featureStore
181
     *            {@link FeatureStore} to load the data to draw from
182
     * @param featureQuery 
183
     *            the query used to filter the features.
184
     * @throws LegendException
185
     */
186
    void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort,
187
            Cancellable cancel, double scale, Map queryParameters,
188
            ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery)
189
            throws LegendException;
190

    
191
        void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
192
                        double scale, Map queryParameters, ICoordTrans coordTrans,
193
                        FeatureStore featureStore, PrintAttributes properties) throws LegendException;
194
        
195
        void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
196
        double scale, Map queryParameters, ICoordTrans coordTrans,
197
        FeatureStore featureStore, FeatureQuery featureQuery, PrintAttributes properties) throws LegendException;
198

    
199
}