Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGeometries / src / org / gvsig / fmap / geometries / operation / GeometryOperation.java @ 20499

History | View | Annotate | Download (3.1 KB)

1
package org.gvsig.fmap.geometries.operation;
2

    
3
import java.util.Map;
4

    
5
import org.gvsig.fmap.geometries.iso.AbstractGeometry;
6
import org.gvsig.fmap.geometries.iso.aggregate.MultiGeometry;
7

    
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: GeometryOperation.java,v 1.2 2008/03/25 08:47:41 cvs Exp $
52
 * $Log: GeometryOperation.java,v $
53
 * Revision 1.2  2008/03/25 08:47:41  cvs
54
 * Visitors removed
55
 *
56
 * Revision 1.1  2008/03/12 08:46:21  cvs
57
 * *** empty log message ***
58
 *
59
 *
60
 */
61
/**
62
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
63
 */
64
public abstract class GeometryOperation {
65
        //Defined operations
66
        public static final int NUMBER_OF_OPERATIONS = 6;
67
        public static final int PRINTLN_OPERATION = 0;
68
        public static final int DRAW2D_SYMBOL_OPERATION = 1;
69
        public static final int DRAW2D_INTS_SYMBOL_OPERATION = 2;
70
        public static final int DRAW2D_INTS_CARTOGRAPHICSUPPORT_OPERATION = 3;
71
        public static final int FLABEL2D_OPERATION = 4;
72
        public static final int DRAW3D_OPERATION = 5;
73
        //Private attributes
74
        protected Map parameters = null;
75
        
76
        /**
77
         * @return the operation code
78
         */
79
        public abstract int getOperationCode();
80
                
81
        /**
82
         * It executes the operation for one geometry
83
         * @param geometry
84
         * The geometry
85
         * @throws GeometryOperationException
86
         */
87
        public abstract Object operate(AbstractGeometry geometry) throws GeometryOperationException;
88
        
89
        /**
90
         * It does the same opertion for all the children of a 
91
         * multigeometry 
92
         * @param multiGeometry
93
         * The multigeometry
94
         * @throws GeometryOperationException
95
         */
96
        public void operateChildren(MultiGeometry multiGeometry) throws GeometryOperationException{
97
                for (int i=0 ; i<multiGeometry.getPrimitivesNumber() ; i++){
98
                        multiGeometry.getPrimitiveAt(i).doOperation(getOperationCode());
99
                }
100
        }        
101
        
102
        /**
103
         * Sets a set of parameters that can be used for the
104
         * operations. 
105
         * @param parameters
106
         * The parameters object
107
         */
108
        public void setParemeters(Map parameters){
109
                this.parameters = parameters;
110
        }
111
        
112
}