Coverage Report - org.jtheque.films.stats.view.impl.panels.JPanelStatsActors
 
Classes in this File Line Coverage Branch Coverage Complexity
JPanelStatsActors
0 %
0/10
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 actors.
 24  
  *
 25  
  * @author Baptiste Wicht
 26  
  */
 27  
 public final class JPanelStatsActors extends PanelStats {
 28  
     private static final long serialVersionUID = 5244577639814727219L;
 29  
 
 30  
     private static final double AN_HALF = 0.5;
 31  
 
 32  
     /**
 33  
      * Construct a new <code>JPanelStatsActors</code>.
 34  
      */
 35  
     public JPanelStatsActors() {
 36  0
         super();
 37  
 
 38  0
         PanelBuilder builder = new PanelBuilder(this);
 39  
 
 40  0
         setHeader("stats.actors.title", getStatsService().getTitles()[1]);
 41  
 
 42  0
         builder.add(getHeader(), builder.gbcSet(0, 0));
 43  
 
 44  0
         builder.add(createPieChartPanel("stats.actors.pie.country", getStatsService().getInformations().getStatsOfActorsByCountry()),
 45  
                 builder.gbcSet(0, 1, GridBagUtils.BOTH, GridBagUtils.BASELINE, 1.0, AN_HALF));
 46  
 
 47  0
         builder.add(createPieChartPanel("stats.actors.pie.note", getStatsService().getInformations().getStatsOfActorsByNote()),
 48  
                 builder.gbcSet(0, 2, GridBagUtils.BOTH, GridBagUtils.BASELINE, 1.0, AN_HALF));
 49  0
     }
 50  
 
 51  
     @Override
 52  
     public void refreshText() {
 53  0
         getHeader().setTitle(getResources().getMessage("stats.actors.title"));
 54  0
         getHeader().setDescription(getStatsService().getInformations().getNumberOfActors() + " " +
 55  
                 getResources().getMessage("stats.actors.actors").toLowerCase(getResources().getCurrentLocale()));
 56  0
     }
 57  
 }