Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_controls / src / org / gvsig / fmap / mapcontrol / impl / DefaultPrimitivesDrawer.java @ 30349

History | View | Annotate | Download (2.63 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.impl;
29

    
30
import java.awt.Color;
31
import java.awt.Graphics;
32
import java.awt.Graphics2D;
33

    
34
import org.gvsig.fmap.mapcontrol.PrimitivesDrawer;
35

    
36
/**
37
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
38
 */
39
public class DefaultPrimitivesDrawer implements PrimitivesDrawer{
40
        protected Graphics2D graphics = null;        
41

    
42
        public DefaultPrimitivesDrawer() {
43
                super();                
44
        }        
45
        
46
        public DefaultPrimitivesDrawer(Graphics2D graphics) {
47
                super();
48
                this.graphics = graphics;
49
        }
50
        
51
        /*
52
         * (non-Javadoc)
53
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#drawLine(int, int, int, int)
54
         */
55
        public void drawLine(int x1, int y1, int x2, int y2) {
56
                graphics.drawLine(x1, y1, x2, y2);                
57
        }
58

    
59
        /*
60
         * (non-Javadoc)
61
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#drawOval(int, int, int, int)
62
         */
63
        public void drawOval(int x, int y, int width, int height) {
64
                graphics.drawOval(x, y, width, height);
65
        }
66

    
67
        /*
68
         * (non-Javadoc)
69
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#drawRect(int, int, int, int)
70
         */
71
        public void drawRect(int x, int y, int width, int height) {
72
                graphics.drawRect(x, y, width, height);        
73
        }
74
        
75
        /*
76
         * (non-Javadoc)
77
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#fillRect(int, int, int, int)
78
         */
79
        public void fillRect(int x, int y, int width, int height) {
80
                graphics.fillRect(x, y, width, height);
81
        }
82

    
83
        /*
84
         * (non-Javadoc)
85
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#setColor(java.awt.Color)
86
         */
87
        public void setColor(Color color) {
88
                graphics.setColor(color);                        
89
        }
90

    
91
        /*
92
         * (non-Javadoc)
93
         * @see org.gvsig.fmap.mapcontrol.PrimitivesDrawer#setGraphics(java.awt.Graphics)
94
         */
95
        public void setGraphics(Graphics graphics) {
96
                this.graphics = (Graphics2D)graphics;
97
        }
98
}
99