[jmsl] change color of Note / acceidental / ledger lines / etc.?

jmsl at music.columbia.edu jmsl at music.columbia.edu
Tue Feb 20 13:56:25 EST 2007


Hi Jason

I don't see an easy way to do this. 
But adding setColor() to various Score components would be very easy for 
me to do. 
What granularity would be helpful? Could these be a bunch of static 
methods in Score, such as:
Score.setNoteHeadColor(Color c);
Score.setBeamColor(Color c);
Score.setNoteStemColor(Color c);
Score.setAccidentalColor(Color c);
Score.setBarColor(Color c);
Score.setStaffColor(Color c);   // also affects ledger lines
Score.setBackgroundColor(Color c);
Score.setTextColor(Color c);
...
what else?

Thanks
Nick Didkovsky



jmsl at music.columbia.edu wrote:
> Hi all,
>
> I'm trying to change the color of a Notehead on a JMSL score, and I 
> can't find a reasonable way to make it happen.
>
> Here's the hack I've made:
> * I override the render method in the Note class so that the note 
> doesn't get rendered by JMSL.
> * I manually render the note onto the score image.
>
> Here is the problem with this hack:
> * The accidentals and ledger lines are still drawn in black.
> * It therefore looks ugly and is difficult to read.
>
> I could, of course, not create a Note object at all and manually draw 
> the notehead, ledger lines, and accidentals. But at that point, I'd 
> basically be reimplimenting all of the JMSL JScore rendering myself, 
> which I really hope not to do.
>
> I tried one other solution, but it didn't work:
> * I override the render method in the Note class.
> * render calls g.setColor(color) and then calls the super.render.
>
> Thanks in advance for any advice.
>
> Best,
> Jason Freeman
> Assistant Professor
> Music Department
> Georgia Institute of Technology
> http://www.jasonfreeman.net
> _______________________________________________
> jmsl mailing list
> jmsl at music.columbia.edu
> http://music.columbia.edu/mailman/listinfo/jmsl


More information about the jmsl mailing list