Coverage Report - br.mia.test.view.tabelas.TabelaModeloCronograma
 
Classes in this File Line Coverage Branch Coverage Complexity
TabelaModeloCronograma
0%
0/54
0%
0/28
0
 
 1  
 package br.mia.test.view.tabelas;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.List;
 5  
 
 6  
 import javax.swing.JTable;
 7  
 import javax.swing.table.AbstractTableModel;
 8  
 
 9  
 import br.mia.test.model.Atividade;
 10  0
 
 11  0
 public class TabelaModeloCronograma extends AbstractTableModel {
 12  0
         private List<Atividade> atividades=new ArrayList<Atividade>();
 13  
         private JTable tabela;
 14  
 
 15  
         /**
 16  
          *
 17  
          */
 18  
         private static final long serialVersionUID = 1L;
 19  
 
 20  
 
 21  
 
 22  
 
 23  0
         public List<Atividade> getAtividades() {
 24  0
                 return atividades;
 25  
         }
 26  
 
 27  0
         public void setAtividades(List<Atividade> atividades1) {
 28  0
                 this.atividades = atividades1;
 29  0
         }
 30  
 
 31  
         public String getColumnName(int arg0) {
 32  0
 
 33  0
                 String[] nomes = { "Nome","Dura��o", "Respons�vel", "Estado","Data Inicio" ,"Data Fim"};
 34  0
 
 35  0
                 return nomes[arg0];
 36  
         }
 37  
 
 38  0
         public int getColumnCount() {
 39  0
                 return 6;
 40  
         }
 41  
 
 42  0
         public int getRowCount() {
 43  0
                 if (this.atividades != null) {
 44  0
                         return this.atividades.size();
 45  0
                 }
 46  0
                 return 0;
 47  
         }
 48  
 
 49  0
         public Object getValueAt(int arg0, int arg1) {
 50  0
                 Atividade atividade =(Atividade) this.atividades.get(arg0);
 51  0
 
 52  0
                 if (arg1==0){
 53  0
                         return atividade.getNome();
 54  
                 }
 55  0
 
 56  0
                 if (arg1==1){
 57  0
                         return atividade.getDuracao();
 58  0
                 }
 59  0
                 if (arg1==2){
 60  0
                         return atividade.getResponsavel();
 61  
                 }
 62  0
 
 63  0
                 if (arg1==3){
 64  0
 
 65  0
                         return atividade.getStatus();
 66  0
                 }
 67  0
                 if (arg1==4){
 68  0
                         return atividade.getInicio();
 69  0
                 }
 70  0
                 if (arg1==5){
 71  0
                         return atividade.getFim();
 72  0
                 }
 73  0
                 return this.atividades.get(arg0);
 74  
         }
 75  
 
 76  
         @SuppressWarnings("unchecked")
 77  
         public Class getColumnClass(int c) {
 78  0
                 try{
 79  0
                 return getValueAt(0, c).getClass();
 80  0
                 }
 81  0
                 catch (Exception e) {
 82  0
                         return "Nenhum".getClass();
 83  
                 }
 84  
         }
 85  
 
 86  
         public boolean isCellEditable(int arg0, int arg1) {
 87  0
 
 88  0
                 return true;
 89  
         }
 90  
 
 91  0
         public JTable getTabela() {
 92  0
                 return tabela;
 93  
         }
 94  
 
 95  0
         public void setTabela(JTable tabela) {
 96  0
                 this.tabela = tabela;
 97  0
         }
 98  
 
 99  
 }