Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / rendering / styling / FStyle2D.java @ 310

History | View | Annotate | Download (1.46 KB)

1
/*
2
 * Created on 22-nov-2004
3
 *
4
 * TODO To change the template for this generated file go to
5
 * Window - Preferences - Java - Code Generation - Code and Comments
6
 */
7
package com.iver.cit.gvsig.fmap.rendering.styling;
8

    
9
import java.awt.Graphics2D;
10
import java.awt.Rectangle;
11
import java.awt.image.BufferedImage;
12

    
13
import org.geotools.renderer.style.Style2D;
14

    
15
import com.iver.cit.gvsig.fmap.rendering.FStyledShapePainter;
16

    
17
/**
18
 * @author FJP
19
 *
20
 * TODO To change the template for this generated type comment go to
21
 * Window - Preferences - Java - Code Generation - Code and Comments
22
 * 
23
 */
24
public class FStyle2D {
25

    
26
        /**
27
         * RGB (incluye transparencia) que se utilizar? para la aceleraci?n gr?fica
28
         */
29
        private int rgb;
30
        private Style2D style2D;
31
        private static BufferedImage img = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
32
        private static FStyledShapePainter shpPainter = new FStyledShapePainter();
33
        private static Rectangle rect = new Rectangle(0,0,1,1);
34
                
35
        /**
36
         * @return Returns the rgb (incluye transparencia) que se utilizar? para la aceleraci?n gr?fica.
37
         */
38
        public int getRgb() {
39
                return rgb;
40
        }
41
        /**
42
         * @return Returns the style2D.
43
         */
44
        public synchronized Style2D getStyle2D() {
45
                return style2D;
46
        }
47
        /**
48
         * @param style2D The style2D to set.
49
         */
50
        public synchronized void setStyle2D(Style2D style2D) {
51
                this.style2D = style2D;
52
                // Recalculamos el RGB
53
                Graphics2D g2 = img.createGraphics();
54
                
55
                shpPainter.paint(g2,rect,style2D,0);                
56
                rgb = img.getRGB(0,0);
57
                
58
        }
59
}