OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 177 → Rev 178

/trunk/jOpenCalendar/src/org/jopencalendar/ui/WeekView.java
43,13 → 43,11
* Load week
*
* @param week the week number (1 - 52)
* */
*/
public void loadWeek(final int week, final int year, boolean forceReload) {
if (!forceReload) {
if (week == this.week && year == this.year) {
if (!forceReload && week == this.week && year == this.year) {
return;
}
}
this.week = week;
this.year = year;
Calendar c = getFirstDayCalendar();
64,17 → 62,18
 
@Override
protected List<JCalendarItem> doInBackground() throws Exception {
return manager.getItemInWeek(week, year);
return WeekView.this.manager.getItemInWeek(week, year);
}
 
@Override
protected void done() {
try {
List<JCalendarItem> l = get();
List<List<JCalendarItem>> items = new ArrayList<List<JCalendarItem>>();
List<List<JCalendarItem>> items = new ArrayList<>();
for (int i = 0; i < columnCount; i++) {
List<JCalendarItem> list = new ArrayList<JCalendarItem>();
int d = daysOfYear[i];
int y = years[i];
List<JCalendarItem> list = new ArrayList<>();
int d = WeekView.this.daysOfYear[i];
int y = WeekView.this.years[i];
for (JCalendarItem jCalendarItem : l) {
if (jCalendarItem.getDtStart().get(Calendar.DAY_OF_YEAR) == d && jCalendarItem.getDtStart().get(Calendar.YEAR) == y) {
list.add(jCalendarItem);
87,18 → 86,18
throw new IllegalStateException("error while getting items", e);
}
 
}
};
};
w.execute();
}
 
public void setWeekEndMinimised(boolean b) {
weekEndMinimised = b;
this.weekEndMinimised = b;
repaint();
}
 
@Override
public void paintHeader(Graphics g) {
 
g.setColor(Color.WHITE);
g.fillRect(0, 0, this.getWidth() + 100, getHeaderHeight());
g.setColor(Color.GRAY);
170,7 → 169,7
 
Calendar c = getFirstDayCalendar();
final DateFormat df;
if (!weekEndMinimised) {
if (!this.weekEndMinimised) {
df = new SimpleDateFormat("EEEE d");
} else {
df = new SimpleDateFormat("E d");
207,7 → 206,7
c.set(year, 1, 0, 0, 0, 0);
c.set(Calendar.MILLISECOND, 0);
c.set(Calendar.DAY_OF_YEAR, day);
return monthAndYearFormat.format(c.getTime()).toUpperCase();
return this.monthAndYearFormat.format(c.getTime()).toUpperCase();
}
 
private Calendar getFirstDayCalendar() {
222,7 → 221,7
@Override
public String getColumnTitle(int index) {
final DateFormat df;
if (!weekEndMinimised) {
if (!this.weekEndMinimised) {
df = new SimpleDateFormat("EEEE d");
} else {
df = new SimpleDateFormat("E d");
248,7 → 247,7
@Override
public int getColumnWidth(int column) {
final int c;
if (weekEndMinimised) {
if (this.weekEndMinimised) {
int minSize = 50;
if (column == 5 || column == 6) {
return minSize;