Statistics
| Revision:

gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.legend / org.gvsig.raster.lib.legend.api / src / main / java / org / gvsig / raster / lib / legend / api / RasterLegendManager.java @ 6900

History | View | Annotate | Download (6.58 KB)

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

    
3
import java.awt.Color;
4
import java.io.File;
5
import java.util.List;
6

    
7
import org.apache.commons.lang3.tuple.Pair;
8

    
9
import org.gvsig.raster.lib.buffer.api.FilterList;
10
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation;
11
import org.gvsig.raster.lib.legend.api.colortable.ColorTable;
12
import org.gvsig.raster.lib.legend.api.colortable.ColorTableIO;
13
import org.gvsig.raster.lib.legend.api.colortable.ColorTableIOFactory;
14
import org.gvsig.raster.lib.legend.api.colortable.MakeColorTable;
15
import org.gvsig.raster.lib.legend.api.colortable.colortableclass.ColorTableClass;
16

    
17
/**
18
 * @author fdiaz
19
 *
20
 */
21
public interface RasterLegendManager {
22

    
23
    /**
24
     * Creates a raster legend
25
     *
26
     * @return RasterLegend
27
     */
28
    public RasterLegend createLegend();
29

    
30
    /**
31
     * Creates a raster legend
32
     *
33
     * @param colorInterpretation
34
     *            {@link ColorInterpretation} of this {@link RasterLegend}
35
     * @return New {@link RasterLegend}
36
     */
37
    public RasterLegend createLegend(ColorInterpretation colorInterpretation);
38

    
39
    /**
40
     * Creates a raster legend
41
     *
42
     * @param colorInterpretation
43
     *            {@link ColorInterpretation} of this
44
     * @param transparency
45
     *            {@link Transparency} of this {@link RasterLegend}
46
     * @param filters
47
     *            A {@link FilterList} to be applied
48
     * @return New {@link RasterLegend}
49
     */
50
    public RasterLegend createLegend(ColorInterpretation colorInterpretation,
51
        Transparency transparency, FilterList filters);
52

    
53
    /**
54
     * @return New empty instance of {@link ColorTableClass}
55
     */
56
    public ColorTableClass createColorTableClass();
57

    
58
    /**
59
     * Creates new instance with values received as parameters.
60
     *
61
     * @param className
62
     *            Name of class
63
     * @param value
64
     *            Value of class
65
     * @param interpolated
66
     *            Interpolated value
67
     * @param color
68
     *            Color of class
69
     * @return New instance of {@link ColorTableClass}.
70
     */
71
    public ColorTableClass createColorTableClass(String className, double value,
72
        double interpolated, Color color);
73

    
74
    /**
75
     * Creates a color table
76
     *
77
     * @return New color table instance
78
     */
79
    public ColorTable createColorTable();
80

    
81
    /**
82
     * Creates a new {@link ColorTable}
83
     *
84
     * @param name
85
     *            Name of {@link ColorTable}
86
     * @param colorTableClasses
87
     *            {@link ColorTableClass} that defined {@link ColorTable}
88
     * @param interpolated
89
     *            True to apply interpolation to {@link ColorTable}
90
     * @return New color table instance.
91
     */
92
    public ColorTable createColorTable(String name, List<ColorTableClass> colorTableClasses,
93
        boolean interpolated);
94

    
95
    /**
96
     * Gets default {@link ColorTableIO} to read and write {@link ColorTable} to
97
     * file.
98
     *
99
     * @return Default {@link ColorTableIO}
100
     */
101
    public ColorTableIO getColorTableIO();
102

    
103
    /**
104
     * @return Gets registered {@link ColorTableIOFactory}.
105
     */
106
    public List<ColorTableIOFactory> getColorTableIOFactories();
107

    
108
    /**
109
     * Gets registered {@link ColorTableIOFactory} with the name
110
     *
111
     * @param name
112
     *            Name of registered {@link ColorTableIOFactory}
113
     * @return Register {@link ColorTableIOFactory} with name
114
     */
115
    public ColorTableIOFactory getColorTableIOFactory(String name);
116

    
117
    /**
118
     * Gets {@link ColorTable} inside folder using registered
119
     * {@link ColorTableIOFactory}.
120
     *
121
     * @param folder
122
     *            Folder of {@link ColorTable}
123
     * @return List of color tables
124
     */
125
    public List<Pair<File,ColorTable>> getColorTables(File folder);
126

    
127
    /**
128
     * Registers {@link ColorTableIOFactory}.
129
     *
130
     * @param name
131
     *            Name of {@link ColorTableIOFactory} to register it.
132
     * @param colorTableIOFactory
133
     *            {@link ColorTableIOFactory} to create instances of
134
     *            {@link ColorTableIO}.
135
     */
136
    public void registerColorTableIOFactory(String name, ColorTableIOFactory colorTableIOFactory);
137

    
138
    /**
139
     * Creates an empty {@link ColorInterpretation}
140
     *
141
     * @param colorInterpretations
142
     *
143
     * @return New {@link ColorInterpretation} instance
144
     */
145
    public ColorInterpretation createColorInterpretation(String[] colorInterpretations);
146

    
147
    /**
148
     * Creates default color interpretation using {@link ColorInterpretation}
149
     * constants.
150
     *
151
     * @param definedColorInterpretation
152
     *            Defined {@link ColorInterpretation}. See constants at
153
     *            {@link ColorInterpretation} interface.
154
     * @return Default {@link ColorInterpretation}
155
     */
156
    public ColorInterpretation createColorInterpretation(String definedColorInterpretation);
157

    
158
    /**
159
     * @return Returns an empty {@link Transparency}
160
     */
161
    public Transparency createTransparency();
162

    
163
    /**
164
     * Creates a new {@link Transparency} using transparency value and defined
165
     * {@link TransparencyRange}.
166
     *
167
     * @param transparency
168
     *            Value of transparency
169
     * @param transparencyRanges
170
     *            List with {@link TransparencyRange} that define ranges of
171
     *            transparency by RGB values
172
     * @return New {@link Transparency} instance
173
     */
174
    public Transparency createTransparency(int transparency,
175
        List<TransparencyRange> transparencyRanges);
176

    
177
    /**
178
     * Creates an empty {@link TransparencyRange}
179
     * {@link TransparencyRange}.
180
     * @return
181
     */
182
    public TransparencyRange createTransparencyRange();
183

    
184
    /**
185
     * Creates a new {@link TransparencyRange} using color ranges
186
     *
187
     * {@link TransparencyRange}.
188
     * @param redRange
189
     * @param greenRange
190
     * @param blueRange
191
     * @param alpha
192
     * @param isAnd
193
     * @return
194
     */
195
    public TransparencyRange createTransparencyRange(int[] redRange, int[] greenRange, int[] blueRange, int alpha, boolean isAnd);
196

    
197
    /**
198
     * @param minimum
199
     * @param maximum
200
     * @param intervals
201
     * @param fromColor
202
     * @param toColor
203
     * @return
204
     */
205
    List<ColorTableClass> createListColorTableClasses(double minimum, double maximum, int intervals, Color fromColor,
206
        Color toColor);
207

    
208
    /**
209
     * @param minimum
210
     * @param maximum
211
     * @param intervalSize
212
     * @param fromColor
213
     * @param toColor
214
     * @return
215
     */
216
    List<ColorTableClass> createListColorTableClasses(double minimum, double maximum, double intervalSize,
217
        Color fromColor, Color toColor);
218

    
219
    /**
220
     * @return
221
     */
222
    MakeColorTable createMakeColorTable();
223
}