Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / styles / IMask.java @ 13073

History | View | Annotate | Download (3.53 KB)

1
/* 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
package com.iver.cit.gvsig.fmap.core.styles;
42

    
43
import java.awt.BasicStroke;
44
import java.awt.Graphics2D;
45
import java.awt.Rectangle;
46
import java.awt.Shape;
47

    
48
import com.iver.cit.gvsig.fmap.core.FPolygon2D;
49
import com.iver.cit.gvsig.fmap.core.FShape;
50
import com.iver.cit.gvsig.fmap.core.GeneralPathX;
51
import com.iver.cit.gvsig.fmap.core.symbols.IFillSymbol;
52
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
53
import com.iver.utiles.XMLEntity;
54

    
55
/**
56
 *
57
 * @author jaume dominguez faus - jaume.dominguez@iver.es
58
 */
59
public interface IMask extends IStyle {
60
        /**
61
         *
62
         * @return
63
         */
64
        public double getSize();
65
        /**
66
         *
67
         * @param size
68
         */
69
        public void setSize(double size);
70
        /**
71
         *
72
         * @return
73
         */
74
        public IFillSymbol getFillSymbol();
75
        /**
76
         *
77
         * @param fill
78
         */
79
        public void setFillSymbol(IFillSymbol fill);
80
        /**
81
         *
82
         * @param shp,Shape
83
         * @return FShape
84
         */
85
        public FShape getHaloShape(Shape shp);
86

    
87
        /**
88
         * Class that implements the methods of the IMask interface showed above.
89
         *
90
         * @author jaume dominguez faus - jaume.dominguez@iver.es
91
         *
92
         */
93
        class BasicMask extends AbstractStyle implements IMask {
94
                private double size;
95
                private IFillSymbol fill;
96

    
97

    
98
                public double getSize() {
99
                        return size;
100
                }
101

    
102
                public void setSize(double size) {
103
                        this.size = size;
104
                }
105

    
106
                public IFillSymbol getFillSymbol() {
107
                        return fill;
108

    
109
                }
110

    
111
                public void setFillSymbol(IFillSymbol fill) {
112
                        this.fill = fill;
113
                }
114

    
115
                public void drawInsideRectangle(Graphics2D g, Rectangle r) {
116
                        // TODO Implement it
117
                        throw new Error("Not yet implemented!");
118

    
119
                }
120

    
121
                public FShape getHaloShape(Shape shp) {
122
                        BasicStroke stroke = new BasicStroke((int) /*falta CartographicSupport*/getSize());
123
                        Shape myShp = stroke.createStrokedShape(shp);
124
                        FShape haloShape = new FPolygon2D(new GeneralPathX(myShp.getBounds2D()));
125

    
126
                        return haloShape;
127
                }
128

    
129
                public boolean isSuitableFor(ISymbol symbol) {
130
                        // TODO Implement it
131
                        throw new Error("Not yet implemented!");
132

    
133
                }
134

    
135
                public void drawOutline(Graphics2D g, Rectangle r) {
136
                        // TODO Implement it
137
                        throw new Error("Not yet implemented!");
138

    
139
                }
140

    
141
                public String getClassName() {
142
                        return this.getClass().getName();
143
                }
144

    
145
                public XMLEntity getXMLEntity() {
146
                        // TODO Implement it
147
                        throw new Error("Not yet implemented!");
148

    
149
                }
150

    
151
                public void setXMLEntity(XMLEntity xml) {
152
                        // TODO Implement it
153
                        throw new Error("Not yet implemented!");
154

    
155
                }
156

    
157
        }
158
}