OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 137 Rev 153
Line 55... Line 55...
55
        //
55
        //
56
 
56
 
57
        this.setLayout(new BorderLayout(2, 2));
57
        this.setLayout(new BorderLayout(2, 2));
58
        JPanel navigator = new JPanel();
58
        JPanel navigator = new JPanel();
59
        navigator.setLayout(new BorderLayout());
59
        navigator.setLayout(new BorderLayout());
-
 
60
        String leftFileName = "left.png";
-
 
61
        String rightFileName = "right.png";
-
 
62
        if (this.getFont().getSize() > 16) {
-
 
63
            leftFileName = "left_2x.png";
-
 
64
            rightFileName = "right_2x.png";
-
 
65
        }
60
        bLeft = new JButton(new ImageIcon(this.getClass().getResource("left.png")));
66
        bLeft = new JButton(new ImageIcon(this.getClass().getResource(leftFileName)));
61
        configureButton(bLeft);
67
        configureButton(bLeft);
62
 
68
 
63
        navigator.add(bLeft, BorderLayout.WEST);
69
        navigator.add(bLeft, BorderLayout.WEST);
64
        title = new JLabel("...", SwingConstants.CENTER);
70
        title = new JLabel("...", SwingConstants.CENTER);
65
        title.setFont(title.getFont().deriveFont(Font.BOLD));
71
        title.setFont(title.getFont().deriveFont(Font.BOLD));
66
        navigator.add(title, BorderLayout.CENTER);
72
        navigator.add(title, BorderLayout.CENTER);
-
 
73
 
67
        bRight = new JButton(new ImageIcon(this.getClass().getResource("right.png")));
74
        bRight = new JButton(new ImageIcon(this.getClass().getResource(rightFileName)));
68
        configureButton(bRight);
75
        configureButton(bRight);
69
        navigator.add(bRight, BorderLayout.EAST);
76
        navigator.add(bRight, BorderLayout.EAST);
70
        this.add(navigator, BorderLayout.NORTH);
77
        this.add(navigator, BorderLayout.NORTH);
71
        final JPanel dayPanel = new JPanel() {
78
        final JPanel dayPanel = new JPanel() {
72
 
79
 
Line 91... Line 98...
91
            int j = i + f;
98
            int j = i + f;
92
            if (j >= 8) {
99
            if (j >= 8) {
93
                j = 1;
100
                j = 1;
94
            }
101
            }
95
            String d = dateFormatSymbols[j];
102
            String d = dateFormatSymbols[j];
96
            dayPanel.add(new JLabel(d, SwingConstants.RIGHT));
103
            final JLabel lDay = new JLabel(d, SwingConstants.RIGHT);
-
 
104
            lDay.setMinimumSize(new Dimension(lDay.getPreferredSize().width, lDay.getPreferredSize().width));
-
 
105
            dayPanel.add(lDay);
97
        }
106
        }
98
 
107
 
99
        //
108
        //
100
        int c = 0;
109
        int c = 0;
101
        final MouseAdapter mListener = new MouseAdapter() {
110
        final MouseAdapter mListener = new MouseAdapter() {
Line 178... Line 187...
178
        this.currentMonth = cal.get(Calendar.MONTH);
187
        this.currentMonth = cal.get(Calendar.MONTH);
179
        updateLabels();
188
        updateLabels();
180
    }
189
    }
181
 
190
 
182
    private void configureButton(final JButton button) {
191
    private void configureButton(final JButton button) {
183
        int buttonSize = 28;
192
        int buttonSize = button.getIcon().getIconWidth() + 8;
184
        button.setMinimumSize(new Dimension(buttonSize, buttonSize));
193
        button.setMinimumSize(new Dimension(buttonSize, buttonSize));
185
        button.setPreferredSize(new Dimension(buttonSize, buttonSize));
194
        button.setPreferredSize(new Dimension(buttonSize, buttonSize));
186
        button.setFocusPainted(false);
195
        button.setFocusPainted(false);
187
        button.setBorderPainted(false);
196
        button.setBorderPainted(false);
188
        button.setBorder(null);
197
        button.setBorder(null);
Line 343... Line 352...
343
        }
352
        }
344
    }
353
    }
345
 
354
 
346
    @Override
355
    @Override
347
    public void mouseReleased(MouseEvent e) {
356
    public void mouseReleased(MouseEvent e) {
-
 
357
        // Nothing
348
    }
358
    }
349
 
359
 
350
    @Override
360
    @Override
351
    public void mouseEntered(MouseEvent e) {
361
    public void mouseEntered(MouseEvent e) {
-
 
362
        // Nothing
352
    }
363
    }
353
 
364
 
354
    @Override
365
    @Override
355
    public void mouseExited(MouseEvent e) {
366
    public void mouseExited(MouseEvent e) {
-
 
367
        // Nothing
356
    }
368
    }
357
 
369
 
358
}
370
}