Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / MemoryLabelAdapter.java @ 1773

History | View | Annotate | Download (3.9 KB)

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

    
47
import com.hardcode.driverManager.DriverLoadException;
48

    
49
import com.hardcode.gdbms.engine.data.DataSource;
50
import com.hardcode.gdbms.engine.data.DataSourceFactory;
51
import com.hardcode.gdbms.engine.data.NoSuchTableException;
52

    
53
import com.iver.cit.gvsig.fmap.DriverException;
54
import com.iver.cit.gvsig.fmap.core.FShape;
55
import com.iver.cit.gvsig.fmap.core.IGeometry;
56
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
57
import com.iver.cit.gvsig.fmap.operations.strategies.MemoryShapeInfo;
58
import com.iver.cit.gvsig.fmap.rendering.indexes.IndexNotExistsException;
59

    
60
import java.awt.geom.Rectangle2D;
61

    
62
import java.util.ArrayList;
63

    
64

    
65
/**
66
 * Adapta un driver de texto a la interfaz vectorial, manteniendo adem?s el
67
 * estado necesario por una capa vectorial en memoria.
68
 *
69
 * @author FJP
70
 */
71
public class MemoryLabelAdapter extends VectorialAdapter {
72
        private String dataSourceName;
73
        private DataSource ds;
74
        private MemoryShapeInfo memShapeInfo = new MemoryShapeInfo();
75
        private ArrayList arrayGeometries = new ArrayList();
76
        private Rectangle2D fullExtent;
77

    
78
        /**
79
         * Inserta el DataSource.
80
         *
81
         * @param ds DataSource.
82
         */
83
        public void setDataSource(DataSource ds) {
84
                this.ds = ds;
85
        }
86

    
87
        /* (non-Javadoc)
88
         * @see com.iver.cit.gvsig.fmap.layers.VectorialAdapter#getRecordset(java.lang.String)
89
         */
90
        public DataSource getRecordset(String name) throws DriverLoadException {
91
                return ds;
92
        }
93

    
94
        /* (non-Javadoc)
95
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#start()
96
         */
97
        public void start() throws DriverIOException {
98
        }
99

    
100
        /* (non-Javadoc)
101
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#stop()
102
         */
103
        public void stop() throws DriverIOException {
104
        }
105

    
106
        /* (non-Javadoc)
107
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getShape(int)
108
         */
109
        public IGeometry getShape(int index) throws DriverIOException {
110
                // TODO Auto-generated method stub
111
                return null;
112
        }
113

    
114
        /* (non-Javadoc)
115
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getShapeCount()
116
         */
117
        public int getShapeCount() throws DriverIOException {
118
                // TODO Auto-generated method stub
119
                return 0;
120
        }
121

    
122
        /* (non-Javadoc)
123
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getFullExtent()
124
         */
125
        public Rectangle2D getFullExtent() throws DriverIOException {
126
                return fullExtent;
127
        }
128

    
129
        /* (non-Javadoc)
130
         * @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getShapeType()
131
         */
132
        public int getShapeType() throws DriverIOException {
133
                return FShape.TEXT;
134
        }
135

    
136
        /* (non-Javadoc)
137
         * @see com.iver.cit.gvsig.fmap.rendering.indexes.Index#getRecordIndexes(java.awt.geom.Rectangle2D)
138
         */
139
        public int[] getRecordIndexes(Rectangle2D rect)
140
                throws DriverIOException, IndexNotExistsException {
141
                return null;
142
        }
143
}