Source code: com/arranger/jarl/base/IGradientManager.java
1 package com.arranger.jarl.base;
2
3 import com.jhlabs.image.Gradient;
4
5 import java.util.Map;
6 import java.util.List;
7 import java.io.IOException;
8 import java.awt.*;
9
10 /**
11 * IGradientManager manages the available gradients in the system
12 */
13 public interface IGradientManager {
14
15 /**
16 * Init the available gradients
17 * @param gradientFile
18 * @throws IOException
19 */
20 public void init(String gradientFile) throws IOException;
21
22 /**
23 * @param index
24 * @return the gradient by index
25 */
26 public Gradient getGradient(int index);
27
28 /**
29 * @param name
30 * @return the gradient by name
31 */
32 public Gradient getGradient(String name);
33
34 /**
35 * @return the map of all gradients
36 */
37 public Map getGradientMap();
38
39 /**
40 * @return a list of all gradients
41 */
42 public List getGradientList();
43
44 /**
45 * Create an interpolated gradient between grad1 and gradient two
46 * @param gradient1 first gradient
47 * @param gradient2 second gradient
48 * @param pct between 0 & 1
49 * @return an interpolated gradient
50 */
51 public Gradient interpolate(Gradient gradient1, Gradient gradient2, double pct);
52
53 /**
54 * Create an interpolated gradient between grad1 and a color
55 * @param gradient1 first gradient
56 * @param color second gradient
57 * @param pct between 0 & 1
58 * @return an interpolated gradient
59 */
60 public Gradient interpolate(Gradient gradient1, Color color, double pct);
61 }