Coverage Report - org.jtheque.films.view.impl.frames.ChoiceFieldsView
 
Classes in this File Line Coverage Branch Coverage Complexity
ChoiceFieldsView
0 %
0/23
N/A
1
 
 1  
 package org.jtheque.films.view.impl.frames;
 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.managers.error.JThequeError;
 20  
 import org.jtheque.core.managers.view.impl.frame.abstraction.SwingDialogView;
 21  
 import org.jtheque.core.utils.ui.PanelBuilder;
 22  
 import org.jtheque.films.utils.Constants.Properties.Film;
 23  
 import org.jtheque.films.view.able.IChoiceFieldsView;
 24  
 import org.jtheque.films.view.impl.actions.CloseViewAction;
 25  
 import org.jtheque.films.view.impl.actions.auto.choice.AcValidateChoiceFieldsView;
 26  
 
 27  
 import javax.swing.JCheckBox;
 28  
 import java.awt.Container;
 29  
 import java.awt.Frame;
 30  
 import java.util.Collection;
 31  
 
 32  
 /**
 33  
  * The view to choice the fields for the automatic edit of a film.
 34  
  *
 35  
  * @author Baptiste Wicht
 36  
  */
 37  
 public final class ChoiceFieldsView extends SwingDialogView implements IChoiceFieldsView {
 38  
     private static final long serialVersionUID = -1071539900190775950L;
 39  
 
 40  
     private JCheckBox boxKind;
 41  
     private JCheckBox boxRealizer;
 42  
     private JCheckBox boxYear;
 43  
     private JCheckBox boxDuration;
 44  
     private JCheckBox boxActors;
 45  
     private JCheckBox boxImage;
 46  
     private JCheckBox boxResume;
 47  
 
 48  
     /**
 49  
      * Construct a new JFrameChoiceFields.
 50  
      *
 51  
      * @param parent         The parent frame.
 52  
      */
 53  
     public ChoiceFieldsView(Frame parent) {
 54  0
         super(parent);
 55  
 
 56  0
         setContentPane(buildContentPane());
 57  0
         pack();
 58  
 
 59  0
         setLocationRelativeTo(getOwner());
 60  0
     }
 61  
 
 62  
     /**
 63  
      * Build and return the content pane.
 64  
      *
 65  
      * @return The builded content pane.
 66  
      */
 67  
     private Container buildContentPane() {
 68  0
         PanelBuilder builder = new PanelBuilder();
 69  
 
 70  0
         boxKind = builder.addI18nCheckBox(Film.KIND, builder.gbcSet(0, 0));
 71  0
         boxRealizer = builder.addI18nCheckBox(Film.REALIZER, builder.gbcSet(0, 1));
 72  0
         boxYear = builder.addI18nCheckBox(Film.YEAR, builder.gbcSet(0, 2));
 73  0
         boxDuration = builder.addI18nCheckBox(Film.DURATION, builder.gbcSet(0, 3));
 74  0
         boxActors = builder.addI18nCheckBox(Film.ACTORS, builder.gbcSet(0, 4));
 75  0
         boxImage = builder.addI18nCheckBox(Film.IMAGE, builder.gbcSet(0, 5));
 76  0
         boxResume = builder.addI18nCheckBox(Film.RESUME, builder.gbcSet(0, 6));
 77  
 
 78  0
         builder.addButtonBar(builder.gbcSet(0, 7), new CloseViewAction("generic.view.actions.cancel", this), new AcValidateChoiceFieldsView());
 79  
 
 80  0
         return builder.getPanel();
 81  
     }
 82  
 
 83  
     @Override
 84  
     public boolean isBoxKindSelected() {
 85  0
         return boxKind.isSelected();
 86  
     }
 87  
 
 88  
     @Override
 89  
     public boolean isBoxRealizerSelected() {
 90  0
         return boxRealizer.isSelected();
 91  
     }
 92  
 
 93  
     @Override
 94  
     public boolean isBoxYearSelected() {
 95  0
         return boxYear.isSelected();
 96  
     }
 97  
 
 98  
     @Override
 99  
     public boolean isBoxDurationSelected() {
 100  0
         return boxDuration.isSelected();
 101  
     }
 102  
 
 103  
     @Override
 104  
     public boolean isBoxActorsSelected() {
 105  0
         return boxActors.isSelected();
 106  
     }
 107  
 
 108  
     @Override
 109  
     public boolean isBoxImageSelected() {
 110  0
         return boxImage.isSelected();
 111  
     }
 112  
 
 113  
     @Override
 114  
     public boolean isBoxResumeSelected() {
 115  0
         return boxResume.isSelected();
 116  
     }
 117  
 
 118  
     @Override
 119  
     protected void validate(Collection<JThequeError> errors) {
 120  0
     }
 121  
 }