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 @ 6899

History | View | Annotate | Download (6.6 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.colortable.ColorTable;
11
import org.gvsig.raster.lib.legend.api.colortable.ColorTableClass;
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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