svn-gvsig-desktop / branches / org.gvsig.desktop-2018a / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / raster / lib / legend / api / RasterLegendManager.java @ 43866
History | View | Annotate | Download (6.83 KB)
1 |
package org.gvsig.raster.lib.legend.api; |
---|---|
2 |
|
3 |
import java.awt.Color; |
4 |
import java.awt.image.BufferedImage; |
5 |
import java.io.File; |
6 |
import java.util.List; |
7 |
|
8 |
import org.apache.commons.lang3.tuple.Pair; |
9 |
|
10 |
import org.gvsig.raster.lib.buffer.api.operations.OperationList; |
11 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
12 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTable; |
13 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTableIO; |
14 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTableIOFactory; |
15 |
import org.gvsig.raster.lib.legend.api.colortable.MakeColorTable; |
16 |
import org.gvsig.raster.lib.legend.api.colortable.colortableclass.ColorTableClass; |
17 |
|
18 |
/**
|
19 |
* @author fdiaz
|
20 |
*
|
21 |
*/
|
22 |
public interface RasterLegendManager { |
23 |
|
24 |
/**
|
25 |
* Creates a raster legend
|
26 |
*
|
27 |
* @return RasterLegend
|
28 |
*/
|
29 |
public RasterLegend createLegend();
|
30 |
|
31 |
/**
|
32 |
* Creates a raster legend
|
33 |
*
|
34 |
* @param colorInterpretation
|
35 |
* {@link ColorInterpretation} of this {@link RasterLegend}
|
36 |
* @return New {@link RasterLegend}
|
37 |
*/
|
38 |
public RasterLegend createLegend(ColorInterpretation colorInterpretation);
|
39 |
|
40 |
/**
|
41 |
* Creates a raster legend
|
42 |
*
|
43 |
* @param colorInterpretation
|
44 |
* {@link ColorInterpretation} of this
|
45 |
* @param transparency
|
46 |
* {@link Transparency} of this {@link RasterLegend}
|
47 |
* @param filters
|
48 |
* A {@link OperationList} to be applied
|
49 |
* @return New {@link RasterLegend}
|
50 |
*/
|
51 |
public RasterLegend createLegend(ColorInterpretation colorInterpretation,
|
52 |
Transparency transparency, OperationList 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 colorInterpretations
|
143 |
*
|
144 |
* @return New {@link ColorInterpretation} instance
|
145 |
*/
|
146 |
public ColorInterpretation createColorInterpretation(String[] colorInterpretations); |
147 |
|
148 |
public ColorInterpretation createColorInterpretation(List<String> colorInterpretations); |
149 |
|
150 |
/**
|
151 |
* Creates default color interpretation using {@link ColorInterpretation}
|
152 |
* constants.
|
153 |
*
|
154 |
* @param definedColorInterpretation
|
155 |
* Defined {@link ColorInterpretation}. See constants at
|
156 |
* {@link ColorInterpretation} interface.
|
157 |
* @return Default {@link ColorInterpretation}
|
158 |
*/
|
159 |
public ColorInterpretation createColorInterpretation(String definedColorInterpretation); |
160 |
|
161 |
public ColorInterpretation createColorInterpretation(BufferedImage image, String prefix); |
162 |
|
163 |
/**
|
164 |
* @return Returns an empty {@link Transparency}
|
165 |
*/
|
166 |
public Transparency createTransparency(); |
167 |
|
168 |
/**
|
169 |
* Creates a new {@link Transparency} using transparency value and defined
|
170 |
* {@link TransparencyRange}.
|
171 |
*
|
172 |
* @param transparency
|
173 |
* Value of transparency
|
174 |
* @param transparencyRanges
|
175 |
* List with {@link TransparencyRange} that define ranges of
|
176 |
* transparency by RGB values
|
177 |
* @return New {@link Transparency} instance
|
178 |
*/
|
179 |
public Transparency createTransparency(int transparency, |
180 |
List<TransparencyRange> transparencyRanges);
|
181 |
|
182 |
/**
|
183 |
* Creates an empty {@link TransparencyRange}
|
184 |
* {@link TransparencyRange}.
|
185 |
* @return
|
186 |
*/
|
187 |
public TransparencyRange createTransparencyRange();
|
188 |
|
189 |
/**
|
190 |
* Creates a new {@link TransparencyRange} using color ranges
|
191 |
*
|
192 |
* {@link TransparencyRange}.
|
193 |
* @param redRange
|
194 |
* @param greenRange
|
195 |
* @param blueRange
|
196 |
* @param alpha
|
197 |
* @param isAnd
|
198 |
* @return
|
199 |
*/
|
200 |
public TransparencyRange createTransparencyRange(int[] redRange, int[] greenRange, int[] blueRange, int alpha, boolean isAnd); |
201 |
|
202 |
/**
|
203 |
* @param minimum
|
204 |
* @param maximum
|
205 |
* @param intervals
|
206 |
* @param fromColor
|
207 |
* @param toColor
|
208 |
* @return
|
209 |
*/
|
210 |
List<ColorTableClass> createListColorTableClasses(double minimum, double maximum, int intervals, Color fromColor, |
211 |
Color toColor);
|
212 |
|
213 |
/**
|
214 |
* @param minimum
|
215 |
* @param maximum
|
216 |
* @param intervalSize
|
217 |
* @param fromColor
|
218 |
* @param toColor
|
219 |
* @return
|
220 |
*/
|
221 |
List<ColorTableClass> createListColorTableClasses(double minimum, double maximum, double intervalSize, |
222 |
Color fromColor, Color toColor); |
223 |
|
224 |
/**
|
225 |
* @return
|
226 |
*/
|
227 |
MakeColorTable createMakeColorTable(); |
228 |
} |