Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / symbols / AbstractSymbol.java @ 38563

History | View | Annotate | Download (3.78 KB)

1 9639 jaume
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 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
42
/* CVS MESSAGES:
43
*
44
* $Id$
45
* $Log$
46 13736 jaume
* Revision 1.8  2007-09-17 09:33:47  jaume
47
* some multishapedsymbol bugs fixed
48
*
49
* Revision 1.7  2007/08/13 11:36:50  jvidal
50 13032 jvidal
* javadoc
51
*
52
* Revision 1.6  2007/07/18 06:54:34  jaume
53 12657 jaume
* continuing with cartographic support
54
*
55
* Revision 1.5  2007/05/22 10:05:31  jaume
56 11741 jaume
* *** empty log message ***
57
*
58
* Revision 1.4  2007/03/26 14:24:13  jaume
59 10902 jaume
* implemented Print
60
*
61
* Revision 1.3  2007/03/09 11:20:56  jaume
62 10679 jaume
* Advanced symbology (start committing)
63
*
64
* Revision 1.2.2.2  2007/02/15 16:23:44  jaume
65
* *** empty log message ***
66
*
67
* Revision 1.2.2.1  2007/02/09 07:47:04  jaume
68
* Isymbol moved
69
*
70
* Revision 1.2  2007/01/24 17:58:22  jaume
71 9893 jaume
* new features and architecture error fixes
72
*
73
* Revision 1.1  2007/01/10 16:31:36  jaume
74 9639 jaume
* *** empty log message ***
75
*
76
*
77
*/
78
package com.iver.cit.gvsig.fmap.core.symbols;
79
80 18621 jdominguez
import com.iver.cit.gvsig.fmap.core.CartographicSupport;
81
import com.iver.cit.gvsig.fmap.core.CartographicSupportToolkit;
82
83 9893 jaume
/**
84 13032 jvidal
 * Abstract class that implements the interface the interface for symbols.It is
85
 * considered as the father of all XXXSymbols and will implement all the methods that
86
 * these classes had not developed (and correspond with one of the methods of AbstractSymbol class)
87 10679 jaume
 * @author  jaume dominguez faus - jaume.dominguez@iver.es
88 9893 jaume
 */
89 18621 jdominguez
public abstract class AbstractSymbol implements ISymbol, CartographicSupport{
90 9639 jaume
        private String desc;
91 18621 jdominguez
        private int unit = CartographicSupportToolkit.DefaultMeasureUnit;
92
        private int referenceSystem = CartographicSupportToolkit.DefaultReferenceSystem;
93 10902 jaume
94 9639 jaume
        private boolean isShapeVisible = true;
95
96
        public final void setDescription(String desc) {
97
                this.desc = desc;
98
        }
99
100
        public final String getDescription() {
101
                return desc;
102
        }
103
104 10679 jaume
        /**
105
         * @return
106
         * @uml.property  name="isShapeVisible"
107
         */
108 9639 jaume
        public final boolean isShapeVisible() {
109
                return isShapeVisible;
110
        }
111
112
        /**
113
         * Sets this symbol to visible
114
         * @param isShapeVisible
115
         */
116
        public final void setIsShapeVisible(boolean isShapeVisible) {
117
                this.isShapeVisible = isShapeVisible;
118
        }
119
120 18621 jdominguez
        public void setUnit(int unitIndex) {
121
                this.unit = unitIndex;
122
        }
123 10902 jaume
124 18621 jdominguez
        public int getUnit() {
125
                return this.unit;
126
        }
127 11741 jaume
128 18621 jdominguez
        public int getReferenceSystem() {
129
                return this.referenceSystem;
130
        }
131 11741 jaume
132 18621 jdominguez
        public void setReferenceSystem(int system) {
133
                this.referenceSystem = system;
134
135
        }
136 25776 vcaballero
        public boolean equals(Object obj){
137
                if (!obj.getClass().equals(getClass())){
138
                        return false;
139
                }
140
                if (((ISymbol)obj).getOnePointRgb()!=getOnePointRgb()){
141
                        return false;
142
                }
143
                if (getDescription()!=null && ((ISymbol)obj).getDescription()!=null){
144
                        if (!((ISymbol)obj).getDescription().equals(getDescription())){
145
                                return false;
146
                        }
147
                }
148
                return true;
149
        }
150 18621 jdominguez
151 9639 jaume
}