Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / rendering / IVectorLegend.java @ 21535

History | View | Annotate | Download (3.85 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.rendering;
42

    
43
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
44
import com.hardcode.gdbms.engine.data.DataSource;
45
import com.hardcode.gdbms.engine.data.driver.DriverException;
46
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
47
import com.iver.cit.gvsig.fmap.core.IFeature;
48
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
49
import com.iver.utiles.XMLEntity;
50

    
51

    
52
/**
53
 * Interface of a vectorial legend.
54
 *
55
 * @author Vicente Caballero Navarro
56
 */
57
public interface IVectorLegend extends ILegend {
58
        /**
59
         * Inserts the DataSource.
60
         *
61
         * @param ds DataSource.
62
         *
63
         * @throws FieldNotFoundException when the field is not found.
64
         * @throws DriverException When the driver fails.
65
         */
66
        void setDataSource(DataSource ds)
67
                throws FieldNotFoundException, ReadDriverException;
68

    
69
        /**
70
         * Returns the symbol to be used to represent the feature in the i-th
71
         * record in the DataSource
72
         * @param i, the record index
73
         *
74
         * @return ISymbol.
75
         *
76
         * @throws DriverException
77
         */
78
        ISymbol getSymbol(int i) throws ReadDriverException;
79
        
80
        /**
81
     * Returns a symbol starting from an IFeature.
82
         * 
83
         * TAKE CARE!! When we are using a feature iterator as a database
84
         * the only field that will be filled is the fieldID.
85
         * The rest of fields will be null to reduce the time of creation
86
         *
87
         * @param feat IFeature.
88
         *
89
         * @return S?mbolo.
90
         */
91
    ISymbol getSymbolByFeature(IFeature feat);
92

    
93
        /**
94
         * Returns the type of the shape.
95
         *
96
         * @return Returns the type of the shapes that the legend is ready to use.
97
         * 
98
         */
99
        int getShapeType();
100

    
101
        /**
102
         * Defines the type of the shape.
103
         *
104
         * @param shapeType type of the shape.
105
         */
106
        void setShapeType(int shapeType);
107

    
108
        /**
109
         * Establishes the default symbol of a legend. In a SingleSymbolLegend the symbol
110
         * is established by calling this method.
111
         *
112
         * @param s default symbol.
113
         * @throws IllegalArgumentException, if the symbol isn't suitable for the
114
         * layer's data type.
115
         */
116
        void setDefaultSymbol(ISymbol s) throws IllegalArgumentException;
117

    
118
        /**
119
         * Returns the XMLEntity.
120
         *
121
         * @return XMLEntity.
122
         */
123
        XMLEntity getXMLEntity();
124

    
125
        /**
126
         * Inserts the XMLEntity.
127
         *
128
         * @param xml XMLEntity.
129
         */
130
        void setXMLEntity(XMLEntity xml);
131

    
132
    /**
133
     * Inserts the XMLEntity.
134
     *
135
     * @param xml XMLEntity.
136
     */
137
    void setXMLEntity03(XMLEntity xml);
138

    
139
    /**
140
     * Returns true or false depending on if the rest of values are used.
141
         * 
142
         * @return  True if the rest of values are used.
143
         */
144
    public boolean isUseDefaultSymbol();
145

    
146
    void useDefaultSymbol(boolean b);
147

    
148
    public ZSort getZSort();
149

    
150
        public void setZSort(ZSort zSort);
151
        
152
        public boolean isSuitableForShapeType(int shapeType);
153
}