OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 17 Rev 156
Line 98... Line 98...
98
        // g.setColor(Color.GREEN);
98
        // g.setColor(Color.GREEN);
99
        // g.fillRect(0, 0, 600, 600);
99
        // g.fillRect(0, 0, 600, 600);
100
        Rectangle clip = g.getClipBounds();
100
        Rectangle clip = g.getClipBounds();
101
        Point upperLeft = clip.getLocation();
101
        Point upperLeft = clip.getLocation();
102
        Point lowerRight = new Point(clip.x + clip.width - 1, clip.y + clip.height - 1);
102
        Point lowerRight = new Point(clip.x + clip.width - 1, clip.y + clip.height - 1);
103
        int rMin = 0;// table.rowAtPoint(upperLeft);
103
        int rMin = table.rowAtPoint(upperLeft);
104
        int rMax = table.getRowCount() - 1;// /table.rowAtPoint(lowerRight);
104
        int rMax = table.rowAtPoint(lowerRight);
105
        // This should never happen.
-
 
106
        if (rMin == -1) {
105
        if (rMin < 0) {
107
            rMin = 0;
106
            rMin = 0;
108
        }
107
        }
109
        // If the table does not have enough rows to fill the view we'll get -1.
108
        // If the table does not have enough rows to fill the view we'll get -1.
110
        // Replace this with the index of the last row.
109
        // Replace this with the index of the last row.
111
        if (rMax == -1) {
110
        if (rMax == -1 || rMax >= table.getRowCount()) {
112
            rMax = table.getRowCount() - 1;
111
            rMax = table.getRowCount() - 1;
113
        }
112
        }
114
 
113
 
115
        boolean ltr = table.getComponentOrientation().isLeftToRight();
114
        boolean ltr = table.getComponentOrientation().isLeftToRight();
116
        int cMin = table.columnAtPoint(ltr ? upperLeft : lowerRight);
115
        int cMin = table.columnAtPoint(ltr ? upperLeft : lowerRight);