| 1 | |
package org.jtheque.films.stats.view.impl.panels; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.utils.ui.PanelBuilder; |
| 20 | |
import org.jtheque.utils.ui.GridBagUtils; |
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
public final class JPanelStatsFilms extends PanelStats { |
| 28 | |
private static final long serialVersionUID = 3556875889469725943L; |
| 29 | |
|
| 30 | |
private static final double A_THIRD = 0.33; |
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
public JPanelStatsFilms() { |
| 36 | 0 | super(); |
| 37 | |
|
| 38 | 0 | PanelBuilder builder = new PanelBuilder(this); |
| 39 | |
|
| 40 | 0 | setHeader("stats.films.title", getStatsService().getTitles()[2]); |
| 41 | |
|
| 42 | 0 | builder.add(getHeader(), builder.gbcSet(0, 0)); |
| 43 | |
|
| 44 | 0 | builder.add(createPieChartPanel("stats.films.pie.type", getStatsService().getInformations().getStatsOfFilmByType()), |
| 45 | |
builder.gbcSet(0, 1, GridBagUtils.BOTH, GridBagUtils.BASELINE, 1.0, A_THIRD)); |
| 46 | |
|
| 47 | 0 | builder.add(createPieChartPanel("stats.films.pie.kind", getStatsService().getInformations().getStatsOfFilmByKind()), |
| 48 | |
builder.gbcSet(0, 2, GridBagUtils.BOTH, GridBagUtils.BASELINE, 1.0, A_THIRD)); |
| 49 | |
|
| 50 | 0 | builder.add(createPieChartPanel("stats.films.pie.note", getStatsService().getInformations().getStatsOfFilmByNote()), |
| 51 | |
builder.gbcSet(0, 3, GridBagUtils.BOTH, GridBagUtils.BASELINE, 1.0, A_THIRD)); |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
@Override |
| 55 | |
public void refreshText() { |
| 56 | 0 | getHeader().setTitle(getResources().getMessage("stats.films.title")); |
| 57 | 0 | getHeader().setDescription(getStatsService().getInformations().getNumberOfFilms() + " " + |
| 58 | |
getResources().getMessage("stats.films.films").toLowerCase(getResources().getCurrentLocale())); |
| 59 | 0 | } |
| 60 | |
} |