[brailleblaster] Re: Implementing the print items on the file menu
- From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
- To: brailleblaster@xxxxxxxxxxxxx
- Date: Wed, 12 Oct 2011 12:46:57 -0500
Michael and Chris,
Thanks for your thoughts. They will help me get my own thoughts
together.
I very much think that we should stick with the SWT printing API. After
all we have to use the SWT dialogs, including PrintDialogs. Parts of the
standard Java API that don't involve any screen interaction might be
useful though. That needs to be looked into.
I know that some transcribers like to get printouts of the Braille dot
patterns. Not al of them can afford embossers, but printers are cheap.
Printouts from both the Daisy and Braille views will ultimately include
graphics, though these may appear quite different in the two.
John
On Wed, Oct 12, 2011 at 09:51:26AM -0700, Chris von See wrote:
> You may want to set up separate helper classes for each view, with a common
> abstract base class that handles the grunt work of getting a printer and
> graphics context, writing the text and graphics, etc. Having separate helper
> classes by view will allow variations in pagination and printing for each
> view - a DAISY text view may be fairly straightforward (text only or text +
> tags), but the braille view may allow printing to an embosser or to an ink
> device or file as braille ASCII, dots (with or without ghost dots), or a
> combination of the two. Each helper can also pop up a view-specific dialog
> soliciting the various print options for that view from the user. You can
> have a method on each view that creates and returns the appropriate helper,
> as in "DaisyView.getPrintHelper()" or some such.
>
> Although I personally would use the SWT printing API for no other reason than
> the rest of your system is SWT-based, I'm not really sure it matters all that
> much. Mixing SWT and Java screen controls doesn't work all that well though,
> so you may not want to mix SWT screen controls with non-SWT print controls so
> as to avoid any possible issues.
>
> Java has a good printing tutorial at
> http://download.oracle.com/javase/tutorial/2d/printing/index.html, and there
> are some SWT printing examples at
> http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Printtexttoprinterwithwordwrapandpagination.htm.
>
>
> Cheers
> Chris
>
> On Oct 12, 2011, at 9:24 AM, Michael Whapples wrote:
>
> > Possibly and possibly not. It depends on so much.
> >
> > Using some of the ideas commonly put forward for object oriented design.
> > Cohesion (how focused the class is on one thing) might there be multiple
> > things being done here? Is previewing on the screen as close to actually
> > printing to warrant being put together? May be another way to consider this
> > would also be in trying to lower coupling between classes. If you are going
> > to make use of the SWT printer stuff, then there may be quite a bit of
> > common code and well you're not tying the printing system to a particular
> > GUI (SWT sort of does that bit as you need all of SWT if using the SWT
> > printing stuff). However if you used the java printing API (the API in the
> > standard JDK) then why should you tie the printing part to SWT as well? By
> > having the preview as a separate class it means that you could change
> > either the GUI or the printing system easier.
> >
> > On a separate note, you say about doing the set up stuff in the
> > constructor. There is sometimes debate over how much should be done in a
> > constructor, however I think normally it is advised not to do any "work" in
> > the constructor, basically you should only be doing enough to get the class
> > up and running to be valid. If by setting it up you meant that the
> > constructor is passed parameters for identifying the printer, the document,
> > the page settings, etc and then it just assigns these internally then this
> > probably is fine. If you meant by setting it up, it would be getting the
> > information from the user, may be performing checks to ensure the page
> > settings will work with the printer, etc, then probably this is more work
> > than should be done in a constructor.
> >
> > Michael whapples
> > On 12 Oct 2011, at 16:57, John J. Boyer wrote:
> >
> >> My understanding is that the printPageSetup item should be handled by
> >> the constructor of the BBPrint class. printPreview will be handled by a
> >> method in this class. The Print item will call a method in the class to
> >> do the actual printing. Does this sound correct?
> >>
> >> Thanks,
> >> John
> >>
> >> --
> >> John J. Boyer; President, Chief Software Developer
> >> Abilitiessoft, Inc.
> >> http://www.abilitiessoft.com
> >> Madison, Wisconsin USA
> >> Developing software for people with disabilities
> >>
> >>
> >
> >
>
--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities
Other related posts: