root / branches / v2_0_0_prep / libraries / libFMap_controls / src / org / gvsig / fmap / mapcontrol / MapControlDrawer.java @ 38626
History | View | Annotate | Download (5.82 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 2
|
9 |
* of the License, or (at your option) any later version.
|
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.
|
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.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2009 {Iver T.I.} {Task}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.fmap.mapcontrol; |
29 |
|
30 |
import java.awt.Color; |
31 |
import java.awt.Composite; |
32 |
import java.awt.Image; |
33 |
import java.awt.RenderingHints; |
34 |
import java.awt.Stroke; |
35 |
import java.awt.geom.AffineTransform; |
36 |
import java.awt.geom.Point2D; |
37 |
|
38 |
import org.gvsig.fmap.geom.Geometry; |
39 |
import org.gvsig.fmap.geom.handler.Handler; |
40 |
import org.gvsig.fmap.mapcontext.ViewPort; |
41 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
42 |
|
43 |
/**
|
44 |
* <p>
|
45 |
* Represents a class that can write objects in a map like a raster image, a
|
46 |
* {@link Geometry} or other graphical objects. This class doesn't depend of the
|
47 |
* dimension of the map (2D or 3D).
|
48 |
* </p>
|
49 |
* <p>
|
50 |
* The Map Control has to have an instance of this class that can be accessed
|
51 |
* using the {@link MapControl#getMapControlDrawer()} method. When a Map Control
|
52 |
* is created some tools are added to this component using the
|
53 |
* {@link MapControl#addBehavior(String, org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior)}
|
54 |
* method. Some of these tools need to draw some objects in the map and they use
|
55 |
* the MapControlDrawer class to do that.
|
56 |
* </p>
|
57 |
*
|
58 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
59 |
*/
|
60 |
public interface MapControlDrawer extends PrimitivesDrawer { |
61 |
|
62 |
/**
|
63 |
* The <code>ViewPort</code> is used to transform the map
|
64 |
* coordinates in the screen coordinates.
|
65 |
*
|
66 |
* @param viewPort
|
67 |
* The <code>ViewPort</code>
|
68 |
*/
|
69 |
public void setViewPort(ViewPort viewPort); |
70 |
|
71 |
/**
|
72 |
* It draws a <code>Geometry</code> on the map using the color
|
73 |
* specified using the {@link #setColor(Color)} method.
|
74 |
*
|
75 |
* @param geometry
|
76 |
* The <code>Geometry</code> to draw.
|
77 |
*/
|
78 |
public void draw(Geometry geometry); |
79 |
|
80 |
/**
|
81 |
* It draws a <code>Geometry</code> on the map using a concrete
|
82 |
* symbol.
|
83 |
*
|
84 |
* @param geometry
|
85 |
* The <code>Geometry</code> to draw.
|
86 |
* @param symbol
|
87 |
* The symbol used to draw the geometry.
|
88 |
*/
|
89 |
public void draw(Geometry geometry, ISymbol symbol); |
90 |
|
91 |
/**
|
92 |
* It draws the <code>Handler</code>'s that compose a geometry
|
93 |
* on the map.
|
94 |
*
|
95 |
* @param handlers
|
96 |
* An array of <code>Handler</code>'s.
|
97 |
* @param at
|
98 |
* A transformation that has to be applied to the
|
99 |
* <code>Handler</code>'s.
|
100 |
* @param symbol
|
101 |
* The symbol used to draw the handlers.
|
102 |
*/
|
103 |
public void drawHandlers(Handler[] handlers, AffineTransform at, |
104 |
ISymbol symbol); |
105 |
|
106 |
/**
|
107 |
* It draws a line using a concrete symbol.
|
108 |
*
|
109 |
* @param firstPoint
|
110 |
* The first point of the line.
|
111 |
* @param endPoint
|
112 |
* The end point of the line.
|
113 |
* @param symbol
|
114 |
* The symbol used to draw the line.
|
115 |
*/
|
116 |
public void drawLine(Point2D firstPoint, Point2D endPoint, ISymbol symbol); |
117 |
|
118 |
/**
|
119 |
* It draws an image on a map in a concrete position.
|
120 |
*
|
121 |
* @param img
|
122 |
* The image to draw.
|
123 |
* @param x
|
124 |
* The X coordinate,
|
125 |
* @param y
|
126 |
* The Y coordinate.
|
127 |
*/
|
128 |
public void drawImage(Image img, int x, int y); |
129 |
|
130 |
/**
|
131 |
* It draws image, applying a transform from image space
|
132 |
* into user space before drawing.
|
133 |
*
|
134 |
* @param img
|
135 |
* The image to draw.
|
136 |
* @param xform
|
137 |
* The transform to apply.
|
138 |
*/
|
139 |
public void drawImage(Image img, AffineTransform xform); |
140 |
|
141 |
/**
|
142 |
* It draws a <code>Handler</code> on the map.
|
143 |
*
|
144 |
* @param handler
|
145 |
* The <code>Handler</code> to draw.
|
146 |
* @param at
|
147 |
* A transformation that has to be applied to the
|
148 |
* <code>Handler</code>.
|
149 |
*/
|
150 |
public void drawHandler(Handler handler, AffineTransform at); |
151 |
|
152 |
/**
|
153 |
* @param at
|
154 |
*/
|
155 |
public void transform(AffineTransform at); |
156 |
|
157 |
/**
|
158 |
* @param instance
|
159 |
*/
|
160 |
public void setComposite(Composite instance); |
161 |
|
162 |
/**
|
163 |
* Replaces the values of all preferences for the rendering algorithms with the specified hints. The existing
|
164 |
* values for all rendering hints are discarded and the new set of known hints and values are initialized
|
165 |
* from the specified Map object. Hint categories include controls for rendering quality and overall time/
|
166 |
* quality trade-off in the rendering process. Refer to the RenderingHints class for definitions of some
|
167 |
* common keys and values.
|
168 |
* @param hints the rendering hints to be set
|
169 |
*/
|
170 |
public void setRenderingHints(RenderingHints hints); |
171 |
|
172 |
/**
|
173 |
* Sets the Stroke for the Graphics2D context.
|
174 |
* @param stroke the Stroke object to be used to stroke a Shape during the rendering
|
175 |
*/
|
176 |
public void setStroke(Stroke stroke); |
177 |
|
178 |
/**
|
179 |
* Cleans the graphics using the image of the MapControl
|
180 |
* @param mapCtrl
|
181 |
*/
|
182 |
public void cleanCanvas(MapControl mapCtrl); |
183 |
|
184 |
} |