OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 149 → Rev 150

/trunk/jOpenCalendar/src/org/jopencalendar/ui/CalendarWithToolBar.java
29,9 → 29,10
import javax.swing.event.ChangeListener;
 
public class CalendarWithToolBar extends JPanel {
private WeekView weekView;
private JSpinner spinWeek;
private JSpinner spinYear;
private final WeekView weekView;
private final JSpinner spinWeek;
private final JSpinner spinYear;
private final DatePicker picker;
private String title;
final JScrollPane contentPane = new JScrollPane();
 
40,6 → 41,8
}
 
public CalendarWithToolBar(JCalendarItemProvider manager, boolean showPrintButton) {
this.weekView = new WeekView(manager);
 
JPanel toolbar = new JPanel();
toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
 
76,21 → 79,11
spinYear = new JSpinner(new SpinnerNumberModel(year, 1000, year + 20, 1));
toolbar.add(spinYear);
//
final DatePicker picker = new DatePicker(false);
this.picker = new DatePicker(false);
toolbar.add(picker);
//
 
final JSlider zoomSlider = new JSlider(1, 9, 1);
zoomSlider.setSnapToTicks(true);
zoomSlider.setMajorTickSpacing(1);
zoomSlider.setPaintTicks(true);
zoomSlider.addChangeListener(new ChangeListener() {
 
@Override
public void stateChanged(ChangeEvent e) {
weekView.setZoom(zoomSlider.getValue());
}
});
final JSlider zoomSlider = createZoomSlider(this.weekView);
toolbar.add(new JLabel(" Zoom"));
toolbar.add(zoomSlider);
if (showPrintButton) {
133,7 → 126,6
 
contentPane.setBorder(BorderFactory.createEmptyBorder());
contentPane.setOpaque(false);
weekView = new WeekView(manager);
contentPane.setColumnHeaderView(new WeekViewHeader(weekView));
contentPane.setViewportView(weekView);
contentPane.getViewport().setBackground(Color.WHITE);
189,6 → 181,26
 
}
 
public static JSlider createZoomSlider(final MultipleDayView mdview) {
final JSlider zoomSlider = new JSlider(1, 9, 1);
zoomSlider.setSnapToTicks(true);
zoomSlider.setMajorTickSpacing(1);
zoomSlider.setPaintTicks(true);
zoomSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
mdview.setZoom(zoomSlider.getValue());
}
});
mdview.addPropertyChangeListener("zoom", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
zoomSlider.setValue(((Number) evt.getNewValue()).intValue());
}
});
return zoomSlider;
}
 
protected void addWeek(int i) {
Calendar c = getCurrentDate();
c.add(Calendar.DAY_OF_YEAR, i * 7);
207,6 → 219,14
return c;
}
 
public final void setCurrentDate(final Calendar c) {
this.setCurrentDate(c.getTime());
}
 
public final void setCurrentDate(final Date d) {
this.picker.setDate(d);
}
 
private void configureButton(JButton b) {
b.setOpaque(false);
b.setBorderPainted(false);