xTextOffset, yHeaderTextOffset + y * hourWidth);
}
}
};
scroll = new JScrollPane();
scroll.setRowHeaderView(rowHeader);
// scroll.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, new JLabel() {
//
// @Override
// public String getText() {
// return "no:" + getCurrentIntervals().size();
// }
// });
scroll.setColumnHeaderView(columnHeader);
JPanel timeNorthPanel = new JPanel();
calendarDateField = CalendarFactory.createDateField();
calendarDateField.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
// get the date only - not the time
DateTime val = new DateTime(((Date) calendarDateField.getValue()).getTime());
DateTime start = settings.getStartDate();
setStartDate(start.withYear(val.getYear()).
withMonthOfYear(val.getMonthOfYear()).withDayOfMonth(val.getDayOfMonth()));
}
});
timeNorthPanel.add(calendarDateField);
timeNorthPanel.add(prevDaysButton = new SmallButton("<"));
timeNorthPanel.add(nextDaysButton = new SmallButton(">"));
prevDaysButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setStartDate(settings.getStartDate().minusDays(settings.getNumberOfDays()));
}
});
nextDaysButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setStartDate(settings.getStartDate().plusDays(settings.getNumberOfDays()));
}
});
scroll.setViewportView(timetableGrid);
JPanel southPanel = new JPanel(new GridLayout(1, 0));
eventJList.setVisibleRowCount(3);
taskJList.setVisibleRowCount(3);
southPanel.add(new JScrollPane(eventJList));
southPanel.add(new JScrollPane(taskJList));
listener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {