Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / raster / lib / legend / api / Transparency.java @ 44831

History | View | Annotate | Download (2.57 KB)

1
package org.gvsig.raster.lib.legend.api;
2

    
3
import java.beans.PropertyChangeEvent;
4
import java.beans.PropertyChangeListener;
5
import java.util.List;
6

    
7
import org.gvsig.tools.persistence.Persistent;
8

    
9
/**
10
 * @author fdiaz
11
 *
12
 */
13
public interface Transparency extends Persistent, Cloneable {
14

    
15
    /**
16
     * Add {@link PropertyChangeListener} to fire {@link PropertyChangeEvent}
17
     * when properties are modified.
18
     *
19
     * @param listener
20
     */
21
    public void addPropertyChangeListener(PropertyChangeListener listener);
22

    
23
    /**
24
     * Remove {@link PropertyChangeListener} from this {@link Transparency}
25
     *
26
     * @param listener
27
     */
28
    public void removePropertyChangeListener(PropertyChangeListener listener);
29

    
30
    /**
31
     * @return Returns value of transparency
32
     */
33
    public int getAlpha();
34

    
35
    /**
36
     * @return Returns defined {@link TransparencyRange}
37
     */
38
    public List<TransparencyRange> getTransparencyRanges();
39

    
40
    /**
41
     * Add {@link TransparencyRange} to this {@link Transparency}
42
     *
43
     * @param range
44
     *            {@link TransparencyRange} to be added
45
     */
46
    public void addTransparencyRange(TransparencyRange range);
47

    
48
    /**
49
     * Remove {@link TransparencyRange} from this {@link Transparency}
50
     *
51
     * @param range
52
     *            {@link TransparencyRange} to be removed
53
     */
54
    public void removeTransparencyRange(TransparencyRange range);
55

    
56
    /**
57
     * Gets alpha of RGB. If there are any {@link TransparencyRange} that
58
     * defines alpha to this RGB, it will be returned. Otherwise, this method
59
     * will return 255.
60
     *
61
     * @param r
62
     *            Red byte
63
     * @param g
64
     *            Green byte
65
     * @param b
66
     *            Blue byte
67
     * @return Alpha defined to this RGB.
68
     */
69
    public int getTransparencyRangeAlpha(byte r, byte g, byte b);
70

    
71
    /**
72
     * Gets alpha of RGB. If there are any {@link TransparencyRange} that
73
     * defines alpha to this RGB, it will be returned. Otherwise, this method
74
     * will return 255.
75
     *
76
     * @param r
77
     *            Red value
78
     * @param g
79
     *            Green value
80
     * @param b
81
     *            Blue value
82
     * @return Alpha defined to this RGB.
83
     */
84
    public int getTransparencyRangeAlpha(int r, int g, int b);
85

    
86
    /**
87
     * Sets transparency value
88
     *
89
     * @param value
90
     *            Value between 0 and 255
91
     */
92
    public void setValue(int value);
93

    
94
    /**
95
     * Set {@link TransparencyRange} of this {@link Transparency}
96
     *
97
     * @param ranges
98
     */
99
    public void setTransparencyRanges(List<TransparencyRange> ranges);
100
}