Statistics
| Revision:

root / trunk / libraries / libCq_CMS_praster / src / org / cresques / filter / enhancement / TransparencyFilter.java @ 8026

History | View | Annotate | Download (2.55 KB)

1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23
 */
24
package org.cresques.filter.enhancement;
25

    
26
import java.io.IOException;
27
import java.util.ArrayList;
28

    
29
import org.cresques.filter.RasterFilter;
30
import org.gvsig.i18n.Messages;
31

    
32

    
33
/**
34
 * Clase base para los filtros de transparencia en sus diferentes tipos
35
 * de datos.
36
 * @author Nacho Brodin (brodin_ign@gva.es)
37
 *
38
 */
39
public abstract class TransparencyFilter extends RasterFilter {
40
    //Par?metros del filtro
41
        /**
42
         * Lista de TransparencyRange
43
         */
44
        public ArrayList        rangesList = null;
45
        
46
    /**
47
     * Valor de transparencia
48
     */
49
    public int alpha = 0x10;
50

    
51
    /**
52
     * Color en la banda del rojo para la transparencia
53
     */
54
    public int transparencyColorRed = 0xff;
55

    
56
    /**
57
     * Color en la banda del verde para la transparencia
58
     */
59
    public int transparencyColorGreen = 0xff;
60

    
61
    /**
62
     * Color en la banda del azul para la transparencia
63
     */
64
    public int transparencyColorBlue = 0xff;
65

    
66
    /**
67
     * Constructor
68
     *
69
     */
70
    public TransparencyFilter() {
71
        super();
72
        super.filterName = Messages.getText("transparency");
73
    }
74
    
75
    /**
76
     * Obtiene par?metros del filtro desde la tabla Hash
77
     */
78
    public void pre() {
79
        //Obtenci?n de par?metros comunes a todos
80
            rangesList = (ArrayList)params.get("rangesList");
81
            /*for(int i=0;i<rangesList.size();i++)
82
                    ((TransparencyRange)rangesList.get(i)).show();*/
83
        alpha = ((Integer) params.get("alpha")).intValue();
84
        transparencyColorRed = ((Integer) params.get("transparencyRed")).intValue();
85
        transparencyColorGreen = ((Integer) params.get("transparencyGreen")).intValue();
86
        transparencyColorBlue = ((Integer) params.get("transparencyBlue")).intValue();
87
    }
88
}