Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IResourceManager |
|
| 1.0;1 |
1 | package org.jtheque.core.managers.resource; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.springframework.core.io.Resource; | |
20 | ||
21 | import javax.swing.Action; | |
22 | import javax.swing.ImageIcon; | |
23 | import java.awt.Color; | |
24 | import java.awt.image.BufferedImage; | |
25 | import java.io.InputStream; | |
26 | ||
27 | /** | |
28 | * A resource manager. | |
29 | * | |
30 | * @author Baptiste Wicht | |
31 | */ | |
32 | public interface IResourceManager { | |
33 | /** | |
34 | * Return the resource of the path. | |
35 | * | |
36 | * @param path The path to the resource. | |
37 | * @return The loaded <code>Resource</code>. | |
38 | */ | |
39 | Resource getResource(String path); | |
40 | ||
41 | /** | |
42 | * Return the resource as stream. | |
43 | * | |
44 | * @param path The path to the resource. | |
45 | * @return The <code>InputStream</code> of the loaded resource. | |
46 | */ | |
47 | InputStream getResourceAsStream(String path); | |
48 | ||
49 | /** | |
50 | * Load and return the icon. | |
51 | * | |
52 | * @param baseName The images base name. | |
53 | * @param id The image index. | |
54 | * @param type The image type. | |
55 | * @return The loaded icon. | |
56 | */ | |
57 | ImageIcon getIcon(String baseName, String id, ImageType type); | |
58 | ||
59 | /** | |
60 | * Load and return the icon. | |
61 | * | |
62 | * @param id The image index. | |
63 | * @param type The image type. | |
64 | * @return The loaded icon. | |
65 | */ | |
66 | ImageIcon getIcon(String id, ImageType type); | |
67 | ||
68 | /** | |
69 | * Load and return the icon. | |
70 | * | |
71 | * @param id The image index. | |
72 | * @return The loaded icon. | |
73 | */ | |
74 | ImageIcon getIcon(String id); | |
75 | ||
76 | /** | |
77 | * Load, return and resize the image. | |
78 | * | |
79 | * @param baseName The image base name. | |
80 | * @param id The image index. | |
81 | * @param type The image type. | |
82 | * @param width The width. | |
83 | * @return The loaded icon. | |
84 | */ | |
85 | BufferedImage getImage(String baseName, String id, ImageType type, int width); | |
86 | ||
87 | /** | |
88 | * Load and return the image. | |
89 | * | |
90 | * @param baseName The image base name. | |
91 | * @param id The image index. | |
92 | * @param type The image type. | |
93 | * @return The loaded icon. | |
94 | */ | |
95 | BufferedImage getImage(String baseName, String id, ImageType type); | |
96 | ||
97 | /** | |
98 | * Load, return and resize the image. | |
99 | * | |
100 | * @param id The image index. | |
101 | * @param type The image type. | |
102 | * @param width The width. | |
103 | * @return The loaded icon. | |
104 | */ | |
105 | BufferedImage getImage(String id, ImageType type, int width); | |
106 | ||
107 | /** | |
108 | * Load and return the image. | |
109 | * | |
110 | * @param id The image index. | |
111 | * @param type The image type. | |
112 | * @return The loaded icon. | |
113 | */ | |
114 | BufferedImage getImage(String id, ImageType type); | |
115 | ||
116 | /** | |
117 | * Load, return and resize the image. | |
118 | * | |
119 | * @param id The image index. | |
120 | * @param width The width. | |
121 | * @return The loaded icon. | |
122 | */ | |
123 | BufferedImage getImage(String id, int width); | |
124 | ||
125 | /** | |
126 | * Load and return the image. | |
127 | * | |
128 | * @param id The image index. | |
129 | * @return The loaded icon. | |
130 | */ | |
131 | BufferedImage getImage(String id); | |
132 | ||
133 | /** | |
134 | * Return the color of the specified name. The color will be searched in the Spring context. | |
135 | * | |
136 | * @param name The name of the color. | |
137 | * @return The color of the specified name. | |
138 | */ | |
139 | Color getColor(String name); | |
140 | ||
141 | /** | |
142 | * Return the action of the specified name. The color will be searched in the Spring context. | |
143 | * | |
144 | * @param name The name of the color. | |
145 | * @return The action of the specified name. | |
146 | */ | |
147 | Action getAction(String name); | |
148 | } |