OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 150 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 168
Line 27... Line 27...
27
import org.jopencalendar.model.JCalendarItem;
27
import org.jopencalendar.model.JCalendarItem;
28
import org.jopencalendar.model.JCalendarItemPart;
28
import org.jopencalendar.model.JCalendarItemPart;
29
 
29
 
30
public abstract class MultipleDayView extends JPanel implements Scrollable {
30
public abstract class MultipleDayView extends JPanel implements Scrollable {
31
    public static final String CALENDARD_ITEMS_PROPERTY = "calendard_items_changed";
31
    public static final String CALENDARD_ITEMS_PROPERTY = "calendard_items_changed";
32
    public final static Color WHITE_TRANSPARENCY_COLOR = new Color(255, 255, 255, 180);
32
    public static final Color WHITE_TRANSPARENCY_COLOR = new Color(255, 255, 255, 180);
33
    public static final Color LIGHT_BLUE = new Color(202, 212, 220);
33
    public static final Color LIGHT_BLUE = new Color(202, 212, 220);
34
    public final static Color LIGHT = new Color(222, 222, 222);
34
    public static final Color LIGHT = new Color(222, 222, 222);
35
    public static final int TITLE_HEIGHT = 20;
35
    public static final int TITLE_HEIGHT = 20;
36
    public static final int HOURS_LABEL_WIDTH = 50;
36
    public static final int HOURS_LABEL_WIDTH = 50;
37
 
37
 
38
    protected static final int YEAR_HEIGHT = 20;
38
    protected static final int YEAR_HEIGHT = 20;
39
    private int deltaY = 10;
39
    private int deltaY = 10;
Line 389... Line 389...
389
        }
389
        }
390
        return String.valueOf(i) + ":00";
390
        return String.valueOf(i) + ":00";
391
    }
391
    }
392
 
392
 
393
    public int getColumnWidth(int column) {
393
    public int getColumnWidth(int column) {
394
        final int c = (this.getWidth() - HOURS_LABEL_WIDTH) / getColumnCount();
394
        return (this.getWidth() - HOURS_LABEL_WIDTH) / getColumnCount();
395
 
-
 
396
        return c;
-
 
397
    }
395
    }
398
 
396
 
399
    public int getColumnX(int column) {
397
    public int getColumnX(int column) {
400
        int x = HOURS_LABEL_WIDTH;
398
        int x = HOURS_LABEL_WIDTH;
401
        for (int i = 0; i < column; i++) {
399
        for (int i = 0; i < column; i++) {
Line 536... Line 534...
536
    private void zoom(int v) {
534
    private void zoom(int v) {
537
        setRowHeight(this.rowHeight + v);
535
        setRowHeight(this.rowHeight + v);
538
    }
536
    }
539
 
537
 
540
    public final void setRowHeight(final int v) {
538
    public final void setRowHeight(final int v) {
541
        if (this.rowHeight != v && v < 200 && v > 20) {
539
        if (this.rowHeight != v && v > 20 && v < 250) {
542
            this.rowHeight = v;
540
            this.rowHeight = v;
543
            // update size
541
            // update size
544
            final int w = this.getSize().width;
542
            final int w = this.getSize().width;
545
            final int h = getPreferredSize().height;
543
            final int h = getPreferredSize().height;
546
            setSize(new Dimension(w, h));
544
            setSize(new Dimension(w, h));
Line 583... Line 581...
583
 
581
 
584
    public void removeItemPartHoverListener(ItemPartHoverListener l) {
582
    public void removeItemPartHoverListener(ItemPartHoverListener l) {
585
        this.hListeners.remove(l);
583
        this.hListeners.remove(l);
586
    }
584
    }
587
 
585
 
588
    abstract public String getColumnTitle(int index);
586
    public abstract String getColumnTitle(int index);
589
 
587
 
590
    abstract public int getColumnCount();
588
    public abstract int getColumnCount();
591
 
589
 
592
    abstract public void reload();
590
    public abstract void reload();
593
 
591
 
594
    public void deselectAll() {
592
    public void deselectAll() {
595
        for (ItemPartView p : selectedItems) {
593
        for (ItemPartView p : selectedItems) {
596
            p.setSelected(false);
594
            p.setSelected(false);
597
        }
595
        }