[jmsl] Set current measure on the display

jmsl at music.columbia.edu jmsl at music.columbia.edu
Tue Feb 14 18:32:58 EST 2006


Hello Pavlos

Use Score's render() method to control the starting measure that is 
rendered on a page:

        int measure = yourWidget.getMeasureIndexSomehow();
        myScore.render(measure);
// IMPORTANT: the first measure of a Score is 0 (zero) !!!

Thanks
Nick Didkovsky


jmsl at music.columbia.edu wrote:

>  
> In ScoreFrame there is a scrollBar which allows you to control the 
> first measure that occurs on the screen
> which if I am right its a PVScrollbar. Since I have created a 
> different interface to control score and i am not
> using ScoreFrame, I use a JSpinner Object trying to control which 
> measure will occur first on the display.
>  
> The problem is that there is no change to the score display.
>  
> This is what I am trying to do:
>  
> public void stateChanged(ChangeEvent e) {
>         SpinnerModel msModel = toolBar.getMeasureSpinner().getModel();
>         if (msModel instanceof SpinnerNumberModel) {
>              int measureNum = 
> (int)((Integer)((SpinnerNumberModel)msModel).getNumber());
>              
> *this.scoreScrollPane.getScore().setMeasureBar(measureNum);*         
>         }
>     }
>  
> So basically I am trying to set the first measure of the display by 
> saying:
> *    * *score.setMeasureBar(measureNum);*
> Is this correct? The compiler does not gives me any errors when I run 
> it but yet it doesn't work.
> I have tried 
> *              score.setMeasureBar( 6 ( or any no.));*    but it 
> doesn't work.
>  
>  
> Thank you
> Pavlos Marios
>  
>          
>
>------------------------------------------------------------------------
>
>_______________________________________________
>jmsl mailing list
>jmsl at music.columbia.edu
>http://music.columbia.edu/mailman/listinfo/jmsl
>  
>


More information about the jmsl mailing list