OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 174
Line 38... Line 38...
38
    public EcritureGrandLivreRenderer(TableSorter model) {
38
    public EcritureGrandLivreRenderer(TableSorter model) {
39
        this.model = model;
39
        this.model = model;
40
    }
40
    }
41
 
41
 
42
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
42
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
43
 
-
 
44
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
43
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
45
 
-
 
46
        TableCellRendererUtils.setBackgroundColor(this, table, isSelected);
44
        TableCellRendererUtils.setBackgroundColor(this, table, isSelected);
47
 
45
 
48
        if (!isSelected) {
46
        if (!isSelected) {
49
 
-
 
50
            Ecriture ecrTmp = ((ConsultCompteModel) this.model.getTableModel()).getEcritures().get(this.model.viewIndex(row));
47
            Ecriture ecrTmp = ((ConsultCompteModel) this.model.getTableModel()).getEcritures().get(this.model.viewIndex(row));
51
 
48
 
52
            if (!ecrTmp.getValide()) {
49
            if (!ecrTmp.getValide()) {
53
                // this.setForeground(couleurEcritureValide);
-
 
54
                Date dateEcr = ecrTmp.getDate();
50
                Date dateEcr = ecrTmp.getDate();
55
                Date dateToDay = new Date();
51
                Date dateToDay = new Date();
56
 
-
 
57
                if ((dateEcr.getDate() == dateToDay.getDate()) && (dateEcr.getMonth() == dateToDay.getMonth()) && (dateEcr.getYear() == dateToDay.getYear())) {
52
                if ((dateEcr.getDate() == dateToDay.getDate()) && (dateEcr.getMonth() == dateToDay.getMonth()) && (dateEcr.getYear() == dateToDay.getYear())) {
58
                    // System.out.println("ToDay :: " + dateToDay + " Ecr ::: " + dateEcr);
-
 
59
 
-
 
60
                    this.setBackground(couleurEcritureToDay);
53
                    this.setBackground(couleurEcritureToDay);
61
                } else {
54
                } else {
62
                    this.setBackground(couleurEcritureValide);
55
                    this.setBackground(couleurEcritureValide);
63
                }
56
                }
64
            }
57
            }
65
        }
58
        }
66
 
-
 
-
 
59
        if (value != null) {
67
        if (value instanceof Date) {
60
            if (value instanceof Date) {
68
            this.setText(dateFormat.format((Date) value));
61
                this.setText(dateFormat.format((Date) value));
69
        }
-
 
70
        if (value.getClass() == Long.class) {
62
            } else if (value.getClass() == Long.class) {
71
            this.setText(GestionDevise.currencyToString(((Long) value).longValue()));
63
                this.setText(GestionDevise.currencyToString(((Long) value).longValue()));
72
        }
64
            }
73
 
65
        }
74
        return this;
66
        return this;
75
    }
67
    }
76
}
68
}