Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
InternationalizableChart |
|
| 1.0;1 |
1 | package org.jtheque.films.stats.view.impl.panels; | |
2 | ||
3 | import org.jfree.chart.JFreeChart; | |
4 | import org.jtheque.core.managers.Managers; | |
5 | import org.jtheque.core.managers.language.ILanguageManager; | |
6 | import org.jtheque.core.managers.language.Internationalizable; | |
7 | ||
8 | /* | |
9 | * This file is part of JTheque. | |
10 | * | |
11 | * JTheque is free software: you can redistribute it and/or modify | |
12 | * it under the terms of the GNU General Public License as published by | |
13 | * the Free Software Foundation, either version 3 of the License. | |
14 | * | |
15 | * JTheque is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
22 | */ | |
23 | ||
24 | /** | |
25 | * An internationalizable object to keep JFreeChart objects to the good language. | |
26 | * | |
27 | * @author Baptiste Wicht | |
28 | */ | |
29 | final class InternationalizableChart implements Internationalizable { | |
30 | private final JFreeChart chart; | |
31 | private final String key; | |
32 | ||
33 | /** | |
34 | * Construct a new InternationalizableChart for a specific chart and i18n key. | |
35 | * | |
36 | * @param chart The chart to keep internationalizable. | |
37 | * @param key The i18n key. | |
38 | */ | |
39 | InternationalizableChart(JFreeChart chart, String key) { | |
40 | 0 | super(); |
41 | ||
42 | 0 | this.chart = chart; |
43 | 0 | this.key = key; |
44 | 0 | } |
45 | ||
46 | @Override | |
47 | public void refreshText() { | |
48 | 0 | chart.setTitle(Managers.getManager(ILanguageManager.class).getMessage(key)); |
49 | 0 | } |
50 | } |