Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_controls / src / org / gvsig / fmap / mapcontrol / MapControlDrawer.java @ 38605

History | View | Annotate | Download (4.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.geom.AffineTransform;
34
import java.awt.geom.Point2D;
35

    
36
import org.gvsig.fmap.geom.Geometry;
37
import org.gvsig.fmap.geom.handler.Handler;
38
import org.gvsig.fmap.mapcontext.ViewPort;
39
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
40

    
41
/**
42
 * <p>
43
 * Represents a class that can write objects in a map like a raster image, a
44
 * {@link Geometry} or other graphical objects. This class doesn't depend of the
45
 * dimension of the map (2D or 3D).
46
 * </p>
47
 * <p>
48
 * The Map Control has to have an instance of this class that can be accessed
49
 * using the {@link MapControl#getMapControlDrawer()} method. When a Map Control
50
 * is created some tools are added to this component using the
51
 * {@link MapControl#addBehavior(String, org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior)}
52
 * method. Some of these tools need to draw some objects in the map and they use
53
 * the MapControlDrawer class to do that.
54
 * </p>
55
 * 
56
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
57
 */
58
public interface MapControlDrawer extends PrimitivesDrawer {
59

    
60
    /**
61
     * The <code>ViewPort</code> is used to transform the map
62
     * coordinates in the screen coordinates.
63
     * 
64
     * @param viewPort
65
     *            The <code>ViewPort</code>
66
     */
67
    public void setViewPort(ViewPort viewPort);
68

    
69
    /**
70
     * It draws a <code>Geometry</code> on the map using the color
71
     * specified using the {@link #setColor(Color)} method.
72
     * 
73
     * @param geometry
74
     *            The <code>Geometry</code> to draw.
75
     */
76
    public void draw(Geometry geometry);
77

    
78
    /**
79
     * It draws a <code>Geometry</code> on the map using a concrete
80
     * symbol.
81
     * 
82
     * @param geometry
83
     *            The <code>Geometry</code> to draw.
84
     * @param symbol
85
     *            The symbol used to draw the geometry.
86
     */
87
    public void draw(Geometry geometry, ISymbol symbol);
88

    
89
    /**
90
     * It draws the <code>Handler</code>'s that compose a geometry
91
     * on the map.
92
     * 
93
     * @param handlers
94
     *            An array of <code>Handler</code>'s.
95
     * @param at
96
     *            A transformation that has to be applied to the
97
     *            <code>Handler</code>'s.
98
     * @param symbol
99
     *            The symbol used to draw the handlers.
100
     */
101
    public void drawHandlers(Handler[] handlers, AffineTransform at,
102
        ISymbol symbol);
103

    
104
    /**
105
     * It draws a line using a concrete symbol.
106
     * 
107
     * @param firstPoint
108
     *            The first point of the line.
109
     * @param endPoint
110
     *            The end point of the line.
111
     * @param symbol
112
     *            The symbol used to draw the line.
113
     */
114
    public void drawLine(Point2D firstPoint, Point2D endPoint, ISymbol symbol);
115

    
116
    /**
117
     * It draws an image on a map in a concrete position.
118
     * 
119
     * @param img
120
     *            The image to draw.
121
     * @param x
122
     *            The X coordinate,
123
     * @param y
124
     *            The Y coordinate.
125
     */
126
    public void drawImage(Image img, int x, int y);
127

    
128
    /**
129
     * It draws image, applying a transform from image space
130
     * into user space before drawing.
131
     * 
132
     * @param img
133
     *            The image to draw.
134
     * @param xform
135
     *            The transform to apply.
136
     */
137
    public void drawImage(Image img, AffineTransform xform);
138

    
139
    /**
140
     * It draws a <code>Handler</code> on the map.
141
     * 
142
     * @param handler
143
     *            The <code>Handler</code> to draw.
144
     * @param at
145
     *            A transformation that has to be applied to the
146
     *            <code>Handler</code>.
147
     */
148
    public void drawHandler(Handler handler, AffineTransform at);
149

    
150
    /**
151
     * @param at
152
     */
153
    public void transform(AffineTransform at);
154

    
155
    /**
156
     * @param instance
157
     */
158
    public void setComposite(Composite instance);
159

    
160
}