Saturday, 20 November 2010

So Java is rubbish for printing

Especially on linux and Mac - and also Windows! Or maybe I'm missing the point. I can print portrait, on all 3 platforms. Trying to go landscape has Mac OS and Linux with the paper rotated but not the drawing, on Windows the whole damn thing is rotated so it looks like portrait but on its side!

I give in!! I will come back to printing later.

Now I'm at the stage I need to write an equivalent of JTextComponent and all the gubbins that surrounds it but for musical notes (well drumming ones anyway) instead of text. I've taken a look at the source code of JTextComponent and the accompanying docs and examples - there's no way I should just subclass it and use embedded components in a StyledDocument. There's just too much to get in the way. Also making the notes into a Font, with glyphs etc for the drawing strokes. Just not flexible enough.

Only one thing for it, an industrial strength JNote class and JScoreComponent, Editor, Pane etc.

One of the big things is this is a drawing program at heart, each note will be placed exactly where the author wants it, not some predetermined space from the previous one. The option exists to write a program which behaves that way, which could in fact be easier for some authors, but the one we're writing here gives all the decisions to the user.

Wish me luck - that bloody printing does bother me but it appears to be a bug in Java.

No comments:

Post a Comment