Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / FMultiPoint2D.java @ 1100

History | View | Annotate | Download (4.27 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.cit.gvsig.fmap.core;
42

    
43
import com.iver.cit.gvsig.fmap.ViewPort;
44
import com.iver.cit.gvsig.fmap.core.v02.FLabel;
45
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
46
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
47

    
48
import com.vividsolutions.jts.geom.Geometry;
49

    
50
import org.cresques.cts.ICoordTrans;
51

    
52
import java.awt.Color;
53
import java.awt.Graphics2D;
54
import java.awt.geom.Rectangle2D;
55

    
56

    
57
/**
58
 * Multipunto 2D.
59
 *
60
 * @author Vicente Caballero Navarro
61
 */
62
public class FMultiPoint2D implements IGeometry {
63
        double[] x = null;
64
        double[] y = null;
65

    
66
        /**
67
         * Crea un nuevo MultiPoint2D.
68
         *
69
         * @param x DOCUMENT ME!
70
         * @param y DOCUMENT ME!
71
         */
72
        public FMultiPoint2D(double[] x, double[] y) {
73
                this.x = x;
74
                this.y = y;
75
        }
76

    
77
        /**
78
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#draw(java.awt.Graphics2D,
79
         *                 ViewPort, FStyle2D)
80
         */
81
        public void draw(Graphics2D g, ViewPort vp, FStyle2D symbol) {
82
                int size = 2;
83
                int hw = 4;
84

    
85
                for (int i = 0; i < x.length; i++) {
86
                        java.awt.geom.Point2D.Double p = new java.awt.geom.Point2D.Double(x[i],
87
                                        y[i]);
88
                        vp.getAffineTransform().transform(p, p);
89
                        g.setColor(Color.red);
90
                        g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, (int) hw);
91
                        g.setColor(Color.black);
92
                        g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, (int) hw);
93
                }
94
        }
95

    
96
        /**
97
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry()
98
         */
99
        public Geometry toJTSGeometry() {
100
                return null;
101
        }
102

    
103
        /**
104
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#createLabels(int, boolean)
105
         */
106
        public FLabel[] createLabels(int position, boolean duplicates) {
107
                return null;
108
        }
109

    
110
        /* (non-Javadoc)
111
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#intersects(java.awt.geom.Rectangle2D)
112
         */
113
        public boolean intersects(Rectangle2D r) {
114
                // TODO Auto-generated method stub
115
                return false;
116
        }
117

    
118
        /* (non-Javadoc)
119
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D()
120
         */
121
        public Rectangle2D getBounds2D() {
122
                // TODO Auto-generated method stub
123
                return null;
124
        }
125

    
126
        /**
127
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeometryType()
128
         */
129
        public int getGeometryType() {
130
                return FShape.POINT;
131
        }
132

    
133
        /* (non-Javadoc)
134
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#draw(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.core.v02.FSymbol)
135
         */
136
        public void draw(Graphics2D g, ViewPort vp, FSymbol symbol) {
137
                int size = 2;
138
                int hw = 4;
139

    
140
                for (int i = 0; i < x.length; i++) {
141
                        java.awt.geom.Point2D.Double p = new java.awt.geom.Point2D.Double(x[i],
142
                                        y[i]);
143
                        vp.getAffineTransform().transform(p, p);
144
                        g.setColor(Color.red);
145
                        g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, (int) hw);
146
                        g.setColor(Color.black);
147
                        g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, (int) hw);
148
                }
149
        }
150

    
151
        /* (non-Javadoc)
152
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry()
153
         */
154
        public IGeometry cloneGeometry() {
155
                // TODO Auto-generated method stub
156
                return null;
157
        }
158

    
159
        /* (non-Javadoc)
160
         * @see com.iver.cit.gvsig.fmap.core.IGeometry#reProject(org.cresques.cts.ICoordTrans)
161
         */
162
        public void reProject(ICoordTrans ct) {
163
                // TODO Auto-generated method stub
164
        }
165
}