Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.fmap.control / src / main / java / org / gvsig / fmap / mapcontrol / MapControlDrawer.java @ 40867

History | View | Annotate | Download (5.86 KB)

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