svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / rendering / legend / IVectorLegend.java @ 43203
History | View | Annotate | Download (5.13 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
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 |
*
|
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 |
*
|
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.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.fmap.mapcontext.rendering.legend; |
24 |
|
25 |
import java.awt.Graphics2D; |
26 |
import java.awt.image.BufferedImage; |
27 |
import java.util.Map; |
28 |
|
29 |
import org.cresques.cts.ICoordTrans; |
30 |
|
31 |
import org.gvsig.compat.print.PrintAttributes; |
32 |
import org.gvsig.fmap.dal.feature.Feature; |
33 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
34 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
35 |
import org.gvsig.fmap.mapcontext.MapContextException; |
36 |
import org.gvsig.fmap.mapcontext.ViewPort; |
37 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
38 |
import org.gvsig.tools.task.Cancellable; |
39 |
|
40 |
/**
|
41 |
* Interface of a vectorial legend.
|
42 |
*
|
43 |
*/
|
44 |
public interface IVectorLegend extends ILegend, DrawingObservable { |
45 |
|
46 |
/**
|
47 |
* Obtains the default symbol of the legend.
|
48 |
*
|
49 |
* @return default symbol.
|
50 |
*/
|
51 |
@Override
|
52 |
ISymbol getDefaultSymbol(); |
53 |
|
54 |
/**
|
55 |
* Returns a symbol starting from an IFeature.
|
56 |
*
|
57 |
* @param feat IFeature.
|
58 |
*
|
59 |
* @return S?mbolo.
|
60 |
* @throws MapContextException
|
61 |
*/
|
62 |
ISymbol getSymbolByFeature(Feature feat) throws MapContextException;
|
63 |
|
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();
|
71 |
|
72 |
/**
|
73 |
* Defines the type of the shape.
|
74 |
*
|
75 |
* @param shapeType type of the shape.
|
76 |
*/
|
77 |
void setShapeType(int shapeType); |
78 |
|
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);
|
86 |
|
87 |
/**
|
88 |
* Returns true or false depending on if the rest of values are used.
|
89 |
*
|
90 |
* @return True if the rest of values are used.
|
91 |
*/
|
92 |
public boolean isUseDefaultSymbol(); |
93 |
|
94 |
void useDefaultSymbol(boolean b); |
95 |
|
96 |
public boolean isSuitableForShapeType(int shapeType); |
97 |
|
98 |
/**
|
99 |
* Draws the {@link FeatureStore} data using this legend simbology.
|
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
|
109 |
* @throws LegendException
|
110 |
*/
|
111 |
void draw(BufferedImage image, Graphics2D graphics2D, ViewPort viewPort, |
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, |
132 |
ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery) |
133 |
throws LegendException;
|
134 |
|
135 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
136 |
double scale, Map queryParameters, ICoordTrans coordTrans, |
137 |
FeatureStore featureStore, PrintAttributes properties) throws LegendException;
|
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 |
|
143 |
} |