OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 137 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 137 Rev 150
Line 520... Line 520...
520
            }
520
            }
521
        }
521
        }
522
 
522
 
523
    }
523
    }
524
 
524
 
525
    public void setZoom(int zIndex) {
525
    public final void setZoom(int zIndex) {
526
        if (zIndex >= 0) {
526
        if (zIndex >= 0) {
527
            int rh = 22 + zIndex * 22;
527
            int rh = (1 + zIndex) * 22;
528
 
-
 
529
            this.rowHeight = rh;
528
            setRowHeight(rh);
530
            // update size
-
 
531
            final int w = this.getSize().width;
-
 
532
            final int h = getPreferredSize().height;
-
 
533
            setSize(new Dimension(w, h));
-
 
534
            validate();
-
 
535
            repaint();
529
        }
536
        }
530
    }
-
 
531
 
-
 
532
    public final int getZoom() {
-
 
533
        return (this.rowHeight / 22) - 1;
537
    }
534
    }
538
 
535
 
539
    private void zoom(int v) {
536
    private void zoom(int v) {
-
 
537
        setRowHeight(this.rowHeight + v);
-
 
538
    }
-
 
539
 
-
 
540
    public final void setRowHeight(final int v) {
540
        if (rowHeight < 200 && rowHeight > 60) {
541
        if (this.rowHeight != v && v < 200 && v > 20) {
541
            rowHeight += v;
542
            this.rowHeight = v;
542
            // update size
543
            // update size
543
            final int w = this.getSize().width;
544
            final int w = this.getSize().width;
544
            final int h = getPreferredSize().height;
545
            final int h = getPreferredSize().height;
545
            setSize(new Dimension(w, h));
546
            setSize(new Dimension(w, h));
546
            validate();
547
            validate();
547
            repaint();
548
            repaint();
-
 
549
            this.firePropertyChange("rowHeight", null, v);
-
 
550
            this.firePropertyChange("zoom", null, getZoom());
548
        }
551
        }
549
    }
552
    }
550
 
553
 
-
 
554
    // how many pixels for one hour
551
    public int getRowHeight() {
555
    public final int getRowHeight() {
552
        return this.rowHeight;
556
        return this.rowHeight;
553
    }
557
    }
554
 
558
 
555
    public void setPopupMenuProvider(JPopupMenuProvider popupProvider) {
559
    public void setPopupMenuProvider(JPopupMenuProvider popupProvider) {
556
        this.popupProvider = popupProvider;
560
        this.popupProvider = popupProvider;