3 |
3 |
*
|
4 |
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
5 |
*
|
6 |
|
* This program is free software; you can redistribute it and/or
|
7 |
|
* modify it under the terms of the GNU General Public License
|
8 |
|
* as published by the Free Software Foundation; either version 3
|
9 |
|
* of the License, or (at your option) any later version.
|
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
|
9 |
* version.
|
10 |
10 |
*
|
11 |
|
* This program is distributed in the hope that it will be useful,
|
12 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
* GNU General Public License for more details.
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
14 |
* details.
|
15 |
15 |
*
|
16 |
|
* You should have received a copy of the GNU General Public License
|
17 |
|
* along with this program; if not, write to the Free Software
|
18 |
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
|
* MA 02110-1301, USA.
|
|
16 |
* You should have received a copy of the GNU General Public License along with
|
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20 |
19 |
*
|
21 |
|
* For any additional information, do not hesitate to contact us
|
22 |
|
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
23 |
22 |
*/
|
24 |
23 |
package org.gvsig.fmap.mapcontext.rendering.legend;
|
25 |
24 |
|
... | ... | |
38 |
37 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
|
39 |
38 |
import org.gvsig.tools.task.Cancellable;
|
40 |
39 |
|
41 |
|
|
42 |
|
|
43 |
40 |
/**
|
44 |
41 |
* Interface of a vectorial legend.
|
45 |
42 |
*
|
46 |
|
* @author Vicente Caballero Navarro
|
47 |
43 |
*/
|
48 |
44 |
public interface IVectorLegend extends ILegend, DrawingObservable {
|
49 |
|
/**
|
50 |
|
* Inserts the DataSource.
|
51 |
|
*
|
52 |
|
* @param ds DataSource.
|
53 |
|
* @throws DataException TODO
|
54 |
|
* @throws FieldNotFoundException when the field is not found.
|
55 |
|
*/
|
56 |
|
// void setFeatureStore(FeatureStore fs)
|
57 |
|
// throws DataException;
|
58 |
45 |
|
59 |
|
/**
|
60 |
|
* Returns the symbol to be used to represent the feature in the i-th
|
61 |
|
* record in the DataSource
|
62 |
|
* @param i, the record index
|
63 |
|
*
|
64 |
|
* @return ISymbol.
|
65 |
|
*/
|
66 |
|
// ISymbol getSymbol(int i) throws ReadException;
|
67 |
|
/**
|
|
46 |
/**
|
|
47 |
* Obtains the default symbol of the legend.
|
|
48 |
*
|
|
49 |
* @return default symbol.
|
|
50 |
*/
|
|
51 |
@Override
|
|
52 |
ISymbol getDefaultSymbol();
|
|
53 |
|
|
54 |
/**
|
68 |
55 |
* Returns a symbol starting from an IFeature.
|
69 |
|
*
|
70 |
|
* TAKE CARE!! When we are using a feature iterator as a database
|
71 |
|
* the only field that will be filled is the fieldID.
|
72 |
|
* The rest of fields will be null to reduce the time of creation
|
73 |
|
*
|
74 |
|
* @param feat IFeature.
|
75 |
|
*
|
76 |
|
* @return S?mbolo.
|
77 |
|
* @throws MapContextException
|
78 |
|
*/
|
|
56 |
*
|
|
57 |
* @param feat IFeature.
|
|
58 |
*
|
|
59 |
* @return S?mbolo.
|
|
60 |
* @throws MapContextException
|
|
61 |
*/
|
79 |
62 |
ISymbol getSymbolByFeature(Feature feat) throws MapContextException;
|
80 |
63 |
|
81 |
|
/**
|
82 |
|
* Returns the type of the shape.
|
83 |
|
*
|
84 |
|
* @return Returns the type of the shapes that the legend is ready to use.
|
85 |
|
*
|
86 |
|
*/
|
87 |
|
int getShapeType();
|
|
64 |
/**
|
|
65 |
* Returns the type of the shape.
|
|
66 |
*
|
|
67 |
* @return Returns the type of the shapes that the legend is ready to use.
|
|
68 |
*
|
|
69 |
*/
|
|
70 |
int getShapeType();
|
88 |
71 |
|
89 |
|
/**
|
90 |
|
* Defines the type of the shape.
|
91 |
|
*
|
92 |
|
* @param shapeType type of the shape.
|
93 |
|
*/
|
94 |
|
void setShapeType(int shapeType);
|
|
72 |
/**
|
|
73 |
* Defines the type of the shape.
|
|
74 |
*
|
|
75 |
* @param shapeType type of the shape.
|
|
76 |
*/
|
|
77 |
void setShapeType(int shapeType);
|
95 |
78 |
|
96 |
|
/**
|
97 |
|
* Establishes the default symbol of a legend. In a SingleSymbolLegend the symbol
|
98 |
|
* is established by calling this method.
|
99 |
|
*
|
100 |
|
* @param s default symbol.
|
101 |
|
*/
|
102 |
|
void setDefaultSymbol(ISymbol s);
|
|
79 |
/**
|
|
80 |
* Establishes the default symbol of a legend. In a SingleSymbolLegend the
|
|
81 |
* symbol is established by calling this method.
|
|
82 |
*
|
|
83 |
* @param s default symbol.
|
|
84 |
*/
|
|
85 |
void setDefaultSymbol(ISymbol s);
|
103 |
86 |
|
104 |
|
/**
|
|
87 |
/**
|
105 |
88 |
* Returns true or false depending on if the rest of values are used.
|
106 |
|
*
|
107 |
|
* @return True if the rest of values are used.
|
108 |
|
*/
|
|
89 |
*
|
|
90 |
* @return True if the rest of values are used.
|
|
91 |
*/
|
109 |
92 |
public boolean isUseDefaultSymbol();
|
110 |
93 |
|
111 |
94 |
void useDefaultSymbol(boolean b);
|
112 |
95 |
|
113 |
|
// jjdc los eliminamos, y debe quedar dependiente de la implementacion y n de api
|
114 |
|
// public ZSort getZSort();
|
115 |
|
//
|
116 |
|
// public void setZSort(ZSort zSort);
|
117 |
|
//
|
118 |
|
public boolean isSuitableForShapeType(int shapeType);
|
|
96 |
public boolean isSuitableForShapeType(int shapeType);
|
119 |
97 |
|
120 |
|
/**
|
121 |
|
* Draws the {@link FeatureStore} data using this legend simbology.
|
122 |
|
*
|
123 |
|
* @param image
|
124 |
|
* the base image to draw over
|
125 |
|
* @param graphics2D
|
126 |
|
* the {@link Graphics2D} to draw to
|
127 |
|
* @param viewPort
|
128 |
|
* the ViewPort to use
|
129 |
|
* @param cancel
|
130 |
|
* the {@link Cancellable} delegate object
|
131 |
|
* @param scale
|
132 |
|
* the scale of the view
|
133 |
|
* @param queryParameters
|
134 |
|
* the query parameters
|
135 |
|
* @param coordTrans
|
136 |
|
* the transformation coordinates to use for reprojection
|
137 |
|
* @param featureStore
|
138 |
|
* {@link FeatureStore} to load the data to draw from
|
139 |
|
* @throws LegendException
|
140 |
|
*/
|
141 |
|
void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort,
|
142 |
|
Cancellable cancel, double scale, Map queryParameters,
|
143 |
|
ICoordTrans coordTrans, FeatureStore featureStore)
|
144 |
|
throws LegendException;
|
145 |
|
|
146 |
|
/**
|
|
98 |
/**
|
147 |
99 |
* Draws the {@link FeatureStore} data using this legend simbology.
|
148 |
|
*
|
149 |
|
* @param image
|
150 |
|
* the base image to draw over
|
151 |
|
* @param graphics2D
|
152 |
|
* the {@link Graphics2D} to draw to
|
153 |
|
* @param viewPort
|
154 |
|
* the ViewPort to use
|
155 |
|
* @param cancel
|
156 |
|
* the {@link Cancellable} delegate object
|
157 |
|
* @param scale
|
158 |
|
* the scale of the view
|
159 |
|
* @param queryParameters
|
160 |
|
* the query parameters
|
161 |
|
* @param coordTrans
|
162 |
|
* the transformation coordinates to use for reprojection
|
163 |
|
* @param featureStore
|
164 |
|
* {@link FeatureStore} to load the data to draw from
|
165 |
|
* @param featureQuery
|
166 |
|
* the query used to filter the features.
|
|
100 |
*
|
|
101 |
* @param image the base image to draw over
|
|
102 |
* @param graphics2D the {@link Graphics2D} to draw to
|
|
103 |
* @param viewPort the ViewPort to use
|
|
104 |
* @param cancel the {@link Cancellable} delegate object
|
|
105 |
* @param scale the scale of the view
|
|
106 |
* @param queryParameters the query parameters
|
|
107 |
* @param coordTrans the transformation coordinates to use for reprojection
|
|
108 |
* @param featureStore {@link FeatureStore} to load the data to draw from
|
167 |
109 |
* @throws LegendException
|
168 |
110 |
*/
|
169 |
111 |
void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort,
|
170 |
112 |
Cancellable cancel, double scale, Map queryParameters,
|
|
113 |
ICoordTrans coordTrans, FeatureStore featureStore)
|
|
114 |
throws LegendException;
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Draws the {@link FeatureStore} data using this legend simbology.
|
|
118 |
*
|
|
119 |
* @param image the base image to draw over
|
|
120 |
* @param graphics2D the {@link Graphics2D} to draw to
|
|
121 |
* @param viewPort the ViewPort to use
|
|
122 |
* @param cancel the {@link Cancellable} delegate object
|
|
123 |
* @param scale the scale of the view
|
|
124 |
* @param queryParameters the query parameters
|
|
125 |
* @param coordTrans the transformation coordinates to use for reprojection
|
|
126 |
* @param featureStore {@link FeatureStore} to load the data to draw from
|
|
127 |
* @param featureQuery the query used to filter the features.
|
|
128 |
* @throws LegendException
|
|
129 |
*/
|
|
130 |
void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort,
|
|
131 |
Cancellable cancel, double scale, Map queryParameters,
|
171 |
132 |
ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery)
|
172 |
133 |
throws LegendException;
|
173 |
134 |
|
174 |
|
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
|
175 |
|
double scale, Map queryParameters, ICoordTrans coordTrans,
|
176 |
|
FeatureStore featureStore, PrintAttributes properties) throws LegendException;
|
177 |
|
|
178 |
|
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
|
179 |
|
double scale, Map queryParameters, ICoordTrans coordTrans,
|
180 |
|
FeatureStore featureStore, FeatureQuery featureQuery, PrintAttributes properties) throws LegendException;
|
|
135 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
|
|
136 |
double scale, Map queryParameters, ICoordTrans coordTrans,
|
|
137 |
FeatureStore featureStore, PrintAttributes properties) throws LegendException;
|
181 |
138 |
|
|
139 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
|
|
140 |
double scale, Map queryParameters, ICoordTrans coordTrans,
|
|
141 |
FeatureStore featureStore, FeatureQuery featureQuery, PrintAttributes properties) throws LegendException;
|
|
142 |
|
182 |
143 |
}
|