Coverage Report - org.jtheque.films.stats.view.impl.panels.JPanelStatsFilms
 
Classes in this File Line Coverage Branch Coverage Complexity
JPanelStatsFilms
0 %
0/11
N/A
1
 
 1  
 package org.jtheque.films.stats.view.impl.panels;
 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.jtheque.core.utils.ui.PanelBuilder;
 20  
 import org.jtheque.utils.ui.GridBagUtils;
 21  
 
 22  
 /**
 23  
  * A stats panel for films.
 24  
  *
 25  
  * @author Baptiste Wicht
 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  
      * Construct a new JPanelStatsFilms.
 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  
 }