OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 178 → Rev 177

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